summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-04-16 12:23:40 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-04-16 12:23:40 +0000
commitbe201c595fe8a8c23c52b85cb6f47eaf51ced775 (patch)
treea9aa42e96e769546fc0148a17e49c716280fe8f9
parent8604f7306b1c4b665a36f7aa2b080bba414507b3 (diff)
parenta1179e5e6022eddccffb26d680dcb544bd20416d (diff)
downloadgitlab-ce-be201c595fe8a8c23c52b85cb6f47eaf51ced775.tar.gz
Merge branch '60533-tooltip-for-view-file-shows-raw-html' into 'master'
Resolve "Tooltip for "View file" shows raw HTML" Closes #60533 See merge request gitlab-org/gitlab-ce!27398
-rw-r--r--app/assets/javascripts/diffs/components/diff_file_header.vue4
-rw-r--r--spec/javascripts/diffs/components/diff_file_header_spec.js3
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue
index 32e5fa5bf8b..91b802766f8 100644
--- a/app/assets/javascripts/diffs/components/diff_file_header.vue
+++ b/app/assets/javascripts/diffs/components/diff_file_header.vue
@@ -112,9 +112,7 @@ export default {
const truncatedContentSha = _.escape(truncateSha(this.diffFile.content_sha));
return sprintf(
s__('MergeRequests|View file @ %{commitId}'),
- {
- commitId: `<span class="commit-sha">${truncatedContentSha}</span>`,
- },
+ { commitId: truncatedContentSha },
false,
);
},
diff --git a/spec/javascripts/diffs/components/diff_file_header_spec.js b/spec/javascripts/diffs/components/diff_file_header_spec.js
index e1170c9762e..596a1ba5ad2 100644
--- a/spec/javascripts/diffs/components/diff_file_header_spec.js
+++ b/spec/javascripts/diffs/components/diff_file_header_spec.js
@@ -611,6 +611,9 @@ describe('diff_file_header', () => {
vm = mountComponentWithStore(Component, { props, store });
expect(viewFileButton().getAttribute('href')).toBe('view-path');
+ expect(viewFileButton().getAttribute('data-original-title')).toEqual(
+ `View file @ ${props.diffFile.content_sha.substr(0, 8)}`,
+ );
});
it('should not render external url view link if diff file has no external url', () => {