From a54e78f5bb7df646640b5cfd957f52fc2273742f Mon Sep 17 00:00:00 2001 From: Nick Krantz Date: Fri, 23 Jan 2026 13:45:51 -0600 Subject: [PATCH] update to view child fixmes --- .../vault-item-dialog.component.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index b728a7cd2cc..90452ba573a 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -9,7 +9,6 @@ import { OnDestroy, OnInit, viewChild, - ViewChild, } from "@angular/core"; import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { Router } from "@angular/router"; @@ -165,14 +164,9 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { * Reference to the dialog content element. Used to scroll to the top of the dialog when switching modes. * @protected */ - // FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals - // eslint-disable-next-line @angular-eslint/prefer-signals - @ViewChild("dialogContent") - protected dialogContent: ElementRef; + protected readonly dialogContent = viewChild.required>("dialogContent"); - // FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals - // eslint-disable-next-line @angular-eslint/prefer-signals - @ViewChild(CipherFormComponent) cipherFormComponent!: CipherFormComponent; + private readonly cipherFormComponent = viewChild.required(CipherFormComponent); private readonly dialogComponent = viewChild(DialogComponent); @@ -540,7 +534,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { updatedCipherView = await this.cipherService.decrypt(updatedCipher, activeUserId); } - this.cipherFormComponent.patchCipher((currentCipher) => { + this.cipherFormComponent().patchCipher((currentCipher) => { currentCipher.attachments = updatedCipherView.attachments; currentCipher.revisionDate = updatedCipherView.revisionDate; @@ -578,7 +572,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { return; } - this.cipherFormComponent.patchCipher((current) => { + this.cipherFormComponent().patchCipher((current) => { current.revisionDate = revisionDate; current.archivedDate = archivedDate; return current; @@ -695,7 +689,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { this.params.mode = mode; this.updateTitle(); // Scroll to the top of the dialog content when switching modes. - this.dialogContent.nativeElement.parentElement.scrollTop = 0; + this.dialogContent().nativeElement.parentElement.scrollTop = 0; // Refocus on title element, the built-in focus management of the dialog only works for the initial open. this.dialogComponent().focusOnHeader();