From 967fb959a56302385d8eb55cbafd0ff4c53cc9fe Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Thu, 1 Jun 2023 19:18:27 -0400 Subject: [PATCH] PM-1049 - Comment cleanup and dependency cleanup across all login-decryption-options comps --- .../login-decryption-options.component.ts | 11 +----- .../login-decryption-options.component.ts | 11 +----- .../login-decryption-options.component.ts | 12 +----- ...base-login-decryption-options.component.ts | 38 +------------------ 4 files changed, 7 insertions(+), 65 deletions(-) diff --git a/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts b/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts index 08a0e839e0..16d5f72887 100644 --- a/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts +++ b/apps/browser/src/auth/popup/login-decryption-options/login-decryption-options.component.ts @@ -3,20 +3,13 @@ import { FormBuilder } from "@angular/forms"; import { BaseLoginDecryptionOptionsComponent } from "@bitwarden/angular/auth/components/base-login-decryption-options.component"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/abstractions/devices/devices-api.service.abstraction"; -import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; @Component({ selector: "browser-login-decryption-options", templateUrl: "login-decryption-options.component.html", }) export class LoginDecryptionOptionsComponent extends BaseLoginDecryptionOptionsComponent { - constructor( - formBuilder: FormBuilder, - devicesApiService: DevicesApiServiceAbstraction, - organizationService: OrganizationService, - policyService: PolicyService - ) { - super(formBuilder, devicesApiService, organizationService, policyService); + constructor(formBuilder: FormBuilder, devicesApiService: DevicesApiServiceAbstraction) { + super(formBuilder, devicesApiService); } } diff --git a/apps/desktop/src/auth/login/login-decryption-options/login-decryption-options.component.ts b/apps/desktop/src/auth/login/login-decryption-options/login-decryption-options.component.ts index 27180d5a85..ba8e7e8617 100644 --- a/apps/desktop/src/auth/login/login-decryption-options/login-decryption-options.component.ts +++ b/apps/desktop/src/auth/login/login-decryption-options/login-decryption-options.component.ts @@ -3,20 +3,13 @@ import { FormBuilder } from "@angular/forms"; import { BaseLoginDecryptionOptionsComponent } from "@bitwarden/angular/auth/components/base-login-decryption-options.component"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/abstractions/devices/devices-api.service.abstraction"; -import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; @Component({ selector: "desktop-login-decryption-options", templateUrl: "login-decryption-options.component.html", }) export class LoginDecryptionOptionsComponent extends BaseLoginDecryptionOptionsComponent { - constructor( - formBuilder: FormBuilder, - devicesApiService: DevicesApiServiceAbstraction, - organizationService: OrganizationService, - policyService: PolicyService - ) { - super(formBuilder, devicesApiService, organizationService, policyService); + constructor(formBuilder: FormBuilder, devicesApiService: DevicesApiServiceAbstraction) { + super(formBuilder, devicesApiService); } } diff --git a/apps/web/src/app/auth/login/login-decryption-options/login-decryption-options.component.ts b/apps/web/src/app/auth/login/login-decryption-options/login-decryption-options.component.ts index beade5bf0a..8c40dc664e 100644 --- a/apps/web/src/app/auth/login/login-decryption-options/login-decryption-options.component.ts +++ b/apps/web/src/app/auth/login/login-decryption-options/login-decryption-options.component.ts @@ -3,20 +3,12 @@ import { FormBuilder } from "@angular/forms"; import { BaseLoginDecryptionOptionsComponent } from "@bitwarden/angular/auth/components/base-login-decryption-options.component"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/abstractions/devices/devices-api.service.abstraction"; -import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; - @Component({ selector: "web-login-decryption-options", templateUrl: "login-decryption-options.component.html", }) export class LoginDecryptionOptionsComponent extends BaseLoginDecryptionOptionsComponent { - constructor( - formBuilder: FormBuilder, - devicesApiService: DevicesApiServiceAbstraction, - organizationService: OrganizationService, - policyService: PolicyService - ) { - super(formBuilder, devicesApiService, organizationService, policyService); + constructor(formBuilder: FormBuilder, devicesApiService: DevicesApiServiceAbstraction) { + super(formBuilder, devicesApiService); } } diff --git a/libs/angular/src/auth/components/base-login-decryption-options.component.ts b/libs/angular/src/auth/components/base-login-decryption-options.component.ts index a49e96d097..e182c81040 100644 --- a/libs/angular/src/auth/components/base-login-decryption-options.component.ts +++ b/libs/angular/src/auth/components/base-login-decryption-options.component.ts @@ -3,16 +3,9 @@ import { FormBuilder } from "@angular/forms"; import { Subject } from "rxjs"; import { DevicesApiServiceAbstraction } from "@bitwarden/common/abstractions/devices/devices-api.service.abstraction"; -import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { Policy } from "@bitwarden/common/admin-console/models/domain/policy"; import { DeviceType } from "@bitwarden/common/enums/device-type.enum"; -// TODO: clean up these comments -// Existing patterns for cross client components: -// 1. Create a new base component here in libs/angular -// 2. for each client, create a new component that extends the base component with its own client specific logic - @Directive() export class BaseLoginDecryptionOptionsComponent implements OnInit, OnDestroy { private componentDestroyed$: Subject = new Subject(); @@ -27,9 +20,7 @@ export class BaseLoginDecryptionOptionsComponent implements OnInit, OnDestroy { constructor( protected formBuilder: FormBuilder, - protected devicesApiService: DevicesApiServiceAbstraction, - protected organizationService: OrganizationService, - protected policyService: PolicyService + protected devicesApiService: DevicesApiServiceAbstraction ) {} async ngOnInit() { @@ -65,33 +56,6 @@ export class BaseLoginDecryptionOptionsComponent implements OnInit, OnDestroy { break; } } - - // this.policyService - // .get$(PolicyType.ResetPassword) - // .pipe( - // filter((policy) => policy != null), // why is this filter needed? - // takeUntil(this.componentDestroyed$) - // ) - // .subscribe((policy) => { - // console.log("policy", policy); - // // this.vaultTimeoutPolicy = policy; - // }); - - // this.policyService.policies$ - // .pipe( - // map((policies) => policies.filter((policy) => policy.type === PolicyType.ResetPassword)), - // takeUntil(this.componentDestroyed$) - // ) - // .subscribe((policies) => { - // console.log("policies", policies); - // // this.policies = policies; - // // this.loaded = true; - // }); - - // const resetPasswordPolicy = policies - // .filter((policy) => policy.type === PolicyType.ResetPassword) - // .find((p) => p.organizationId === this.organization.id); - // this.orgResetPasswordPolicyEnabled = resetPasswordPolicy?.enabled; } ngOnDestroy(): void {