mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
UIF - Prefer signal & change detection (#16940)
This commit is contained in:
@@ -26,6 +26,8 @@ const DEFAULT_COLOR: Record<SimpleDialogType, string> = {
|
||||
danger: "tw-text-danger",
|
||||
};
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
templateUrl: "./simple-configurable-dialog.component.html",
|
||||
imports: [
|
||||
|
||||
@@ -10,6 +10,8 @@ import { CalloutModule } from "../../../callout";
|
||||
import { I18nMockService } from "../../../utils/i18n-mock.service";
|
||||
import { DialogModule } from "../../dialog.module";
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
template: `
|
||||
@for (group of dialogs; track group) {
|
||||
|
||||
@@ -9,6 +9,8 @@ import { DialogTitleContainerDirective } from "../directives/dialog-title-contai
|
||||
})
|
||||
export class IconDirective {}
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
selector: "bit-simple-dialog",
|
||||
templateUrl: "./simple-dialog.component.html",
|
||||
@@ -16,12 +18,14 @@ export class IconDirective {}
|
||||
imports: [DialogTitleContainerDirective, TypographyDirective],
|
||||
})
|
||||
export class SimpleDialogComponent {
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-signals
|
||||
@ContentChild(IconDirective) icon!: IconDirective;
|
||||
|
||||
/**
|
||||
* Optional flag to hide the dialog's center icon. Defaults to false.
|
||||
*/
|
||||
hideIcon = input(false, { transform: booleanAttribute });
|
||||
readonly hideIcon = input(false, { transform: booleanAttribute });
|
||||
|
||||
get hasIcon() {
|
||||
return this.icon != null;
|
||||
|
||||
@@ -15,6 +15,8 @@ interface Animal {
|
||||
animal: string;
|
||||
}
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
template: `
|
||||
<button type="button" bitButton (click)="openSimpleDialog()">Open Simple Dialog</button>
|
||||
@@ -57,6 +59,8 @@ class StoryDialogComponent {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
template: `
|
||||
<bit-simple-dialog>
|
||||
@@ -87,6 +91,8 @@ class SimpleDialogContent {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
template: `
|
||||
<bit-simple-dialog>
|
||||
@@ -116,6 +122,8 @@ class NonDismissableWithPrimaryButtonContent {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
|
||||
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
||||
@Component({
|
||||
template: `
|
||||
<bit-simple-dialog>
|
||||
|
||||
Reference in New Issue
Block a user