Skip to content

Commit aa031c5

Browse files
authored
Merge branch 'main' into jm/feat-prevent-banner-and-sign-in-gate-together
2 parents 0e6ca1d + 9695fe3 commit aa031c5

File tree

3 files changed

+59
-5
lines changed

3 files changed

+59
-5
lines changed

dotcom-rendering/src/components/SignInGate/gateDesigns/SignInGateAuxiaV1.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ export const SignInGateAuxiaV1 = ({
4545
body,
4646
first_cta_name: firstCtaName,
4747
first_cta_link: firstCtaLink,
48-
second_cta_name: secondCtaName,
4948
} = JSON.parse(userTreatment.treatmentContent) as TreatmentContentDecoded;
5049

5150
const has = (s?: string) => !!s && s.trim() !== '';
52-
const isDismissible = has(secondCtaName);
51+
const isDismissible =
52+
userTreatment.treatmentType === 'DISMISSABLE_SIGN_IN_GATE';
5353
const dismissStatusLabel = isDismissible
5454
? 'dismissible'
5555
: 'non-dismissible';

dotcom-rendering/src/components/SignInGate/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,17 @@ export interface TreatmentContentDecoded {
9898
second_cta_name?: string;
9999
}
100100

101+
export type AuxiaAPIResponseDataUserTreatmentType =
102+
| 'DISMISSABLE_SIGN_IN_GATE'
103+
| 'NONDISMISSIBLE_SIGN_IN_GATE';
104+
101105
export interface AuxiaAPIResponseDataUserTreatment {
102106
treatmentId: string;
103107
treatmentTrackingId: string;
104108
rank: string;
105109
contentLanguageCode: string;
106110
treatmentContent: string;
107-
treatmentType: string;
111+
treatmentType: AuxiaAPIResponseDataUserTreatmentType;
108112
surface: string;
109113
}
110114

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import { Island } from '../components/Island';
2626
import { LabsHeader } from '../components/LabsHeader';
2727
import { MainMediaGallery } from '../components/MainMediaGallery';
2828
import { Masthead } from '../components/Masthead/Masthead';
29+
import { MostViewedFooterData } from '../components/MostViewedFooterData.importable';
30+
import { MostViewedFooterLayout } from '../components/MostViewedFooterLayout';
31+
import { OnwardsUpper } from '../components/OnwardsUpper.importable';
2932
import { Section } from '../components/Section';
3033
import { Standfirst } from '../components/Standfirst';
3134
import { StickyBottomBanner } from '../components/StickyBottomBanner.importable';
@@ -178,6 +181,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
178181
const showComments =
179182
frontendData.isCommentable && !frontendData.config.isPaidContent;
180183

184+
const { absoluteServerTimes = false } = switches;
181185
return (
182186
<>
183187
{isWeb && (
@@ -399,13 +403,36 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
399403
</Section>
400404
)}
401405
<StoryPackage
402-
absoluteServerTimes={switches['absoluteServerTimes'] ?? false}
406+
absoluteServerTimes={absoluteServerTimes}
403407
discussionApiUrl={discussionApiUrl}
404408
format={format}
405409
renderingTarget={renderingTarget}
406410
storyPackage={gallery.storyPackage}
407411
topBorder={showMerchandisingHigh}
408412
/>
413+
414+
<Island priority="feature" defer={{ until: 'visible' }}>
415+
<OnwardsUpper
416+
ajaxUrl={frontendData.config.ajaxUrl}
417+
hasRelated={frontendData.hasRelated}
418+
hasStoryPackage={frontendData.hasStoryPackage}
419+
isAdFreeUser={frontendData.isAdFreeUser}
420+
pageId={frontendData.pageId}
421+
isPaidContent={!!frontendData.config.isPaidContent}
422+
showRelatedContent={frontendData.config.showRelatedContent}
423+
keywordIds={frontendData.config.keywordIds}
424+
contentType={frontendData.contentType}
425+
tags={frontendData.tags}
426+
format={format}
427+
pillar={format.theme}
428+
editionId={frontendData.editionId}
429+
shortUrlId={frontendData.config.shortUrlId}
430+
discussionApiUrl={frontendData.config.discussionApiUrl}
431+
absoluteServerTimes={absoluteServerTimes}
432+
renderingTarget={renderingTarget}
433+
/>
434+
</Island>
435+
409436
{/** More Galleries container goes here */}
410437
{showComments && (
411438
<Section
@@ -436,7 +463,30 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
436463
/>
437464
</Section>
438465
)}
439-
{/** Most Popular container goes here */}
466+
{!frontendData.pageType.isPaidContent && (
467+
<Section
468+
title="Most viewed"
469+
padContent={false}
470+
verticalMargins={false}
471+
element="aside"
472+
data-link-name="most-popular"
473+
data-component="most-popular"
474+
backgroundColour={palette('--article-section-background')}
475+
borderColour={palette('--article-border')}
476+
fontColour={palette('--article-section-title')}
477+
>
478+
<MostViewedFooterLayout renderAds={isWeb && renderAds}>
479+
<Island priority="feature" defer={{ until: 'visible' }}>
480+
<MostViewedFooterData
481+
sectionId={frontendData.config.section}
482+
ajaxUrl={frontendData.config.ajaxUrl}
483+
edition={frontendData.editionId}
484+
/>
485+
</Island>
486+
</MostViewedFooterLayout>
487+
</Section>
488+
)}
489+
440490
{isWeb && renderAds && !isLabs && (
441491
<Section
442492
fullWidth={true}

0 commit comments

Comments
 (0)