mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
fix repeat panels (#5796)
This commit is contained in:
parent
0d26bc63ae
commit
cbf0e77add
@ -54,6 +54,8 @@ export class DynamicDashboardSrv {
|
||||
// clean up old left overs
|
||||
row.panels = _.without(row.panels, panel);
|
||||
j = j - 1;
|
||||
} else if (row.repeat || row.repeatRowId) {
|
||||
continue;
|
||||
} else if (!_.isEmpty(panel.scopedVars) && panel.repeatIteration !== this.iteration) {
|
||||
panel.scopedVars = {};
|
||||
}
|
||||
@ -120,7 +122,6 @@ export class DynamicDashboardSrv {
|
||||
panel = copy.panels[i];
|
||||
panel.scopedVars = {};
|
||||
panel.scopedVars[variable.name] = option;
|
||||
panel.repeatIteration = this.iteration;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ dynamicDashScenario('given dashboard with row repeat', function(ctx) {
|
||||
|
||||
it('should generate a repeartRowId based on repeat row index', function() {
|
||||
expect(ctx.rows[1].repeatRowId).to.be(1);
|
||||
expect(ctx.rows[1].repeatIteration).to.be(ctx.dynamicDashboardSrv.iteration);
|
||||
});
|
||||
|
||||
it('should set scopedVars on row panels', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user