Add a mutation that allows dynamically changing how a diff is viewed in the UI
What does this MR do?
For #205401 (closed).
This MR adds a mutation that allows the diff file viewer
to be swapped out.
Why?
Until now, the frontend has depended exclusively on the viewer
returned by the diff information from the backend API.
Now, however, we want to be able to "upgrade" a diff file in the UI from the viewer
that the backend reported to a different viewer
.
At the moment, there's no way to do this without completely rewriting the entire diff file (and all of it's deeply nested attached lines and discussions along with it). This mutation allows an action to provide a file_path
and a viewer and swap out just that part of the state.
Screenshots
N/A, all ~backstage
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