mirror of https://github.com/grafana/grafana.git
AutoGridItem: Reset repeatedPanels when disabling repeats (#111072)
reset repeatedPanels when disabling repeats
This commit is contained in:
parent
6c35bb2c6e
commit
f73cb477cb
|
@ -141,6 +141,10 @@ export class AutoGridItem extends SceneObjectBase<AutoGridItemState> implements
|
|||
public setRepeatByVariable(variableName: string | undefined) {
|
||||
const stateUpdate: Partial<AutoGridItemState> = { variableName };
|
||||
|
||||
if (!variableName) {
|
||||
stateUpdate.repeatedPanels = undefined;
|
||||
}
|
||||
|
||||
if (this.state.body.state.$variables) {
|
||||
this.state.body.setState({ $variables: undefined });
|
||||
}
|
||||
|
|
|
@ -234,6 +234,10 @@ export class DashboardGridItem
|
|||
public setRepeatByVariable(variableName: string | undefined) {
|
||||
const stateUpdate: Partial<DashboardGridItemState> = { variableName };
|
||||
|
||||
if (!variableName) {
|
||||
stateUpdate.repeatedPanels = undefined;
|
||||
}
|
||||
|
||||
if (variableName && !this.state.repeatDirection) {
|
||||
stateUpdate.repeatDirection = 'h';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue