Skip to content

Add a mutation that allows dynamically changing how a diff is viewed in the UI

Thomas Randolph requested to merge 205401-change-viewer-mutation into master

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

Availability and Testing

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
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading