GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
285 stars 71 forks source link

[grafana 8.0.x] Populate target.datasource with ds name if undefined #135

Closed samfadrigalan closed 2 years ago

samfadrigalan commented 2 years ago

Notes

datasource isn't available in props on first query creation in Grafana 8.0.x. This PR manually populates target.datasource in MetaQueries' query control if datasource is undefined.

Grafana 7 Query Operation Row props -- datasource is defined for new queries

Screen Shot 2021-07-14 at 11 16 34 AM

Grafana 8 Query Operation Row props -- undefined datasource for new queries

Screen Shot 2021-07-14 at 11 19 59 AM

Grafana 8 Query Operation Row props -- datasource is defined after some steps

Screen Shot 2021-07-14 at 11 24 44 AM
samfadrigalan commented 2 years ago

potentially relates to #134 and https://github.com/grafana/grafana/issues/36508

Gauravshah commented 2 years ago

@ShilpaSivanesan this should solve problem with grafana 8 generically can you please take a look and merge ?

samfadrigalan commented 2 years ago

Resolves #133

adsail commented 2 years ago

@Gauravshah @ShilpaSivanesan -- Would greatly appreciate a review in hopes of getting this merged. Thanks!

ShilpaSivanesan commented 2 years ago

@Gauravshah @ShilpaSivanesan -- Would greatly appreciate a review in hopes of getting this merged. Thanks!

https://github.com/GoshPosh/grafana-meta-queries/pull/134 fixes the issue

ShilpaSivanesan commented 2 years ago

Thank you for your contribution, @samfadrigalan . However, this change had a problem while validating, so a new fix https://github.com/GoshPosh/grafana-meta-queries/pull/134 was created.