Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3180236
feat(wip): Integrate Sign-In Gate Portal into Sticky Bottom Banner
Aug 14, 2025
b8ce109
feat: Enhance StickyBottomBanner with AB testing support and improve …
Aug 27, 2025
b08b4dd
feat: remove sign-in gate selector from slot so only the sticky banne…
Aug 29, 2025
cf3461a
feat: remove Auxia AB testing code from SignInGateSelector, StickyBot…
Aug 29, 2025
ec85f7c
Merge branch 'main' of github.com:guardian/dotcom-rendering into jm/f…
Sep 1, 2025
4190028
fix: optimize message picking with Promise.allSettled
Sep 1, 2025
ebd4729
fix: set timeoutMillis to null to prevent hanging in problematic envi…
Sep 1, 2025
98eedb6
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-toge…
juabara Sep 1, 2025
15f93d2
fix: revert message picker changes
Sep 8, 2025
01da7d3
test: check if auxia api is being called in sign-in gate
Sep 9, 2025
975f8c7
feat: move auxia check from sign-in gate to sticky bottom banner
Sep 15, 2025
d034044
Merge branch 'main' of github.com:guardian/dotcom-rendering into jm/f…
Sep 15, 2025
4b76929
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-toge…
juabara Sep 15, 2025
70b36fb
fix: strong type sign-in gate candidate config
Sep 16, 2025
f0d994f
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-toge…
juabara Sep 16, 2025
0e6ca1d
fix: update sign-in gate portal tests
Sep 17, 2025
aa031c5
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-toge…
juabara Sep 17, 2025
2831516
fix: treatment type values in tests
Sep 17, 2025
0dcbaf5
fix: restore pnpm-lock.yaml
Sep 18, 2025
5a0077d
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-toge…
juabara Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotcom-rendering/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ style.appendChild(document.createTextNode(css));
// Could this be better? Sure, we could investigate ways to really, truly server side
// render in Storybook but for now this (and some of the other steps we take around
// hydration) achieve what we need
window.guardian = {
(window as any).guardian = {
config: {
ophan: {
pageViewId: 'mockPageViewId',
Expand Down
17 changes: 14 additions & 3 deletions dotcom-rendering/fixtures/manual/sign-in-gate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import type { AuxiaAPIResponseDataUserTreatment } from '../../src/components/SignInGate/types';

export const mockAuxiaResponseDismissible = {
status: true,
data: {
userTreatment: {
treatmentId: 'auxia-treatment-001',
treatmentTrackingId: 'tracking-001',
treatmentType: 'DISMISSABLE_SIGN_IN_GATE',
rank: '1',
contentLanguageCode: 'en-GB',
surface: 'signin-gate',
treatmentContent: JSON.stringify({
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
Expand All @@ -14,7 +19,7 @@ export const mockAuxiaResponseDismissible = {
first_cta_link: 'https://profile.theguardian.com/register',
second_cta_name: "I'll do it later",
}),
},
} as AuxiaAPIResponseDataUserTreatment,
},
};

Expand All @@ -24,6 +29,9 @@ export const mockAuxiaResponseNonDismissible = {
userTreatment: {
treatmentId: 'auxia-treatment-002',
treatmentTrackingId: 'tracking-002',
treatmentType: 'NONDISMISSIBLE_SIGN_IN_GATE',
rank: '1',
contentLanguageCode: 'en-GB',
surface: 'signin-gate',
treatmentContent: JSON.stringify({
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
Expand All @@ -34,7 +42,7 @@ export const mockAuxiaResponseNonDismissible = {
first_cta_link: 'https://profile.theguardian.com/register',
second_cta_name: '', // Empty makes it non-dismissible
}),
},
} as AuxiaAPIResponseDataUserTreatment,
},
};

Expand All @@ -44,6 +52,9 @@ export const mockAuxiaResponseLegacy = {
userTreatment: {
treatmentId: 'default-treatment-id', // This triggers legacy gate
treatmentTrackingId: 'legacy-tracking',
treatmentType: 'DISMISSABLE_SIGN_IN_GATE',
rank: '1',
contentLanguageCode: 'en-GB',
surface: 'signin-gate',
treatmentContent: JSON.stringify({
title: 'Like uninterrupted reading?\nSo do we. Sign in.',
Expand All @@ -53,7 +64,7 @@ export const mockAuxiaResponseLegacy = {
first_cta_link: 'https://profile.theguardian.com/register',
second_cta_name: 'Not now',
}),
},
} as AuxiaAPIResponseDataUserTreatment,
},
};

Expand Down
33 changes: 33 additions & 0 deletions dotcom-rendering/playwright/tests/banner.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,36 @@ test.describe('The banner', function () {
await rrBannerRequestPromise;
});
});

