1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

Vault Refactor: Clean up some strict types (#12357)

* update cipher-view to account for strict type checking

* update view-identity-sections to account for strict type checking

* update read-only-cipher-card to account for strict type checking

* remove unused card import

* remove unused card import

* update additional-options to account for strict type checking
This commit is contained in:
Nick Krantz
2024-12-20 10:16:34 -06:00
committed by GitHub
parent b27a1a5337
commit 6ad35e0871
5 changed files with 46 additions and 26 deletions

View File

@@ -1,5 +1,3 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AfterViewInit, Component, ContentChildren, QueryList } from "@angular/core";
import { CardComponent, BitFormFieldComponent } from "@bitwarden/components";
@@ -14,14 +12,16 @@ import { CardComponent, BitFormFieldComponent } from "@bitwarden/components";
* A thin wrapper around the `bit-card` component that disables the bottom border for the last form field.
*/
export class ReadOnlyCipherCardComponent implements AfterViewInit {
@ContentChildren(BitFormFieldComponent) formFields: QueryList<BitFormFieldComponent>;
@ContentChildren(BitFormFieldComponent) formFields?: QueryList<BitFormFieldComponent>;
ngAfterViewInit(): void {
// Disable the bottom border for the last form field
if (this.formFields.last) {
if (this.formFields?.last) {
// Delay model update until next change detection cycle
setTimeout(() => {
this.formFields.last.disableReadOnlyBorder = true;
if (this.formFields) {
this.formFields.last.disableReadOnlyBorder = true;
}
});
}
}