Refactored the rule_form.vue validation code structure
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 |
|
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) |
---|---|---|
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because this makes no visual changes and is an internal code refactor.
-
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
- Open a project and go to project settings, then open the
Merge request approvals
section - Check that adding and editing approval rules works as expected and looks correct and that the validation messages are expected
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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