Skip to content

Draft: Add FE validation to Seat Controls

Angelo Gulina requested to merge ag/477091-seat-controls-fe-validation into master

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

  1. disable the input field, when Open access is checked
  2. add a required condition when Set user cap is checked

To understand why, consider the following cases:

  1. If Open access is checked, no validation should be triggered. However, if the field has 0 (for whatever reason), the validation will be triggered because of min = 1 constraint. Removing min = 1 would be too specific. Therefore, disabling the field seems the best option
  2. If Set user cap is 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 a required field

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

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Angelo Gulina

Merge request reports

Loading