-
Notifications
You must be signed in to change notification settings - Fork 23
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
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
src/core_modules/capture-ui/DateAndTimeFields/DateField/Date.component.js
Outdated
Show resolved
Hide resolved
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.capture.netlify.dhis2.org |
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
…s2-ui-calendarinput-component-in-forms
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.
We are very close now @alaa-yahia.
|
||
if (result === true || (result && result.valid)) { | ||
return false; | ||
} | ||
|
||
message = (result && result.message) || validatorContainer.message; | ||
message = (result && result.errorMessage) || validatorContainer.message; |
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 see. After your comment and digging into it a bit more, I changed my opinion a bit. Let's keep what you did here for now, but I made a ticket for later: https://dhis2.atlassian.net/browse/DHIS2-18464
src/core_modules/capture-core/components/D2Form/FormBuilder/FormBuilder.component.js
Outdated
Show resolved
Hide resolved
Like we talked about, made a separate ticket for this: https://dhis2.atlassian.net/browse/DHIS2-18468 |
…s2-ui-calendarinput-component-in-forms
src/core_modules/capture-core/components/D2Form/field/validators/getValidators.js
Outdated
Show resolved
Hide resolved
src/core_modules/capture-core/utils/validators/form/ageValidator.js
Outdated
Show resolved
Hide resolved
src/core_modules/capture-core/utils/validators/form/dateValidator.js
Outdated
Show resolved
Hide resolved
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.
Good job! 🎉
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.
Nice 🎉 Looks good to me now. Let's have QA redo the testing before merging.
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.3,2.40.7,2.39.8 versions
# [101.19.0](v101.18.1...v101.19.0) (2024-12-03) ### Features * [DHIS2-15462] Use dhis2 UI calendarinput component in forms ([#3658](#3658)) ([f39fd47](f39fd47))
🎉 This PR is included in version 101.19.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Implements DHIS2-15462
Description
@dhis2/ui
CalendarInput
is used when capturing dates in forms.