[Port] Fix modelview container removal issue (#16753) (#16757)

* Fix modelview container removal issue (#16753)

* include azdata fix
This commit is contained in:
Charles Gagnon
2021-08-12 14:05:24 -07:00
committed by GitHub
parent f92db4ae76
commit 66ef175501
2 changed files with 4 additions and 4 deletions

2
src/sql/azdata.d.ts vendored
View File

@@ -2691,7 +2691,7 @@ declare module 'azdata' {
}
// Building on top of flex item
export interface SplitViewBuilder extends ContainerBuilder<SplitViewContainer, SplitViewLayout, FlexItemLayout, SplitViewContainer> {
export interface SplitViewBuilder extends ContainerBuilder<SplitViewContainer, SplitViewLayout, FlexItemLayout, ComponentProperties> {
}
export interface DivBuilder extends ContainerBuilder<DivContainer, DivLayout, DivItemLayout, DivContainerProperties> {

View File

@@ -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);
});
}