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 {
},
viewReplacedFileButtonText() {
const truncatedBaseSha = escape(truncateSha(this.diffFile.diff_refs.base_sha));
return sprintf(
s__('MergeRequests|View replaced file @ %{commitId}'),
{
commitId: `<span class="commit-sha">${truncatedBaseSha}</span>`,
},
false,
);
return sprintf(s__('MergeRequests|View replaced file @ %{commitId}'), {
commitId: truncatedBaseSha,
});
},
gfmCopyText() {
return `\`${this.diffFile.file_path}\``;
......@@ -311,10 +307,11 @@ export default {
<gl-dropdown-item
v-if="diffFile.replaced_view_path"
ref="replacedFileButton"
v-safe-html="viewReplacedFileButtonText"
:href="diffFile.replaced_view_path"
target="_blank"
/>
>
{{ viewReplacedFileButtonText }}
</gl-dropdown-item>
<gl-dropdown-item ref="viewButton" :href="diffFile.view_path" target="_blank">
{{ viewFileButtonText }}
</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