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:
-
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.
-
Better form state management - the form now properly watches for changes to initial values and updates accordingly, making editing more reliable.
-
Simplified autofocus behavior - input fields now only autofocus when they're empty, preventing disruptive focus changes when editing existing data.
-
Streamlined i18n (internationalization) handling - moved hardcoded strings directly into the components using them rather than importing from a central constants file.
-
More intuitive UI for restoring default stages - the "Restore defaults" button now only appears when there are actual changes to restore.
-
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
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
-
Analyze > Value stream analyticsin the sidebar for any group or project - Create a new value stream (with or without template is fine)
- Edit the newly created value stream
- Verify that the Restore defaults button does not appear on page load
- Make various changes to the form and validate that the Restore defaults button is only rendered when there are pending changes
- 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)