All files / app/assets/javascripts/monitoring/components/charts empty_chart.vue

100% Statements 7/7
100% Branches 0/0
100% Functions 4/4
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  11x 11x 11x             5x           5x           5x         48x                    
<script>
import chartEmptyStateIllustration from '@gitlab/svgs/dist/illustrations/chart-empty-state.svg';
import { GlSafeHtmlDirective } from '@gitlab/ui';
import { chartHeight } from '../../constants';
 
export default {
  directives: {
    SafeHtml: GlSafeHtmlDirective,
  },
  data() {
    return {
      height: chartHeight,
    };
  },
  computed: {
    svgContainerStyle() {
      return {
        height: `${this.height}px`,
      };
    },
  },
  created() {
    this.chartEmptyStateIllustration = chartEmptyStateIllustration;
  },
  safeHtmlConfig: { ADD_TAGS: ['use'] },
};
</script>
<template>
  <div class="d-flex flex-column justify-content-center">
    <div
      v-safe-html:[$options.safeHtmlConfig]="chartEmptyStateIllustration"
      class="gl-mt-3 svg-w-100 d-flex align-items-center"
      :style="svgContainerStyle"
    ></div>
    <h5 class="text-center gl-mt-3">{{ __('No data to display') }}</h5>
  </div>
</template>