mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
VariableEditorForm: Fix multi-value variable runtime error (#80425)
This commit is contained in:
@@ -84,7 +84,7 @@ export function VariableEditorForm({ variable, onTypeChange, onGoBack, onDiscard
|
||||
|
||||
{EditorToRender && <EditorToRender variable={variable} />}
|
||||
|
||||
{hasVariableOptions(variable) && <VariableValuesPreview options={variable.options} />}
|
||||
{hasVariableOptions(variable) && <VariableValuesPreview options={variable.state.options} />}
|
||||
|
||||
<div style={{ marginTop: '16px' }}>
|
||||
<HorizontalGroup spacing="md" height="inherit">
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
QueryVariable,
|
||||
AdHocFilterSet,
|
||||
SceneVariable,
|
||||
VariableValueOption,
|
||||
MultiValueVariable,
|
||||
} from '@grafana/scenes';
|
||||
import { VariableType } from '@grafana/schema';
|
||||
|
||||
@@ -117,8 +117,6 @@ export function getVariableScene(type: EditableVariableType, initialState: Commo
|
||||
}
|
||||
}
|
||||
|
||||
export function hasVariableOptions(
|
||||
variable: SceneVariable
|
||||
): variable is SceneVariable & { options: VariableValueOption[] } {
|
||||
export function hasVariableOptions(variable: SceneVariable): variable is MultiValueVariable {
|
||||
return 'options' in variable.state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user