Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5,313 changes: 5,313 additions & 0 deletions dotcom-rendering/fixtures/generated/fe-articles/AffiliateProductShowcase.ts

Large diffs are not rendered by default.

4,124 changes: 4,124 additions & 0 deletions dotcom-rendering/fixtures/generated/fe-articles/AffiliateProductStandard.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dotcom-rendering/fixtures/manual/productBlockElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ export const exampleProduct: ProductBlockElement = {
_type: 'model.dotcomrendering.pageElements.LinkBlockElement',
url: 'https://www.johnlewis.com/bosch-twk7203gb-sky-variable-temperature-kettle-1-7l-black/p3228625',
label: '£79.99 at John Lewis',
elementId: '123',
linkType: 'ProductButton',
},
{
_type: 'model.dotcomrendering.pageElements.LinkBlockElement',
url: 'https://www.amazon.co.uk/Bosch-TWK7203GB-Sky-Variable-Temperature/dp/B07Z8VQ2V6',
label: '£79.99 at Amazon',
elementId: '1234',
linkType: 'ProductButton',
},
{
Expand Down
8 changes: 8 additions & 0 deletions dotcom-rendering/scripts/test-data/gen-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ const articles = [
name: 'Video',
url: 'https://www.theguardian.com/sport/video/2023/nov/20/atp-finals-djokovic-beats-sinner-to-claim-record-seventh-title-video',
},
{
name: 'AffiliateProductShowcase',
url: 'https://www.theguardian.com/thefilter/2026/may/04/things-you-loved-most-april-2026',
},
{
name: 'AffiliateProductStandard',
url: 'https://www.theguardian.com/thefilter-us/2025/dec/25/glass-food-containers-to-store-leftovers',
},
];

const HEADER = `/**
Expand Down
2 changes: 2 additions & 0 deletions dotcom-rendering/src/components/ProductElement.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,15 @@ const product = {
label: '£79.99 at John Lewis',
linkType: 'ProductButton',
priority: 'Primary',
elementId: '123',
},
{
_type: 'model.dotcomrendering.pageElements.LinkBlockElement',
url: 'https://www.amazon.co.uk/Bosch-TWK7203GB-Sky-Variable-Temperature/dp/B07Z8VQ2V6',
label: '£79.99 at Amazon',
linkType: 'ProductButton',
priority: 'Primary',
elementId: '1234',
},
{
_type: 'model.dotcomrendering.pageElements.TextBlockElement',
Expand Down
4 changes: 4 additions & 0 deletions dotcom-rendering/src/frontend/schemas/feArticle.json
Original file line number Diff line number Diff line change
Expand Up @@ -2670,6 +2670,9 @@
"type": "string",
"const": "model.dotcomrendering.pageElements.LinkBlockElement"
},
"elementId": {
"type": "string"
},
"url": {
"type": "string"
},
Expand All @@ -2693,6 +2696,7 @@
},
"required": [
"_type",
"elementId",
"label",
"linkType",
"url"
Expand Down
16 changes: 16 additions & 0 deletions dotcom-rendering/src/layouts/DecideLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { breakpoints } from '@guardian/source/foundations';
import type { Decorator, StoryObj } from '@storybook/react-webpack5';
import { useEffect } from 'react';
import { colourSchemeDecorator } from '../../.storybook/decorators/themeDecorator';
import { AffiliateProductShowcase as AffiliateProductShowcaseFixture } from '../../fixtures/generated/fe-articles/AffiliateProductShowcase';
import { AffiliateProductStandard as AffiliateProductStandardFixture } from '../../fixtures/generated/fe-articles/AffiliateProductStandard';
import { Analysis as AnalysisStandardNewsFixture } from '../../fixtures/generated/fe-articles/Analysis';
import { Comment as CommentStandardOpinionFixture } from '../../fixtures/generated/fe-articles/Comment';
import { Feature as FeatureStandardCultureFixture } from '../../fixtures/generated/fe-articles/Feature';
Expand Down Expand Up @@ -333,6 +335,20 @@ export const WebLiveBlogStandardLabsLight: Story = {
parameters: webParameters,
};

export const AffiliateProductStandardLight: Story = {
args: {
article: enhanceArticleType(AffiliateProductStandardFixture, 'Web'),
},
parameters: webParameters,
};

export const AffiliateProductShowcaseLight: Story = {
args: {
article: enhanceArticleType(AffiliateProductShowcaseFixture, 'Web'),
},
parameters: webParameters,
};

export const AppsLiveBlogStandardNewsLight = {
args: {
article: enhanceArticleType(LiveBlogStandardNewsFixture, 'Apps'),
Expand Down
4 changes: 4 additions & 0 deletions dotcom-rendering/src/model/block-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2147,6 +2147,9 @@
"type": "string",
"const": "model.dotcomrendering.pageElements.LinkBlockElement"
},
"elementId": {
"type": "string"
},
"url": {
"type": "string"
},
Expand All @@ -2170,6 +2173,7 @@
},
"required": [
"_type",
"elementId",
"label",
"linkType",
"url"
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/types/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export interface ListItem {

export interface LinkBlockElement {
_type: 'model.dotcomrendering.pageElements.LinkBlockElement';
elementId: string;
url: string;
label: string;
linkType: 'ProductButton' | 'StandardButton';
Expand Down
Loading