All files / app/assets/javascripts/operation_settings/components/form_group external_dashboard.vue

80% Statements 4/5
100% Branches 0/0
66.67% Functions 2/3
80% Lines 4/5

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  1x 1x                     14x                         57x                                            
<script>
import { GlFormGroup, GlFormInput } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex';
 
export default {
  components: {
    GlFormGroup,
    GlFormInput,
  },
  computed: {
    ...mapState(['externalDashboard']),
    userDashboardUrl: {
      get() {
        return this.externalDashboard.url;
      },
      set(url) {
        this.setExternalDashboardUrl(url);
      },
    },
  },
  methods: {
    ...mapActions(['setExternalDashboardUrl']),
  },
};
</script>
 
<template>
  <gl-form-group
    :label="s__('MetricsSettings|External dashboard URL')"
    label-for="external-dashboard-url"
  >
    <template #description>
      {{
        s__(
          'MetricsSettings|Add a button to the metrics dashboard linking directly to your existing external dashboard.',
        )
      }}
    </template>
    <!-- placeholder with a url is a false positive  -->
    <!-- eslint-disable @gitlab/vue-require-i18n-attribute-strings -->
    <gl-form-input
      id="external-dashboard-url"
      v-model="userDashboardUrl"
      placeholder="https://my-org.gitlab.io/my-dashboards"
    />
    <!-- eslint-enable @gitlab/vue-require-i18n-attribute-strings -->
  </gl-form-group>
</template>