Explore: Restricts query text edit toggle to metrics mode (#17921)

* Explore: Adds datasource plugin config option 'modesSupportingTextEdit'
This allows one to specify which modes support toggling query text edit on and off
Closes #17904

* Explore: Restricts query text edit toggle to metrics mode
This commit is contained in:
kay delaney 2019-07-04 13:10:44 +01:00 committed by Torkel Ödegaard
parent cf37b5439f
commit 3a18098760

View File

@ -129,7 +129,8 @@ export class QueryRow extends PureComponent<QueryRowProps, QueryRowState> {
queryErrors,
mode,
} = this.props;
const canToggleEditorModes = _.has(datasourceInstance, 'components.QueryCtrl.prototype.toggleEditorMode');
const canToggleEditorModes =
mode === ExploreMode.Metrics && _.has(datasourceInstance, 'components.QueryCtrl.prototype.toggleEditorMode');
let QueryField;
if (mode === ExploreMode.Metrics && datasourceInstance.components.ExploreMetricsQueryField) {