Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-06 15:10:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-06 15:10:58 +0300
commitf2c27c6f97cf138acaed79b90be7a5be520746fc (patch)
tree369b09c536983f7b8682a8e66ebdac8fd6c54446 /app/assets/javascripts/alert_management
parentb3c8b65ec2ab3af29d4d14eac27837e0c4793939 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/alert_management')
-rw-r--r--app/assets/javascripts/alert_management/components/alert_management_empty_state.vue52
-rw-r--r--app/assets/javascripts/alert_management/list.js4
2 files changed, 12 insertions, 44 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>
diff --git a/app/assets/javascripts/alert_management/list.js b/app/assets/javascripts/alert_management/list.js
index e4d418e15c0..ce793464a38 100644
--- a/app/assets/javascripts/alert_management/list.js
+++ b/app/assets/javascripts/alert_management/list.js
@@ -17,12 +17,10 @@ export default () => {
emptyAlertSvgPath,
populatingAlertsHelpUrl,
alertsHelpUrl,
- opsgenieMvcTargetUrl,
textQuery,
assigneeUsernameQuery,
alertManagementEnabled,
userCanEnableAlertManagement,
- opsgenieMvcEnabled,
} = domEl.dataset;
const apolloProvider = new VueApollo({
@@ -57,10 +55,8 @@ export default () => {
enableAlertManagementPath,
populatingAlertsHelpUrl,
emptyAlertSvgPath,
- opsgenieMvcTargetUrl,
alertManagementEnabled: parseBoolean(alertManagementEnabled),
userCanEnableAlertManagement: parseBoolean(userCanEnableAlertManagement),
- opsgenieMvcEnabled: parseBoolean(opsgenieMvcEnabled),
},
apolloProvider,
components: {