mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[PM-2340] Enable use-lifecycle-interface (#5488)
Enables one of the recommended rules of @angular-eslint. Since this rule was fairly trivial to fix and has no QA effects it seemed reasonable to migrate all code.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, NgZone } from "@angular/core";
|
||||
import { Component, NgZone, OnInit } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
@@ -36,7 +36,7 @@ import { fido2PopoutSessionData$ } from "../../vault/popup/utils/fido2-popout-se
|
||||
selector: "app-lock",
|
||||
templateUrl: "lock.component.html",
|
||||
})
|
||||
export class LockComponent extends BaseLockComponent {
|
||||
export class LockComponent extends BaseLockComponent implements OnInit {
|
||||
private isInitialLockScreen: boolean;
|
||||
|
||||
biometricError: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectorRef, Component, OnInit } from "@angular/core";
|
||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
import {
|
||||
BehaviorSubject,
|
||||
@@ -52,7 +52,7 @@ import { AwaitDesktopDialogComponent } from "./await-desktop-dialog.component";
|
||||
templateUrl: "account-security.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class AccountSecurityComponent implements OnInit {
|
||||
export class AccountSecurityComponent implements OnInit, OnDestroy {
|
||||
protected readonly VaultTimeoutAction = VaultTimeoutAction;
|
||||
|
||||
availableVaultTimeoutActions: VaultTimeoutAction[] = [];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DialogModule } from "@angular/cdk/dialog";
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
|
||||
import { Subject, Subscription, filter, firstValueFrom, takeUntil } from "rxjs";
|
||||
|
||||
@@ -38,7 +38,10 @@ import { ZonedMessageListenerService } from "../../platform/browser/zoned-messag
|
||||
],
|
||||
providers: [I18nPipe],
|
||||
})
|
||||
export class TwoFactorAuthDuoComponent extends TwoFactorAuthDuoBaseComponent {
|
||||
export class TwoFactorAuthDuoComponent
|
||||
extends TwoFactorAuthDuoBaseComponent
|
||||
implements OnInit, OnDestroy
|
||||
{
|
||||
private destroy$ = new Subject<void>();
|
||||
duoResultSubscription: Subscription;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DialogModule } from "@angular/cdk/dialog";
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, inject } from "@angular/core";
|
||||
import { Component, OnInit, inject } from "@angular/core";
|
||||
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
|
||||
|
||||
import { TwoFactorAuthEmailComponent as TwoFactorAuthEmailBaseComponent } from "@bitwarden/angular/auth/components/two-factor-auth/two-factor-auth-email.component";
|
||||
@@ -34,7 +34,7 @@ import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
|
||||
],
|
||||
providers: [I18nPipe],
|
||||
})
|
||||
export class TwoFactorAuthEmailComponent extends TwoFactorAuthEmailBaseComponent {
|
||||
export class TwoFactorAuthEmailComponent extends TwoFactorAuthEmailBaseComponent implements OnInit {
|
||||
private dialogService = inject(DialogService);
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, Inject, OnInit } from "@angular/core";
|
||||
import { Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||
import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
|
||||
import { ActivatedRoute, Router, RouterLink } from "@angular/router";
|
||||
|
||||
@@ -71,7 +71,10 @@ import { TwoFactorAuthEmailComponent } from "./two-factor-auth-email.component";
|
||||
],
|
||||
providers: [I18nPipe],
|
||||
})
|
||||
export class TwoFactorAuthComponent extends BaseTwoFactorAuthComponent implements OnInit {
|
||||
export class TwoFactorAuthComponent
|
||||
extends BaseTwoFactorAuthComponent
|
||||
implements OnInit, OnDestroy
|
||||
{
|
||||
constructor(
|
||||
protected loginStrategyService: LoginStrategyServiceAbstraction,
|
||||
protected router: Router,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, Inject } from "@angular/core";
|
||||
import { Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { Subject, Subscription, firstValueFrom } from "rxjs";
|
||||
import { filter, first, takeUntil } from "rxjs/operators";
|
||||
@@ -37,7 +37,7 @@ import { closeTwoFactorAuthPopout } from "./utils/auth-popout-window";
|
||||
selector: "app-two-factor",
|
||||
templateUrl: "two-factor.component.html",
|
||||
})
|
||||
export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
export class TwoFactorComponent extends BaseTwoFactorComponent implements OnInit, OnDestroy {
|
||||
private destroy$ = new Subject<void>();
|
||||
inPopout = BrowserPopupUtils.inPopout(window);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Location } from "@angular/common";
|
||||
import { Component, NgZone } from "@angular/core";
|
||||
import { Component, NgZone, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
selector: "app-generator",
|
||||
templateUrl: "generator.component.html",
|
||||
})
|
||||
export class GeneratorComponent extends BaseGeneratorComponent {
|
||||
export class GeneratorComponent extends BaseGeneratorComponent implements OnInit {
|
||||
private addEditCipherInfo: AddEditCipherInfo;
|
||||
private cipherState: CipherView;
|
||||
private cipherService: CipherService;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DatePipe, Location } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
@@ -26,7 +26,7 @@ import { FilePopoutUtilsService } from "../services/file-popout-utils.service";
|
||||
templateUrl: "send-add-edit.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class SendAddEditComponent extends BaseAddEditComponent {
|
||||
export class SendAddEditComponent extends BaseAddEditComponent implements OnInit {
|
||||
// Options header
|
||||
showOptions = false;
|
||||
// File visibility
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectorRef, Component, NgZone } from "@angular/core";
|
||||
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
import { SendComponent as BaseSendComponent } from "@bitwarden/angular/tools/send/send.component";
|
||||
@@ -26,7 +26,7 @@ const ComponentId = "SendComponent";
|
||||
selector: "app-send-groupings",
|
||||
templateUrl: "send-groupings.component.html",
|
||||
})
|
||||
export class SendGroupingsComponent extends BaseSendComponent {
|
||||
export class SendGroupingsComponent extends BaseSendComponent implements OnInit, OnDestroy {
|
||||
// Header
|
||||
showLeftHeader = true;
|
||||
// State Handling
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Location } from "@angular/common";
|
||||
import { ChangeDetectorRef, Component, NgZone } from "@angular/core";
|
||||
import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -27,7 +27,7 @@ const ComponentId = "SendTypeComponent";
|
||||
selector: "app-send-type",
|
||||
templateUrl: "send-type.component.html",
|
||||
})
|
||||
export class SendTypeComponent extends BaseSendComponent {
|
||||
export class SendTypeComponent extends BaseSendComponent implements OnInit, OnDestroy {
|
||||
groupingTitle: string;
|
||||
// State Handling
|
||||
state: BrowserComponentState;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DatePipe, Location } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import qrcodeParser from "qrcode-parser";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
@@ -39,7 +39,7 @@ import { closeAddEditVaultItemPopout, VaultPopoutType } from "../../utils/vault-
|
||||
templateUrl: "add-edit.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class AddEditComponent extends BaseAddEditComponent {
|
||||
export class AddEditComponent extends BaseAddEditComponent implements OnInit {
|
||||
currentUris: string[];
|
||||
showAttachments = true;
|
||||
openAttachmentsInPopup: boolean;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Location } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -20,7 +20,7 @@ import { DialogService } from "@bitwarden/components";
|
||||
templateUrl: "attachments.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class AttachmentsComponent extends BaseAttachmentsComponent {
|
||||
export class AttachmentsComponent extends BaseAttachmentsComponent implements OnInit {
|
||||
openedAttachmentsInPopup: boolean;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Location } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -17,7 +17,7 @@ import { CollectionService } from "@bitwarden/common/vault/abstractions/collecti
|
||||
templateUrl: "collections.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class CollectionsComponent extends BaseCollectionsComponent {
|
||||
export class CollectionsComponent extends BaseCollectionsComponent implements OnInit {
|
||||
constructor(
|
||||
collectionService: CollectionService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Location } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi
|
||||
templateUrl: "password-history.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class PasswordHistoryComponent extends BasePasswordHistoryComponent {
|
||||
export class PasswordHistoryComponent extends BasePasswordHistoryComponent implements OnInit {
|
||||
constructor(
|
||||
cipherService: CipherService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -15,7 +15,7 @@ import { CollectionService } from "@bitwarden/common/vault/abstractions/collecti
|
||||
templateUrl: "share.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class ShareComponent extends BaseShareComponent {
|
||||
export class ShareComponent extends BaseShareComponent implements OnInit {
|
||||
constructor(
|
||||
collectionService: CollectionService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DatePipe, Location } from "@angular/common";
|
||||
import { ChangeDetectorRef, Component, NgZone } from "@angular/core";
|
||||
import { ChangeDetectorRef, Component, NgZone, OnInit, OnDestroy } from "@angular/core";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { Subject, firstValueFrom, takeUntil, Subscription } from "rxjs";
|
||||
import { first } from "rxjs/operators";
|
||||
@@ -52,7 +52,7 @@ type LoadAction = typeof AUTOFILL_ID | typeof SHOW_AUTOFILL_BUTTON | CopyAction;
|
||||
selector: "app-vault-view",
|
||||
templateUrl: "view.component.html",
|
||||
})
|
||||
export class ViewComponent extends BaseViewComponent {
|
||||
export class ViewComponent extends BaseViewComponent implements OnInit, OnDestroy {
|
||||
showAttachments = true;
|
||||
pageDetails: any[] = [];
|
||||
tab: any;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { first } from "rxjs/operators";
|
||||
@@ -16,7 +16,7 @@ import { DialogService } from "@bitwarden/components";
|
||||
templateUrl: "folder-add-edit.component.html",
|
||||
})
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
export class FolderAddEditComponent extends BaseFolderAddEditComponent {
|
||||
export class FolderAddEditComponent extends BaseFolderAddEditComponent implements OnInit {
|
||||
constructor(
|
||||
folderService: FolderService,
|
||||
folderApiService: FolderApiServiceAbstraction,
|
||||
|
||||
Reference in New Issue
Block a user