From 2b733f16c426617469c4c43aeaec5d9c0f049923 Mon Sep 17 00:00:00 2001 From: Hendrik de Graaf Date: Tue, 26 Sep 2023 16:54:11 +0200 Subject: [PATCH 1/2] fix: ensure pagination max-width is correct in interpretations modal (#434) * fix: always attach resize observer if node is found * chore: remove stray console.log * fix: upgrade @dhis2/ui to get spacing between pagination elements * chore: deduplicate @dhis2/ui versions * fix: implement min width on pagination container so dropdowns fit * fix: bump min width for less concise locales --- package.json | 2 +- src/components/Visualization/Visualization.js | 19 +- yarn.lock | 871 +++++++++--------- 3 files changed, 444 insertions(+), 448 deletions(-) diff --git a/package.json b/package.json index f8101e4c9..43b494c75 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "dependencies": { "@dhis2/analytics": "^26.0.7", "@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", diff --git a/src/components/Visualization/Visualization.js b/src/components/Visualization/Visualization.js index b56fee4a0..dd10ff009 100644 --- a/src/components/Visualization/Visualization.js +++ b/src/components/Visualization/Visualization.js @@ -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) { @@ -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) @@ -435,7 +445,10 @@ export const Visualization = ({ styles.stickyNavigation, sizeClass )} - style={{ maxWidth: paginationMaxWidth }} + style={{ + maxWidth: paginationMaxWidth, + minWidth: PAGINATION_MIN_WIDTH, + }} > Date: Wed, 27 Sep 2023 16:48:11 +0200 Subject: [PATCH 2/2] chore: send release success and fail slack messages on actual releases only (#439) Check the commit message to ensure the commit is an actual release. --- .github/workflows/dhis2-verify-app.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 83c8a38fb..6a54f55e8 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -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 @@ -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 ", + "text": ":small_red_triangle_down: :line-listing-app: Line Listing release ", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": ":small_red_triangle_down: :line-listing-app: Line Listing version ${{ steps.extract_version.outputs.version }} release " + "text": ":small_red_triangle_down: :line-listing-app: Line Listing release " } } ] @@ -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