From 2235664bedc50b7261b61f9c582fe207cafc18e4 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Tue, 31 Aug 2021 16:42:43 +0200 Subject: [PATCH] Fix ModalService refactor bugs (#1168) --- .../src/app/providers/clients/clients.component.ts | 2 +- bitwarden_license/src/app/providers/providers.module.ts | 9 ++++++++- jslib | 2 +- src/app/send/send.component.ts | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bitwarden_license/src/app/providers/clients/clients.component.ts b/bitwarden_license/src/app/providers/clients/clients.component.ts index 2bf7c1d123..a745646d4e 100644 --- a/bitwarden_license/src/app/providers/clients/clients.component.ts +++ b/bitwarden_license/src/app/providers/clients/clients.component.ts @@ -124,7 +124,7 @@ export class ClientsComponent implements OnInit { } async addExistingOrganization() { - const [modal, childComponent] = await this.modalService.openViewRef(AddOrganizationComponent, this.addModalRef, comp => { + const [modal] = await this.modalService.openViewRef(AddOrganizationComponent, this.addModalRef, comp => { comp.providerId = this.providerId; comp.organizations = this.addableOrganizations; comp.onAddedOrganization.subscribe(async () => { diff --git a/bitwarden_license/src/app/providers/providers.module.ts b/bitwarden_license/src/app/providers/providers.module.ts index df69031810..9eddcd2426 100644 --- a/bitwarden_license/src/app/providers/providers.module.ts +++ b/bitwarden_license/src/app/providers/providers.module.ts @@ -1,7 +1,10 @@ import { CommonModule } from '@angular/common'; +import { ComponentFactoryResolver } from '@angular/core'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { ModalService } from 'jslib-angular/services/modal.service'; + import { ProviderGuardService } from './services/provider-guard.service'; import { ProviderTypeGuardService } from './services/provider-type-guard.service'; import { ProviderService } from './services/provider.service'; @@ -59,4 +62,8 @@ import { OssModule } from 'src/app/oss.module'; ProviderTypeGuardService, ], }) -export class ProvidersModule {} +export class ProvidersModule { + constructor(modalService: ModalService, componentFactoryResolver: ComponentFactoryResolver) { + modalService.registerComponentFactoryResolver(AddOrganizationComponent, componentFactoryResolver); + } +} diff --git a/jslib b/jslib index f02720a1c6..d50531886b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit f02720a1c654adeb73d68b73bb61fcf7415041f4 +Subproject commit d50531886bb8a797e98a3aeea08a7ed54e768788 diff --git a/src/app/send/send.component.ts b/src/app/send/send.component.ts index 045b4eaf78..09eef6c98a 100644 --- a/src/app/send/send.component.ts +++ b/src/app/send/send.component.ts @@ -72,7 +72,7 @@ export class SendComponent extends BaseSendComponent { async editSend(send: SendView) { const [modal, childComponent] = await this.modalService.openViewRef(AddEditComponent, this.sendAddEditModalRef, comp => { - childComponent.sendId = send == null ? null : send.id; + comp.sendId = send == null ? null : send.id; comp.onSavedSend.subscribe(async (s: SendView) => { modal.close(); await this.load();