From 5975b9dd8ca5aac2fd9c841c01c2d5d23ca24302 Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Wed, 31 May 2023 19:26:36 +0800 Subject: [PATCH] Change integrations page wording and add more guidance (#1986) # What this PR does ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Yulia Shanyrova --- .../apps/alerts/integration_options_mixin.py | 5 +++ .../apps/api/views/alert_receive_channel.py | 3 ++ .../config_integrations/grafana_alerting.py | 1 + engine/config_integrations/webhook.py | 5 +-- .../CollapsedIntegrationRouteDisplay.tsx | 11 +++--- .../ExpandedIntegrationRouteDisplay.tsx | 22 +++++++++--- .../IntegrationForm/IntegrationForm2.tsx | 8 ++++- .../alert_receive_channel.types.ts | 2 ++ .../integration_2/Integration2.helper.ts | 9 +++++ .../src/pages/integration_2/Integration2.tsx | 36 +++++++++++++------ .../pages/integrations_2/Integrations2.tsx | 22 +++++++++--- 11 files changed, 97 insertions(+), 27 deletions(-) diff --git a/engine/apps/alerts/integration_options_mixin.py b/engine/apps/alerts/integration_options_mixin.py index a747d899..0594e0f6 100644 --- a/engine/apps/alerts/integration_options_mixin.py +++ b/engine/apps/alerts/integration_options_mixin.py @@ -49,6 +49,11 @@ class IntegrationOptionsMixin: integration_config.slug: integration_config.short_description for integration_config in _config } INTEGRATION_FEATURED = [integration_config.slug for integration_config in _config if integration_config.is_featured] + INTEGRATION_FEATURED_TAG_NAME = { + integration_config.slug: integration_config.featured_tag_name + for integration_config in _config + if hasattr(integration_config, "featured_tag_name") + } # The following attributes dynamically generated and used by apps.alerts.incident_appearance.renderers, templaters # e.g. INTEGRATION_TO_DEFAULT_SLACK_TITLE_TEMPLATE, INTEGRATION_TO_DEFAULT_SLACK_MESSAGE_TEMPLATE, etc... diff --git a/engine/apps/api/views/alert_receive_channel.py b/engine/apps/api/views/alert_receive_channel.py index 95cb3120..cd4e2552 100644 --- a/engine/apps/api/views/alert_receive_channel.py +++ b/engine/apps/api/views/alert_receive_channel.py @@ -198,6 +198,9 @@ class AlertReceiveChannelView( "display_name": integration_title, "short_description": AlertReceiveChannel.INTEGRATION_SHORT_DESCRIPTION[integration_id], "featured": integration_id in AlertReceiveChannel.INTEGRATION_FEATURED, + "featured_tag_name": AlertReceiveChannel.INTEGRATION_FEATURED_TAG_NAME[integration_id] + if integration_id in AlertReceiveChannel.INTEGRATION_FEATURED_TAG_NAME + else None, } # if integration is featured we show it in the beginning if choice["featured"]: diff --git a/engine/config_integrations/grafana_alerting.py b/engine/config_integrations/grafana_alerting.py index 0b72ff20..5b0deb0c 100644 --- a/engine/config_integrations/grafana_alerting.py +++ b/engine/config_integrations/grafana_alerting.py @@ -8,6 +8,7 @@ short_description = ( description = None is_displayed_on_web = True is_featured = True +featured_tag_name = "Quick Connect" is_able_to_autoresolve = True is_demo_alert_enabled = True diff --git a/engine/config_integrations/webhook.py b/engine/config_integrations/webhook.py index 823bc837..0041c8c1 100644 --- a/engine/config_integrations/webhook.py +++ b/engine/config_integrations/webhook.py @@ -2,9 +2,10 @@ enabled = True title = "Webhook" slug = "webhook" -short_description = None +short_description = "If your monitoring system isn't listed, choose Webhook for generic templates, and feel free to modify them as needed." description = None -is_featured = False +is_featured = True +featured_tag_name = "Generic" is_displayed_on_web = True is_able_to_autoresolve = True is_demo_alert_enabled = True diff --git a/grafana-plugin/src/containers/IntegrationContainers/CollapsedIntegrationRouteDisplay/CollapsedIntegrationRouteDisplay.tsx b/grafana-plugin/src/containers/IntegrationContainers/CollapsedIntegrationRouteDisplay/CollapsedIntegrationRouteDisplay.tsx index 383be9b6..8a3504ac 100644 --- a/grafana-plugin/src/containers/IntegrationContainers/CollapsedIntegrationRouteDisplay/CollapsedIntegrationRouteDisplay.tsx +++ b/grafana-plugin/src/containers/IntegrationContainers/CollapsedIntegrationRouteDisplay/CollapsedIntegrationRouteDisplay.tsx @@ -55,7 +55,10 @@ const CollapsedIntegrationRouteDisplay: React.FC {routeWording === 'Default' && ( @@ -93,7 +96,7 @@ const CollapsedIntegrationRouteDisplay: React.FC - Escalate to + Trigger escalation chain: {escalationChain?.name && ( - - No Escalation chain - + No Escalation chain selected )} diff --git a/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx b/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx index 4c6bf8ee..cf24abe8 100644 --- a/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx +++ b/grafana-plugin/src/containers/IntegrationContainers/ExpandedIntegrationRouteDisplay/ExpandedIntegrationRouteDisplay.tsx @@ -113,7 +113,7 @@ const ExpandedIntegrationRouteDisplay: React.FC @@ -129,6 +129,16 @@ const ExpandedIntegrationRouteDisplay: React.FC + {routeIndex !== channelFiltersTotal.length - 1 && ( + + + + If the Routing Template is True, group the alerts using the Grouping Template, publish them to + messengers, and trigger the escalation chain. + + + + )} {/* Show Routing Template only for If/Else Routes, not for Default */} {!isDefault && ( @@ -206,9 +216,13 @@ const ExpandedIntegrationRouteDisplay: React.FC - -