Admin settings form errors for a given section leak into other sections

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Form errors that target a specific Admin Settings section appear in other sections as well. This bug happens in production and it was reported on !208978 (merged).

image.png

Solution proposal

Do not display form errors that target a specific Admin Settings section into sections.

Acceptance criteria

  • Do not display form errors that target a specific Admin Settings section into sections.

Implementation guide

  • Create a decorator function for the form_errors (e.g. settings_form_errors) helper that accepts an anchor parameter. The helper doesn't render the form errors alert if the current URL contains an anchor that is different from the anchor argument passed to the decorator.
  • Replace calls to form_errors with calls to settings_form_errors in all the admin settings sections templates.
  • Write a feature test spec/features to detect leak of form errors.

Additional Context

The following discussion from !208978 (merged) should be addressed:

  • @smaglangit started a discussion: (+1 comment)

    issue (blocking): I noticed that the error message from failed submissions leaks to the other sections 🤔

    Although the repeated error message seems to also exist in master, the error displayed in other sections is inconsistent with what's on Web IDE.

    What do you think about making the error message consistent? Or would it be easier to fix the bug with leaking error message instead?

    image

Edited by 🤖 GitLab Bot 🤖