|
|
|
@ -138,7 +138,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode |
|
|
|
|
filters: variable.filters ?? [], |
|
|
|
|
baseFilters: variable.baseFilters ?? [], |
|
|
|
|
defaultKeys: variable.defaultKeys, |
|
|
|
|
allowCustomValue: variable.allowCustomValue ?? true, |
|
|
|
|
allowCustomValue: variable.allowCustomValue, |
|
|
|
|
useQueriesAsFilterForOptions: true, |
|
|
|
|
layout: config.featureToggles.newFiltersUI ? 'combobox' : undefined, |
|
|
|
|
supportsMultiValueOperators: Boolean( |
|
|
|
@ -159,7 +159,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode |
|
|
|
|
defaultToAll: Boolean(variable.includeAll), |
|
|
|
|
skipUrlSync: variable.skipUrlSync, |
|
|
|
|
hide: variable.hide, |
|
|
|
|
allowCustomValue: variable.allowCustomValue ?? true, |
|
|
|
|
allowCustomValue: variable.allowCustomValue, |
|
|
|
|
}); |
|
|
|
|
} else if (variable.type === 'query') { |
|
|
|
|
return new QueryVariable({ |
|
|
|
@ -179,7 +179,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode |
|
|
|
|
skipUrlSync: variable.skipUrlSync, |
|
|
|
|
hide: variable.hide, |
|
|
|
|
definition: variable.definition, |
|
|
|
|
allowCustomValue: variable.allowCustomValue ?? true, |
|
|
|
|
allowCustomValue: variable.allowCustomValue, |
|
|
|
|
}); |
|
|
|
|
} else if (variable.type === 'datasource') { |
|
|
|
|
return new DataSourceVariable({ |
|
|
|
@ -195,7 +195,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode |
|
|
|
|
isMulti: variable.multi, |
|
|
|
|
hide: variable.hide, |
|
|
|
|
defaultOptionEnabled: variable.current?.value === DEFAULT_DATASOURCE && variable.current?.text === 'default', |
|
|
|
|
allowCustomValue: variable.allowCustomValue ?? true, |
|
|
|
|
allowCustomValue: variable.allowCustomValue, |
|
|
|
|
}); |
|
|
|
|
} else if (variable.type === 'interval') { |
|
|
|
|
const intervals = getIntervalsFromQueryString(variable.query); |
|
|
|
@ -246,7 +246,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode |
|
|
|
|
hide: variable.hide, |
|
|
|
|
// @ts-expect-error
|
|
|
|
|
defaultOptions: variable.options, |
|
|
|
|
allowCustomValue: variable.allowCustomValue ?? true, |
|
|
|
|
allowCustomValue: variable.allowCustomValue, |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
throw new Error(`Scenes: Unsupported variable type ${variable.type}`); |
|
|
|
|