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
DashboardScene: adjust lib panel as a dashboard datasource refresh logic #87120
Conversation
@@ -10,10 +10,15 @@ export class PanelModelCompatibilityWrapper implements PanelModel { | |||
constructor(private _vizPanel: VizPanel) {} | |||
|
|||
public get id() { | |||
// console.log('this._vizPanel.parent', this._vizPanel.parent); | |||
// console.log('this._vizPanel', this._vizPanel); | |||
|
|||
const id = getPanelIdForVizPanel( |
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 we should use getPanelIdForLibraryVizPanel
instead of modifying getPanelIdForVizPanel
here. So I think we can check if the vizPanel parent is LibraryVizPanel
or not and call the appropriate function for it.
// return parseInt(panel.state.key!.replace('panel-', ''), 10); | ||
|
||
let key = ('panelKey' in panel.state ? panel.state.panelKey : panel.state.key) as string; | ||
|
||
return parseInt(key.replace('panel-', ''), 10); |
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 #87125 is enough / simpler fix
if (!panel.parent.isActive) { | ||
panel.parent.activate(); | ||
} |
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.
need to call the deactivation function returned by activate (in the deactivation function for this behavior)
This PR must be merged before a backport PR will be created. |
Tested and the problem is solved 💯 |
…refresh logic (#87232) DashboardScene: adjust lib panel as a dashboard datasource refresh logic (#87120) * activate library viz panel and adjust id extractor * revert parts that are fixed in #87125 * clean up after activation handler (cherry picked from commit afbd02c) Co-authored-by: Sergej-Vlasov <37613182+Sergej-Vlasov@users.noreply.github.com>
Not sure if this is not caused by a more global issue.
So far seems like two issues were causing the bug:
panel id was not extracted correctly -fixed in DashboardScene: Fixes issue referring to library panel in dashboard data source #87125panel.state.key
inLibraryVizPanel
was uuid andpanelKey
was the correct propertydashboard-scene/scene/DashboardDatasourceBehaviour.tsx
Fixes #87128
Special notes for your reviewer:
Please check that: