Fix security policy editor validation error rendering
What does this MR do and why?
Fixes validation error message rendering in the security policy editor:
I had a look as well and it's indeed regression from Update alert for not enough approvers (!123757 - merged). The MR added
validationErrors
for the GraphQL query and it uncovered an inconsistent behavior in backend where we don't always returnfield
and we default tonil
here, even though the field is marked as not-nullable.As discussed on Slack, we agreed a proper fix would be to make sure in backend that we always return
field
for thevalidationErrors
. For cases where we don't have a specific field in the form such asInvalid policy type
, we'd propose to usebase
, which aligns with Rails validations.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Navigate to Secure > Policies
, attempt to create an invalid security policy of either type, and verify error messages are rendered as expected.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #404777 (closed)