All files / app/assets/javascripts/incidents_settings/components incidents_settings_tabs.vue

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

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 57 58 59 60  1x 1x 1x               2x         12x               23x                                                                      
<script>
import { GlButton, GlTabs, GlTab } from '@gitlab/ui';
import { INTEGRATION_TABS_CONFIG, I18N_INTEGRATION_TABS } from '../constants';
import PagerDutySettingsForm from './pagerduty_form.vue';
 
export default {
  components: {
    GlButton,
    GlTabs,
    GlTab,
    PagerDutySettingsForm,
    ServiceLevelAgreementForm: () =>
      import('ee_component/incidents_settings/components/service_level_agreement_form.vue'),
  },
  computed: {
    activeTabs() {
      return this.$options.tabs.filter((tab) => tab.active);
    },
  },
  tabs: INTEGRATION_TABS_CONFIG,
  i18n: I18N_INTEGRATION_TABS,
};
</script>
 
<template>
  <section
    id="incident-management-settings"
    data-qa-selector="incidents_settings_content"
    class="settings no-animate"
  >
    <div class="settings-header">
      <h4
        ref="sectionHeader"
        class="settings-title js-settings-toggle js-settings-toggle-trigger-only"
      >
        {{ $options.i18n.headerText }}
      </h4>
      <gl-button ref="toggleBtn" class="js-settings-toggle">{{
        $options.i18n.expandBtnLabel
      }}</gl-button>
      <p ref="sectionSubHeader">
        {{ $options.i18n.subHeaderText }}
      </p>
    </div>
 
    <div class="settings-content">
      <gl-tabs>
        <service-level-agreement-form />
        <gl-tab
          v-for="(tab, index) in activeTabs"
          :key="`${tab.title}_${index}`"
          :title="tab.title"
        >
          <component :is="tab.component" class="gl-pt-3" :data-testid="`${tab.component}-tab`" />
        </gl-tab>
      </gl-tabs>
    </div>
  </section>
</template>