-
Notifications
You must be signed in to change notification settings - Fork 6
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
Event date facet (DDFFORM-67) #562
base: develop
Are you sure you want to change the base?
Conversation
Generally we do not use PascalCase for story titles.
This allows us to make the component usable in more situations - e.g. show the calendar with a form field. This also allows us to move styling that was currently placed in the pause modal component into the generic component. Styling specific to Flatpickr has been moved to a separate SCSS file.
This supports our usage of visual testing.
This allows us to reuse the logic in the CMS.
This is recommended by React DevTools.
Filters have black borders. Add a story to showcase this.
This goes to the right of the filters on desktop. We also want to control the width. Instead of setting the width on the element like we do for dropdowns we instead set it on the surrounding elements. This makes it easier to use across different contexts.
Localization will not work inside storybook so this is the best we can do. To use this format we have to set an alt input. This requires updates to our asynchronous clicking as there are now multiple input elements from Flatpickr. This also allows us to lower the waiting time before we click.
By splitting the two we can create a date range for content that has been loaded asynchronously.
The component gets its bottom margin from the origin implementation but this is not needed here.
now, | ||
animate: false, | ||
altInput: true, | ||
altFormat: "j. M Y", |
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 think we should align it to the right and not left.
Maybe this is the correct change, not sure.
now, | |
animate: false, | |
altInput: true, | |
altFormat: "j. M Y", | |
now, | |
animate: false, | |
altInput: true, | |
altFormat: "j. M Y", | |
position: "auto right", |
<input | ||
className="date-range__input" | ||
type="text" | ||
aria-label="Vælg dato" | ||
/> |
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.
Placeholder værdi
<input | |
className="date-range__input" | |
type="text" | |
aria-label="Vælg dato" | |
/> | |
<input | |
className="date-range__input" | |
type="text" | |
aria-label="Vælg dato" | |
placeholder="Vælg dato" | |
/> |
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.
Comments reflect a mix of review on the design system, and the cms PR.
General suggestions
-
I found this design for the date picker. I think that is favorable to the empty input so i feel we should add that.
-
I added some comments for placeholder and position/alignment of the open flatpickr, aswell as possibility of showing 2 months in desktop.
-
I think we it would be nice with a reset/clear button for this. A button with an X or some text that shows up left of the date filter.
Potential problematic behaviour
These are not things i think needs to change for now necessarily, but i wanted to highlight some of the flatpickr behaviour that could be problematic.
-
There is no default display of a date. The input is empty, but we could display the current day and forward here since that is what it is showing.
-
If i want to select a date_from, and not a date_to, this is hard. I have to select 1 date, move out of the box without select a range and click. If then i reopen it, the date picker is now expecting a date_to input from the previous interaction.
I am not sure how to prevent it from expecting a date_to on reopening.
- Related to above: If i again want to select a date_from, and not a date_to, i can also i double click a date. This activates a search with both a date_to and date_from.
- I think this is not intuitive.
- The filter-input is not diplaying this selection in the format of "Date_from TIL date_to" which i guess is expected.
One suggestion here could be to just handle this by checking if the same date was clicked twice, and then perform a Date_from without date_to search.
Suggestions
Perhabs most of this can be solved with some conditional checking in the current implementation. The date filtering works, but some of the current flatpickr functionality can be confusing.
An alternativ could be to display the date_from and date_to inputs above the calendar, which all would then be in one container that opened. Maybe in a readonly state. The point would be to reflect changes more intuitively to the user, but not sure if necessary.
Take what you wish from this. I think the reset button and individual comments are the most prevalent.
Also i am interested in knowing what made you not do it as a react app 👂
window.flatpickrOptions = { | ||
now, |
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 think it would be nice to use the functionality built in of displaying 2 months instead of one on desktop / when there is room for it.
Up to you
window.flatpickrOptions = { | |
now, | |
window.flatpickrOptions = { | |
now, | |
showMonths={2} |
Link to issue
https://reload.atlassian.net/browse/DDFFORM-67
Description
This PR shows how date filtering should appear on content list pages. The PR consists of two parts:
Please go through the individual commits for additional commentary.
Screenshot of the result
Additional comments or questions
I have added a few comments in the PR below.