Skip to content

Commit deb245f

Browse files
jeinwagtorkelo
authored andcommitted
fix repeat panels (grafana#5796)
1 parent 7a1011a commit deb245f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

public/app/features/dashboard/dynamic_dashboard_srv.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export class DynamicDashboardSrv {
5454
// clean up old left overs
5555
row.panels = _.without(row.panels, panel);
5656
j = j - 1;
57+
} else if (row.repeat || row.repeatRowId) {
58+
continue;
5759
} else if (!_.isEmpty(panel.scopedVars) && panel.repeatIteration !== this.iteration) {
5860
panel.scopedVars = {};
5961
}
@@ -120,7 +122,6 @@ export class DynamicDashboardSrv {
120122
panel = copy.panels[i];
121123
panel.scopedVars = {};
122124
panel.scopedVars[variable.name] = option;
123-
panel.repeatIteration = this.iteration;
124125
}
125126
});
126127
}

public/app/features/dashboard/specs/dynamic_dashboard_srv_specs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ dynamicDashScenario('given dashboard with row repeat', function(ctx) {
165165

166166
it('should generate a repeartRowId based on repeat row index', function() {
167167
expect(ctx.rows[1].repeatRowId).to.be(1);
168+
expect(ctx.rows[1].repeatIteration).to.be(ctx.dynamicDashboardSrv.iteration);
168169
});
169170

170171
it('should set scopedVars on row panels', function() {

0 commit comments

Comments
 (0)