|
|
@ -8,7 +8,7 @@ import { convertToGraphiteQueryObject } from './helpers'; |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
query: GraphiteQuery | string; |
|
|
|
query: GraphiteQuery | string; |
|
|
|
onChange: (query: GraphiteQuery) => void; |
|
|
|
onChange: (query: GraphiteQuery, definition: string) => void; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const GRAPHITE_QUERY_VARIABLE_TYPE_OPTIONS = [ |
|
|
|
const GRAPHITE_QUERY_VARIABLE_TYPE_OPTIONS = [ |
|
|
@ -36,10 +36,13 @@ export const GraphiteVariableEditor = (props: Props) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (value.target) { |
|
|
|
if (value.target) { |
|
|
|
onChange({ |
|
|
|
onChange( |
|
|
|
...value, |
|
|
|
{ |
|
|
|
queryType: selectableValue.value, |
|
|
|
...value, |
|
|
|
}); |
|
|
|
queryType: selectableValue.value, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
value.target ?? '' |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
@ -48,7 +51,7 @@ export const GraphiteVariableEditor = (props: Props) => { |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
aria-label="Variable editor query input" |
|
|
|
aria-label="Variable editor query input" |
|
|
|
value={value.target} |
|
|
|
value={value.target} |
|
|
|
onBlur={() => onChange(value)} |
|
|
|
onBlur={() => onChange(value, value.target ?? '')} |
|
|
|
onChange={(e) => { |
|
|
|
onChange={(e) => { |
|
|
|
setValue({ |
|
|
|
setValue({ |
|
|
|
...value, |
|
|
|
...value, |
|
|
|