Commit a36b15b2 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '241867-Replace-v-html' into 'master'

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

See merge request gitlab-org/gitlab!41471
parents eceb2547 4b263d80
<script>
/* eslint-disable vue/no-v-html */
import { mapGetters } from 'vuex';
import { escape } from 'lodash';
import { GlButton } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
import { GlButton, GlSprintf } from '@gitlab/ui';
export default {
components: {
GlButton,
GlSprintf,
},
props: {
changesEmptyStateIllustration: {
......@@ -17,20 +15,6 @@ export default {
},
computed: {
...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>
......@@ -42,7 +26,14 @@ export default {
</div>
<div class="col-12">
<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">
<gl-button :href="getNoteableData.new_blob_path" variant="success" category="primary">{{
__('Create commit')
......
---
title: Replace v-html with v-safe-html in no_changes.vue
merge_request: 41471
author: Kev @KevSlashNull
type: other
......@@ -16870,7 +16870,7 @@ msgstr ""
msgid "No changes"
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 ""
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