Draft: Add FE validation to Seat Controls
What does this MR do and why?
Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/477091, this MR adds a basic FE validation for the User Cap number field, when User Cap is selected. The most effective strategy seems to
- disable the input field, when
Open accessis checked - add a
requiredcondition whenSet user capis checked
To understand why, consider the following cases:
- If
Open accessis checked, no validation should be triggered. However, if the field has0(for whatever reason), the validation will be triggered because ofmin = 1constraint. Removingmin = 1would be too specific. Therefore, disabling the field seems the best option - If
Set user capis checked, the validation should be triggered for the empty field (the original problem for this Issue). The way to achieve this is to dynamically add arequiredfield
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before
| ValidationsDemo-small |
After
- https://zoom.us/clips/share/O3j9JmGbEp6ATD8OpCf_t_bIUxfxf5gDsP8hbVPdG33iYPCecR23cNjgaLvyCNukAbFMOHmi-uKdK_FWTVNWuXkt.JFRvY0oSeAiCNhjf
- Passcode:
7i0V+C2k
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Edited by Angelo Gulina