Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudWatch: Fix query editor does not render in Explore #20909

Merged
merged 2 commits into from Dec 6, 2019

Conversation

davkal
Copy link
Contributor

@davkal davkal commented Dec 5, 2019

  • the datasource plugin module API was changed recently so that it no longer falls back on the panel editor in Explore, now it needs to be explicitly set
  • this PR sets the cloudwatch explore query field to be the same as the query editor
  • needed to change editor types to satisfy explore query field interface

Fixes: #20805

Copy link
Contributor

@sunker sunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Tested and it works fine.

@sunker sunker added this to the 6.5.2 milestone Dec 5, 2019
@sunker
Copy link
Contributor

sunker commented Dec 5, 2019

@davkal added this to 6.5.2 milestone

import { Input, Segment, SegmentAsync, ValidationEvents, EventsWithValidation, Switch } from '@grafana/ui';
import { CloudWatchQuery } from '../types';
import CloudWatchDatasource from '../datasource';
import { SelectableStrings } from '../types';
import { Stats, Dimensions, QueryInlineField, QueryField, Alias } from './';

export type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery>;
export type Props = ExploreQueryFieldProps<CloudWatchDatasource, CloudWatchQuery>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for a quick fix, but really wish we could unify these interfaces, I see very recently that ExploreQueryFieldProps has now a NEW prop in master (compared to 6.5) (absoluteRange?: ) the plan was to get rid of the differences not expand them. Can't find the PR where this was added, do you know?

history could be handled easily internally by each editor, and onBlur could be added to main interface. not sure what this absoluteRange is used for. PanelData has a timeRange property already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or query history could potentially be made into a more universal feature that we can shared between dashboard / explore.

@davkal davkal merged commit ab3df98 into master Dec 6, 2019
@davkal davkal deleted the davkal/explore-cloudwatch branch December 6, 2019 15:04
@marefr marefr changed the title Cloudwatch: Defined explore query editor for cloudwatch Cloudwatch: Fix query editor does not render in Explore Dec 10, 2019
@marefr marefr changed the title Cloudwatch: Fix query editor does not render in Explore CloudWatch: Defined explore query editor for cloudwatch Dec 10, 2019
@marefr marefr changed the title CloudWatch: Defined explore query editor for cloudwatch CloudWatch: Fix query editor does not render in Explore Dec 10, 2019
mckn pushed a commit that referenced this pull request Dec 11, 2019
* Defined explore query editor for cloudwatch

* Fix types

(cherry picked from commit ab3df98)
mckn pushed a commit that referenced this pull request Dec 11, 2019
* Defined explore query editor for cloudwatch

* Fix types

(cherry picked from commit ab3df98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CloudWatch: Query editor does not render in Explore mode
5 participants