test.describe('Sign-in gate portal', function () {
test('makes a request to the auxia', async ({ page, context }) => {
await optOutOfArticleCountConsent(context);

const auxiaUrl =
'https://contributions.guardianapis.com/auxia/get-treatments';
const auxiaRequestPromise = page.waitForRequest((request) =>
requestBodyHasProperties(request, auxiaUrl, ['isSupporter']),
);

await loadPage({
page,
path: `/Article/https://www.theguardian.com/politics/2019/nov/20/jeremy-corbyn-boris-johnson-tv-debate-watched-by-67-million-people`,
waitUntil: 'domcontentloaded',
region: 'GB',
preventSupportBanner: false,
queryParamsOn: true,
queryParams: { showgate: 'true' },
});

await cmpAcceptAll(page);

await page.evaluate(() => {
// Set geolocation to IE to force the sign-in gate to appear
window.localStorage.setItem('gu.geo.override', 'IE');
});

await page.reload({ waitUntil: 'domcontentloaded' });

await auxiaRequestPromise;
});
});
3 changes: 0 additions & 3 deletions dotcom-rendering/src/components/Island.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,10 @@ describe('Island: server-side rendering', () => {
renderToString(
<WithConfig>
<SignInGateSelector
contentType={''}
tags={[]}
isPaidContent={false}
isPreview={false}
pageId={''}
contributionsServiceUrl={''}
editionId="UK"
/>
</WithConfig>,
),
Expand Down
74 changes: 36 additions & 38 deletions dotcom-rendering/src/components/SignInGate/SignInGate.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { type EditionId } from '../../lib/edition';
import type { TagType } from '../../types/tag';
import {
mockAuxiaResponseDismissible,
mockAuxiaResponseLegacy,
mockAuxiaResponseNonDismissible,
} from '../../../fixtures/manual/sign-in-gate';
import { Section } from '../Section';
import { SignInGateSelector } from '../SignInGateSelector.importable';
import { SignInGateCustomizableText } from './gateDesigns/SignInGateCustomizableText';
Expand Down Expand Up @@ -158,24 +161,23 @@ signInGateMainCheckoutCompletePersonalisedCopy.argTypes = {
};

export const signInGateSelectorStoryDismissable = () => {
const tags: TagType[] = [
{ id: 'politics/politics', type: 'Keyword', title: 'Politics' },
{ id: 'world/europe-news', type: 'Keyword', title: 'Europe News' },
];

return (
<Section fullWidth={true}>
<SignInGateSelector
contentType="Article"
sectionId="dismissable"
tags={tags}
isPaidContent={false}
isPreview={false}
pageId="dismissable"
host="https://www.theguardian.com"
idUrl="https://profile.theguardian.com"
contributionsServiceUrl="https://contributions.guardianapis.com"
editionId={'UK' as EditionId}
auxiaGateDisplayData={{
browserId: 'test-browser-id',
auxiaData: {
responseId: 'test-response-id',
userTreatment:
mockAuxiaResponseDismissible.data.userTreatment,
},
}}
/>
</Section>
);
Expand All @@ -185,24 +187,23 @@ signInGateSelectorStoryDismissable.storyName =
'sign_in_gate_selector_dismissable';

export const signInGateSelectorStoryNonDismissable = () => {
const tags: TagType[] = [
{ id: 'politics/politics', type: 'Keyword', title: 'Politics' },
{ id: 'world/europe-news', type: 'Keyword', title: 'Europe News' },
];

return (
<Section fullWidth={true}>
<SignInGateSelector
contentType="Article"
sectionId="non-dismissable"
tags={tags}
isPaidContent={false}
isPreview={false}
pageId="non-dismissable"
host="https://www.theguardian.com"
idUrl="https://profile.theguardian.com"
contributionsServiceUrl="https://contributions.guardianapis.com"
editionId={'UK' as EditionId}
auxiaGateDisplayData={{
browserId: 'test-browser-id',
auxiaData: {
responseId: 'test-response-id',
userTreatment:
mockAuxiaResponseNonDismissible.data.userTreatment,
},
}}
/>
</Section>
);
Expand All @@ -212,24 +213,23 @@ signInGateSelectorStoryNonDismissable.storyName =
'sign_in_gate_selector_non_dismissable';

export const signInGateSelectorStoryLegacy = () => {
const tags: TagType[] = [
{ id: 'politics/politics', type: 'Keyword', title: 'Politics' },
{ id: 'world/europe-news', type: 'Keyword', title: 'Europe News' },
];

return (
<Section fullWidth={true}>
<SignInGateSelector
contentType="Article"
sectionId="legacy"
tags={tags}
isPaidContent={false}
isPreview={false}
pageId="legacy"
host="https://www.theguardian.com"
idUrl="https://profile.theguardian.com"
contributionsServiceUrl="https://contributions.guardianapis.com"
editionId={'UK' as EditionId}
auxiaGateDisplayData={{
browserId: 'test-browser-id',
auxiaData: {
responseId: 'test-response-id',
userTreatment:
mockAuxiaResponseLegacy.data.userTreatment,
},
}}
/>
</Section>
);
Expand All @@ -238,24 +238,22 @@ export const signInGateSelectorStoryLegacy = () => {
signInGateSelectorStoryLegacy.storyName = 'sign_in_gate_selector_legacy';

export const signInGateSelectorStoryNoTreatment = () => {
const tags: TagType[] = [
{ id: 'politics/politics', type: 'Keyword', title: 'Politics' },
{ id: 'world/europe-news', type: 'Keyword', title: 'Europe News' },
];

return (
<Section fullWidth={true}>
<SignInGateSelector
contentType="Article"
sectionId="no-treatment"
tags={tags}
isPaidContent={false}
isPreview={false}
pageId="no-treatment"
host="https://www.theguardian.com"
idUrl="https://profile.theguardian.com"
contributionsServiceUrl="https://contributions.guardianapis.com"
editionId={'UK' as EditionId}
auxiaGateDisplayData={{
browserId: 'test-browser-id',
auxiaData: {
responseId: 'test-response-id',
userTreatment: undefined,
},
}}
/>
</Section>
);
Expand Down
Loading
Loading