-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Dashboard: Add Alert icon in library panels #107723
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
Conversation
@@ -50,6 +51,10 @@ export class LibraryPanelBehavior extends SceneObjectBase<LibraryPanelBehaviorSt | |||
|
|||
const libPanelModel = new PanelModel(libPanel.model); | |||
|
|||
// Use dashboard panel ID for data layer filtering | |||
// const dashboardPanelId = getPanelIdForVizPanel(vizPanel); | |||
// libPanelModel.id = dashboardPanelId; |
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.
Should these lines be commented out?
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.
Lol, I was testing something locally and ended up commenting out these lines, good catch!
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.
LGTM!
* Use panel.id from the dashboard to filter alterts properly * add unit test * Fix linting * add fix back * fix betterer in test, use same pattern as DashboardDatasourceBehaviour
What is this feature?
This fixes the issue where alert icons were not displayed in library panels when alert rules were configured for them.
When an alert rule is created for a panel, it stores the
dashboard.uid
and thepanel.id
. When loading a library panel, theLibraryPanelBehavior
retrieves the library panel model and replaces the current panel state in the dashboard. However, the library panel was using its original panel ID instead of the dashboard panel ID, causing a mismatch in the data layer filtering.The fix ensures that library panels use the dashboard panel ID (extracted from the
VizPanel
key) for data provider filtering, allowing alert states to be properly matched and displayed.Before
BeforeFixAlert.mp4
After
AfterFix.mp4
Which issue(s) does this PR fix?:
Fixes #107494
Special notes for your reviewer:
Please check that: