Skip to content

Created a template for the secondary user product card in account overview#1671

Draft
enesihsa wants to merge 13 commits into
mainfrom
ea/multiple-accounts/secondary-user-account-overview
Draft

Created a template for the secondary user product card in account overview#1671
enesihsa wants to merge 13 commits into
mainfrom
ea/multiple-accounts/secondary-user-account-overview

Conversation

@enesihsa

@enesihsa enesihsa commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Current situation/background

This PR creates the necessary product card sections and benefits copies for the secondary user account benefits as part of the multiple accounts initiative.

What does this PR change?

  • Creates a new product card section for secondary user subscriptions.
    • I assumed primary users will get their product data from MDAPI since their subscription is registered in Zuora.
  • SecondaryAccountCard.tsx to render the shared subscription product card on account overview without depending on a ProductDetail response since the endpoint for secondary accounts will not return a detailed subscription data.
  • Storybook card for visual testing.
  • Connection setup to '/api/me/secondary-user' endpoint and guarded DEV and CODE test for a hard-coded mock response from the API. This is still TBC.
  • New benefits text configuration to be used by the new card.

Next steps/further info

  1. See Manage shared subscription page #1700 for the leave subscription button.
  2. For the product card we need the primary user's name, and once the secondary user clicks 'Leave Subscription' we need name and email address. The current implementation assumes a single API call which returns both.
  3. Endpoints and data format of the response still to be completed by the backend.
    a. There is a guard for testing in CODE and DEV with a url parameter.
  4. Primary user benefits will change for the digital plus (addition of account sharing), this is to be removed from secondary accounts (benefitsOverride can be used for this).

@enesihsa enesihsa added the feature Departmental tracking: work on a new feature label Jun 10, 2026
</div>
{groupedProductType.tierLabel && (
{isSecondary &&
primarySubscriber && ( // TODO Separate more properly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main addition, makes it look like there is plenty of changes but not really, much is indentation. This conditional section renders the shared subscription details and leave subscription Card.Sections. Currently combined into a single one but there probably is a better way to do this?

Comment thread client/components/mma/accountoverview/ProductCard.tsx Outdated
Comment on lines 313 to 321
{cardConfig.getBenefitsSectionCopy && nextPaymentDetails && (
<Card.Section backgroundColor="#edf5fA" removeBorders>
<p css={benefitsTextCss}>
{cardConfig.getBenefitsSectionCopy(
nextPaymentDetails,
)}
{isSecondary && primarySubscriber // TODO should probably find a better way to do this too.
? `You're enjoying ${mainPlan.name} as part of a shared subscription.`
: cardConfig.getBenefitsSectionCopy(
nextPaymentDetails,
)}
</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that nextPaymentDetails will not exist, so
cardConfig.getBenefitsSectionCopy && nextPaymentDetails
Will always test false. You could do something like:
cardConfig.getBenefitsSectionCopy && (nextPaymentDetails || isSecondary) && (
And then
isSecondary ? "you are enjoying copy" : cardConfig.getBenefitsSectionCopy()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, missed this one. Another question I had was would it be possible to have the secondary user details in the getBenefitsSectionCopy too (or a more generic way of fetching them), currently it has one for each Zuora subscription type I think, but there are exceptions now for secondary users and GW Gift subscriptions.

Comment thread client/components/mma/accountoverview/ProductCard.tsx Outdated

@j-ruda-guardian j-ruda-guardian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. May I ask you for a change that will make reviewing this files a lot easier:
Please, take the new secondary user card and extract it to a new file (This ProductCard file is already more than crowded enough) and then import it and render it conditionally like you are doing. That might solve this indentation nightmare and will also make the whole thing easier to review!

nice work, thank you!

@enesihsa
enesihsa force-pushed the ea/multiple-accounts/secondary-user-account-overview branch from 044e650 to a756302 Compare June 15, 2026 14:32
@enesihsa
enesihsa force-pushed the ea/multiple-accounts/secondary-user-account-overview branch 2 times, most recently from 16d4f8c to 0567ca5 Compare June 23, 2026 16:10
/>
<JoinDateRow
}) =>
!primaryUser && (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really confused as to why this keeps causing the same issue. At least it's much more manageable here and easier to verify that nothing actually changes apart from the addition of this condition.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

http.get('/api/me/one-off-contributions', () => {
return HttpResponse.json([]);
}),
http.get('/api/me/secondary-account', () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Endpoint still TBD

uniqueProductCategories.push('subscriptions');
}

// TODO we can add secondary user product card to subscriptions but will need to update the type definition to make it work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow us to show shared subscriptions alongside other subscriptions. Current setup shows it in a separate section.

Comment thread client/fixtures/productBuilder/baseProducts.ts
Comment thread server/apiProxy.ts

export const multipleAccountsApiHandler = proxyApiHandler(
// TODO format differs from other API hosts?
conf.STAGE === 'PROD'

@enesihsa enesihsa Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enesihsa
enesihsa force-pushed the ea/multiple-accounts/secondary-user-account-overview branch from 4e9357b to 6563f63 Compare July 7, 2026 10:09
>
<p css={benefitsTextCss}>
{cardConfig.getBenefitsSectionCopy(nextPaymentDetails)}
{nextPaymentDetails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be done because secondary account benefits copy text cannot take in a nextPaymentDetails since it is not used for anything in the text. All other subscription product cards show some information about pricing and next payment dates.

const guardianWeeklyBenefitsCopy = (npd: NextPaymentDetails) =>
`You're subscribed to The Guardian Weekly for ${npd.currentPriceValue} per ${npd.paymentInterval} and receive a curated news magazine featuring our best global journalism in print, as well as unlimited access to our full suite of digital benefits.`;

// TODO This not having npd has been quite a problem. Current solution is a bit hacky.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enesihsa
enesihsa force-pushed the ea/multiple-accounts/secondary-user-account-overview branch from 6563f63 to 6fc8b9a Compare July 21, 2026 16:11
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants