Add UI to load the full file for `renamed`-type files
requested to merge 205401-cannot-view-content-of-moved-file-without-changes-in-merge-request into master
What does this MR do?
For #205401 (closed)
Adds a link to renamed diffs to expand the full file inline, or - for binary files - a link to the full file at the current commit.
I want to break that down, because there are notable exceptions:
- Only fundamentally
text
files will get the ability to upgrade their diff inline. That means source code, markdown, bare text, etc. - Any binary blob (images, videos, compiled programs, etc.) will get a link so they're not left adrift in the UI, but that link just points them to our existing single-file viewer for the current commit.
- The addition is a link in the
renamed
viewer (which normally just showsFile moved
). - Without JavaScript, this link points to the same location the "View file @ [commit SHA]" button points to.
- With JavaScript, the link loads the full diff and replaces the
renamed
viewer with atext
viewer- In this MR, the only thing that happens is a Vuex action is triggered. The rest of the behavior happens in Vuex actions / mutations already in the repository.
Screenshots
Description | Screenshot |
---|---|
Before (current master ) |
|
Feature | |
Feature (network request errors) | |
Feature (load succeeds) | |
Documentation |
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
Edited by 🤖 GitLab Bot 🤖