Commit 42b52efa authored by Simon Knox's avatar Simon Knox

Merge branch...

Merge branch '241928-remove-v-html-from-app-assets-javascripts-environments-components-stop_environment_modal-vue' into 'master'

Replace v-html with gl-sprintf in app/assets/javascripts/environments/components/stop_environment_modal.vue

Closes #241928

See merge request gitlab-org/gitlab!41506
parents b0e398f4 2c332f8b
<script> <script>
/* eslint-disable @gitlab/vue-require-i18n-strings, vue/no-v-html */ /* eslint-disable @gitlab/vue-require-i18n-strings */
import { GlTooltipDirective } from '@gitlab/ui'; import { GlSprintf, GlTooltipDirective } from '@gitlab/ui';
import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue'; import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
import { s__, sprintf } from '~/locale';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
export default { export default {
...@@ -11,6 +10,7 @@ export default { ...@@ -11,6 +10,7 @@ export default {
components: { components: {
GlModal: DeprecatedModal2, GlModal: DeprecatedModal2,
GlSprintf,
}, },
directives: { directives: {
...@@ -24,27 +24,6 @@ export default { ...@@ -24,27 +24,6 @@ export default {
}, },
}, },
computed: {
noStopActionMessage() {
return sprintf(
s__(
`Environments|Note that this action will stop the environment,
but it will %{emphasisStart}not%{emphasisEnd} have an effect on any existing deployment
due to no “stop environment action” being defined
in the %{ciConfigLinkStart}.gitlab-ci.yml%{ciConfigLinkEnd} file.`,
),
{
emphasisStart: '<strong>',
emphasisEnd: '</strong>',
ciConfigLinkStart:
'<a href="https://docs.gitlab.com/ee/ci/yaml/" target="_blank" rel="noopener noreferrer">',
ciConfigLinkEnd: '</a>',
},
false,
);
},
},
methods: { methods: {
onSubmit() { onSubmit() {
eventHub.$emit('stopEnvironment', this.environment); eventHub.$emit('stopEnvironment', this.environment);
...@@ -72,7 +51,25 @@ export default { ...@@ -72,7 +51,25 @@ export default {
<p>{{ s__('Environments|Are you sure you want to stop this environment?') }}</p> <p>{{ s__('Environments|Are you sure you want to stop this environment?') }}</p>
<div v-if="!environment.has_stop_action" class="warning_message"> <div v-if="!environment.has_stop_action" class="warning_message">
<p v-html="noStopActionMessage"></p> <p>
<gl-sprintf
:message="
s__(`Environments|Note that this action will stop the environment,
but it will %{emphasisStart}not%{emphasisEnd} have an effect on any existing deployment
due to no “stop environment action” being defined
in the %{ciConfigLinkStart}.gitlab-ci.yml%{ciConfigLinkEnd} file.`)
"
>
<template #emphasis="{ content }">
<strong>{{ content }}</strong>
</template>
<template #ciConfigLink="{ content }">
<a href="https://docs.gitlab.com/ee/ci/yaml/" target="_blank" rel="noopener noreferrer">
{{ content }}</a
>
</template>
</gl-sprintf>
</p>
<a <a
href="https://docs.gitlab.com/ee/ci/environments.html#stopping-an-environment" href="https://docs.gitlab.com/ee/ci/environments.html#stopping-an-environment"
target="_blank" target="_blank"
......
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