Dynamic dashboards: Use addNewRow and addNewTab when duplicating rows and tabs (#103362)

Use addNewRow and addNewTab when duplicating rows and tabs
This commit is contained in:
Oscar Kilhed
2025-04-03 16:28:45 +03:00
committed by GitHub
parent ae700e7632
commit 370f4c2bcd
2 changed files with 2 additions and 3 deletions
@@ -90,8 +90,7 @@ export class RowsLayoutManager extends SceneObjectBase<RowsLayoutManagerState> i
public duplicateRow(row: RowItem) {
const newRow = row.duplicate();
this.setState({ rows: [...this.state.rows, newRow] });
this.publishEvent(new NewObjectAddedToCanvasEvent(newRow), true);
this.addNewRow(newRow);
}
public addNewRow(row?: RowItem): RowItem {
@@ -70,7 +70,7 @@ export class TabsLayoutManager extends SceneObjectBase<TabsLayoutManagerState> i
public duplicateTab(tab: TabItem) {
const newTab = tab.duplicate();
this.setState({ tabs: [...this.state.tabs, newTab] });
this.addNewTab(newTab);
}
public getUrlState() {