summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/alert_management/components/alert_management_empty_state.vue')
-rw-r--r--app/assets/javascripts/alert_management/components/alert_management_empty_state.vue52
1 files changed, 12 insertions, 40 deletions
diff --git a/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue b/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue
index c5ff2dc0d11..9b0e5090a75 100644
--- a/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue
+++ b/app/assets/javascripts/alert_management/components/alert_management_empty_state.vue
@@ -6,20 +6,11 @@ import alertsHelpUrlQuery from '../graphql/queries/alert_help_url.query.graphql'
export default {
i18n: {
emptyState: {
- opsgenie: {
- title: s__('AlertManagement|Opsgenie is enabled'),
- info: s__(
- 'AlertManagement|You have enabled the Opsgenie integration. Your alerts will be visible directly in Opsgenie.',
- ),
- buttonText: s__('AlertManagement|View alerts in Opsgenie'),
- },
- gitlab: {
- 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'),
- },
+ 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'),
},
@@ -33,46 +24,27 @@ export default {
query: alertsHelpUrlQuery,
},
},
- inject: [
- 'enableAlertManagementPath',
- 'userCanEnableAlertManagement',
- 'emptyAlertSvgPath',
- 'opsgenieMvcEnabled',
- 'opsgenieMvcTargetUrl',
- ],
+ inject: ['enableAlertManagementPath', 'userCanEnableAlertManagement', 'emptyAlertSvgPath'],
data() {
return {
alertsHelpUrl: '',
};
},
- computed: {
- emptyState() {
- return {
- ...(this.opsgenieMvcEnabled
- ? this.$options.i18n.emptyState.opsgenie
- : this.$options.i18n.emptyState.gitlab),
- link: this.opsgenieMvcEnabled ? this.opsgenieMvcTargetUrl : this.enableAlertManagementPath,
- };
- },
- alertsCanBeEnabled() {
- return this.userCanEnableAlertManagement || this.opsgenieMvcEnabled;
- },
- },
};
</script>
<template>
<div>
- <gl-empty-state :title="emptyState.title" :svg-path="emptyAlertSvgPath">
+ <gl-empty-state :title="$options.i18n.emptyState.title" :svg-path="emptyAlertSvgPath">
<template #description>
<div class="gl-display-block">
- <span>{{ emptyState.info }}</span>
- <gl-link v-if="!opsgenieMvcEnabled" :href="alertsHelpUrl" target="_blank">
+ <span>{{ $options.i18n.emptyState.info }}</span>
+ <gl-link :href="alertsHelpUrl" target="_blank">
{{ $options.i18n.moreInformation }}
</gl-link>
</div>
- <div v-if="alertsCanBeEnabled" class="gl-display-block center gl-pt-4">
- <gl-button category="primary" variant="success" :href="emptyState.link">
- {{ emptyState.buttonText }}
+ <div v-if="userCanEnableAlertManagement" class="gl-display-block center gl-pt-4">
+ <gl-button category="primary" variant="success" :href="enableAlertManagementPath">
+ {{ $options.i18n.emptyState.buttonText }}
</gl-button>
</div>
</template>