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
Azure Monitor: Fix subscription selector when changing data sources #56284
Conversation
Backend code coverage report for PR #56284 |
Frontend code coverage report for PR #56284
|
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/36063 |
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 work! A really nice touch with checking on the intersection of subscriptions 👍
}); | ||
render(<ArgQueryEditor {...defaultProps} onChange={onChange} query={query} />); | ||
expect(await screen.findByTestId('azure-monitor-arg-query-editor-with-experimental-ui')).toBeInTheDocument(); | ||
expect(onChange).not.toHaveBeenCalledWith(expect.objectContaining({ subscriptions: ['foo'] })); |
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.
Nit: This assertion is unneeded as there's no reference to subscriptions: ['foo']
in this test.
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/36337 |
What this PR does / why we need it:
When changing the data source, the list of subscriptions will change. This PR includes two fixes to adapt the Azure Resource Graph editor to that situation:
useRef
does not change when using the editor in the template variable section (because the editor does not get re-mounted). I have changed that solution to useuseMemo
instead.Screencast.from.04-10-22.12.47.35.webm
Which issue(s) this PR fixes:
Fixes #55193
Special notes for your reviewer: