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

Billing - Prefer signal & change detection (#16944)

This commit is contained in:
Oscar Hinton
2025-10-23 22:02:01 +02:00
committed by GitHub
parent a592f2b866
commit e3f943364f
83 changed files with 429 additions and 9 deletions

View File

@@ -16,6 +16,8 @@ export type LineItem = {
* This component has no external dependencies and performs minimal logic -
* it only displays data and allows expanding/collapsing of line items.
*/
// 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: "billing-cart-summary",
templateUrl: "./cart-summary.component.html",
@@ -23,13 +25,13 @@ export type LineItem = {
})
export class CartSummaryComponent {
// Required inputs
passwordManager = input.required<LineItem>();
additionalStorage = input<LineItem>();
secretsManager = input<{ seats: LineItem; additionalServiceAccounts?: LineItem }>();
estimatedTax = input.required<number>();
readonly passwordManager = input.required<LineItem>();
readonly additionalStorage = input<LineItem>();
readonly secretsManager = input<{ seats: LineItem; additionalServiceAccounts?: LineItem }>();
readonly estimatedTax = input.required<number>();
// UI state
isExpanded = signal(true);
readonly isExpanded = signal(true);
/**
* Calculates total for password manager line item

View File

@@ -6,6 +6,8 @@ import { ButtonType, IconModule, TypographyModule } from "@bitwarden/components"
import { PricingCardComponent } from "./pricing-card.component";
// 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: `
<billing-pricing-card

View File

@@ -15,6 +15,8 @@ import {
* This component has no external dependencies and performs no logic - it only displays data
* and emits events when the button is clicked.
*/
// 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: "billing-pricing-card",
templateUrl: "./pricing-card.component.html",
@@ -36,6 +38,8 @@ export class PricingCardComponent {
readonly features = input<string[]>();
readonly activeBadge = input<{ text: string; variant?: BadgeVariant }>();
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@Output() buttonClick = new EventEmitter<void>();
/**