mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
use correct type for select option
This commit is contained in:
parent
4928984825
commit
126ceb9780
@ -3,10 +3,11 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
import Select from './Select';
|
import Select from './Select';
|
||||||
import { Variable } from 'app/types/templates';
|
import { Variable } from 'app/types/templates';
|
||||||
|
import { SelectOptionItem } from './Select';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
onChange: (value: string) => void;
|
onChange: (value: string) => void;
|
||||||
options: any[];
|
options: SelectOptionItem[];
|
||||||
isSearchable: boolean;
|
isSearchable: boolean;
|
||||||
value: string;
|
value: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
@ -46,17 +47,7 @@ export class MetricSelect extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildOptions({ variables = [], options }) {
|
buildOptions({ variables = [], options }) {
|
||||||
return variables.length > 0
|
return variables.length > 0 ? [this.getVariablesGroup(), ...options] : options;
|
||||||
? [
|
|
||||||
this.getVariablesGroup(),
|
|
||||||
// {
|
|
||||||
// label: groupName,
|
|
||||||
// expanded: true,
|
|
||||||
// options,
|
|
||||||
// },
|
|
||||||
...options,
|
|
||||||
]
|
|
||||||
: options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getVariablesGroup() {
|
getVariablesGroup() {
|
||||||
|
Loading…
Reference in New Issue
Block a user