From 183a2e479dae3c0144271bab86cf9943404f447c Mon Sep 17 00:00:00 2001 From: Richard Bangay Date: Thu, 12 Dec 2024 14:54:14 +0000 Subject: [PATCH 1/4] add a temporary alert/message on the accountoverview for Cancadian customers with either a Guardian weekly or tier three subscription to let them know about suspending their deliveries while the Canadian post strike is active --- .../mma/accountoverview/AccountOverview.tsx | 12 +++++ .../mma/accountoverview/CanadaStrike.tsx | 37 +++++++++++++++ client/components/mma/shared/ProblemAlert.tsx | 45 +++++++++++-------- 3 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 client/components/mma/accountoverview/CanadaStrike.tsx diff --git a/client/components/mma/accountoverview/AccountOverview.tsx b/client/components/mma/accountoverview/AccountOverview.tsx index ad20e0215..dd1ff92a9 100644 --- a/client/components/mma/accountoverview/AccountOverview.tsx +++ b/client/components/mma/accountoverview/AccountOverview.tsx @@ -51,6 +51,7 @@ import type { IsFromAppProps } from '../shared/IsFromAppProps'; import { NewspaperArchiveCta } from '../shared/NewspaperArchiveCta'; import { nonServiceableCountries } from '../shared/NonServiceableCountries'; import { PaymentFailureAlertIfApplicable } from '../shared/PaymentFailureAlertIfApplicable'; +import { CanadaStrike } from './CanadaStrike'; import { CancelledProductCard } from './CancelledProductCard'; import { EmptyAccountOverview } from './EmptyAccountOverview'; import { InAppPurchaseCard } from './InAppPurchaseCard'; @@ -197,6 +198,16 @@ const AccountOverviewPage = ({ isFromApp }: IsFromAppProps) => { return specificProductType.groupedProductType; }; + const possiblyAffectedByCanadaPostStrike = allActiveProductDetails.some( + (product) => { + return ( + (product.tier === 'Tier Three' || + product.tier === 'Guardian Weekly - ROW') && + product.billingCountry === 'Canada' + ); + }, + ); + return ( <> { productDetails={allActiveProductDetails} isFromApp={isFromApp} /> + {possiblyAffectedByCanadaPostStrike && } {uniqueProductCategories.map((category) => { const groupedProductType = GROUPED_PRODUCT_TYPES[category]; const activeProductsInCategory = allActiveProductDetails.filter( diff --git a/client/components/mma/accountoverview/CanadaStrike.tsx b/client/components/mma/accountoverview/CanadaStrike.tsx new file mode 100644 index 000000000..d91b6bd98 --- /dev/null +++ b/client/components/mma/accountoverview/CanadaStrike.tsx @@ -0,0 +1,37 @@ +import { css } from '@emotion/react'; +import { Link } from '@guardian/source/react-components'; +import { ProblemAlert } from '../shared/ProblemAlert'; + +export const CanadaStrike = () => ( + +

+ Due to industrial action by Canada Post, it is not possible + to deliver your copies of the Guardian Weekly. You are + welcome to pause your subscription during the period of + industrial action, details on how to do so can be found{' '} + + here + + . +

+

+ If you have reached your allowance limit please contact{' '} + + customer.help@guardian.co.uk + +

+ + } + additionalcss={css` + margin-top: 30px; + `} + /> +); diff --git a/client/components/mma/shared/ProblemAlert.tsx b/client/components/mma/shared/ProblemAlert.tsx index e8b1520ab..b74536cc6 100644 --- a/client/components/mma/shared/ProblemAlert.tsx +++ b/client/components/mma/shared/ProblemAlert.tsx @@ -23,8 +23,8 @@ interface AlertButtonProps { } interface ProblemAlertProps { - title: string; - message: string; + title?: string; + message: string | React.ReactElement; button?: AlertButtonProps; additionalcss?: SerializedStyles; } @@ -48,23 +48,30 @@ export const ProblemAlert = (props: ProblemAlertProps) => ( > -

- {props.title} -

-

- {props.message} -

+ {props.title && ( +

+ {props.title} +

+ )} + {typeof props.message === 'string' ? ( +

+ {props.message} +

+ ) : ( + props.message + )} + {props.button && ( Date: Fri, 13 Dec 2024 09:57:32 +0000 Subject: [PATCH 2/4] amend Canada strike check to check for the delivery address country instead of the billing address country --- client/components/mma/accountoverview/AccountOverview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/components/mma/accountoverview/AccountOverview.tsx b/client/components/mma/accountoverview/AccountOverview.tsx index dd1ff92a9..0fffd3588 100644 --- a/client/components/mma/accountoverview/AccountOverview.tsx +++ b/client/components/mma/accountoverview/AccountOverview.tsx @@ -203,7 +203,8 @@ const AccountOverviewPage = ({ isFromApp }: IsFromAppProps) => { return ( (product.tier === 'Tier Three' || product.tier === 'Guardian Weekly - ROW') && - product.billingCountry === 'Canada' + product.subscription.deliveryAddress?.country.toUpperCase() === + 'CANADA' ); }, ); From 7e83329e2d389cda28808189faa49242f7d8f8b1 Mon Sep 17 00:00:00 2001 From: Richard Bangay Date: Fri, 13 Dec 2024 10:16:56 +0000 Subject: [PATCH 3/4] add CA as a possible delivery address country name for the purpose of the caanda mail strike message condition --- client/components/mma/accountoverview/AccountOverview.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/components/mma/accountoverview/AccountOverview.tsx b/client/components/mma/accountoverview/AccountOverview.tsx index 0fffd3588..b2c22c58f 100644 --- a/client/components/mma/accountoverview/AccountOverview.tsx +++ b/client/components/mma/accountoverview/AccountOverview.tsx @@ -200,11 +200,12 @@ const AccountOverviewPage = ({ isFromApp }: IsFromAppProps) => { const possiblyAffectedByCanadaPostStrike = allActiveProductDetails.some( (product) => { + const deliveryCountry = + product.subscription.deliveryAddress?.country.toUpperCase(); return ( (product.tier === 'Tier Three' || product.tier === 'Guardian Weekly - ROW') && - product.subscription.deliveryAddress?.country.toUpperCase() === - 'CANADA' + (deliveryCountry === 'CANADA' || deliveryCountry === 'CA') ); }, ); From 7d1f67db09855283f2759f8c0adcdd95c9cf1697 Mon Sep 17 00:00:00 2001 From: Richard Bangay Date: Fri, 13 Dec 2024 10:30:38 +0000 Subject: [PATCH 4/4] fix guardian help center email address copy error --- client/components/mma/accountoverview/CanadaStrike.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/mma/accountoverview/CanadaStrike.tsx b/client/components/mma/accountoverview/CanadaStrike.tsx index d91b6bd98..1444ffbe5 100644 --- a/client/components/mma/accountoverview/CanadaStrike.tsx +++ b/client/components/mma/accountoverview/CanadaStrike.tsx @@ -25,7 +25,7 @@ export const CanadaStrike = () => ( href="mailto:customer.help@theguardian.com" priority="primary" > - customer.help@guardian.co.uk + customer.help@theguardian.com