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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user