From 66ef17550154f47331cde942424e1a967b96349e Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 12 Aug 2021 14:05:24 -0700 Subject: [PATCH] [Port] Fix modelview container removal issue (#16753) (#16757) * Fix modelview container removal issue (#16753) * include azdata fix --- src/sql/azdata.d.ts | 2 +- src/sql/workbench/browser/modelComponents/viewBase.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index 864aedc491..acc5487379 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -2691,7 +2691,7 @@ declare module 'azdata' { } // Building on top of flex item - export interface SplitViewBuilder extends ContainerBuilder { + export interface SplitViewBuilder extends ContainerBuilder { } export interface DivBuilder extends ContainerBuilder { diff --git a/src/sql/workbench/browser/modelComponents/viewBase.ts b/src/sql/workbench/browser/modelComponents/viewBase.ts index 8737c3bb36..59b31faf8a 100644 --- a/src/sql/workbench/browser/modelComponents/viewBase.ts +++ b/src/sql/workbench/browser/modelComponents/viewBase.ts @@ -81,8 +81,8 @@ export abstract class ViewBase extends AngularDisposable implements IModelView { return descriptor; } - private removeComponent(component: IComponentShape): void { - this.logService.debug(`Removing component ${component.id} from view ${this.id}`); + private removeComponentChildren(component: IComponentShape): void { + this.logService.debug(`Removing children of component ${component.id} from view ${this.id}`); if (component.itemConfigs) { for (let item of component.itemConfigs) { this.removeFromContainer(component.id, item); @@ -138,8 +138,8 @@ export abstract class ViewBase extends AngularDisposable implements IModelView { return; } this.logService.debug(`Removing component ${itemConfig.componentShape.id} from container ${containerId}`); + this.removeComponentChildren(itemConfig.componentShape); component.removeFromContainer({ id: itemConfig.componentShape.id, type: componentRegistry.getIdForTypeMapping(itemConfig.componentShape.type) }); - this.removeComponent(itemConfig.componentShape); }); }