Commit d6c49c96 authored by Stanislav Lashmanov's avatar Stanislav Lashmanov Committed by Natalia Tepluhina

Replace v-html with gl-sprintf in spent_only_pane.vue

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/241935
parent a7822ccd
<script> <script>
import { sprintf, s__ } from '~/locale'; import { GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale';
const timeSpent = s__('TimeTracking|%{spentStart}Spent: %{spentEnd}');
export default { export default {
name: 'TimeTrackingSpentOnlyPane', name: 'TimeTrackingSpentOnlyPane',
timeSpent,
components: {
GlSprintf,
},
props: { props: {
timeSpentHumanReadable: { timeSpentHumanReadable: {
type: String, type: String,
required: true, required: true,
}, },
}, },
computed: {
timeSpent() {
return sprintf(
s__('TimeTracking|%{startTag}Spent: %{endTag}%{timeSpentHumanReadable}'),
{
startTag: '<span class="gl-font-weight-bold">',
endTag: '</span>',
timeSpentHumanReadable: this.timeSpentHumanReadable,
},
false,
);
},
},
}; };
</script> </script>
<template> <template>
<div data-testid="spentOnlyPane" v-html="timeSpent /* eslint-disable-line vue/no-v-html */"></div> <div data-testid="spentOnlyPane">
<gl-sprintf :message="$options.timeSpent">
<template #spent="{ content }">
<span class="gl-font-weight-bold">{{ content }}</span
>{{ timeSpentHumanReadable }}
</template>
</gl-sprintf>
</div>
</template> </template>
...@@ -35118,7 +35118,7 @@ msgstr "" ...@@ -35118,7 +35118,7 @@ msgstr ""
msgid "TimeTrackingEstimated|Est" msgid "TimeTrackingEstimated|Est"
msgstr "" msgstr ""
msgid "TimeTracking|%{startTag}Spent: %{endTag}%{timeSpentHumanReadable}" msgid "TimeTracking|%{spentStart}Spent: %{spentEnd}"
msgstr "" msgstr ""
msgid "TimeTracking|Estimated:" msgid "TimeTracking|Estimated:"
......
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