Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ads for Tag Fronts & respect speed #8056

Merged
merged 28 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5c2383e
feat: Add support for tuples
OllysCoding Jun 26, 2023
6bb444f
feat: Add support for fast & slow containers on tag fronts
OllysCoding Jun 26, 2023
3062bca
feat: Inject MPU states into containers on Tag fronts
OllysCoding Jun 26, 2023
ff6fb62
WIP: Add support for MPU injection & ads in tag fronts
OllysCoding Jun 27, 2023
962622e
feat: Add support for desktop & mobile ads on tag fronts
OllysCoding Jun 28, 2023
d6cac3a
Update slow MPU containers to match frontend for tag fronts
OllysCoding Jun 28, 2023
1b8e611
use containerId for key on tag fronts map
OllysCoding Jun 28, 2023
bbc0a4a
Add stories for mpu containers on tag fronts & fix any bugs
OllysCoding Jun 28, 2023
944180c
Add stories for DecideContainerByTrails & fix layout bugs
OllysCoding Jun 29, 2023
a5221e9
refactor: tidier definitions for tuples
OllysCoding Jul 4, 2023
e4c1af6
refactor: Use exhaustive checks for tag front MPU components
OllysCoding Jul 4, 2023
54fbe69
Merge branch 'main' of github.com:guardian/dotcom-rendering into olly…
OllysCoding Jul 4, 2023
ee4bf30
fix: remove unused import
OllysCoding Jul 4, 2023
b0b5c3c
feat: Introduce 'TupleOrLess`and `takeFirst`
OllysCoding Jul 4, 2023
bca4962
refactor: Use exhaustive checking for DecideContainerByTrails
OllysCoding Jul 4, 2023
0ee3334
fix: dont render empty ULs if theres only 8 cards
OllysCoding Jul 4, 2023
fc54def
Add tests for tuples takeFirst
OllysCoding Jul 4, 2023
d7a9ada
chore: Update comment for takeFirst
OllysCoding Jul 4, 2023
1094746
fix: use correct %'s on DecideContainerByTrails
OllysCoding Jul 4, 2023
2edc5d6
fix: remove exports from tag front mpu containers as they're not used
OllysCoding Jul 4, 2023
a4b1ce8
Update dotcom-rendering/src/lib/getAdPositions.ts
OllysCoding Jul 4, 2023
dee5ad3
Update dotcom-rendering/src/lib/getAdPositions.ts
OllysCoding Jul 4, 2023
b3cc90d
Merge branch 'olly/tag-fronts-containers-and-ads' of github.com:guard…
OllysCoding Jul 4, 2023
3164bba
Merge branch 'olly/tag-fronts-containers-and-ads' of github.com:guard…
OllysCoding Jul 4, 2023
c2d1f19
chore: remove isTupleOrGreater as this is no longer used
OllysCoding Jul 4, 2023
1468767
refactor: use takeFirst in injectMpuIntoGroupedTrails
OllysCoding Jul 4, 2023
8cf5436
Merge branch 'olly/tag-fronts-containers-and-ads' of github.com:guard…
OllysCoding Jul 4, 2023
c742345
Final tidy-up
OllysCoding Jul 5, 2023
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
188 changes: 188 additions & 0 deletions dotcom-rendering/src/components/DecideContainerByTrails.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
import { breakpoints } from '@guardian/source-foundations';
import { trails } from '../../fixtures/manual/trails';
import { DecideContainerByTrails } from './DecideContainerByTrails';
import { FrontSection } from './FrontSection';

export default {
component: DecideContainerByTrails,
title: 'Components/DecideContainerByTrails',
parameters: {
chromatic: {
viewports: [
breakpoints.mobile,
breakpoints.tablet,
breakpoints.wide,
],
},
},
};

export const OneCardFast = () => {
return (
<FrontSection title="Fast - One card">
<DecideContainerByTrails trails={trails.slice(0, 1)} speed="fast" />
</FrontSection>
);
};
OneCardFast.storyName = 'Fast - One card';

export const TwoCardFast = () => {
return (
<FrontSection title="Fast - Two cards">
<DecideContainerByTrails trails={trails.slice(0, 2)} speed="fast" />
</FrontSection>
);
};
TwoCardFast.storyName = 'Fast - Two cards';

