summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/operation_settings/components/form_group/external_dashboard.vue
blob: 812c5a3fe9a35ab04cb2506b78361993e9b043cd (plain)
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
<script>
import { mapState, mapActions } from 'vuex';
import { GlFormGroup, GlFormInput } from '@gitlab/ui';

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>