Fix Value Stream form restore defaults button

What does this MR do and why?

This merge request enhances the Value Stream Analytics settings form with several usability improvements. The main changes include:

  1. Improved handling of hidden stages - instead of maintaining separate lists for active and hidden stages, stages now have a "hidden" property and are sorted to display hidden stages at the end.

  2. Better form state management - the form now properly watches for changes to initial values and updates accordingly, making editing more reliable.

  3. Simplified autofocus behavior - input fields now only autofocus when they're empty, preventing disruptive focus changes when editing existing data.

  4. Streamlined i18n (internationalization) handling - moved hardcoded strings directly into the components using them rather than importing from a central constants file.

  5. More intuitive UI for restoring default stages - the "Restore defaults" button now only appears when there are actual changes to restore.

  6. Fixed validation and submission logic to properly handle stage properties, especially for hidden stages.

These changes make the Value Stream Analytics form more intuitive and reliable for users managing their value stream stages.

References

Screenshots or screen recordings

vsa_form_test

How to set up and validate locally

Note: There is currently a loading error when viewing the main VSA page in a GDK. These error messages can be disregarded to test this change, as we're only focused on the create/edit page

  1. Analyze > Value stream analytics in the sidebar for any group or project
  2. Create a new value stream (with or without template is fine)
  3. Edit the newly created value stream
  4. Verify that the Restore defaults button does not appear on page load
  5. Make various changes to the form and validate that the Restore defaults button is only rendered when there are pending changes
  6. When clicking the Restore defaults button, verify that the page is returned to it's initial state

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #513304 (closed)

Edited by Alex Pennells

Merge request reports

Loading