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
Explore: Add feature tracking events #54514
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/31699 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/31710 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/31735 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/31738 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/31877 |
97b36d8
to
cc175e2
Compare
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/33924 |
@@ -57,6 +57,7 @@ interface Props<TQuery extends DataQuery> { | |||
history?: Array<HistoryItem<TQuery>>; | |||
eventBus?: EventBusExtended; | |||
alerting?: boolean; | |||
onTriggerTracking?: (action: string, queryStatus?: boolean | undefined) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the method shouldn't be called onTriggerTracking
as it can be used to handle anything (maybe something like onEvent
would be better?). Also the optional queryStatus
param is confusing because it's passed only with enableDisable
so it's harder to understand just reading the API. @Elfo404, @ivanortegaalba please correct me if I'm wrong by I think what you meant was to have separate handlers for each event:
onQueryRemoved: () => void;
onQueryCopied: () => void;
onQueryToggled: (shown: boolean): void;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Backend code coverage report for PR #54514 |
Frontend code coverage report for PR #54514
|
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/34089 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff 🎉
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/34139 |
8933315
to
1d0fc33
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-54514-to-v9.1.x origin/v9.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x dbbab6e95c63b80bea2b192cf322a649469499c5
# Push it to GitHub
git push --set-upstream origin backport-54514-to-v9.1.x
git switch main
# Remove the local backport branch
git branch -D backport-54514-to-v9.1.x Then, create a pull request where the |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/34156 |
* refactor: repair tests * refactor: clean up * feat: add details to change of data source * refactor: remove duplicate tracking * refactor: make tracking reusable in an easier way * refactor: add property * refactor: change data for time picker * refactor: change tracking label for time picker Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com> * refactor: store tracking in explore component * refactor: add index signature * refactor: remove ? * refactor: split into 3 callbacks * refactor: apply suggestions from code review Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com> Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> (cherry picked from commit dbbab6e)
* Explore: Add feature tracking events (#54514) * refactor: repair tests * refactor: clean up * feat: add details to change of data source * refactor: remove duplicate tracking * refactor: make tracking reusable in an easier way * refactor: add property * refactor: change data for time picker * refactor: change tracking label for time picker Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com> * refactor: store tracking in explore component * refactor: add index signature * refactor: remove ? * refactor: split into 3 callbacks * refactor: apply suggestions from code review Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com> Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> (cherry picked from commit dbbab6e) * refactor: remove unrelated changes
Fixes #54082
QueryEditorRow.tsx
: tracking is only available for the component in Explore, other use cases were excluded