From 59f3aba29ebfcf990c6e09ae6333a1c3d7d6a09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Henrik=20=C3=98verland?= Date: Wed, 4 Dec 2024 15:25:05 +0100 Subject: [PATCH 1/3] fix: enable ou tree and levels/groups with user orgunits --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e9dc49b27..20b0e4368 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "typescript": "^4.8.4" }, "dependencies": { - "@dhis2/analytics": "^26.8.1", + "@dhis2/analytics": "^26.9.3", "@dhis2/app-runtime": "^3.4.4", "@dhis2/ui": "^9.4.2", "@dnd-kit/core": "^5.0.3", diff --git a/yarn.lock b/yarn.lock index 2adb88d63..3dac3b8c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2038,10 +2038,10 @@ classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2/analytics@^26.8.1": - version "26.8.1" - resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-26.8.1.tgz#ad72b326e92f0440a0280fc223ff0b85483eac5f" - integrity sha512-0y2RMlP1VucSaKCSGIsY4EwYmg6dg3ig765j7StOhbgT6wbRnE32VrQibG/sElGN3jwGf58frIGntEXdqGbjuw== +"@dhis2/analytics@^26.9.3": + version "26.9.3" + resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-26.9.3.tgz#bcb550e2e87f931622c4fe04c40711464f0d5989" + integrity sha512-MFA4Q8MpzDO4o3e+Oy1dZcQSxTc/AqFzdcQrln37DOpA1iUF5ZpiU17CdwDNdvZ6DjVZF6/GQNFnzPzLJ3svIw== dependencies: "@dhis2/multi-calendar-dates" "^1.2.2" "@dnd-kit/core" "^6.0.7" @@ -2049,7 +2049,7 @@ "@dnd-kit/utilities" "^3.2.1" "@react-hook/debounce" "^4.0.0" classnames "^2.3.1" - crypto-js "^4.1.1" + crypto-js "^4.2.0" d2-utilizr "^0.2.16" d3-color "^1.2.3" highcharts "^10.3.3" @@ -6716,7 +6716,7 @@ crypto-browserify@^3.0.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@^4.1.1: +crypto-js@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== From db357a2bac555e80f377a8f54cd9fb65c318c230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Henrik=20=C3=98verland?= Date: Wed, 4 Dec 2024 15:57:29 +0100 Subject: [PATCH 2/3] test: update test according to new decimal rules in analytics --- src/modules/__tests__/tableValues.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/__tests__/tableValues.spec.js b/src/modules/__tests__/tableValues.spec.js index c36cf916a..95723c062 100644 --- a/src/modules/__tests__/tableValues.spec.js +++ b/src/modules/__tests__/tableValues.spec.js @@ -87,7 +87,7 @@ describe('getFormattedCellValue', () => { value, visualization: { digitGroupSeparator: 'COMMA' }, }) - ).toEqual('3,700.5') + ).toEqual('3,700.50') }) test('username', () => { From 436483570af203d81b49a9084bb875679f9ffbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Henrik=20=C3=98verland?= Date: Thu, 5 Dec 2024 10:46:02 +0100 Subject: [PATCH 3/3] test: update tests according to new ou dialog behaviour --- cypress/integration/orgUnitDimension.cy.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cypress/integration/orgUnitDimension.cy.js b/cypress/integration/orgUnitDimension.cy.js index e98735e27..f17ee36f7 100644 --- a/cypress/integration/orgUnitDimension.cy.js +++ b/cypress/integration/orgUnitDimension.cy.js @@ -14,7 +14,6 @@ import { expectOrgUnitDimensionModalToBeVisible, expectOrgUnitDimensionToNotBeLoading, expectOrgUnitItemToBeSelected, - expectOrgUnitTreeToBeDisabled, expectOrgUnitTreeToBeEnabled, openOuDimension, selectOrgUnitTreeItem, @@ -45,7 +44,7 @@ describe(`Org unit dimension`, () => { openOuDimension(DIMENSION_ID_ORGUNIT) expectOrgUnitDimensionModalToBeVisible() expectOrgUnitDimensionToNotBeLoading() - expectOrgUnitTreeToBeDisabled() + expectOrgUnitTreeToBeEnabled() deselectUserOrgUnit(TEST_DEFAULT_ORG_UNIT) selectOrgUnitTreeItem(TEST_ROOT) selectOrgUnitTreeItem(TEST_DISTRICT_1) @@ -143,20 +142,19 @@ describe(`Org unit dimension`, () => { expectOrgUnitItemToBeSelected(TEST_ROOT) expectOrgUnitTreeToBeEnabled() selectUserOrgUnit(TEST_USER_ORG_UNIT) - expectOrgUnitTreeToBeDisabled() + expectOrgUnitTreeToBeEnabled() clickOrgUnitDimensionModalUpdateButton() expectTableToBeVisible() - assertChipContainsText('Organisation unit', 1) + assertChipContainsText('Organisation unit', 2) assertTooltipContainsEntries([TEST_USER_ORG_UNIT]) cy.log(`deselects '${TEST_USER_ORG_UNIT}'`) openOuDimension(DIMENSION_ID_ORGUNIT) expectOrgUnitDimensionModalToBeVisible() expectOrgUnitDimensionToNotBeLoading() - expectOrgUnitTreeToBeDisabled() + expectOrgUnitTreeToBeEnabled() deselectUserOrgUnit(TEST_USER_ORG_UNIT) expectOrgUnitTreeToBeEnabled() - selectOrgUnitTreeItem(TEST_ROOT) expectOrgUnitItemToBeSelected(TEST_ROOT) clickOrgUnitDimensionModalUpdateButton() expectTableToBeVisible() @@ -174,7 +172,7 @@ describe(`Org unit dimension`, () => { openOuDimension(DIMENSION_ID_ORGUNIT) expectOrgUnitDimensionModalToBeVisible() expectOrgUnitDimensionToNotBeLoading() - expectOrgUnitTreeToBeDisabled() + expectOrgUnitTreeToBeEnabled() deselectUserOrgUnit(TEST_DEFAULT_ORG_UNIT) TEST_DISTRICTS.forEach((district) => selectOrgUnitTreeItem(district)) toggleOrgUnitLevel(TEST_LEVEL)