Skip to content

Commit

Permalink
fix: enable ou tree and levels/groups with user orgunits (DHIS2-18066) (
Browse files Browse the repository at this point in the history
#626)

Implements DHIS2-18066

Includes dhis2/analytics#1702

Updates value test according to a new decimal rule in analytics.

Updates ou dialog tests according to new behaviour.
  • Loading branch information
janhenrikoverland authored Dec 10, 2024
1 parent 70491f8 commit 57b8b45
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
12 changes: 5 additions & 7 deletions cypress/integration/orgUnitDimension.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
expectOrgUnitDimensionModalToBeVisible,
expectOrgUnitDimensionToNotBeLoading,
expectOrgUnitItemToBeSelected,
expectOrgUnitTreeToBeDisabled,
expectOrgUnitTreeToBeEnabled,
openOuDimension,
selectOrgUnitTreeItem,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/__tests__/tableValues.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('getFormattedCellValue', () => {
value,
visualization: { digitGroupSeparator: 'COMMA' },
})
).toEqual('3,700.5')
).toEqual('3,700.50')
})

test('username', () => {
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2038,18 +2038,18 @@
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"
"@dnd-kit/sortable" "^7.0.2"
"@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"
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit 57b8b45

Please sign in to comment.