Commit 8361d840 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch '300827-alerts-integrations-UX-cleanup-2nd-part' into 'master'

Alert integrations UX cleanup - 2nd part

See merge request gitlab-org/gitlab!55786
parents ddeee4e7 18e2e0ca
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
GlTooltipDirective, GlTooltipDirective,
GlSprintf, GlSprintf,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { capitalize } from 'lodash';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { import {
...@@ -77,6 +78,7 @@ export default { ...@@ -77,6 +78,7 @@ export default {
{ {
key: 'type', key: 'type',
label: __('Type'), label: __('Type'),
formatter: (value) => (value === typeSet.prometheus ? capitalize(value) : value),
}, },
{ {
key: 'actions', key: 'actions',
...@@ -172,7 +174,7 @@ export default { ...@@ -172,7 +174,7 @@ export default {
<template #cell(actions)="{ item }"> <template #cell(actions)="{ item }">
<gl-button-group class="gl-ml-3"> <gl-button-group class="gl-ml-3">
<gl-button icon="pencil" @click="editIntegration(item)" /> <gl-button icon="settings" @click="editIntegration(item)" />
<gl-button <gl-button
v-gl-modal.deleteIntegration v-gl-modal.deleteIntegration
:disabled="item.type === $options.typeSet.prometheus" :disabled="item.type === $options.typeSet.prometheus"
......
...@@ -19,9 +19,13 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; ...@@ -19,9 +19,13 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { import {
integrationTypes, integrationTypes,
integrationSteps,
createStepNumbers,
editStepNumbers,
JSON_VALIDATE_DELAY, JSON_VALIDATE_DELAY,
targetPrometheusUrlPlaceholder, targetPrometheusUrlPlaceholder,
typeSet, typeSet,
viewCredentialsTabIndex,
i18n, i18n,
} from '../constants'; } from '../constants';
import getCurrentIntegrationQuery from '../graphql/queries/get_current_integration.query.graphql'; import getCurrentIntegrationQuery from '../graphql/queries/get_current_integration.query.graphql';
...@@ -35,6 +39,7 @@ export default { ...@@ -35,6 +39,7 @@ export default {
}, },
JSON_VALIDATE_DELAY, JSON_VALIDATE_DELAY,
typeSet, typeSet,
integrationSteps,
i18n, i18n,
components: { components: {
ClipboardButton, ClipboardButton,
...@@ -108,6 +113,7 @@ export default { ...@@ -108,6 +113,7 @@ export default {
parsingPayload: false, parsingPayload: false,
currentIntegration: null, currentIntegration: null,
parsedPayload: [], parsedPayload: [],
activeTabIndex: 0,
}; };
}, },
computed: { computed: {
...@@ -170,20 +176,23 @@ export default { ...@@ -170,20 +176,23 @@ export default {
canEditPayload() { canEditPayload() {
return this.hasSamplePayload && !this.resetPayloadAndMappingConfirmed; return this.hasSamplePayload && !this.resetPayloadAndMappingConfirmed;
}, },
canParseSamplePayload() {
return !this.active || !this.isSampePayloadValid || !this.samplePayload.json;
},
isResetAuthKeyDisabled() { isResetAuthKeyDisabled() {
return !this.active && !this.integrationForm.token !== ''; return !this.active && !this.integrationForm.token !== '';
}, },
isPayloadEditDisabled() { isPayloadEditDisabled() {
return this.glFeatures.multipleHttpIntegrationsCustomMapping return !this.active || this.canEditPayload;
? !this.active || this.canEditPayload
: !this.active;
},
isSubmitTestPayloadDisabled() {
return !this.active || Boolean(this.samplePayload.error) || this.samplePayload.json === '';
}, },
isSelectDisabled() { isSelectDisabled() {
return this.currentIntegration !== null || !this.canAddIntegration; return this.currentIntegration !== null || !this.canAddIntegration;
}, },
viewCredentialsHelpMsg() {
return this.isPrometheus
? i18n.integrationFormSteps.setupCredentials.prometheusHelp
: i18n.integrationFormSteps.setupCredentials.help;
},
}, },
watch: { watch: {
currentIntegration(val) { currentIntegration(val) {
...@@ -203,6 +212,8 @@ export default { ...@@ -203,6 +212,8 @@ export default {
); );
this.updateMapping(mapping); this.updateMapping(mapping);
} }
this.activeTabIndex = viewCredentialsTabIndex;
this.$el.scrollIntoView({ block: 'center' });
}, },
}, },
methods: { methods: {
...@@ -320,18 +331,32 @@ export default { ...@@ -320,18 +331,32 @@ export default {
this.parsedPayload = []; this.parsedPayload = [];
this.updateMapping([]); this.updateMapping([]);
}, },
getLabelWithStepNumber(step, label) {
let stepNumber = editStepNumbers[step];
if (this.isCreating) {
stepNumber = createStepNumbers[step];
}
return stepNumber ? `${stepNumber}.${label}` : label;
},
}, },
}; };
</script> </script>
<template> <template>
<gl-form class="gl-mt-6" @submit.prevent="submit" @reset.prevent="reset"> <gl-form class="gl-mt-6" @submit.prevent="submit" @reset.prevent="reset">
<gl-tabs> <gl-tabs v-model="activeTabIndex">
<gl-tab :title="$options.i18n.integrationTabs.configureDetails"> <gl-tab :title="$options.i18n.integrationTabs.configureDetails">
<gl-form-group <gl-form-group
v-if="isCreating" v-if="isCreating"
id="integration-type" id="integration-type"
:label="$options.i18n.integrationFormSteps.selectType.label" :label="
getLabelWithStepNumber(
$options.integrationSteps.selectType,
$options.i18n.integrationFormSteps.selectType.label,
)
"
label-for="integration-type" label-for="integration-type"
> >
<gl-form-select <gl-form-select
...@@ -354,7 +379,12 @@ export default { ...@@ -354,7 +379,12 @@ export default {
<gl-form-group <gl-form-group
v-if="isHttp" v-if="isHttp"
id="name-integration" id="name-integration"
:label="$options.i18n.integrationFormSteps.nameIntegration.label" :label="
getLabelWithStepNumber(
$options.integrationSteps.nameIntegration,
$options.i18n.integrationFormSteps.nameIntegration.label,
)
"
label-for="name-integration" label-for="name-integration"
> >
<gl-form-input <gl-form-input
...@@ -364,15 +394,6 @@ export default { ...@@ -364,15 +394,6 @@ export default {
/> />
</gl-form-group> </gl-form-group>
<alert-settings-form-help-block
:message="
isPrometheus
? $options.i18n.integrationFormSteps.setupCredentials.prometheusHelp
: $options.i18n.integrationFormSteps.setupCredentials.help
"
link="https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html"
/>
<gl-toggle <gl-toggle
v-model="active" v-model="active"
:is-loading="loading" :is-loading="loading"
...@@ -382,7 +403,12 @@ export default { ...@@ -382,7 +403,12 @@ export default {
<div v-if="isPrometheus" class="gl-my-4"> <div v-if="isPrometheus" class="gl-my-4">
<span class="gl-font-weight-bold"> <span class="gl-font-weight-bold">
{{ $options.i18n.integrationFormSteps.prometheusFormUrl.label }} {{
getLabelWithStepNumber(
$options.integrationSteps.setPrometheusApiUrl,
$options.i18n.integrationFormSteps.prometheusFormUrl.label,
)
}}
</span> </span>
<gl-form-input <gl-form-input
...@@ -397,34 +423,38 @@ export default { ...@@ -397,34 +423,38 @@ export default {
</span> </span>
</div> </div>
<gl-form-group
v-if="isHttp"
data-testid="sample-payload-section"
:label="$options.i18n.integrationFormSteps.setSamplePayload.label"
label-for="sample-payload"
:class="{ 'gl-mb-0!': showMappingBuilder }"
:invalid-feedback="samplePayload.error"
>
<alert-settings-form-help-block
:message="$options.i18n.integrationFormSteps.setSamplePayload.testPayloadHelpHttp"
:link="generic.alertsUsageUrl"
/>
<gl-form-textarea
id="sample-payload"
v-model.trim="samplePayload.json"
:disabled="isPayloadEditDisabled"
:state="isSampePayloadValid"
:placeholder="$options.i18n.integrationFormSteps.setSamplePayload.placeholder"
class="gl-my-3"
:debounce="$options.JSON_VALIDATE_DELAY"
rows="6"
max-rows="10"
@input="validateJson"
/>
</gl-form-group>
<template v-if="showMappingBuilder"> <template v-if="showMappingBuilder">
<gl-form-group
data-testid="sample-payload-section"
:label="
getLabelWithStepNumber(
$options.integrationSteps.setSamplePayload,
$options.i18n.integrationFormSteps.setSamplePayload.label,
)
"
label-for="sample-payload"
class="gl-mb-0!"
:invalid-feedback="samplePayload.error"
>
<alert-settings-form-help-block
:message="$options.i18n.integrationFormSteps.setSamplePayload.testPayloadHelpHttp"
:link="generic.alertsUsageUrl"
/>
<gl-form-textarea
id="sample-payload"
v-model.trim="samplePayload.json"
:disabled="isPayloadEditDisabled"
:state="isSampePayloadValid"
:placeholder="$options.i18n.integrationFormSteps.setSamplePayload.placeholder"
class="gl-my-3"
:debounce="$options.JSON_VALIDATE_DELAY"
rows="6"
max-rows="10"
@input="validateJson"
/>
</gl-form-group>
<gl-button <gl-button
v-if="canEditPayload" v-if="canEditPayload"
v-gl-modal.resetPayloadModal v-gl-modal.resetPayloadModal
...@@ -439,7 +469,7 @@ export default { ...@@ -439,7 +469,7 @@ export default {
v-else v-else
data-testid="payload-action-btn" data-testid="payload-action-btn"
:class="{ 'gl-mt-3': samplePayload.error }" :class="{ 'gl-mt-3': samplePayload.error }"
:disabled="!active || !isSampePayloadValid" :disabled="canParseSamplePayload"
:loading="parsingPayload" :loading="parsingPayload"
@click="parseMapping" @click="parseMapping"
> >
...@@ -454,23 +484,27 @@ export default { ...@@ -454,23 +484,27 @@ export default {
> >
{{ $options.i18n.integrationFormSteps.setSamplePayload.resetBody }} {{ $options.i18n.integrationFormSteps.setSamplePayload.resetBody }}
</gl-modal> </gl-modal>
</template>
<gl-form-group <gl-form-group
v-if="showMappingBuilder" id="mapping-builder"
id="mapping-builder" class="gl-mt-5"
class="gl-mt-5" :label="
:label="$options.i18n.integrationFormSteps.mapFields.label" getLabelWithStepNumber(
label-for="mapping-builder" $options.integrationSteps.customizeMapping,
> $options.i18n.integrationFormSteps.mapFields.label,
<span>{{ $options.i18n.integrationFormSteps.mapFields.intro }}</span> )
<mapping-builder "
:parsed-payload="parsedPayload" label-for="mapping-builder"
:saved-mapping="mapping" >
:alert-fields="alertFields" <span>{{ $options.i18n.integrationFormSteps.mapFields.intro }}</span>
@onMappingUpdate="updateMapping" <mapping-builder
/> :parsed-payload="parsedPayload"
</gl-form-group> :saved-mapping="mapping"
:alert-fields="alertFields"
@onMappingUpdate="updateMapping"
/>
</gl-form-group>
</template>
</div> </div>
<div class="gl-display-flex gl-justify-content-start gl-py-3"> <div class="gl-display-flex gl-justify-content-start gl-py-3">
...@@ -490,6 +524,11 @@ export default { ...@@ -490,6 +524,11 @@ export default {
</gl-tab> </gl-tab>
<gl-tab :title="$options.i18n.integrationTabs.viewCredentials" :disabled="isCreating"> <gl-tab :title="$options.i18n.integrationTabs.viewCredentials" :disabled="isCreating">
<alert-settings-form-help-block
:message="viewCredentialsHelpMsg"
link="https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html"
/>
<gl-form-group id="integration-webhook"> <gl-form-group id="integration-webhook">
<div class="gl-my-4"> <div class="gl-my-4">
<span class="gl-font-weight-bold"> <span class="gl-font-weight-bold">
......
...@@ -165,6 +165,9 @@ export default { ...@@ -165,6 +165,9 @@ export default {
if (error) { if (error) {
return createFlash({ message: error }); return createFlash({ message: error });
} }
const { integration } = httpIntegrationCreate || prometheusIntegrationCreate;
this.editIntegration(integration);
return createFlash({ return createFlash({
message: this.$options.i18n.changesSaved, message: this.$options.i18n.changesSaved,
......
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
// TODO: Remove this as part of the form old removal
export const i18n = { export const i18n = {
usageSection: s__(
'AlertSettings|You must provide this URL and authorization key to authorize an external service to send alerts to GitLab. You can provide this URL and key to multiple services. After configuring an external service, alerts from your service will display on the GitLab %{linkStart}Alerts%{linkEnd} page.',
),
setupSection: s__(
"AlertSettings|Review your external service's documentation to learn where to provide this information to your external service, and the %{linkStart}GitLab documentation%{linkEnd} to learn more about configuring your endpoint.",
),
errorMsg: s__('AlertSettings|There was an error updating the alert settings.'),
errorKeyMsg: s__(
'AlertSettings|There was an error while trying to reset the key. Please refresh the page to try again.',
),
restKeyInfo: s__(
'AlertSettings|Resetting the authorization key for this project will require updating the authorization key in every alert source it is enabled in.',
),
changesSaved: s__('AlertSettings|Your integration was successfully updated.'),
prometheusInfo: s__('AlertSettings|Add URL and auth key to your Prometheus config file'),
integrationsInfo: s__(
'AlertSettings|Learn more about our our upcoming %{linkStart}integrations%{linkEnd}',
),
resetKey: s__('AlertSettings|Reset key'),
copyToClipboard: s__('AlertSettings|Copy'),
apiBaseUrlLabel: s__('AlertSettings|API URL'),
authKeyLabel: s__('AlertSettings|Authorization key'),
urlLabel: s__('AlertSettings|Webhook URL'),
activeLabel: s__('AlertSettings|Active'),
apiBaseUrlHelpText: s__('AlertSettings|URL cannot be blank and must start with http or https'),
testAlertInfo: s__('AlertSettings|Test alert payload'),
alertJson: s__('AlertSettings|Alert test payload'),
alertJsonPlaceholder: s__('AlertSettings|Enter test alert JSON....'),
testAlertFailed: s__('AlertSettings|Test failed. Do you still want to save your changes anyway?'),
testAlertSuccess: s__(
'AlertSettings|Test alert sent successfully. If you have made other changes, please save them now.',
),
authKeyRest: s__(
'AlertSettings|Authorization key has been successfully reset. Please save your changes now.',
),
integration: s__('AlertSettings|Integration'),
integrationTabs: { integrationTabs: {
configureDetails: s__('AlertSettings|Configure details'), configureDetails: s__('AlertSettings|Configure details'),
viewCredentials: s__('AlertSettings|View credentials'), viewCredentials: s__('AlertSettings|View credentials'),
...@@ -87,9 +50,9 @@ export const i18n = { ...@@ -87,9 +50,9 @@ export const i18n = {
), ),
}, },
mapFields: { mapFields: {
label: s__('AlertSettings|Map fields (optional)'), label: s__('AlertSettings|Customize alert payload mapping (optional)'),
intro: s__( intro: s__(
"AlertSettings|If you've provided a sample alert payload, you can create a custom mapping for your endpoint. The default GitLab alert keys are listed below. Please define which payload key should map to the specified GitLab key.", 'AlertSettings|If you intend to create a custom mapping, provide an example payload from your monitoring tool and click "parse payload fields" button to continue. The sample payload is required for completing the custom mapping; if you want to skip the mapping step, progress straight to saving your integration.',
), ),
}, },
prometheusFormUrl: { prometheusFormUrl: {
...@@ -103,11 +66,36 @@ export const i18n = { ...@@ -103,11 +66,36 @@ export const i18n = {
}, },
}, },
saveIntegration: s__('AlertSettings|Save integration'), saveIntegration: s__('AlertSettings|Save integration'),
changesSaved: s__('AlertSettings|Your integration was successfully updated.'),
cancelAndClose: __('Cancel and close'), cancelAndClose: __('Cancel and close'),
send: s__('AlertSettings|Send'), send: s__('AlertSettings|Send'),
copy: __('Copy'), copy: __('Copy'),
}; };
export const integrationSteps = {
selectType: 'SELECT_TYPE',
nameIntegration: 'NAME_INTEGRATION',
setPrometheusApiUrl: 'SET_PROMETHEUS_API_URL',
setSamplePayload: 'SET_SAMPLE_PAYLOAD',
customizeMapping: 'CUSTOMIZE_MAPPING',
};
export const createStepNumbers = {
[integrationSteps.selectType]: 1,
[integrationSteps.nameIntegration]: 2,
[integrationSteps.setPrometheusApiUrl]: 2,
[integrationSteps.setSamplePayload]: 3,
[integrationSteps.customizeMapping]: 4,
};
export const editStepNumbers = {
[integrationSteps.selectType]: 1,
[integrationSteps.nameIntegration]: 1,
[integrationSteps.setPrometheusApiUrl]: null,
[integrationSteps.setSamplePayload]: 2,
[integrationSteps.customizeMapping]: 3,
};
export const integrationTypes = { export const integrationTypes = {
none: { value: '', text: s__('AlertSettings|Select integration type') }, none: { value: '', text: s__('AlertSettings|Select integration type') },
http: { value: 'HTTP', text: s__('AlertSettings|HTTP Endpoint') }, http: { value: 'HTTP', text: s__('AlertSettings|HTTP Endpoint') },
...@@ -125,14 +113,11 @@ export const JSON_VALIDATE_DELAY = 250; ...@@ -125,14 +113,11 @@ export const JSON_VALIDATE_DELAY = 250;
export const targetPrometheusUrlPlaceholder = 'http://prometheus.example.com/'; export const targetPrometheusUrlPlaceholder = 'http://prometheus.example.com/';
export const sectionHash = 'js-alert-management-settings';
/* eslint-disable @gitlab/require-i18n-strings */
/** /**
* Tracks snowplow event when user views alerts integration list * Tracks snowplow event when user views alerts integration list
*/ */
export const trackAlertIntegrationsViewsOptions = { export const trackAlertIntegrationsViewsOptions = {
/* eslint-disable-next-line @gitlab/require-i18n-strings */
category: 'Alert Integrations', category: 'Alert Integrations',
action: 'view_alert_integrations_list', action: 'view_alert_integrations_list',
}; };
...@@ -141,3 +126,5 @@ export const mappingFields = { ...@@ -141,3 +126,5 @@ export const mappingFields = {
mapping: 'mapping', mapping: 'mapping',
fallback: 'fallback', fallback: 'fallback',
}; };
export const viewCredentialsTabIndex = 1;
---
title: Alert integrations UX cleanup
merge_request: 55786
author:
type: changed
...@@ -2837,31 +2837,16 @@ msgstr "" ...@@ -2837,31 +2837,16 @@ msgstr ""
msgid "AlertMappingBuilder|Title is a required field for alerts in GitLab. Should the payload field you specified not be available, specifiy which field we should use instead. " msgid "AlertMappingBuilder|Title is a required field for alerts in GitLab. Should the payload field you specified not be available, specifiy which field we should use instead. "
msgstr "" msgstr ""
msgid "AlertSettings|API URL"
msgstr ""
msgid "AlertSettings|Active"
msgstr ""
msgid "AlertSettings|Add URL and auth key to your Prometheus config file"
msgstr ""
msgid "AlertSettings|Add new integration" msgid "AlertSettings|Add new integration"
msgstr "" msgstr ""
msgid "AlertSettings|Alert test payload"
msgstr ""
msgid "AlertSettings|Authorization key" msgid "AlertSettings|Authorization key"
msgstr "" msgstr ""
msgid "AlertSettings|Authorization key has been successfully reset. Please save your changes now."
msgstr ""
msgid "AlertSettings|Configure details" msgid "AlertSettings|Configure details"
msgstr "" msgstr ""
msgid "AlertSettings|Copy" msgid "AlertSettings|Customize alert payload mapping (optional)"
msgstr "" msgstr ""
msgid "AlertSettings|Delete integration" msgid "AlertSettings|Delete integration"
...@@ -2873,9 +2858,6 @@ msgstr "" ...@@ -2873,9 +2858,6 @@ msgstr ""
msgid "AlertSettings|Enter integration name" msgid "AlertSettings|Enter integration name"
msgstr "" msgstr ""
msgid "AlertSettings|Enter test alert JSON...."
msgstr ""
msgid "AlertSettings|External Prometheus" msgid "AlertSettings|External Prometheus"
msgstr "" msgstr ""
...@@ -2885,21 +2867,12 @@ msgstr "" ...@@ -2885,21 +2867,12 @@ msgstr ""
msgid "AlertSettings|If you edit the payload, the stored mapping will be reset, and you'll need to re-map the fields." msgid "AlertSettings|If you edit the payload, the stored mapping will be reset, and you'll need to re-map the fields."
msgstr "" msgstr ""
msgid "AlertSettings|If you've provided a sample alert payload, you can create a custom mapping for your endpoint. The default GitLab alert keys are listed below. Please define which payload key should map to the specified GitLab key." msgid "AlertSettings|If you intend to create a custom mapping, provide an example payload from your monitoring tool and click \"parse payload fields\" button to continue. The sample payload is required for completing the custom mapping; if you want to skip the mapping step, progress straight to saving your integration."
msgstr "" msgstr ""
msgid "AlertSettings|In free versions of GitLab, only one integration for each type can be added. %{linkStart}Upgrade your subscription%{linkEnd} to add additional integrations." msgid "AlertSettings|In free versions of GitLab, only one integration for each type can be added. %{linkStart}Upgrade your subscription%{linkEnd} to add additional integrations."
msgstr "" msgstr ""
msgid "AlertSettings|Integration"
msgstr ""
msgid "AlertSettings|Learn more about our our upcoming %{linkStart}integrations%{linkEnd}"
msgstr ""
msgid "AlertSettings|Map fields (optional)"
msgstr ""
msgid "AlertSettings|Name integration" msgid "AlertSettings|Name integration"
msgstr "" msgstr ""
...@@ -2921,18 +2894,12 @@ msgstr "" ...@@ -2921,18 +2894,12 @@ msgstr ""
msgid "AlertSettings|Reset Key" msgid "AlertSettings|Reset Key"
msgstr "" msgstr ""
msgid "AlertSettings|Reset key"
msgstr ""
msgid "AlertSettings|Reset the mapping" msgid "AlertSettings|Reset the mapping"
msgstr "" msgstr ""
msgid "AlertSettings|Resetting the authorization key for this project will require updating the authorization key in every alert source it is enabled in." msgid "AlertSettings|Resetting the authorization key for this project will require updating the authorization key in every alert source it is enabled in."
msgstr "" msgstr ""
msgid "AlertSettings|Review your external service's documentation to learn where to provide this information to your external service, and the %{linkStart}GitLab documentation%{linkEnd} to learn more about configuring your endpoint."
msgstr ""
msgid "AlertSettings|Sample alert payload (optional)" msgid "AlertSettings|Sample alert payload (optional)"
msgstr "" msgstr ""
...@@ -2951,21 +2918,6 @@ msgstr "" ...@@ -2951,21 +2918,6 @@ msgstr ""
msgid "AlertSettings|Send test alert" msgid "AlertSettings|Send test alert"
msgstr "" msgstr ""
msgid "AlertSettings|Test alert payload"
msgstr ""
msgid "AlertSettings|Test alert sent successfully. If you have made other changes, please save them now."
msgstr ""
msgid "AlertSettings|Test failed. Do you still want to save your changes anyway?"
msgstr ""
msgid "AlertSettings|There was an error updating the alert settings."
msgstr ""
msgid "AlertSettings|There was an error while trying to reset the key. Please refresh the page to try again."
msgstr ""
msgid "AlertSettings|URL cannot be blank and must start with http or https" msgid "AlertSettings|URL cannot be blank and must start with http or https"
msgstr "" msgstr ""
...@@ -2984,9 +2936,6 @@ msgstr "" ...@@ -2984,9 +2936,6 @@ msgstr ""
msgid "AlertSettings|You can now set up alert endpoints for manually configured Prometheus instances in the Alerts section on the Operations settings page. Alert endpoint fields on this page have been deprecated." msgid "AlertSettings|You can now set up alert endpoints for manually configured Prometheus instances in the Alerts section on the Operations settings page. Alert endpoint fields on this page have been deprecated."
msgstr "" msgstr ""
msgid "AlertSettings|You must provide this URL and authorization key to authorize an external service to send alerts to GitLab. You can provide this URL and key to multiple services. After configuring an external service, alerts from your service will display on the GitLab %{linkStart}Alerts%{linkEnd} page."
msgstr ""
msgid "AlertSettings|Your integration was successfully updated." msgid "AlertSettings|Your integration was successfully updated."
msgstr "" msgstr ""
......
...@@ -41,14 +41,14 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -41,14 +41,14 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
role="presentation" role="presentation"
> >
<a <a
aria-controls="__BVID__22" aria-controls="__BVID__19"
aria-disabled="true" aria-disabled="true"
aria-posinset="2" aria-posinset="2"
aria-selected="false" aria-selected="false"
aria-setsize="3" aria-setsize="3"
class="nav-link disabled disabled gl-tab-nav-item" class="nav-link disabled disabled gl-tab-nav-item"
href="#" href="#"
id="__BVID__22___BV_tab_button__" id="__BVID__19___BV_tab_button__"
role="tab" role="tab"
tabindex="-1" tabindex="-1"
target="_self" target="_self"
...@@ -112,7 +112,7 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -112,7 +112,7 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
for="integration-type" for="integration-type"
id="integration-type__BV_label_" id="integration-type__BV_label_"
> >
Select integration type 1.Select integration type
</label> </label>
<div <div
class="bv-no-focus-ring" class="bv-no-focus-ring"
...@@ -150,19 +150,6 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -150,19 +150,6 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
> >
<!----> <!---->
<span>
Utilize the URL and authorization key below to authorize an external service to send alerts to GitLab. Review your external service's documentation to learn where to add these details, and the
<a
class="gl-link gl-display-inline-block"
href="https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html"
rel="noopener noreferrer"
target="_blank"
>
GitLab documentation
</a>
to learn more about configuring your endpoint.
</span>
<label <label
class="gl-display-flex gl-flex-direction-column gl-mb-0 gl-w-max-content gl-my-4 gl-font-weight-normal" class="gl-display-flex gl-flex-direction-column gl-mb-0 gl-w-max-content gl-my-4 gl-font-weight-normal"
> >
...@@ -206,10 +193,6 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -206,10 +193,6 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
<!----> <!---->
<!----> <!---->
<!---->
<!---->
</div> </div>
<div <div
...@@ -264,12 +247,25 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`] ...@@ -264,12 +247,25 @@ exports[`AlertsSettingsForm with default values renders the initial template 1`]
> >
<div <div
aria-hidden="true" aria-hidden="true"
aria-labelledby="__BVID__22___BV_tab_button__" aria-labelledby="__BVID__19___BV_tab_button__"
class="tab-pane disabled" class="tab-pane disabled"
id="__BVID__22" id="__BVID__19"
role="tabpanel" role="tabpanel"
style="display: none;" style="display: none;"
> >
<span>
Utilize the URL and authorization key below to authorize an external service to send alerts to GitLab. Review your external service's documentation to learn where to add these details, and the
<a
class="gl-link gl-display-inline-block"
href="https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html"
rel="noopener noreferrer"
target="_blank"
>
GitLab documentation
</a>
to learn more about configuring your endpoint.
</span>
<fieldset <fieldset
class="form-group gl-form-group" class="form-group gl-form-group"
id="integration-webhook" id="integration-webhook"
......
...@@ -43,10 +43,10 @@ describe('AlertsSettingsForm', () => { ...@@ -43,10 +43,10 @@ describe('AlertsSettingsForm', () => {
}); });
}; };
const findForm = () => wrapper.find(GlForm); const findForm = () => wrapper.findComponent(GlForm);
const findSelect = () => wrapper.find(GlFormSelect); const findSelect = () => wrapper.findComponent(GlFormSelect);
const findFormFields = () => wrapper.findAll(GlFormInput); const findFormFields = () => wrapper.findAllComponents(GlFormInput);
const findFormToggle = () => wrapper.find(GlToggle); const findFormToggle = () => wrapper.findComponent(GlToggle);
const findSamplePayloadSection = () => wrapper.find('[data-testid="sample-payload-section"]'); const findSamplePayloadSection = () => wrapper.find('[data-testid="sample-payload-section"]');
const findMappingBuilderSection = () => wrapper.find(`[id = "mapping-builder"]`); const findMappingBuilderSection = () => wrapper.find(`[id = "mapping-builder"]`);
const findMappingBuilder = () => wrapper.findComponent(MappingBuilder); const findMappingBuilder = () => wrapper.findComponent(MappingBuilder);
...@@ -56,7 +56,7 @@ describe('AlertsSettingsForm', () => { ...@@ -56,7 +56,7 @@ describe('AlertsSettingsForm', () => {
const findJsonTestSubmit = () => wrapper.find(`[data-testid="send-test-alert"]`); const findJsonTestSubmit = () => wrapper.find(`[data-testid="send-test-alert"]`);
const findJsonTextArea = () => wrapper.find(`[id = "test-payload"]`); const findJsonTextArea = () => wrapper.find(`[id = "test-payload"]`);
const findActionBtn = () => wrapper.find(`[data-testid="payload-action-btn"]`); const findActionBtn = () => wrapper.find(`[data-testid="payload-action-btn"]`);
const findTabs = () => wrapper.findAll(GlTab); const findTabs = () => wrapper.findAllComponents(GlTab);
afterEach(() => { afterEach(() => {
if (wrapper) { if (wrapper) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment