From 8f3cdc3ccc80af0b0e3c1f332782733e9e8db65d Mon Sep 17 00:00:00 2001 From: Dominik Broj Date: Mon, 17 Jun 2024 17:01:33 +0200 Subject: [PATCH] Disable All option for non selectable variables (#4544) # What this PR does Disable All option for non selectable variables ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes. --- grafana-plugin/src/pages/insights/variables.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/grafana-plugin/src/pages/insights/variables.ts b/grafana-plugin/src/pages/insights/variables.ts index b8dbd6e2..9a5cdb76 100644 --- a/grafana-plugin/src/pages/insights/variables.ts +++ b/grafana-plugin/src/pages/insights/variables.ts @@ -4,8 +4,6 @@ import { InsightsConfig } from './Insights.types'; const DEFAULT_VARIABLE_CONFIG: Partial[0]> = { hide: 0, - includeAll: true, - allValue: `.+`, isMulti: true, options: [], refresh: 1, @@ -33,6 +31,8 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ label: 'Team', text: ['All'], value: ['$__all'], + includeAll: true, + allValue: `.+`, datasource, definition: `label_values(\${alert_groups_total}{slug=~"${stack}"},team)`, query: { @@ -47,6 +47,8 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ label: 'Integration', text: ['All'], value: ['$__all'], + includeAll: true, + allValue: `.+`, datasource, definition: `label_values(\${alert_groups_total}{team=~"$team",slug=~"${stack}"},integration)`, query: { @@ -61,6 +63,7 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ label: 'Service name', text: ['All'], value: ['$__all'], + includeAll: true, allValue: '($^)|(.+)', datasource, definition: `label_values(\${alert_groups_total}{slug=~"${stack}",team=~"$team"},service_name)`, @@ -85,7 +88,6 @@ const getVariables = ({ isOpenSource, datasource, stack }: InsightsConfig) => ({ value: ['oncall_alert_groups_total', 'grafanacloud_oncall_instance_alert_groups_total'], definition: 'metrics(alert_groups_total)', hide: 2, - includeAll: false, }), userNotified: new QueryVariable({ ...DEFAULT_VARIABLE_CONFIG,