Commit dd3463d0 authored by Takuya Noguchi's avatar Takuya Noguchi

Replace v-html with gl-sprintf in releases/.../app_edit_new.vue

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 117df1e9
<script> <script>
/* eslint-disable vue/no-v-html */
import { mapState, mapActions, mapGetters } from 'vuex'; import { mapState, mapActions, mapGetters } from 'vuex';
import { GlButton, GlFormInput, GlFormGroup } from '@gitlab/ui'; import { GlButton, GlFormInput, GlFormGroup, GlSprintf } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import MarkdownField from '~/vue_shared/components/markdown/field.vue'; import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import { BACK_URL_PARAM } from '~/releases/constants'; import { BACK_URL_PARAM } from '~/releases/constants';
import { getParameterByName } from '~/lib/utils/common_utils'; import { getParameterByName } from '~/lib/utils/common_utils';
...@@ -17,6 +16,7 @@ export default { ...@@ -17,6 +16,7 @@ export default {
GlFormInput, GlFormInput,
GlFormGroup, GlFormGroup,
GlButton, GlButton,
GlSprintf,
MarkdownField, MarkdownField,
AssetLinksForm, AssetLinksForm,
MilestoneCombobox, MilestoneCombobox,
...@@ -41,18 +41,6 @@ export default { ...@@ -41,18 +41,6 @@ export default {
showForm() { showForm() {
return Boolean(!this.isFetchingRelease && !this.fetchError && this.release); return Boolean(!this.isFetchingRelease && !this.fetchError && this.release);
}, },
subtitleText() {
return sprintf(
__(
'Releases are based on Git tags. We recommend tags that use semantic versioning, for example %{codeStart}v1.0%{codeEnd}, %{codeStart}v2.0-pre%{codeEnd}.',
),
{
codeStart: '<code>',
codeEnd: '</code>',
},
false,
);
},
releaseTitle: { releaseTitle: {
get() { get() {
return this.$store.state.detail.release.name; return this.$store.state.detail.release.name;
...@@ -127,7 +115,19 @@ export default { ...@@ -127,7 +115,19 @@ export default {
</script> </script>
<template> <template>
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<p class="pt-3 js-subtitle-text" v-html="subtitleText"></p> <p class="pt-3 js-subtitle-text">
<gl-sprintf
:message="
__(
'Releases are based on Git tags. We recommend tags that use semantic versioning, for example %{codeStart}v1.0%{codeEnd}, %{codeStart}v2.0-pre%{codeEnd}.',
)
"
>
<template #code="{ content }">
<code>{{ content }}</code>
</template>
</gl-sprintf>
</p>
<form v-if="showForm" class="js-quick-submit" @submit.prevent="submitForm"> <form v-if="showForm" class="js-quick-submit" @submit.prevent="submitForm">
<tag-field /> <tag-field />
<gl-form-group> <gl-form-group>
......
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