From 88dc962661b1cecaccd52de7310a0ad983ee9430 Mon Sep 17 00:00:00 2001 From: William Martin Date: Wed, 2 Jul 2025 11:02:35 -0400 Subject: [PATCH] revert callout --- .../src/callout/callout.component.ts | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libs/components/src/callout/callout.component.ts b/libs/components/src/callout/callout.component.ts index 264087b9d3d..a289496e71b 100644 --- a/libs/components/src/callout/callout.component.ts +++ b/libs/components/src/callout/callout.component.ts @@ -1,6 +1,6 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { Component, Input, OnInit, input } from "@angular/core"; +import { Component, Input, OnInit } from "@angular/core"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; @@ -35,29 +35,23 @@ let nextId = 0; imports: [SharedModule, TypographyModule], }) export class CalloutComponent implements OnInit { - readonly type = input("info"); - // TODO: Skipped for migration because: - // This input is used in a control flow expression (e.g. `@if` or `*ngIf`) - // and migrating would break narrowing currently. + @Input() type: CalloutTypes = "info"; @Input() icon: string; - // TODO: Skipped for migration because: - // Your application code writes to the input. This prevents migration. @Input() title: string; - readonly useAlertRole = input(false); + @Input() useAlertRole = false; protected titleId = `bit-callout-title-${nextId++}`; constructor(private i18nService: I18nService) {} ngOnInit() { - const type = this.type(); - this.icon ??= defaultIcon[type]; - if (this.title == null && defaultI18n[type] != null) { - this.title = this.i18nService.t(defaultI18n[type]); + this.icon ??= defaultIcon[this.type]; + if (this.title == null && defaultI18n[this.type] != null) { + this.title = this.i18nService.t(defaultI18n[this.type]); } } get calloutClass() { - switch (this.type()) { + switch (this.type) { case "danger": return "tw-bg-danger-100"; case "info":