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

fix: groupBy manual applyMode #1010

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Conversation

joannaWebDev
Copy link
Contributor

This PR fixes a bug in the GroupByVariable where the applyMode property was not being respected. Specifically, the addActivationHandler logic ran regardless of the applyMode value, causing unintended behavior.

To address this, we introduced a conditional check for this.state.applyMode === 'auto' before invoking addActivationHandler. This ensures that activation logic only applies when the applyMode is set to auto.

Changes have been tested locally using npm link --force ../scenes/packages/scenes.

Demo

demo.mov

@joannaWebDev joannaWebDev self-assigned this Dec 19, 2024
Copy link
Member

@axelavargas axelavargas left a comment

Choose a reason for hiding this comment

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

Hey @joannaWebDev 😊, great work with this one 🏅 , can you add a unit test for this scenario, https://github.com/grafana/scenes/blob/main/packages/scenes/src/variables/groupby/GroupByVariable.test.tsx

@joannaWebDev
Copy link
Contributor Author

Hey @joannaWebDev 😊, great work with this one 🏅 , can you add a unit test for this scenario, https://github.com/grafana/scenes/blob/main/packages/scenes/src/variables/groupby/GroupByVariable.test.tsx

Sure thing. Done

Copy link
Member

@axelavargas axelavargas left a comment

Choose a reason for hiding this comment

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

🥇 Great work, @joannaWebDev !

@joannaWebDev joannaWebDev merged commit fc15e94 into main Dec 19, 2024
5 checks passed
@joannaWebDev joannaWebDev deleted the joannaWebDev/fix-groupBy-applyMode branch December 19, 2024 10:43
@scenes-repo-bot-access-token
Copy link

🚀 PR was released in v5.36.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants