Skip to content

Refactored the rule_form.vue validation code structure

Robert Hunt requested to merge refactor-rule-form-validation into master

What does this MR do?

This MR refactors the existing validation logic to make it simpler to follow and easier to maintain, following the more standard computed prop checks rather than using a validation object.

This does not change any of the visual aspects of the form.

This is a two-part refactor:

Step MR
Refactor the validation 👉 You are here
Refactor to use GlFormInput/GlFormGroup !56319 (merged)

Setup & Testing

To view the rule form with external approval gates you need to enable this feature flag:

echo "Feature.enable(:ff_compliance_approval_gates)" | rails c

Screenshots (strongly suggested)

Form With validation errors (User / Group) With validation errors (Approval Gate)
image image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

  1. Open a project and go to project settings, then open the Merge request approvals section
  2. Check that adding and editing approval rules works as expected and looks correct and that the validation messages are expected

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Jiaan Louw

Merge request reports