[Group owner bypass] - Improve form error messages

The implementation of !197703 (merged) relies on the error handling in the group settings form. Yet this restricts the kind of wording we can show to the user.

The error builder automatically appends the name of the setting to whatever is sent from the backend. This is not ideal.

Other issues

Screenshot 2025-07-31 at 5.15.55 PM.png

Proposal

Many of the other settings in the group settings page provide the user a restricted number of options. My proposal is skip the clientside error handling (and the need to override the form setup) and instead constrain the user so errors are impossible.

The UI already forces a minimum expiry date of 25 hours ahead. Thus the user should not see the error that the expiry date in the past. The user also will not see the error that end date is required, as the UI sets an end date as soon as the setting is turned on (though the checkbox).

We can address the third error by preventing the user from choosing an expiry date greater than a year.

It would be helpful to show maybe an alert that end date is required, and that is has constraints

Acceptance criteria

  • The error messages in app/models/namespace_setting.rb should be for API access only and not shown client side. No error message flash is pushed
  • The user is informed that expiry date is required, is a minimum date and has a maximum
  • The user is thus prevented from setting an expiry date outside that time bound
Edited by 🤖 GitLab Bot 🤖