diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/assets/javascripts/performance_bar | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/performance_bar')
3 files changed, 21 insertions, 8 deletions
diff --git a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue index 670b0535ca3..f204f0ebfaa 100644 --- a/app/assets/javascripts/performance_bar/components/performance_bar_app.vue +++ b/app/assets/javascripts/performance_bar/components/performance_bar_app.vue @@ -1,5 +1,5 @@ <script> -/* eslint-disable vue/no-v-html */ +import { GlSafeHtmlDirective } from '@gitlab/ui'; import { glEmojiTag } from '~/emoji'; import { s__ } from '~/locale'; @@ -13,6 +13,9 @@ export default { DetailedMetric, RequestSelector, }, + directives: { + SafeHtml: GlSafeHtmlDirective, + }, props: { store: { type: Object, @@ -129,6 +132,7 @@ export default { this.currentRequest = newRequestId; }, }, + safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, }; </script> <template> @@ -144,7 +148,7 @@ export default { class="current-host" :class="{ canary: currentRequest.details.host.canary }" > - <span v-html="birdEmoji"></span> + <span v-safe-html:[$options.safeHtmlConfig]="birdEmoji"></span> {{ currentRequest.details.host.hostname }} </span> </div> diff --git a/app/assets/javascripts/performance_bar/components/request_selector.vue b/app/assets/javascripts/performance_bar/components/request_selector.vue index 75fb7bbc5c5..a46ac620f48 100644 --- a/app/assets/javascripts/performance_bar/components/request_selector.vue +++ b/app/assets/javascripts/performance_bar/components/request_selector.vue @@ -1,6 +1,5 @@ <script> -/* eslint-disable vue/no-v-html */ -import { GlPopover } from '@gitlab/ui'; +import { GlPopover, GlSafeHtmlDirective } from '@gitlab/ui'; import { glEmojiTag } from '~/emoji'; import { n__ } from '~/locale'; @@ -8,6 +7,9 @@ export default { components: { GlPopover, }, + directives: { + SafeHtml: GlSafeHtmlDirective, + }, props: { currentRequest: { type: Object, @@ -43,6 +45,7 @@ export default { methods: { glEmojiTag, }, + safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, }; </script> <template> @@ -59,7 +62,10 @@ export default { </option> </select> <span v-if="requestsWithWarnings.length" class="gl-cursor-default"> - <span id="performance-bar-request-selector-warning" v-html="glEmojiTag('warning')"></span> + <span + id="performance-bar-request-selector-warning" + v-safe-html:[$options.safeHtmlConfig]="glEmojiTag('warning')" + ></span> <gl-popover placement="bottom" target="performance-bar-request-selector-warning" diff --git a/app/assets/javascripts/performance_bar/components/request_warning.vue b/app/assets/javascripts/performance_bar/components/request_warning.vue index 7fe6b088ebb..3ebd222029b 100644 --- a/app/assets/javascripts/performance_bar/components/request_warning.vue +++ b/app/assets/javascripts/performance_bar/components/request_warning.vue @@ -1,12 +1,14 @@ <script> -/* eslint-disable vue/no-v-html */ -import { GlPopover } from '@gitlab/ui'; +import { GlPopover, GlSafeHtmlDirective } from '@gitlab/ui'; import { glEmojiTag } from '~/emoji'; export default { components: { GlPopover, }, + directives: { + SafeHtml: GlSafeHtmlDirective, + }, props: { htmlId: { type: String, @@ -32,11 +34,12 @@ export default { methods: { glEmojiTag, }, + safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, }; </script> <template> <span v-if="hasWarnings" class="gl-cursor-default"> - <span :id="htmlId" v-html="glEmojiTag('warning')"></span> + <span :id="htmlId" v-safe-html:[$options.safeHtmlConfig]="glEmojiTag('warning')"></span> <gl-popover placement="bottom" :target="htmlId" :content="warningMessage" /> </span> </template> |