Skip to content

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

Screenshot_2023-08-17_at_1.36.06_PM

  1. "edit-profile": registrations/welcome/show page. No form validation here adds field_with_errors wrapper.

Screenshot_2023-08-17_at_1.43.57_PM

  1. "new-project": registrations/groups/new page. Actual form inputs are built with Vue, so no use case here.

Screenshot_2023-08-17_at_1.46.25_PM

  1. "verify-identity": component built with Vue, so no use case here

How to set up and validate locally

  1. Without checking out this branch
  2. Sign in as Admin
  3. Turn on related feature flag in rails console: Feature.enable(:prevent_visibility_restriction)
  4. Go to Admin area > Settings > General
  5. Expand Visibility and access controls, select the current Default project visibility level as restricted in the Restricted visibility levels setting and click Save changes.
  6. Observe the validation flash message and incorrect rendering of Default project visibility level setting.
  7. 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.

Edited by Roy Liu

Merge request reports