summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue
blob: 77c14d9f8126bdc1351ec29b920d9417e085844a (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
49
50
51
52
53
<script>
import { GlEmptyState, GlButton, GlLink } from '@gitlab/ui';
import { s__ } from '~/locale';
import alertsHelpUrlQuery from '../graphql/queries/alert_help_url.query.graphql';

export default {
  i18n: {
    emptyState: {
      title: s__('AlertManagement|Surface alerts in GitLab'),
      info: s__(
        'AlertManagement|Display alerts from all your monitoring tools directly within GitLab. Streamline the investigation of your alerts and the escalation of alerts to incidents.',
      ),
      buttonText: s__('AlertManagement|Authorize external service'),
    },
    moreInformation: s__('AlertManagement|More information'),
  },
  components: {
    GlEmptyState,
    GlButton,
    GlLink,
  },
  apollo: {
    alertsHelpUrl: {
      query: alertsHelpUrlQuery,
    },
  },
  inject: ['enableAlertManagementPath', 'userCanEnableAlertManagement', 'emptyAlertSvgPath'],
  data() {
    return {
      alertsHelpUrl: '',
    };
  },
};
</script>
<template>
  <div>
    <gl-empty-state :title="$options.i18n.emptyState.title" :svg-path="emptyAlertSvgPath">
      <template #description>
        <div class="gl-display-block">
          <span>{{ $options.i18n.emptyState.info }}</span>
          <gl-link :href="alertsHelpUrl" target="_blank">
            {{ $options.i18n.moreInformation }}
          </gl-link>
        </div>
        <div v-if="userCanEnableAlertManagement" class="gl-display-block center gl-pt-4">
          <gl-button category="primary" variant="confirm" :href="enableAlertManagementPath">
            {{ $options.i18n.emptyState.buttonText }}
          </gl-button>
        </div>
      </template>
    </gl-empty-state>
  </div>
</template>