-
Notifications
You must be signed in to change notification settings - Fork 13
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: use PeriodDimension in ThematicDialog #3407
base: master
Are you sure you want to change the base?
Conversation
🚀 Deployed on https://pr-3407.maps.netlify.dhis2.org |
@@ -10,6 +10,10 @@ | |||
height: 36px; | |||
} | |||
|
|||
.radioGroup.compact fieldset>div>div>label { |
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 it possible to use the same spacing as is on line 25?
/> | ||
)} | ||
{periodError && ( | ||
<div key="error" className={styles.error}> |
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.
What is the purpose of the key
attribute?
display: flex; | ||
align-items: center; | ||
line-height: 1; | ||
gap: 8px; |
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.
use spacers-dp8
I noticed a few things when entering the start or end date. Maybe it's working as expected, or maybe it should be improved, not sure:
|
Just to confirm, with this implementation, the "bug" mentioned in this Jira issue will go away. Is it confirmed that we want the start/end dates to not be cleared even if they aren't in use? |
return this | ||
} | ||
|
||
/* eslint-disable max-params */ |
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.
Maybe send an object instead of disabling max-params
.validateStage('Inpatient morbidity and mortality') | ||
.selectTab('Period') | ||
.selectPeriodType('Start/end dates') | ||
.typeStartDate(`${CURRENT_YEAR - 5}-02-01`) |
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.
With the use of the "-5" in several places I wonder if it might be informative to future us to create a test object, for example:
{
programName: 'Inpatient morbitity and mortality',
yearWithData: CURRENT_YEAR - 5
}
Maybe other properties as well?
excludedPeriodTypes={ | ||
systemSettings.hiddenPeriods | ||
} | ||
height={'250px'} |
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.
I don't think you need the curly braces.
@@ -631,15 +701,14 @@ class ThematicDialog extends Component { | |||
) | |||
} | |||
|
|||
if (!period && periodType !== START_END_DATES) { | |||
if (periods?.length === 0 && periodType !== START_END_DATES) { |
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 periods
is undefined, then this first condition will not be true. Is that expected behavior?
@@ -23,8 +24,15 @@ const ManageLayerSourcesModal = ({ onClose }) => { | |||
const { managedLayerSources, showLayerSource, hideLayerSource } = | |||
useManagedLayerSourcesStore() | |||
|
|||
useKeyDown('Escape', onClose) |
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.
I'm thinking that maybe we should pull changes that aren't related to the period dimension into a separate PR.
Implement: DHIS2-15796
Linked @dhis2/analytics PR: dhis2/analytics#1735
Overview
Main changes are:
PeriodDimension
period selector (transfer-style) for preset periods (in thematic dialog)StartEndDate
for start-end dates periods (in thematic, events and tracked entity dialogs)RenderingStrategy
that controls the use of single map / timeline / split-map (in thematic dialog)SegmentedControl
to switch between preset periods and start-end dates (in thematic dialog)Timeline
component to support multiple periods and from class to functional component (for thematic layers)Also improved keyboard navigation is introduced. The original object was to only to enable typing dates properly. In the end a number of files are modified to introduce consistency. Reviewing them should be quick so it might be a good idea to start here. A few other quality of life improvements included as well. All these changes are listed at the end.
1. Multiple periods selection
2.
PeriodDimension
The new period selector used is
PeriodDimension
(transfer-style) is defined in@dhis2/analytics
.3.
StartEndDate
We updated and rename
StartEndDates
toStartEndDate
to align with the Linelisting app but with an updated date pickerCalendarInput
from@dhis2/ui
which supports multiple calendars.EventDialog
andTrackedEntityDialog
are also updated to useStartEndDate
.4.
RenderingStrategy
We updated the logic to account for multiple periods selection.
5.
SegmentedControl
6.
Timeline
Smaller quality of life improvements are included:
Keyboard navigation
Added "x" close modal buttons:
Small bug fixes
Missing:
Checklist: