Skip to content

Commit 2e7a098

Browse files
Merge branch 'main' into ashishpuliyel-patch-1
2 parents 35733fc + a7ce286 commit 2e7a098

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

dotcom-rendering/src/client/userFeatures/user-features.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ const requestNewData = async () => {
3535
return syncDataFromUserBenefitsApi(authStatus).then(persistResponse);
3636
};
3737

38+
/**
39+
* Persist the user benefits response to cookies
40+
*
41+
* If new cookies are added/removed/edited, update the persistUserBenefitsCookie function in Gateway
42+
* https://github.com/guardian/gateway/blob/252b2b2f24be826da42c6e7c1b1e202594184023/src/server/lib/user-features.ts#L88
43+
*
44+
* In gateway, the cookies are set after authentication.
45+
*
46+
* @param {UserBenefits} userBenefitsResponse
47+
*/
3848
const persistResponse = (userBenefitsResponse: UserBenefits) => {
3949
createOrRenewCookie(USER_BENEFITS_EXPIRY_COOKIE);
4050
if (userBenefitsResponse.hideSupportMessaging) {

dotcom-rendering/src/components/marketing/banners/designableBanner/DesignableBannerV2.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ const DesignableBannerV2: ReactComponent<BannerRenderProps> = ({
452452
isTabletOrAbove,
453453
countryCode,
454454
)}
455+
id={'banner'}
455456
/>
456457

457458
<div css={styles.ctaContainer}>

dotcom-rendering/src/components/marketing/epics/ThreeTierChoiceCards.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ type ThreeTierChoiceCardsProps = {
183183
countryCode?: string;
184184
choices: ChoiceInfo[];
185185
supporterPlusDiscount?: number;
186+
id: string; // uniquely identify this choice cards component to avoid conflicting with others
186187
};
187188

188189
export const ThreeTierChoiceCards = ({
@@ -191,6 +192,7 @@ export const ThreeTierChoiceCards = ({
191192
setSelectedProduct,
192193
choices,
193194
supporterPlusDiscount,
195+
id,
194196
}: ThreeTierChoiceCardsProps) => {
195197
const currencySymbol = getLocalCurrencySymbol(countryCode);
196198
const countryGroupId = countryCodeToCountryGroupId(countryCode);
@@ -221,7 +223,7 @@ export const ThreeTierChoiceCards = ({
221223
!isUndefined(supporterPlusDiscount) &&
222224
supportTier === 'SupporterPlus';
223225

224-
const radioId = `choicecard-${supportTier}`;
226+
const radioId = `choicecard-${id}-${supportTier}`;
225227

226228
return (
227229
<div

dotcom-rendering/src/components/marketing/epics/ctas/ContributionsEpicCtasContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const ContributionsEpicCtasContainer: ReactComponent<Props> = ({
6767
supporterPlusDiscount={
6868
hasSupporterPlusPromoCode ? 0.5 : undefined
6969
}
70+
id={'epic'}
7071
/>
7172
)}
7273
<ContributionsEpicButtons

0 commit comments

Comments
 (0)