-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: hide periods based on system settings (DHIS2-11161) #1789
Conversation
@@ -90,6 +121,9 @@ const FilterDialog = ({ | |||
<PeriodDimension | |||
selectedPeriods={selectedItems} | |||
onSelect={commonProps.onSelect} | |||
excludedPeriodTypes={getExcludedPeriodTypes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea with making excludedPeriodTypes configurable in PeriodDimension that the app may want to be even more restrictive than the system settings? Could the app also enforce a less restrictive list than the system settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my initial version of this, the fetching of system settings and excluding of periods were all done in Analytics itself. But it was decided to move it out to excludedPeriodTypes
and let the apps decide which periods to exclude, since we want to keep the lib flexible and unopinionated. Also, since the apps already fetch the system settings, we avoid having a separate backend call in Analytics which would also lead to a having a loading spinner when you open the period dimension.
So by letting the apps fetch the settings (which the already do, these are just additional props to the existing api request), we avoid both the loading spinner, an additional api request and opinionating Analytics.
So to answer the question, yes apps could provide any restrictions they want, regardless of the system settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, if that's approved by the product manager, then ok with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If what is approved?
# [31.16.0](v31.15.6...v31.16.0) (2021-05-31) ### Bug Fixes * applying a filter to a dashboard with a Map item results in the map not rendering [DHIS2-11054] ([#1741](#1741)) ([cd4d2d6](cd4d2d6)) ### Features * hide periods based on system settings (DHIS2-11161) ([#1789](#1789)) ([d01c2e6](d01c2e6))
🎉 This PR is included in version 31.16.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Implements DHIS2-11161
Requires dhis2/analytics#920
Relates to dhis2/data-visualizer-app#1721
Key features
excludedPeriodTypes
with values from system settingsDAYS
andWEEKS
from Analytics toDAILY
andWEEKLY
Description
Fetches props from system settings to be passed to
excludedPeriodTypes
. Based on the DV change (dhis2/data-visualizer-app#1721).TODO
getExcludedPeriodTypes
to Analytics?Screenshots
see the Analytics PR