From f50f5ef70bfe9a86e0f3ca374fc7c870d73808ae Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 23 Jan 2025 19:22:22 +0100 Subject: [PATCH] Remove unused imports for modal service (#12904) We're auditing the remaining usages of ModalService so that we may kill the feature. These are unused imports which can be safely removed. --- .../app/admin-console/common/base.people.component.ts | 2 -- .../organizations/members/members.component.ts | 2 -- .../organizations/settings/account.component.ts | 4 ---- .../settings/two-factor-setup.component.ts | 3 --- .../settings/two-factor/two-factor-setup.component.ts | 11 +---------- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/apps/web/src/app/admin-console/common/base.people.component.ts b/apps/web/src/app/admin-console/common/base.people.component.ts index 10632582e99..07ae67ac33b 100644 --- a/apps/web/src/app/admin-console/common/base.people.component.ts +++ b/apps/web/src/app/admin-console/common/base.people.component.ts @@ -6,7 +6,6 @@ import { firstValueFrom, concatMap, map, lastValueFrom, startWith, debounceTime import { SearchPipe } from "@bitwarden/angular/pipes/search.pipe"; import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; import { OrganizationManagementPreferencesService } from "@bitwarden/common/admin-console/abstractions/organization-management-preferences/organization-management-preferences.service"; @@ -123,7 +122,6 @@ export abstract class BasePeopleComponent< protected platformUtilsService: PlatformUtilsService, protected keyService: KeyService, protected validationService: ValidationService, - protected modalService: ModalService, private logService: LogService, private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe, diff --git a/apps/web/src/app/admin-console/organizations/members/members.component.ts b/apps/web/src/app/admin-console/organizations/members/members.component.ts index 57b352a2047..5e1da94be75 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/members.component.ts @@ -25,7 +25,6 @@ import { CollectionDetailsResponse, } from "@bitwarden/admin-console/common"; import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction"; import { @@ -133,7 +132,6 @@ export class MembersComponent extends BaseMembersComponent private groupService: GroupApiService, private collectionService: CollectionService, private billingApiService: BillingApiServiceAbstraction, - private modalService: ModalService, private configService: ConfigService, ) { super( diff --git a/apps/web/src/app/admin-console/organizations/settings/account.component.ts b/apps/web/src/app/admin-console/organizations/settings/account.component.ts index 0cc0f85a008..f2834b61096 100644 --- a/apps/web/src/app/admin-console/organizations/settings/account.component.ts +++ b/apps/web/src/app/admin-console/organizations/settings/account.component.ts @@ -14,7 +14,6 @@ import { takeUntil, } from "rxjs"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction"; import { getOrganizationById, @@ -26,7 +25,6 @@ import { OrganizationUpdateRequest } from "@bitwarden/common/admin-console/model import { OrganizationResponse } from "@bitwarden/common/admin-console/models/response/organization.response"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; @@ -85,7 +83,6 @@ export class AccountComponent implements OnInit, OnDestroy { private destroy$ = new Subject(); constructor( - private modalService: ModalService, private i18nService: I18nService, private route: ActivatedRoute, private platformUtilsService: PlatformUtilsService, @@ -97,7 +94,6 @@ export class AccountComponent implements OnInit, OnDestroy { private dialogService: DialogService, private formBuilder: FormBuilder, private toastService: ToastService, - private configService: ConfigService, ) {} async ngOnInit() { diff --git a/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts b/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts index bc28270d3a7..d07f674e813 100644 --- a/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts +++ b/apps/web/src/app/admin-console/organizations/settings/two-factor-setup.component.ts @@ -6,7 +6,6 @@ import { ActivatedRoute } from "@angular/router"; import { concatMap, takeUntil, map, lastValueFrom, firstValueFrom } from "rxjs"; import { first, tap } from "rxjs/operators"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { getOrganizationById, @@ -36,7 +35,6 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent impleme constructor( dialogService: DialogService, apiService: ApiService, - modalService: ModalService, messagingService: MessagingService, policyService: PolicyService, private route: ActivatedRoute, @@ -47,7 +45,6 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent impleme super( dialogService, apiService, - modalService, messagingService, policyService, billingAccountProfileStateService, diff --git a/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts b/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts index c561d92d759..4530692ebee 100644 --- a/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts +++ b/apps/web/src/app/auth/settings/two-factor/two-factor-setup.component.ts @@ -1,7 +1,7 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore import { DialogRef } from "@angular/cdk/dialog"; -import { Component, OnDestroy, OnInit, Type, ViewChild, ViewContainerRef } from "@angular/core"; +import { Component, OnDestroy, OnInit, ViewChild, ViewContainerRef } from "@angular/core"; import { first, firstValueFrom, @@ -14,7 +14,6 @@ import { } from "rxjs"; import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; @@ -67,7 +66,6 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { constructor( protected dialogService: DialogService, protected apiService: ApiService, - protected modalService: ModalService, protected messagingService: MessagingService, protected policyService: PolicyService, billingAccountProfileStateService: BillingAccountProfileStateService, @@ -268,13 +266,6 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy { return type === TwoFactorProviderType.OrganizationDuo; } - protected async openModal(ref: ViewContainerRef, type: Type): Promise { - const [modal, childComponent] = await this.modalService.openViewRef(type, ref); - this.modal = modal; - - return childComponent; - } - protected updateStatus(enabled: boolean, type: TwoFactorProviderType) { if (!enabled && this.modal != null) { this.modal.close();