Commit 74ac9880 authored by Savas Vedova's avatar Savas Vedova

Merge branch 'djadmin-vhtml-1' into 'master'

Remove v-html from app/assets/javascripts/monitoring/components/charts/empty_chart.vue

See merge request gitlab-org/gitlab!72679
parents 95050854 fce41f3a
<script> <script>
import chartEmptyStateIllustration from '@gitlab/svgs/dist/illustrations/chart-empty-state.svg'; import chartEmptyStateIllustration from '@gitlab/svgs/dist/illustrations/chart-empty-state.svg';
import { GlSafeHtmlDirective } from '@gitlab/ui';
import { chartHeight } from '../../constants'; import { chartHeight } from '../../constants';
export default { export default {
directives: {
SafeHtml: GlSafeHtmlDirective,
},
data() { data() {
return { return {
height: chartHeight, height: chartHeight,
...@@ -18,14 +22,15 @@ export default { ...@@ -18,14 +22,15 @@ export default {
created() { created() {
this.chartEmptyStateIllustration = chartEmptyStateIllustration; this.chartEmptyStateIllustration = chartEmptyStateIllustration;
}, },
safeHtmlConfig: { ADD_TAGS: ['use'] },
}; };
</script> </script>
<template> <template>
<div class="d-flex flex-column justify-content-center"> <div class="d-flex flex-column justify-content-center">
<div <div
v-safe-html:[$options.safeHtmlConfig]="chartEmptyStateIllustration"
class="gl-mt-3 svg-w-100 d-flex align-items-center" class="gl-mt-3 svg-w-100 d-flex align-items-center"
:style="svgContainerStyle" :style="svgContainerStyle"
v-html="chartEmptyStateIllustration /* eslint-disable-line vue/no-v-html */"
></div> ></div>
<h5 class="text-center gl-mt-3">{{ __('No data to display') }}</h5> <h5 class="text-center gl-mt-3">{{ __('No data to display') }}</h5>
</div> </div>
......
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