Commit 22951395 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/260415/fixedReplacedFileLinkInDiffHeader' into 'master'

Fixed view replaced file button in diff not working

Closes #260415

See merge request gitlab-org/gitlab!44270
parents 827dc246 516bd2b6
...@@ -136,13 +136,9 @@ export default { ...@@ -136,13 +136,9 @@ export default {
}, },
viewReplacedFileButtonText() { viewReplacedFileButtonText() {
const truncatedBaseSha = escape(truncateSha(this.diffFile.diff_refs.base_sha)); const truncatedBaseSha = escape(truncateSha(this.diffFile.diff_refs.base_sha));
return sprintf( return sprintf(s__('MergeRequests|View replaced file @ %{commitId}'), {
s__('MergeRequests|View replaced file @ %{commitId}'), commitId: truncatedBaseSha,
{ });
commitId: `<span class="commit-sha">${truncatedBaseSha}</span>`,
},
false,
);
}, },
gfmCopyText() { gfmCopyText() {
return `\`${this.diffFile.file_path}\``; return `\`${this.diffFile.file_path}\``;
...@@ -311,10 +307,11 @@ export default { ...@@ -311,10 +307,11 @@ export default {
<gl-dropdown-item <gl-dropdown-item
v-if="diffFile.replaced_view_path" v-if="diffFile.replaced_view_path"
ref="replacedFileButton" ref="replacedFileButton"
v-safe-html="viewReplacedFileButtonText"
:href="diffFile.replaced_view_path" :href="diffFile.replaced_view_path"
target="_blank" target="_blank"
/> >
{{ viewReplacedFileButtonText }}
</gl-dropdown-item>
<gl-dropdown-item ref="viewButton" :href="diffFile.view_path" target="_blank"> <gl-dropdown-item ref="viewButton" :href="diffFile.view_path" target="_blank">
{{ viewFileButtonText }} {{ viewFileButtonText }}
</gl-dropdown-item> </gl-dropdown-item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment