-
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
fix: [DHIS2-15383] align mandatory behaviour for all value types #3413
Conversation
- Trigger validation whenever focus leaves component - Ignore key events fired by held-down keys
- Option sets - Organisation unit field - User name field - File selector button - Image selector button
Makes `d2:hasValue` work on the relevant fields
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.
Some minor stuff in addition to what we talked about in person.
@@ -0,0 +1,37 @@ | |||
// @flow |
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.
Can we move this file to internal/SelectionBoxes
? (With the managedKeys it is quite coupled to it and we can make something reusable later if we need to)
}; | ||
|
||
let ignoreFlag = false; |
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.
Can you add a comment about this flag for future reference?
event.preventDefault(); | ||
return; | ||
} | ||
if (event.key == keys.TAB) { |
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.
===
?
- Relocate withKeyboardNavigation.js - Add comment to ignoreFlag variable - Fix equality check typo
## [100.35.8](v100.35.7...v100.35.8) (2023-08-22) ### Bug Fixes * [DHIS2-15492] transition of tooltip enabled state ([#3381](#3381)) ([adb6b32](adb6b32))
## [100.35.9](v100.35.8...v100.35.9) (2023-08-22) ### Bug Fixes * [DHIS2-15700] Option sets not working in TEI Registration ([2e47477](2e47477))
# [100.36.0](v100.35.9...v100.36.0) (2023-08-22) ### Features * [DHIS2-15229] search for MULTI_TEXT ([#3395](#3395)) ([c5d9a7d](c5d9a7d))
# [100.37.0](v100.36.0...v100.37.0) (2023-08-22) ### Features * [DHIS2-15299] escape value for attribute filter ([#3403](#3403)) ([5db743e](5db743e))
# [100.38.0](v100.37.0...v100.38.0) (2023-09-06) ### Features * [DHIS2-14334] edit enrollment date ([#3350](#3350)) ([9dd1b6a](9dd1b6a))
# [100.39.0](v100.38.0...v100.39.0) (2023-09-07) ### Features * [DHIS2-13343] hidden program stage rule effect ([#3406](#3406)) ([4ef2973](4ef2973))
Automatically merged.
## [100.39.1](v100.39.0...v100.39.1) (2023-09-13) ### Bug Fixes * **translations:** sync translations from transifex (master) ([0fab0eb](0fab0eb))
Automatically merged.
## [100.39.2](v100.39.1...v100.39.2) (2023-09-14) ### Bug Fixes * **translations:** sync translations from transifex (master) ([c17c663](c17c663))
## [100.39.3](v100.39.2...v100.39.3) (2023-09-14) ### Bug Fixes * [DHIS2-15356] change tei search parameter from `ou` to `orgUnit` ([#3362](#3362)) ([c7ab828](c7ab828))
Automatically merged.
## [100.39.4](v100.39.3...v100.39.4) (2023-09-19) ### Bug Fixes * **translations:** sync translations from transifex (master) ([712b56e](712b56e))
The merge I did from master accidentally got split up into several commits during a rebasing operation.. @JoakimSM - I fixed the keyboard navigation problem and the file selector button problem that you showed me, as well as correcting what you pointed out in the comments. |
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 @superskip,
The mandatory error is not displayed when leaving a field with value type MULTI_TEXT
(probably some logic is missing in MultiSelectField.component.js).
In addition, after submitting the form, the required error text is displayed, but the field background is not red. Can take a look?
Screen.Recording.2023-10-31.at.11.37.54.mov
Besides this, the rest looks great. Thanks!
Thanks for the review @simonadomnisoru ! |
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.
LGTM
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
🚀 Deployed on https://deploy-preview-3413--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.41,2.40.2,2.39.4,2.38.6 versions
## [100.44.4](v100.44.3...v100.44.4) (2023-11-10) ### Bug Fixes * [DHIS2-15383] align mandatory behaviour for all value types ([#3413](#3413)) ([b0eddc7](b0eddc7))
🎉 This PR is included in version 100.44.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Jira: DHIS2-15383
The first three commits are completely independent of each other, so I recommend viewing them separately.
The first commit is a bit complex, so let me break it down a bit:
It concerns itself with a home-made low-level component, acting as a container for a collection of checkboxes.
This component supports keyboard input: arrow keys to move between checkboxes, enter/space to select a checkbox.
However, the original implementation didn't properly handle the case when a key is being held down over time.
The new file
withKeyboardNavigation
aims to improve the handling in this situation.Another central feature of this commit is that it introduces an array of refs to the checkboxes.
These are used to keep the container from validating when the focus moves within it (which typically happens when an arrow key is pressed).
The third commit doesn't really address the reported issue, but it is sort of related in that it also contributes to alignment of the behaviour of all fields, specifically the result of
d2:hasValue
in the rule engine.All the subsequent commits are only minor adjustments needed for passing the cypress tests.