summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/alert_management/components/alert_management_list_wrapper.vue
blob: 094f33fed3b564fdd9ee3304554c63b16d03b553 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<script>
import Tracking from '~/tracking';
import { trackAlertListViewsOptions } from '../constants';
import AlertManagementEmptyState from './alert_management_empty_state.vue';
import AlertManagementTable from './alert_management_table.vue';

export default {
  components: {
    AlertManagementEmptyState,
    AlertManagementTable,
  },
  props: {
    projectPath: {
      type: String,
      required: true,
    },
    alertManagementEnabled: {
      type: Boolean,
      required: true,
    },
    enableAlertManagementPath: {
      type: String,
      required: true,
    },
    populatingAlertsHelpUrl: {
      type: String,
      required: true,
    },
    userCanEnableAlertManagement: {
      type: Boolean,
      required: true,
    },
    emptyAlertSvgPath: {
      type: String,
      required: true,
    },
    opsgenieMvcEnabled: {
      type: Boolean,
      required: false,
      default: false,
    },
    opsgenieMvcTargetUrl: {
      type: String,
      required: false,
      default: '',
    },
  },
  mounted() {
    this.trackPageViews();
  },
  methods: {
    trackPageViews() {
      const { category, action } = trackAlertListViewsOptions;
      Tracking.event(category, action);
    },
  },
};
</script>
<template>
  <div>
    <alert-management-table
      v-if="alertManagementEnabled"
      :populating-alerts-help-url="populatingAlertsHelpUrl"
      :project-path="projectPath"
    />
    <alert-management-empty-state
      v-else
      :empty-alert-svg-path="emptyAlertSvgPath"
      :enable-alert-management-path="enableAlertManagementPath"
      :user-can-enable-alert-management="userCanEnableAlertManagement"
      :opsgenie-mvc-enabled="opsgenieMvcEnabled"
      :opsgenie-mvc-target-url="opsgenieMvcTargetUrl"
    />
  </div>
</template>