mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Dashboards: Fixes repeating by row and no refresh (#46565)
This commit is contained in:
parent
468def0c00
commit
31d141b267
@ -587,6 +587,14 @@ describe('given dashboard with row and panel repeat', () => {
|
||||
expect(panelTypes).toEqual(['row', 'graph', 'graph', 'row', 'graph', 'graph']);
|
||||
});
|
||||
|
||||
it('Row repeat should create new panel keys every repeat cycle', () => {
|
||||
// This is the first repeated panel inside the second repeated row
|
||||
// Since we create a new panel model every time (and new panel events bus) we need to create a new key here to trigger a re-mount & re-subscribe
|
||||
const key1 = dashboard.panels[3].key;
|
||||
dashboard.processRepeats();
|
||||
expect(key1).not.toEqual(dashboard.panels[3].key);
|
||||
});
|
||||
|
||||
it('should clean up old repeated panels', () => {
|
||||
dashboardJSON.panels = [
|
||||
{
|
||||
|
@ -799,7 +799,6 @@ export class DashboardModel implements TimeModel {
|
||||
updateRepeatedPanelIds(panel: PanelModel, repeatedByRow?: boolean) {
|
||||
panel.repeatPanelId = panel.id;
|
||||
panel.id = this.getNextPanelId();
|
||||
panel.key = `${panel.id}`;
|
||||
panel.repeatIteration = this.iteration;
|
||||
if (repeatedByRow) {
|
||||
panel.repeatedByRow = true;
|
||||
|
Loading…
Reference in New Issue
Block a user