Skip to content

Commit

Permalink
Merge branch 'main' into pd/landing-page-abtest-benefit-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-daniel-dempsey authored Jan 21, 2025
2 parents cddb4ff + 8ba7a37 commit 362cfd5
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 44 deletions.
1 change: 0 additions & 1 deletion support-e2e/tests/test/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const setUserDetailsForProduct = async (
) => {
switch (product) {
case 'SupporterPlus':
case 'GuardianLight':
case 'GuardianAdLite':
await setTestUserRequiredDetails(page, email(), firstName(), lastName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ export type TierThree = {
fulfilmentOptions: FulfilmentOptions;
productOptions: ProductOptions;
};
export type GuardianLight = {
productType: 'GuardianLight';
currency: string;
billingPeriod: BillingPeriod;
};
export type GuardianAdLite = {
productType: 'GuardianAdLite';
currency: string;
Expand Down Expand Up @@ -106,7 +101,6 @@ export type SubscriptionProductFields =
| PaperSubscription
| GuardianWeeklySubscription
| TierThree
| GuardianLight
| GuardianAdLite;
type ProductFields = RegularContribution | SubscriptionProductFields;
type RegularPayPalPaymentFields = {
Expand Down
10 changes: 0 additions & 10 deletions support-frontend/assets/helpers/productCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ export const productCatalogDescription: Record<
ActiveProductKey,
ProductDescription
> = {
GuardianLight: {
label: 'Guardian Ad-Lite',
thankyouMessage: `Your valued support powers our journalism${' '}`,
ratePlans: {
Monthly: {
billingPeriod: 'Monthly',
},
},
benefits: guardianAdLiteBenefits,
},
GuardianAdLite: {
label: 'Guardian Ad-Lite',
thankyouMessage: `Your valued support powers our journalism${' '}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ export const getProductFields = ({
* We might be able to defer this to the backend.
*/
switch (productKey) {
case 'GuardianLight':
return {
productType: 'GuardianLight',
currency: currencyKey,
billingPeriod: ratePlanDescription.billingPeriod,
};

case 'GuardianAdLite':
return {
productType: 'GuardianAdLite',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export function CheckoutComponent({

const returnParam = returnLink ? '?returnAddress=' + returnLink : '';
const returnToLandingPage =
productKey === 'GuardianLight' || productKey === 'GuardianAdLite'
productKey === 'GuardianAdLite'
? `/guardian-ad-lite${returnParam}`
: `/${geoId}/contribute`;

Expand Down Expand Up @@ -766,12 +766,7 @@ export function CheckoutComponent({
headerButton={
<BackButton
path={returnToLandingPage}
buttonText={
productKey === 'GuardianLight' ||
productKey === 'GuardianAdLite'
? 'Back'
: 'Change'
}
buttonText={productKey === 'GuardianAdLite' ? 'Back' : 'Change'}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ export function ThankYouComponent({
return <div>Unable to find contribution type {contributionType}</div>;
}

const isGuardianAdLite =
productKey === 'GuardianLight' || productKey === 'GuardianAdLite';
const isGuardianAdLite = productKey === 'GuardianAdLite';
const isOneOffPayPal = order.paymentMethod === 'PayPal' && isOneOff;
const isSupporterPlus = productKey === 'SupporterPlus';
const isTier3 = productKey === 'TierThree';
Expand Down
11 changes: 7 additions & 4 deletions support-frontend/assets/pages/[countryGroupId]/events/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ export function Events({ geoId }: Props) {

const pageviewId = getPageViewId();

if (!pageviewId) {
logException('pageviewId not available on event listing');
}

const hashUrlSearchParams = new URLSearchParams({
'p[meta_page_view_id]': pageviewId,
'p[meta_region_id]': geoId,
Expand All @@ -124,6 +120,13 @@ export function Events({ geoId }: Props) {
hashUrlSearchParams.toString(),
)}`;

if (
!hashUrlSearchParams.has('p[meta_page_view_id]') ||
hashUrlSearchParams.get('p[meta_page_view_id]') !== pageviewId
) {
logException('hashUrlSearchParams pageviewId mismatch');
}

const embedUrl = `${ticketTailorUrl}/${eventId}/book${presetDataUrl}`;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ function Heading({
promotion,
}: HeadingProps): JSX.Element {
const isPending = paymentStatus === 'pending';
const isGuardianAdLite =
productKey === 'GuardianLight' || productKey === 'GuardianAdLite';
const isGuardianAdLite = productKey === 'GuardianAdLite';
const isTier3 = productKey === 'TierThree';
const maybeNameAndTrailingSpace: string =
name && name.length < 10 ? `${name} ` : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ function Subheading({
paymentStatus,
}: SubheadingProps): JSX.Element {
const isTier3 = productKey === 'TierThree';
const isGuardianAdLite =
productKey === 'GuardianLight' || productKey === 'GuardianAdLite';
const isGuardianAdLite = productKey === 'GuardianAdLite';
const subheadingCopy = getSubHeadingCopy(
productKey,
amountIsAboveThreshold,
Expand Down
2 changes: 1 addition & 1 deletion support-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@guardian/pasteup": "1.0.0-alpha.7",
"@guardian/source": "8.0.0",
"@guardian/source-development-kitchen": "13.1.0",
"@guardian/support-service-lambdas": "guardian/support-service-lambdas#1cac223aa8cf278f4e70cb39dc0f7740304e4566",
"@guardian/support-service-lambdas": "guardian/support-service-lambdas#954a612fbce077790fa2d00c6e159b8d384f3e14",
"@guardian/tsconfig": "^0.2.0",
"@reduxjs/toolkit": "^1.9.4",
"@sentry/browser": "^8.33.1",
Expand Down
4 changes: 2 additions & 2 deletions support-frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1836,9 +1836,9 @@
dependencies:
mini-svg-data-uri "1.4.4"

"@guardian/support-service-lambdas@guardian/support-service-lambdas#1cac223aa8cf278f4e70cb39dc0f7740304e4566":
"@guardian/support-service-lambdas@guardian/support-service-lambdas#954a612fbce077790fa2d00c6e159b8d384f3e14":
version "1.0.0"
resolved "https://codeload.github.com/guardian/support-service-lambdas/tar.gz/1cac223aa8cf278f4e70cb39dc0f7740304e4566"
resolved "https://codeload.github.com/guardian/support-service-lambdas/tar.gz/954a612fbce077790fa2d00c6e159b8d384f3e14"

"@guardian/tsconfig@^0.2.0":
version "0.2.0"
Expand Down

0 comments on commit 362cfd5

Please sign in to comment.