1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

[PM-3919] Remove deprecated Angular functionality from ModalService (#6285)

Remove deprecated Angular functionality from ModalService so we can upgrade Angular.
This commit is contained in:
Oscar Hinton
2024-01-22 10:36:42 +01:00
committed by GitHub
parent 487d17daed
commit 7bb4ea842f
6 changed files with 29 additions and 107 deletions

View File

@@ -1,7 +1,6 @@
import {
ChangeDetectorRef,
Component,
ComponentFactoryResolver,
EventEmitter,
Input,
Output,
@@ -45,7 +44,6 @@ export class PolicyEditComponent {
private policyApiService: PolicyApiServiceAbstraction,
private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService,
private componentFactoryResolver: ComponentFactoryResolver,
private cdr: ChangeDetectorRef,
private logService: LogService,
) {}
@@ -54,8 +52,7 @@ export class PolicyEditComponent {
await this.load();
this.loading = false;
const factory = this.componentFactoryResolver.resolveComponentFactory(this.policy.component);
this.policyComponent = this.policyFormRef.createComponent(factory)
this.policyComponent = this.policyFormRef.createComponent(this.policy.component)
.instance as BasePolicyComponent;
this.policyComponent.policy = this.policy;
this.policyComponent.policyResponse = this.policyResponse;

View File

@@ -2,19 +2,15 @@ import { DialogConfig, DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
import { Component, Inject } from "@angular/core";
import { FormBuilder } from "@angular/forms";
import { UserVerificationPromptComponent as BaseUserVerificationPrompt } from "@bitwarden/angular/auth/components/user-verification-prompt.component";
import { ModalConfig } from "@bitwarden/angular/services/modal.service";
import {
UserVerificationPromptComponent as BaseUserVerificationPrompt,
UserVerificationPromptParams,
} from "@bitwarden/angular/auth/components/user-verification-prompt.component";
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { DialogService } from "@bitwarden/components";
export interface UserVerificationPromptParams {
confirmDescription: string;
confirmButtonText: string;
modalTitle: string;
}
@Component({
templateUrl: "user-verification-prompt.component.html",
})
@@ -27,16 +23,7 @@ export class UserVerificationPromptComponent extends BaseUserVerificationPrompt
platformUtilsService: PlatformUtilsService,
i18nService: I18nService,
) {
// TODO: Remove when BaseUserVerificationPrompt has support for CL
const modalConfig: ModalConfig = { data };
super(
null,
modalConfig,
userVerificationService,
formBuilder,
platformUtilsService,
i18nService,
);
super(null, data, userVerificationService, formBuilder, platformUtilsService, i18nService);
}
override close(success: boolean) {

View File

@@ -1,4 +1,4 @@
import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector } from "@angular/core";
import { Injectable, Injector } from "@angular/core";
import * as jq from "jquery";
import { first } from "rxjs/operators";
@@ -13,12 +13,10 @@ export class ModalService extends BaseModalService {
modalOpen = false;
constructor(
componentFactoryResolver: ComponentFactoryResolver,
applicationRef: ApplicationRef,
injector: Injector,
private messagingService: MessagingService,
) {
super(componentFactoryResolver, applicationRef, injector);
super(injector);
}
protected setupHandlers(modalRef: ModalRef) {