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

Geomap: Add ability to select a data query filter for each layer #49966

Merged
merged 20 commits into from
Jun 9, 2022

Conversation

mmandrus
Copy link
Contributor

@mmandrus mmandrus commented May 31, 2022

What this PR does / why we need it:
Right now, the Geomap panel always uses the first query in the list, so users are not able to fully visualize all of their data. This fix allows users to select which query to use in each layer. It also includes some handling for when queries are renamed or deleted that will keep the UI up to date.

Which issue(s) this PR fixes:
Fixes #48274

2022-06-06_18-13-59 (1)

@mmandrus mmandrus requested a review from a team May 31, 2022 20:11
@mmandrus mmandrus requested review from a team as code owners May 31, 2022 20:11
@mmandrus mmandrus requested review from a team, ashharrison90, JoaoSilvaGrafana, jackw, oscarkilhed and davkal and removed request for a team May 31, 2022 20:11
@mmandrus
Copy link
Contributor Author

Added query picker under the layer type
image

@ryantxu ryantxu added this to the 9.1.0 milestone Jun 6, 2022
@mmandrus mmandrus modified the milestones: 9.1.0, 9.0.0 Jun 6, 2022
@ryantxu ryantxu modified the milestones: 9.0.0, 9.1.0 Jun 7, 2022
Copy link
Member

@ryantxu ryantxu left a comment

Choose a reason for hiding this comment

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

@mmandrus -- this looks great, thanks for sticking with it :)

I pushed a small commit that changes the text displayed in the dropdown. I think we can improve this component in a new PR.

I recall you had previously implemented logic that looked tried to re-sync the current value with a new value when the refID changes. I think that is OK, but should happen in FrameSelectionEditor not the base layer implementation

@mmandrus mmandrus requested a review from ryantxu June 7, 2022 20:38
@mmandrus
Copy link
Contributor Author

mmandrus commented Jun 7, 2022

Hate to keep this one going, but while re-adding the query ID recovery logic, I discovered a bug in the onFilterChange callback. If we don't add the layer name as a dependency, we always use the "last" version of the callback, which updates the wrong layer.

Also re-added the recovery logic, using redux to store the previous dropdown state after every update.

@mmandrus mmandrus modified the milestones: 9.1.0, 9.0.0 Jun 7, 2022
@grafanabot
Copy link
Contributor

Copy link
Contributor

@drew08t drew08t left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@mmandrus mmandrus modified the milestones: 9.0.0, 9.1.0 Jun 9, 2022
@mmandrus mmandrus merged commit 1284c59 into main Jun 9, 2022
@mmandrus mmandrus deleted the mmandrus/geomap-data-layers branch June 9, 2022 15:54
@IevaVasiljeva IevaVasiljeva modified the milestone: 9.1.0-beta1 Aug 2, 2022
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.

Geomap panel only shows the first query
5 participants