Form error cause checkbox render incorrectly in admin settings form
What does this MR do and why?
Disable the Rails default behavior of wrapping form fields that has validation errors with field_with_errors
divs. This aims to solve the problem that sometimes those fields render incorrectly. Specific issue here: #419316 (closed).
The only css currently applied to field_with_errors
is also removed as after investigation, it does not have any use case anymore.
Investigation of current usage
1. ".edit-group": subscription/groups/edit page. Does not have any effect after removing- "edit-profile": registrations/welcome/show page. No form validation here adds field_with_errors wrapper.
- "new-project": registrations/groups/new page. Actual form inputs are built with Vue, so no use case here.
- "verify-identity": component built with Vue, so no use case here
How to set up and validate locally
- Without checking out this branch
- Sign in as Admin
- Turn on related feature flag in rails console:
Feature.enable(:prevent_visibility_restriction)
- Go to Admin area > Settings > General
- Expand Visibility and access controls, select the current
Default project visibility
level as restricted in theRestricted visibility levels
setting and click Save changes. - Observe the validation flash message and incorrect rendering of Default project visibility level setting.
- Then add the config in this MR or checkout the branch and repeat the same.
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.
Edited by Roy Liu