Commit 3b3dce4a authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'imrishabh18-#241905' into 'master'

refactor: replacing v-html with v-safe-html

See merge request gitlab-org/gitlab!70838
parents 28e47ff8 cc1fd0e1
<script> <script>
import { GlButton, GlFormGroup, GlFormInput, GlModal, GlModalDirective } from '@gitlab/ui'; import {
GlButton,
GlFormGroup,
GlFormInput,
GlModal,
GlModalDirective,
GlSprintf,
GlLink,
} from '@gitlab/ui';
import createFlash from '~/flash'; import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
export default { export default {
...@@ -13,6 +21,8 @@ export default { ...@@ -13,6 +21,8 @@ export default {
GlFormInput, GlFormInput,
GlModal, GlModal,
ClipboardButton, ClipboardButton,
GlSprintf,
GlLink,
}, },
directives: { directives: {
'gl-modal': GlModalDirective, 'gl-modal': GlModalDirective,
...@@ -44,16 +54,6 @@ export default { ...@@ -44,16 +54,6 @@ export default {
data() { data() {
return { return {
authorizationKey: this.initialAuthorizationKey, authorizationKey: this.initialAuthorizationKey,
sectionDescription: sprintf(
__(
'To receive alerts from manually configured Prometheus services, add the following URL and Authorization key to your Prometheus webhook config file. Learn more about %{linkStart}configuring Prometheus%{linkEnd} to send alerts to GitLab.',
),
{
linkStart: `<a href="${this.learnMoreUrl}" target="_blank" rel="noopener noreferrer">`,
linkEnd: '</a>',
},
false,
),
}; };
}, },
methods: { methods: {
...@@ -84,7 +84,17 @@ export default { ...@@ -84,7 +84,17 @@ export default {
</p> </p>
</div> </div>
<div class="col-lg-9"> <div class="col-lg-9">
<p v-html="sectionDescription /* eslint-disable-line vue/no-v-html */"></p> <gl-sprintf
:message="
__(
'To receive alerts from manually configured Prometheus services, add the following URL and Authorization key to your Prometheus webhook config file. Learn more about %{linkStart}configuring Prometheus%{linkEnd} to send alerts to GitLab.',
)
"
>
<template #link="{ content }">
<gl-link :href="learnMoreUrl" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
<gl-form-group :label="__('URL')" label-for="notify-url" label-class="label-bold"> <gl-form-group :label="__('URL')" label-for="notify-url" label-class="label-bold">
<div class="input-group"> <div class="input-group">
<gl-form-input id="notify-url" :readonly="true" :value="notifyUrl" /> <gl-form-input id="notify-url" :readonly="true" :value="notifyUrl" />
......
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