Commit 3a180987 by kay delaney Committed by Torkel Ödegaard

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
parent cf37b543
...@@ -129,7 +129,8 @@ export class QueryRow extends PureComponent<QueryRowProps, QueryRowState> { ...@@ -129,7 +129,8 @@ export class QueryRow extends PureComponent<QueryRowProps, QueryRowState> {
queryErrors, queryErrors,
mode, mode,
} = this.props; } = this.props;
const canToggleEditorModes = _.has(datasourceInstance, 'components.QueryCtrl.prototype.toggleEditorMode'); const canToggleEditorModes =
mode === ExploreMode.Metrics && _.has(datasourceInstance, 'components.QueryCtrl.prototype.toggleEditorMode');
let QueryField; let QueryField;
if (mode === ExploreMode.Metrics && datasourceInstance.components.ExploreMetricsQueryField) { if (mode === ExploreMode.Metrics && datasourceInstance.components.ExploreMetricsQueryField) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment