Skip to content

Commit 437c064

Browse files
use group friendly name
- only go to reminders if Membership
1 parent 16d9ab2 commit 437c064

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

client/components/mma/cancel/cancellationSaves/SelectReason.tsx

+17-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import {
2222
getMainPlan,
2323
MDA_TEST_USER_HEADER,
2424
} from '../../../../../shared/productResponse';
25-
import type { ProductTypeWithCancellationFlow } from '../../../../../shared/productTypes';
25+
import {
26+
GROUPED_PRODUCT_TYPES,
27+
type ProductTypeWithCancellationFlow,
28+
} from '../../../../../shared/productTypes';
2629
import {
2730
buttonCentredCss,
2831
stackedButtonLayoutCss,
@@ -100,7 +103,11 @@ const ReasonSelection = ({
100103
`}
101104
>
102105
<legend css={reasonLegendCss}>
103-
Why did you cancel your {productType.friendlyName()} today?
106+
Why did you cancel your{' '}
107+
{GROUPED_PRODUCT_TYPES[
108+
productType.groupedProductType
109+
].friendlyName()}{' '}
110+
today?
104111
</legend>
105112
<RadioGroup
106113
name="issue_type"
@@ -202,12 +209,14 @@ export const SelectReason = () => {
202209
mainPlan.chargedThrough ?? undefined,
203210
).dateStr(DATE_FNS_LONG_OUTPUT_FORMAT);
204211

212+
const navigateToReminder = productType.productType === 'membership';
213+
205214
const submitReason = async () => {
206215
{
207216
const canContinue = !!selectedReasonId.length;
208217
if (canContinue) {
209218
await postReason();
210-
navigate('../reminder', {
219+
navigate(navigateToReminder ? '../reminder' : './', {
211220
state: {
212221
selectedReasonId,
213222
},
@@ -254,7 +263,11 @@ export const SelectReason = () => {
254263
return (
255264
<section css={sectionSpacing}>
256265
<h2 css={headingCss}>
257-
Your {productType.friendlyName()} has been cancelled
266+
Your{' '}
267+
{GROUPED_PRODUCT_TYPES[
268+
productType.groupedProductType
269+
].friendlyName()}{' '}
270+
has been cancelled
258271
</h2>
259272
<CancellationInfo
260273
userEmailAddress={userEmailAddress}

shared/productTypes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ export const GROUPED_PRODUCT_TYPES: {
719719
membership: {
720720
...PRODUCT_TYPES.membership, // TODO: Can we omit 'groupedProductType' and 'softOptInIDs' from spread properties as omitted from type
721721
mapGroupedToSpecific: () => PRODUCT_TYPES.membership,
722-
groupFriendlyName: 'membership',
722+
groupFriendlyName: 'Membership',
723723
showSupporterId: true,
724724
supportTheGuardianSectionProps: {
725725
supportReferer: 'account_overview_membership_section',

0 commit comments

Comments
 (0)