export const ThreeCardFast = () => {
return (
<FrontSection title="Fast - Three cards">
<DecideContainerByTrails trails={trails.slice(0, 3)} speed="fast" />
</FrontSection>
);
};
ThreeCardFast.storyName = 'Fast - Three cards';

export const FourCardFast = () => {
return (
<FrontSection title="Fast - Four cards">
<DecideContainerByTrails trails={trails.slice(0, 4)} speed="fast" />
</FrontSection>
);
};
FourCardFast.storyName = 'Fast - Four cards';

export const FiveCardFast = () => {
return (
<FrontSection title="Fast - Five cards">
<DecideContainerByTrails trails={trails.slice(0, 5)} speed="fast" />
</FrontSection>
);
};
FiveCardFast.storyName = 'Fast - Five cards';

export const SixCardFast = () => {
return (
<FrontSection title="Fast - Six cards">
<DecideContainerByTrails trails={trails.slice(0, 6)} speed="fast" />
</FrontSection>
);
};
SixCardFast.storyName = 'Fast - Six cards';

export const SevenCardFast = () => {
return (
<FrontSection title="Fast - Seven cards">
<DecideContainerByTrails trails={trails.slice(0, 7)} speed="fast" />
</FrontSection>
);
};
SevenCardFast.storyName = 'Fast - Seven cards';

export const EightCardFast = () => {
return (
<FrontSection title="Fast - Eight cards">
<DecideContainerByTrails trails={trails.slice(0, 8)} speed="fast" />
</FrontSection>
);
};

EightCardFast.storyName = 'Fast - Eight cards';

export const TwelveCardFast = () => {
return (
<FrontSection title="Fast - Twelve cards">
<DecideContainerByTrails
trails={trails.slice(0, 12)}
speed="fast"
/>
</FrontSection>
);
};
TwelveCardFast.storyName = 'Fast - Twelve cards';

export const OneCardSlow = () => {
return (
<FrontSection title="Slow - One card">
<DecideContainerByTrails trails={trails.slice(0, 1)} speed="slow" />
</FrontSection>
);
};
OneCardSlow.storyName = 'Slow - One card';

export const TwoCardSlow = () => {
return (
<FrontSection title="Slow - Two cards">
<DecideContainerByTrails trails={trails.slice(0, 2)} speed="slow" />
</FrontSection>
);
};
TwoCardSlow.storyName = 'Slow - Two cards';

export const ThreeCardSlow = () => {
return (
<FrontSection title="Slow - Three cards">
<DecideContainerByTrails trails={trails.slice(0, 3)} speed="slow" />
</FrontSection>
);
};
ThreeCardSlow.storyName = 'Slow - Three cards';

export const FourCardSlow = () => {
return (
<FrontSection title="Slow - Four cards">
<DecideContainerByTrails trails={trails.slice(0, 4)} speed="slow" />
</FrontSection>
);
};
FourCardSlow.storyName = 'Slow - Four cards';

export const FiveCardSlow = () => {
return (
<FrontSection title="Slow - Five cards">
<DecideContainerByTrails trails={trails.slice(0, 5)} speed="slow" />
</FrontSection>
);
};
FiveCardSlow.storyName = 'Slow - Five cards';

export const SixCardSlow = () => {
return (
<FrontSection title="Slow - Six cards">
<DecideContainerByTrails trails={trails.slice(0, 6)} speed="slow" />
</FrontSection>
);
};
SixCardSlow.storyName = 'Slow - Six cards';

export const SevenCardSlow = () => {
return (
<FrontSection title="Slow - Seven cards">
<DecideContainerByTrails trails={trails.slice(0, 7)} speed="slow" />
</FrontSection>
);
};
SevenCardSlow.storyName = 'Slow - Seven cards';

export const EightCardSlow = () => {
return (
<FrontSection title="Slow - Eight cards">
<DecideContainerByTrails trails={trails.slice(0, 8)} speed="slow" />
</FrontSection>
);
};

EightCardSlow.storyName = 'Slow - Eight cards';

export const TwelveCardSlow = () => {
return (
<FrontSection title="Slow - Twelve cards">
<DecideContainerByTrails
trails={trails.slice(0, 12)}
speed="slow"
/>
</FrontSection>
);
};
TwelveCardSlow.storyName = 'Slow - Twelve cards';
Loading