Skip to content

Conversation

@amorask-bitwarden
Copy link
Contributor

@amorask-bitwarden amorask-bitwarden commented Dec 29, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-29609
https://bitwarden.atlassian.net/browse/PM-29608

📔 Objective

This PR does some refactoring of existing @bitwarden/pricing components as well as introduces 3 new components in the @bitwarden/subscription library.

@bitwarden/pricing

cart-summary.component

  1. Refactors the component to operate off a single input with the Cart type rather than separate inputs for each portion of the cart. This prepares us for this component's usage on the redesigned premium subscription page where we'll fetch an entire cart from the backend.
  2. Updates the usage of this component in the upgrade-payment.component by changing input to the Cart type with the same data passed in.
  3. Adds an optional header template that can be passed into the component in the case we're rendering the subscription page.
  4. Adds support for cart-level Discount display

discount-badge.component

  1. Refactors the component to operate off a Discount input, which is a union type of "amount-off" and "percent-off" discounts.
  2. Updates the usage of this component in the user-subscription.component by changing the input to the Discount type with the same data passed in.

pricing-card.component

  1. Updates the component to use changeDetection: OnPush

@bitwarden/subscription

subscription-card.component

  1. Introduces a BitwardenSubscription type which will be fetched from the backend and used to render this card.
  2. Implements the component operating off a BitwardenSubscription input and includes a spec file, stories and MDX file.

storage-card.component

  1. Introduces a Storage type which will be fetched from the backend and used to render this card.
  2. Implements the component operating off a Storage input and includes a spec file, stories and MDX file.

additional-options-card.component

  1. Implements the component, spec file, stories and MDX file.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

amorask-bitwarden and others added 11 commits December 29, 2025 08:51
- Remove unused test file
- Introduce new Discount union type
- Introduce Maybe type helper for T | null | undefined
- Use Discount type in the discount-badge.component
- Update the user-subscription.component to pass Discount type into the discount-badge.component
- Update spec, stories and mdx
- Support changeDetection: ChangeDetectionStrategy.OnPush
- Update spec and mdx files
- Introduce new Cart type
- Use Cart type as main input in cart-summary.component
- Support optional custom header template in cart-summary.component
- Support optional cart-level Discount type in cart-summary.component
- Update upgrade-payment.component to pass in new Cart type to cart-summary.component
- Update spec file, stories and mdx file
- Remove unused test file
- Update jest.config.js
- Add test.setup.ts
- Add BitwardenSubscription type
- Add subscription-card.component
- Add translations
- Add spec file, stories and MDX file
- Add standalone Storage type
- Add storage-card.component
- Add spec file, stories and MDX file
- Add additional-options-card.component
- Add spec file, stories and MDX file
@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Logo
Checkmarx One – Scan Summary & Detailscdc1241c-4e5f-45dc-9df6-d0df5ba8d36a

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 64.59627% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.29%. Comparing base (11b5342) to head (34494b9).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...iption-card/subscription-card.component.stories.ts 0.00% 21 Missing ⚠️
...nts/storage-card/storage-card.component.stories.ts 0.00% 17 Missing ⚠️
...grade/upgrade-payment/upgrade-payment.component.ts 18.18% 9 Missing ⚠️
...-card/additional-options-card.component.stories.ts 0.00% 9 Missing ⚠️
.../billing/individual/user-subscription.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18145      +/-   ##
==========================================
+ Coverage   42.26%   42.29%   +0.02%     
==========================================
  Files        3599     3606       +7     
  Lines      104516   104669     +153     
  Branches    15776    15797      +21     
==========================================
+ Hits        44171    44265      +94     
- Misses      58465    58523      +58     
- Partials     1880     1881       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amorask-bitwarden amorask-bitwarden marked this pull request as ready for review December 30, 2025 20:06
@amorask-bitwarden amorask-bitwarden requested review from a team as code owners December 30, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants