From 9d04822a6ad48a8e04c948d867df89552b67bfa9 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 09:43:34 +0100 Subject: [PATCH 1/8] chore: no short-hand declaration after specific declaration --- src/pages/start/styles/StartScreen.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/start/styles/StartScreen.module.css b/src/pages/start/styles/StartScreen.module.css index 6648968a2..fce23aecd 100644 --- a/src/pages/start/styles/StartScreen.module.css +++ b/src/pages/start/styles/StartScreen.module.css @@ -71,7 +71,7 @@ line-height: 18px; letter-spacing: 0.1px; list-style-position: outside; - list-style: circle; + list-style-type: circle; margin-block-start: 0; margin-block-end: 0; margin-inline-start: var(--spacers-dp12); From 5812fc56c9d3f6cb83820442fb3e26d71fb86187 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 09:44:18 +0100 Subject: [PATCH 2/8] chore: no need to declare font-family (it was missing generic font-family) --- .../InformationBlock/styles/InformationBlock.module.css | 1 - src/pages/view/styles/SlideshowControlbar.module.css | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/DashboardsBar/InformationBlock/styles/InformationBlock.module.css b/src/components/DashboardsBar/InformationBlock/styles/InformationBlock.module.css index 4db96ab27..176b097fb 100644 --- a/src/components/DashboardsBar/InformationBlock/styles/InformationBlock.module.css +++ b/src/components/DashboardsBar/InformationBlock/styles/InformationBlock.module.css @@ -16,7 +16,6 @@ } .title { - font-family: 'Roboto'; font-size: 16px; line-height: 16px; font-weight: 500; diff --git a/src/pages/view/styles/SlideshowControlbar.module.css b/src/pages/view/styles/SlideshowControlbar.module.css index 341c606ce..93f00e082 100644 --- a/src/pages/view/styles/SlideshowControlbar.module.css +++ b/src/pages/view/styles/SlideshowControlbar.module.css @@ -61,7 +61,6 @@ } .pageCounter { - font-family: 'Roboto', sans-serif; font-weight: 400; font-style: normal; color: var(--colors-grey300); From e737240b8ea2c12a7ada3f0a407d66ec8721f0c3 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 10:04:43 +0100 Subject: [PATCH 3/8] chore: use button instead of span since element is interactive --- src/pages/edit/ItemSelector/ContentMenuItem.js | 6 +++--- .../edit/ItemSelector/styles/ContentMenuItem.module.css | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/edit/ItemSelector/ContentMenuItem.js b/src/pages/edit/ItemSelector/ContentMenuItem.js index d9e93bf06..b71b1630f 100644 --- a/src/pages/edit/ItemSelector/ContentMenuItem.js +++ b/src/pages/edit/ItemSelector/ContentMenuItem.js @@ -12,13 +12,13 @@ const LaunchLink = ({ url }) => { }, [url]) return ( - - + ) } diff --git a/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css b/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css index 52f04f546..c874bcae6 100644 --- a/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css +++ b/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css @@ -4,10 +4,13 @@ justify-content: space-between; } -.launchLink { +.launchLinkButton { display: flex; margin-inline-start: 8px; z-index: 10000; + border: none; + background-color: transparent; + padding: 0; } .label { From 9ab8dd6b7b330e092237669cd9877b6b0388ba14 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 10:20:12 +0100 Subject: [PATCH 4/8] chore: maintainability, reliability --- .../InformationBlock/__tests__/FilterSelector.spec.js | 2 +- src/components/DashboardsBar/NavigationMenu/NavigationMenu.js | 2 +- .../NavigationMenu/__tests__/NavigationMenu.spec.js | 2 +- src/pages/view/FilterBar/__tests__/FilterBadge.spec.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/DashboardsBar/InformationBlock/__tests__/FilterSelector.spec.js b/src/components/DashboardsBar/InformationBlock/__tests__/FilterSelector.spec.js index 108da2d4e..28d6c81a1 100644 --- a/src/components/DashboardsBar/InformationBlock/__tests__/FilterSelector.spec.js +++ b/src/components/DashboardsBar/InformationBlock/__tests__/FilterSelector.spec.js @@ -15,7 +15,7 @@ useDimensions.mockImplementation(() => ['Moomin', 'Snorkmaiden']) const baseState = { activeModalDimension: {}, itemFilters: {} } const createMockStore = (state) => - createStore(() => Object.assign({}, baseState, state)) + createStore(() => ({ ...baseState, ...state })) test('is disabled when offline', () => { useDhis2ConnectionStatus.mockImplementationOnce( diff --git a/src/components/DashboardsBar/NavigationMenu/NavigationMenu.js b/src/components/DashboardsBar/NavigationMenu/NavigationMenu.js index 125a82e5a..dd87cf11a 100644 --- a/src/components/DashboardsBar/NavigationMenu/NavigationMenu.js +++ b/src/components/DashboardsBar/NavigationMenu/NavigationMenu.js @@ -69,7 +69,7 @@ export const NavigationMenu = ({ close }) => {
{filteredDashboards.length === 0 ? ( -
  • +
  • {i18n.t('No dashboards found')}
  • ) : ( diff --git a/src/components/DashboardsBar/NavigationMenu/__tests__/NavigationMenu.spec.js b/src/components/DashboardsBar/NavigationMenu/__tests__/NavigationMenu.spec.js index c8710ecd1..bd173899c 100644 --- a/src/components/DashboardsBar/NavigationMenu/__tests__/NavigationMenu.spec.js +++ b/src/components/DashboardsBar/NavigationMenu/__tests__/NavigationMenu.spec.js @@ -43,7 +43,7 @@ const baseState = { } const createMockStore = (state) => - createStore(() => Object.assign({}, baseState, state)) + createStore(() => ({ ...baseState, ...state })) test('renders a list of dashboard menu items', () => { const mockStore = createMockStore({}) diff --git a/src/pages/view/FilterBar/__tests__/FilterBadge.spec.js b/src/pages/view/FilterBar/__tests__/FilterBadge.spec.js index b183c4643..450af82ae 100644 --- a/src/pages/view/FilterBar/__tests__/FilterBadge.spec.js +++ b/src/pages/view/FilterBar/__tests__/FilterBadge.spec.js @@ -15,7 +15,7 @@ jest.mock('../../../../components/WindowDimensionsProvider.js', () => ({ const baseState = { selected: { id: 'dashboard1' } } const createMockStore = (state) => - createStore(() => Object.assign({}, baseState, state)) + createStore(() => ({ ...baseState, ...state })) test('Displays badge containing number of filter items when filtered on multiple', () => { const filter = { From d988359ab4fce5f58cae3be4f81185b7b346403a Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 10:33:47 +0100 Subject: [PATCH 5/8] chore: remove nested ternary for increased maintainability --- .../DashboardsBar/InformationBlock/ActionsBar.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/DashboardsBar/InformationBlock/ActionsBar.js b/src/components/DashboardsBar/InformationBlock/ActionsBar.js index 8add1296b..3c7009557 100644 --- a/src/components/DashboardsBar/InformationBlock/ActionsBar.js +++ b/src/components/DashboardsBar/InformationBlock/ActionsBar.js @@ -186,11 +186,14 @@ const ActionsBar = ({ return } - const slideshowTooltipContent = !hasSlideshowItems - ? i18n.t('No dashboard items to show in slideshow') - : offline && !isCached - ? i18n.t('Not available offline') - : null + let slideshowTooltipContent = null + if (!hasSlideshowItems) { + slideshowTooltipContent = i18n.t( + 'No dashboard items to show in slideshow' + ) + } else if (offline && !isCached) { + slideshowTooltipContent = i18n.t('Not available offline') + } return ( <> From b9f5ded486abce9c3df4205889eb81669a0c123d Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 13:19:41 +0100 Subject: [PATCH 6/8] chore: add hover color to button to highlight it --- src/pages/edit/ItemSelector/ContentMenuItem.js | 2 +- .../edit/ItemSelector/styles/ContentMenuItem.module.css | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/edit/ItemSelector/ContentMenuItem.js b/src/pages/edit/ItemSelector/ContentMenuItem.js index b71b1630f..8d790fb36 100644 --- a/src/pages/edit/ItemSelector/ContentMenuItem.js +++ b/src/pages/edit/ItemSelector/ContentMenuItem.js @@ -17,7 +17,7 @@ const LaunchLink = ({ url }) => { className={classes.launchLinkButton} aria-label={i18n.t('Open visualization in new tab')} > - + ) } diff --git a/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css b/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css index c874bcae6..94cc20a57 100644 --- a/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css +++ b/src/pages/edit/ItemSelector/styles/ContentMenuItem.module.css @@ -5,12 +5,11 @@ } .launchLinkButton { + all: unset; display: flex; margin-inline-start: 8px; z-index: 10000; - border: none; - background-color: transparent; - padding: 0; + color: var(--colors-grey600); } .label { @@ -39,3 +38,7 @@ li .buttonInsert { .buttonInsert:focus { outline: none; } + +.launchLinkButton:hover { + color: var(--colors-grey900); +} From 4aba1827370761545eaa63835e14e53f34c24c62 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 13:33:27 +0100 Subject: [PATCH 7/8] chore: extract to function --- .../DashboardsBar/InformationBlock/ActionsBar.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/DashboardsBar/InformationBlock/ActionsBar.js b/src/components/DashboardsBar/InformationBlock/ActionsBar.js index 3c7009557..b01f0ba07 100644 --- a/src/components/DashboardsBar/InformationBlock/ActionsBar.js +++ b/src/components/DashboardsBar/InformationBlock/ActionsBar.js @@ -186,15 +186,17 @@ const ActionsBar = ({ return } - let slideshowTooltipContent = null - if (!hasSlideshowItems) { - slideshowTooltipContent = i18n.t( - 'No dashboard items to show in slideshow' - ) - } else if (offline && !isCached) { - slideshowTooltipContent = i18n.t('Not available offline') + const getSlideshowTooltipContent = () => { + if (!hasSlideshowItems) { + return i18n.t('No dashboard items to show in slideshow') + } else if (offline && !isCached) { + return i18n.t('Not available offline') + } + return null } + const slideshowTooltipContent = getSlideshowTooltipContent() + return ( <>
    From 83a9a6ec84f79521465febeeb5583f13c586ef52 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 14:40:22 +0100 Subject: [PATCH 8/8] chore: restore analytics to latest release version --- package.json | 2 +- yarn.lock | 38 +++++++------------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index b35aadaf5..c651ae390 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "private": true, "license": "BSD-3-Clause", "dependencies": { - "@dhis2/analytics": "git+https://github.com/d2-ci/analytics.git#e398d08e696356908725c8f51f32c30e7cb002ec", + "@dhis2/analytics": "^26.9.4", "@dhis2/app-runtime": "^3.10.6", "@dhis2/app-runtime-adapter-d2": "^1.1.0", "@dhis2/d2-i18n": "^1.1.3", diff --git a/yarn.lock b/yarn.lock index d046039e3..be56c66a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2304,9 +2304,10 @@ classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2/analytics@git+https://github.com/d2-ci/analytics.git#e398d08e696356908725c8f51f32c30e7cb002ec": - version "26.9.4" - resolved "git+https://github.com/d2-ci/analytics.git#e398d08e696356908725c8f51f32c30e7cb002ec" +"@dhis2/analytics@^26.9.4": + version "26.10.0" + resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-26.10.0.tgz#6be4f7ad13b4a64e63f330255f0bbc57aa118ff2" + integrity sha512-JmJFXsxnpoQ1KDoAYttygp7bsP76EpLVRaXDk5bGoye7lhG+Q2k0DW3q+hj9H3tIdwV1m3N1mIxzAMzG01QEtw== dependencies: "@dhis2/multi-calendar-dates" "^1.2.2" "@dnd-kit/core" "^6.0.7" @@ -16035,16 +16036,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -16143,14 +16135,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17834,7 +17819,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17861,15 +17846,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"