mirror of
https://github.com/grafana/grafana.git
synced 2025-01-13 09:32:12 -06:00
influxdb: flux-editor: fix html.onchange bug with angular, improve types (#31765)
* influxdb: flux-editor: fix html.onchange bug with angular, improve types * influx: flux: simplified bug-fix
This commit is contained in:
parent
ee547b4410
commit
3139a60012
@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import { InfluxQuery } from '../types';
|
||||
import { SelectableValue, QueryEditorProps } from '@grafana/data';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { cx, css } from 'emotion';
|
||||
import {
|
||||
InlineFormLabel,
|
||||
@ -14,8 +14,16 @@ import {
|
||||
import { getTemplateSrv } from '@grafana/runtime';
|
||||
import InfluxDatasource from '../datasource';
|
||||
|
||||
// @ts-ignore -- complicated since the datasource is not really reactified yet!
|
||||
type Props = QueryEditorProps<InfluxDatasource, InfluxQuery>;
|
||||
type Props = {
|
||||
onChange: (query: InfluxQuery) => void;
|
||||
onRunQuery: () => void;
|
||||
query: InfluxQuery;
|
||||
// `datasource` is not used internally, but this component is used at some places
|
||||
// directly, where the `datasource` prop has to exist. later, when the whole
|
||||
// query-editor gets converted to react we can stop using this component directly
|
||||
// and then we can probably remove the datasource attribute.
|
||||
datasource: InfluxDatasource;
|
||||
};
|
||||
|
||||
const samples: Array<SelectableValue<string>> = [
|
||||
{ label: 'Show buckets', description: 'List the available buckets (table)', value: 'buckets()' },
|
||||
|
@ -2,7 +2,7 @@
|
||||
<query-editor-row ng-if="ctrl.datasource.isFlux" query-ctrl="ctrl" can-collapse="true" has-text-edit-mode="true">
|
||||
<flux-query-editor
|
||||
query="ctrl.target"
|
||||
onChange="ctrl.onChange"
|
||||
on-change="ctrl.onChange"
|
||||
onRunQuery="ctrl.onRunQuery"
|
||||
></flux-query-editor>
|
||||
</query-editor-row>
|
||||
@ -237,4 +237,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</query-editor-row>
|
||||
</query-editor-row>
|
||||
|
Loading…
Reference in New Issue
Block a user