Commit 4b263d80 authored by Kev's avatar Kev Committed by Natalia Tepluhina

Replace v-html with v-safe-html in no_changes.vue

parent b6e5b641
<script> <script>
/* eslint-disable vue/no-v-html */
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { escape } from 'lodash'; import { GlButton, GlSprintf } from '@gitlab/ui';
import { GlButton } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
export default { export default {
components: { components: {
GlButton, GlButton,
GlSprintf,
}, },
props: { props: {
changesEmptyStateIllustration: { changesEmptyStateIllustration: {
...@@ -17,20 +15,6 @@ export default { ...@@ -17,20 +15,6 @@ export default {
}, },
computed: { computed: {
...mapGetters(['getNoteableData']), ...mapGetters(['getNoteableData']),
emptyStateText() {
return sprintf(
__(
'No changes between %{ref_start}%{source_branch}%{ref_end} and %{ref_start}%{target_branch}%{ref_end}',
),
{
ref_start: '<span class="ref-name">',
ref_end: '</span>',
source_branch: escape(this.getNoteableData.source_branch),
target_branch: escape(this.getNoteableData.target_branch),
},
false,
);
},
}, },
}; };
</script> </script>
...@@ -42,7 +26,14 @@ export default { ...@@ -42,7 +26,14 @@ export default {
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="text-content text-center"> <div class="text-content text-center">
<span v-html="emptyStateText"></span> <gl-sprintf :message="__('No changes between %{sourceBranch} and %{targetBranch}')">
<template #sourceBranch>
<span class="ref-name">{{ getNoteableData.source_branch }}</span>
</template>
<template #targetBranch>
<span class="ref-name">{{ getNoteableData.target_branch }}</span>
</template>
</gl-sprintf>
<div class="text-center"> <div class="text-center">
<gl-button :href="getNoteableData.new_blob_path" variant="success" category="primary">{{ <gl-button :href="getNoteableData.new_blob_path" variant="success" category="primary">{{
__('Create commit') __('Create commit')
......
---
title: Replace v-html with v-safe-html in no_changes.vue
merge_request: 41471
author: Kev @KevSlashNull
type: other
...@@ -16780,7 +16780,7 @@ msgstr "" ...@@ -16780,7 +16780,7 @@ msgstr ""
msgid "No changes" msgid "No changes"
msgstr "" msgstr ""
msgid "No changes between %{ref_start}%{source_branch}%{ref_end} and %{ref_start}%{target_branch}%{ref_end}" msgid "No changes between %{sourceBranch} and %{targetBranch}"
msgstr "" msgstr ""
msgid "No child epics match applied filters" msgid "No child epics match applied filters"
......
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