All files / app/assets/javascripts/operation_settings/components metrics_settings.vue

71.43% Statements 5/7
100% Branches 0/0
33.33% Functions 1/3
71.43% Lines 5/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 47 48 49 50 51 52 53 54 55 56  1x 1x 1x 1x                                                   45x                                                  
<script>
import { GlButton, GlLink } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex';
import DashboardTimezone from './form_group/dashboard_timezone.vue';
import ExternalDashboard from './form_group/external_dashboard.vue';
 
export default {
  components: {
    GlButton,
    GlLink,
    ExternalDashboard,
    DashboardTimezone,
  },
  computed: {
    ...mapState(['helpPage']),
    userDashboardUrl: {
      get() {
        return this.externalDashboard.url;
      },
      set(url) {
        this.setExternalDashboardUrl(url);
      },
    },
  },
  methods: {
    ...mapActions(['saveChanges']),
  },
};
</script>
 
<template>
  <section class="settings no-animate">
    <div class="settings-header">
      <h4
        class="js-section-header settings-title js-settings-toggle js-settings-toggle-trigger-only"
      >
        {{ s__('MetricsSettings|Metrics') }}
      </h4>
      <gl-button class="js-settings-toggle">{{ __('Expand') }}</gl-button>
      <p class="js-section-sub-header">
        {{ s__('MetricsSettings|Manage metrics dashboard settings.') }}
        <gl-link :href="helpPage">{{ __('Learn more.') }}</gl-link>
      </p>
    </div>
    <div class="settings-content">
      <form>
        <dashboard-timezone />
        <external-dashboard />
        <gl-button variant="confirm" category="primary" @click="saveChanges">
          {{ __('Save Changes') }}
        </gl-button>
      </form>
    </div>
  </section>
</template>