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