Add backstage code that allows Diffs app to dynamically respond to changes to `state` `commit`
What does this MR do?
For #18140 (closed).
This MR causes the Diffs app to respond to changes to the commit
. When the commit
changes, the Diffs app should reload the data it's displaying. As of right now, there's no way to directly interact with this state property through the UI. A future MR will add UI to take advantage of this new ability.
Why
Until now, the only way to change the commit a user is looking at in the UI is to change the commit in the URL and trigger a full page reload. It's fairly easy to replace the parts of the state that actually need to change and reload the data while the page remains rendered.
This watcher watches the only really relevant state object (commit
) and triggers the appropriate changes:
- Updates the URL
- Refetches the diff data
- Adjusts the view appropriately
Screenshots
N/A, ~backstage changes
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team