All files / app/assets/javascripts/monitoring/pages panel_new_page.vue

100% Statements 7/7
100% Branches 0/0
100% Functions 2/2
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 39 40 41 42 43 44 45 46  2x 2x 2x 2x 2x                         10x                     36x                                
<script>
import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import { mapState } from 'vuex';
import { s__ } from '~/locale';
import DashboardPanelBuilder from '../components/dashboard_panel_builder.vue';
import { DASHBOARD_PAGE } from '../router/constants';
 
export default {
  components: {
    GlButton,
    DashboardPanelBuilder,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  computed: {
    ...mapState('monitoringDashboard', ['panelPreviewYml']),
    dashboardPageLocation() {
      return {
        ...this.$route,
        name: DASHBOARD_PAGE,
      };
    },
  },
  i18n: {
    backToDashboard: s__('Metrics|Back to dashboard'),
  },
};
</script>
<template>
  <div class="gl-mt-5">
    <div class="gl-display-flex gl-align-items-baseline gl-mb-5">
      <gl-button
        v-gl-tooltip
        icon="go-back"
        :to="dashboardPageLocation"
        :aria-label="$options.i18n.backToDashboard"
        :title="$options.i18n.backToDashboard"
        class="gl-mr-5"
      />
      <h1 class="gl-font-size-h1 gl-my-0">{{ s__('Metrics|Add panel') }}</h1>
    </div>
    <dashboard-panel-builder />
  </div>
</template>