Skip to content

Commit

Permalink
feat: implements latest Dynamic Dimension selector from Analytics (#1046
Browse files Browse the repository at this point in the history
)

Bumps the Analytics version to v.7.0.0
Removes onDeselect and onReorder from the props passed to DynamicDimension
Prop d2 passed as context
Prop dialogId passed as dimensionId
  • Loading branch information
martinkrulltott authored Jun 9, 2020
1 parent 2166f8e commit 8582d09
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"redux-mock-store": "^1.5.4"
},
"dependencies": {
"@dhis2/analytics": "^6.0.3",
"@dhis2/analytics": "^7.0.0",
"@dhis2/app-runtime": "*",
"@dhis2/d2-i18n": "*",
"@dhis2/d2-ui-file-menu": "^7.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,43 +251,40 @@ export class DialogManager extends Component {
item.isActive = index < axisMaxNumberOfItems
})
}

let content = null
if (dialogId === DIMENSION_ID_DATA) {
return (
content = (
<DataDimension
displayNameProp={displayNameProperty}
selectedDimensions={selectedItems}
infoBoxMessage={infoBoxMessage}
{...dimensionProps}
/>
)
}

if (dialogId === DIMENSION_ID_PERIOD) {
return (
} else if (dialogId === DIMENSION_ID_PERIOD) {
content = (
<PeriodDimension
selectedPeriods={selectedItems}
onSelect={dimensionProps.onSelect}
// TODO infoBoxMessage should ideally be implemented for all dimensions
// TODO: infoBoxMessage should ideally be implemented for all dimensions
/>
)
}

const nonPredefinedDimensions = filterOutPredefinedDimensions(
Object.keys(this.props.dimensions)
)

if (nonPredefinedDimensions.includes(dialogId)) {
return (
} else if (
filterOutPredefinedDimensions(
Object.keys(this.props.dimensions)
).includes(dialogId)
) {
content = (
<DynamicDimension
selectedItems={selectedItems}
dialogId={dialogId}
{...dimensionProps}
// TODO infoBoxMessage should ideally be implemented for all dimensions
dimensionId={dialogId}
onSelect={dimensionProps.onSelect}
context={dimensionProps.d2}
// TODO: infoBoxMessage should ideally be implemented for all dimensions
/>
)
}
return null
return content
}

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"access": "public"
},
"dependencies": {
"@dhis2/analytics": "^6.0.3",
"@dhis2/analytics": "^7.0.0",
"@dhis2/ui-core": "^4.21.1",
"lodash-es": "^4.17.11"
},
Expand Down
30 changes: 25 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1302,10 +1302,10 @@
debug "^3.1.0"
lodash.once "^4.1.1"

"@dhis2/analytics@^6.0.3":
version "6.0.3"
resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-6.0.3.tgz#5875621a5ae92565f23603b156f86253c582740a"
integrity sha512-ctLGJpHLI5cCn+9ryA5m1B7euH7Hgofl4rFKTLjyKUCIAprojgDKf/9BuDby33ym5qN03ljj84wy/EtgcsXP2w==
"@dhis2/analytics@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-7.0.0.tgz#1e2d11875fa06e88b2549ba01bf10b595c77a280"
integrity sha512-t6l4gxhhPUjL4EkJrBs8ThHdop52LvUiwJxIvQRESo5kC9hswbODe3siTLyfPugonWw8V5HbN8ew/lt8TX6Frw==
dependencies:
"@dhis2/d2-ui-org-unit-dialog" "^7.0.3"
"@dhis2/ui-core" "^4.21.1"
Expand Down Expand Up @@ -1443,7 +1443,27 @@
semver "^6.3.0"
yargs "^14.2.0"

"@dhis2/d2-i18n@*", "@dhis2/d2-i18n@^1.0.5":
"@dhis2/d2-i18n-extract@^1.0.7":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n-extract/-/d2-i18n-extract-1.0.8.tgz#9d98690d522a51895c8ef3fe7136f026b0f8dacd"
integrity sha512-wjQ5J0v8Td12+KcQYSuuZ1tQLReXJ1gBSqkyImf2aNtLwJKERaTOjZ71da+GXdHtd6ph/DP1ezQvFDFKhBHa/A==
dependencies:
argparse "^1.0.10"
i18next-conv "^6.0.0"
i18next-scanner "^2.4.4"

"@dhis2/d2-i18n-generate@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n-generate/-/d2-i18n-generate-1.1.1.tgz#e800fa39e85a71c23040b6378de1c9439f69fef7"
integrity sha512-akKFdEot0d38Yq51WlnflKYuQYMAYvHxDnQuOy3GVUDpmavnQec3wxQNdXbwy6FH9UUHO3kAJhlYL+slxEI+LQ==
dependencies:
argparse "^1.0.10"
handlebars "^4.0.11"
i18next-conv "^6.0.0"
moment "^2.22.1"
rimraf "^2.6.2"

"@dhis2/d2-i18n@*", "@dhis2/d2-i18n@^1.0.3", "@dhis2/d2-i18n@^1.0.5":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n/-/d2-i18n-1.0.6.tgz#2914be8acf296f3a6bf7b51c76c46da6a120b0ff"
integrity sha512-7YdA4ppFosjuyf7ZMm47BrdsA5TWLM9lmS0lUPgjcCVeeWfUgagqzf4W5JGB9XQ3w1vzK+yy5zH2Ij8IgRAGhA==
Expand Down

0 comments on commit 8582d09

Please sign in to comment.