From 261f4fe7accfb0cad82feed4f74a26e9ccebcbe3 Mon Sep 17 00:00:00 2001 From: Samantha Ming Date: Wed, 21 Aug 2019 08:23:22 +0000 Subject: Fix to show renamed file in mr --- app/assets/javascripts/diffs/components/diff_file_header.vue | 2 +- changelogs/unreleased/59786-show-renamed-file-in-mr.yml | 5 +++++ spec/javascripts/diffs/components/diff_file_header_spec.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/59786-show-renamed-file-in-mr.yml diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 32fbeaaa905..69ec6ab8600 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -130,7 +130,7 @@ export default { return `\`${this.diffFile.file_path}\``; }, isFileRenamed() { - return this.diffFile.viewer.name === diffViewerModes.renamed; + return this.diffFile.renamed_file; }, isModeChanged() { return this.diffFile.viewer.name === diffViewerModes.mode_changed; diff --git a/changelogs/unreleased/59786-show-renamed-file-in-mr.yml b/changelogs/unreleased/59786-show-renamed-file-in-mr.yml new file mode 100644 index 00000000000..e8c52b592d2 --- /dev/null +++ b/changelogs/unreleased/59786-show-renamed-file-in-mr.yml @@ -0,0 +1,5 @@ +--- +title: Fix to show renamed file in mr +merge_request: 31888 +author: +type: changed diff --git a/spec/javascripts/diffs/components/diff_file_header_spec.js b/spec/javascripts/diffs/components/diff_file_header_spec.js index d4280d3ec2c..356e7a8f1fe 100644 --- a/spec/javascripts/diffs/components/diff_file_header_spec.js +++ b/spec/javascripts/diffs/components/diff_file_header_spec.js @@ -372,7 +372,7 @@ describe('diff_file_header', () => { }); it('displays old and new path if the file was renamed', () => { - props.diffFile.viewer.name = diffViewerModes.renamed; + props.diffFile.renamed_file = true; vm = mountComponentWithStore(Component, { props, store }); -- cgit v1.2.1