2020-07-28 23:09:34 +05:30
import { s _ _ } from '~/locale' ;
2021-01-29 00:20:46 +05:30
// TODO: Remove this as part of the form old removal
2020-07-28 23:09:34 +05:30
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." ,
) ,
2021-01-03 14:25:43 +05:30
errorMsg : s _ _ ( 'AlertSettings|There was an error updating the alert settings.' ) ,
2020-07-28 23:09:34 +05:30
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.' ,
) ,
2021-01-03 14:25:43 +05:30
changesSaved : s _ _ ( 'AlertSettings|Your integration was successfully updated.' ) ,
2020-07-28 23:09:34 +05:30
prometheusInfo : s _ _ ( 'AlertSettings|Add URL and auth key to your Prometheus config file' ) ,
integrationsInfo : s _ _ (
2021-01-29 00:20:46 +05:30
'AlertSettings|Learn more about our our upcoming %{linkStart}integrations%{linkEnd}' ,
2020-07-28 23:09:34 +05:30
) ,
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.' ,
) ,
2020-10-24 23:57:45 +05:30
authKeyRest : s _ _ (
'AlertSettings|Authorization key has been successfully reset. Please save your changes now.' ,
) ,
2021-01-03 14:25:43 +05:30
integration : s _ _ ( 'AlertSettings|Integration' ) ,
2020-07-28 23:09:34 +05:30
} ;
2021-01-29 00:20:46 +05:30
// TODO: Delete as part of old form removal in 13.6
export const integrationTypes = [
{ value : 'HTTP' , text : s _ _ ( 'AlertSettings|HTTP Endpoint' ) } ,
{ value : 'PROMETHEUS' , text : s _ _ ( 'AlertSettings|External Prometheus' ) } ,
{ value : 'OPSGENIE' , text : s _ _ ( 'AlertSettings|Opsgenie' ) } ,
2020-07-28 23:09:34 +05:30
] ;
2021-01-29 00:20:46 +05:30
export const integrationTypesNew = [
{ value : '' , text : s _ _ ( 'AlertSettings|Select integration type' ) } ,
... integrationTypes ,
] ;
export const typeSet = {
http : 'HTTP' ,
prometheus : 'PROMETHEUS' ,
opsgenie : 'OPSGENIE' ,
} ;
export const integrationToDeleteDefault = { id : null , name : '' } ;
2020-07-28 23:09:34 +05:30
export const JSON _VALIDATE _DELAY = 250 ;
export const targetPrometheusUrlPlaceholder = 'http://prometheus.example.com/' ;
export const targetOpsgenieUrlPlaceholder = 'https://app.opsgenie.com/alert/list/' ;
2021-01-03 14:25:43 +05:30
export const sectionHash = 'js-alert-management-settings' ;
/* eslint-disable @gitlab/require-i18n-strings */
/ * *
2021-01-29 00:20:46 +05:30
* Tracks snowplow event when user views alerts integration list
2021-01-03 14:25:43 +05:30
* /
2021-01-29 00:20:46 +05:30
export const trackAlertIntegrationsViewsOptions = {
category : 'Alert Integrations' ,
2021-01-03 14:25:43 +05:30
action : 'view_alert_integrations_list' ,
} ;