Skip to content

Commit

Permalink
Merge branch 'master' into fix/ao-deleted-after-copy-DHIS2-15722
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott authored Sep 28, 2023
2 parents 8918a88 + 7f0fee4 commit 36a7b13
Show file tree
Hide file tree
Showing 4 changed files with 450 additions and 452 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ jobs:
if: |
failure() &&
!cancelled() &&
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master
Expand All @@ -141,13 +142,13 @@ jobs:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": ":small_red_triangle_down: :line-listing-app: Line Listing version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"text": ":small_red_triangle_down: :line-listing-app: Line Listing release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :line-listing-app: Line Listing version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>"
"text": ":small_red_triangle_down: :line-listing-app: Line Listing release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>"
}
}
]
Expand All @@ -161,7 +162,8 @@ jobs:
if: |
success() &&
!cancelled() &&
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@dhis2/analytics": "^26.0.20",
"@dhis2/app-runtime": "^3.4.4",
"@dhis2/ui": "^8.13.13",
"@dhis2/ui": "^8.14.5",
"@dnd-kit/core": "^5.0.3",
"@dnd-kit/sortable": "^6.0.1",
"@dnd-kit/utilities": "^3.2.0",
Expand Down
19 changes: 16 additions & 3 deletions src/components/Visualization/Visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ import {
export const DEFAULT_SORT_DIRECTION = 'asc'
export const FIRST_PAGE = 1
export const PAGE_SIZE = 100
// +/- min width of "Rows per page" select + 2 * padding
// + 30% in case label text are longer than English
export const PAGINATION_MIN_WIDTH = 250

const getFontSizeClass = (fontSize) => {
switch (fontSize) {
Expand Down Expand Up @@ -125,16 +128,23 @@ export const Visualization = ({
const visualizationRef = useRef(visualization)

const containerCallbackRef = useCallback((node) => {
if (node === null || node.clientWidth === 0) {
if (node === null) {
return
}

const adjustSize = () => {
if (node.clientWidth === 0) {
return
}
const containerInnerWidth = node.clientWidth
const scrollBox = node.querySelector('.tablescrollbox')
const scrollbarWidth = scrollBox.offsetWidth - scrollBox.clientWidth
const maxWidth = Math.max(
containerInnerWidth - scrollbarWidth,
PAGINATION_MIN_WIDTH
)

setPaginationMaxWidth(containerInnerWidth - scrollbarWidth)
setPaginationMaxWidth(maxWidth)
}

const sizeObserver = new window.ResizeObserver(adjustSize)
Expand Down Expand Up @@ -435,7 +445,10 @@ export const Visualization = ({
styles.stickyNavigation,
sizeClass
)}
style={{ maxWidth: paginationMaxWidth }}
style={{
maxWidth: paginationMaxWidth,
minWidth: PAGINATION_MIN_WIDTH,
}}
>
<PaginationComponent
offline={offline}
Expand Down
Loading

0 comments on commit 36a7b13

Please sign in to comment.