mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* VizPanel - add variables dependencies definition * Migrate variables to scene variables * Constant variable migration * Update test * Lint fix
24 lines
611 B
TypeScript
24 lines
611 B
TypeScript
import { SceneObjectBase } from '../../core/SceneObjectBase';
|
|
import { SceneVariable, SceneVariableState, VariableValue } from '../types';
|
|
|
|
export interface ConstantVariableState extends SceneVariableState {
|
|
value: VariableValue;
|
|
}
|
|
|
|
export class ConstantVariable
|
|
extends SceneObjectBase<ConstantVariableState>
|
|
implements SceneVariable<ConstantVariableState>
|
|
{
|
|
public constructor(initialState: Partial<ConstantVariableState>) {
|
|
super({
|
|
type: 'constant',
|
|
value: '',
|
|
name: '',
|
|
...initialState,
|
|
});
|
|
}
|
|
public getValue(): VariableValue {
|
|
return this.state.value;
|
|
}
|
|
}
|