1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-06 18:57:56 +01:00

PM-1049 - Comment cleanup and dependency cleanup across all login-decryption-options comps

This commit is contained in:
Jared Snider 2023-06-01 19:18:27 -04:00
parent 786d197a14
commit 967fb959a5
No known key found for this signature in database
GPG Key ID: A149DDD612516286
4 changed files with 7 additions and 65 deletions

View File

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

View File

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

View File

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

View File

@ -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<void> = 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 {