-
Notifications
You must be signed in to change notification settings - Fork 22
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: [DHIS2-15462] Use dhis2 UI calendarinput component in forms #3658
base: master
Are you sure you want to change the base?
feat: [DHIS2-15462] Use dhis2 UI calendarinput component in forms #3658
Conversation
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.
Hey @alaa-yahia, great job on this PR 👏 !
From capture-app side, I only added a small comment about hiding the default label. Additionally, can you please take a look and fix the failed cypress tests related to the calendar data-test
selectors?
From the UI library side, these are the pending features that need to be added before merging this PR:
- minimum and maximum support data - feat: support editable input | min & max dates | dd-mm-yyyy format in CalendarInput ui#1504
- support for typing/removing a date - feat(calendar input): make input editable ui#1445
- support for DD-MM-YYYY format - I couldn't find a ticket/PR for this. Let's sync up for the next step on this.
Thank you!
src/core_modules/capture-ui/DateAndTimeFields/DateField/Date.component.js
Show resolved
Hide resolved
Hey, minimum and maximum support data - feat: support min & max dates in CalendarInput ui#1504 |
8cd2340
to
ec8c228
Compare
src/core_modules/capture-ui/DateAndTimeFields/DateField/Date.component.js
Outdated
Show resolved
Hide resolved
width={calculatedInputWidth} | ||
{...splittedPassOnProps.input} | ||
<CalendarInput | ||
{...passOnProps} |
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 passOnProps
, there are a lot of old props that are no longer used and it's quite hard to keep track. Is it possible to clean it up a bit and leave only the props that CalendarInput
actually uses? You can also clean up unused props from parent components of Date.component.js. Thanks!
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.
Will update the code!
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.
Solid work, well done @alaa-yahia ! 👏
Let's move it to QA and then discuss in one of our Tuesday syncs if we want to release with alpha or wait for the @dhis/ui
stable release.
Just one question regarding validation: The new calendar component is doing validation internally, which makes sense since it's supposed to support exotic calendar types. But as far as I can see the Capture app is still doing its own validation - is it possible to make it use the validation result from the new calendar component instead? I can't see how this can be achieved with the current interface though (https://ui.dhis2.nu/components/calendar#props), but maybe that document is outdated. |
Yeah @superskip the document is outdated as I haven't worked on docs yet. |
🚀 Deployed on https://deploy-preview-3658--dhis2-capture.netlify.app |
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.
Tested successfully on 2.42,2.41.2,2.40.5,2.39.7 versions
Implements DHIS2-15462
Description
@dhis2/ui
CalendarInput
is used when capturing dates in forms.