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.
This commit is contained in:
Dominik Broj 2024-06-17 17:01:33 +02:00 committed by GitHub
parent 100047c0c7
commit 8f3cdc3ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,8 +4,6 @@ import { InsightsConfig } from './Insights.types';
const DEFAULT_VARIABLE_CONFIG: Partial<ConstructorParameters<typeof QueryVariable>[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,