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:
parent
100047c0c7
commit
8f3cdc3ccc
1 changed files with 5 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue