blackcowmoo / grafana-google-analytics-datasource

Grafana Google Analytics datasource
https://grafana.com/grafana/plugins/blackcowmoo-googleanalytics-datasource/
Apache License 2.0
38 stars 17 forks source link

support variable at query eidtor #103

Closed lcc3108 closed 11 months ago

lcc3108 commented 1 year ago

Summary

Support variable at query editor

Summary by CodeRabbit

coderabbitai[bot] commented 1 year ago

Walkthrough

The update to DataSource.ts enhances the data source class by integrating template variable support. It imports necessary utilities for template handling and adds a method to apply these variables to query filters, ensuring dynamic and customizable queries. Additionally, the getAccountSummaries method has been updated, likely to accommodate the new template variable functionality.

Changes

File Change Summary
src/DataSource.ts Imported ScopedVars and getTemplateSrv, added applyTemplateVariables method, and updated getAccountSummaries method.

Poem

In the code where logic hops around, 🐇💻
A change was made without a sound.
Variables template, now they weave,
Through queries' fabric, they interleave.

A rabbit coder with a deft hand, 🐾
Updated methods as per command.
Data dances with dynamic flair,
Thanks to changes made with care.

So here's to code that now adapts, 🎉
To user needs, with no mishaps.
A hop, a skip, a jump, we're done,
Celebrate the work well spun! 🥳


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
lcc3108 commented 1 year ago

@coderabbitai review