Skip to content

Commit b6d8545

Browse files
Merge branch 'main' into al-1710-popstate
2 parents e1968a3 + 5a31639 commit b6d8545

File tree

283 files changed

+2539
-3655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+2539
-3655
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@
2727
/dotcom-rendering/src/lib/braze/ @guardian/value
2828
/dotcom-rendering/webpack/ @guardian/dotcom-platform
2929
/scripts/ @guardian/dotcom-platform
30+
/ab-testing/ @guardian/commercial-dev

ab-testing/frontend/src/routes/+page.svelte

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import AudienceBreakdown from '$lib/components/AudienceBreakdown.svelte';
55
</script>
66

7-
<h1 class="headline">A/B Tests</h1>
7+
<h1 class="headline">A/B Tests (Beta)</h1>
88
<section>
99
<p>
1010
This page provides an overview of currently running A/B tests on
@@ -31,8 +31,14 @@
3131
</p>
3232
</section>
3333
<section>
34-
<AudienceBreakdown tests={activeABtests} />
35-
<Table tests={allABTests} />
34+
{#if activeABtests.length > 0}
35+
<AudienceBreakdown tests={activeABtests} />
36+
{/if}
37+
{#if allABTests.length > 0}
38+
<Table tests={allABTests} />
39+
{:else}
40+
<p>There are <b>ZERO</b> A/B tests currently configured!</p>
41+
{/if}
3642
</section>
3743

3844
<style>

apps-rendering/.storybook/fonts-css.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import CleanCSS from 'clean-css';
2-
31
type FontFamily =
42
| 'GH Guardian Headline'
53
| 'Guardian Egyptian Web' // Legacy of GH Guardian Headline
@@ -278,5 +276,4 @@ const getStyleString: () => string = () => {
278276
);
279277
};
280278

281-
export const getFontsCss = (): string =>
282-
new CleanCSS().minify(getStyleString()).styles;
279+
export const getFontsCss = (): string => getStyleString();

apps-rendering/.storybook/main.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ module.exports = {
1616
// Global options for webpack
1717
config.resolve.extensions?.push('.ts', '.tsx');
1818

19-
config.resolve.fallback ??= {};
20-
// clean-css will try to import these packages
21-
config.resolve.fallback['http'] = false;
22-
config.resolve.fallback['https'] = false;
23-
2419
// Required as otherwise 'process' will not be defined when included on its own (without .env)
2520
// e.g process?.env?.SOME_VAR
2621
config.plugins.push(

apps-rendering/.storybook/preview.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ export const viewports = [320, 375, 480, 660, 740, 980, 1140, 1300];
8282

8383
export const parameters = {
8484
viewport: {
85-
viewports: guardianViewports,
86-
defaultViewport: 'wide',
85+
options: guardianViewports,
8786
},
8887
layout: 'fullscreen',
8988
};
89+
90+
export const initialGlobals = {
91+
viewport: {
92+
value: 'wide',
93+
isRotated: false,
94+
},
95+
};

apps-rendering/config/.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ module.exports = {
118118
{
119119
files: ['**/*.tsx'],
120120
rules: {
121-
'@typescript-eslint/ban-types': [
121+
'@typescript-eslint/no-restricted-types': [
122122
'error',
123123
{
124124
types: {
@@ -132,7 +132,6 @@ module.exports = {
132132
'React.FC':
133133
'Please use const MyThing = ({foo, bar}: Props) instead',
134134
},
135-
extendDefaults: true,
136135
},
137136
],
138137
},

apps-rendering/package.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,15 @@
4646
"@guardian/cdk": "62.0.1",
4747
"@guardian/content-api-models": "31.0.0",
4848
"@guardian/content-atom-model": "6.1.0",
49-
"@guardian/eslint-config-typescript": "11.0.0",
49+
"@guardian/eslint-config-typescript": "12.0.0",
5050
"@guardian/libs": "22.0.0",
5151
"@guardian/renditions": "0.2.0",
5252
"@guardian/source": "9.0.0",
5353
"@guardian/source-development-kitchen": "17.0.0",
5454
"@smithy/property-provider": "2.0.16",
55-
"@storybook/addon-essentials": "8.6.14",
55+
"@storybook/addon-docs": "9.1.13",
5656
"@storybook/addon-webpack5-compiler-babel": "3.0.6",
57-
"@storybook/components": "8.6.14",
58-
"@storybook/core-events": "8.6.14",
59-
"@storybook/manager-api": "8.6.14",
60-
"@storybook/preview-api": "8.6.14",
61-
"@storybook/react": "8.6.14",
62-
"@storybook/react-webpack5": "8.6.14",
63-
"@storybook/theming": "8.6.14",
57+
"@storybook/react-webpack5": "9.1.13",
6458
"@types/clean-css": "4.2.11",
6559
"@types/compression": "1.8.1",
6660
"@types/express": "5.0.1",
@@ -81,7 +75,7 @@
8175
"compression": "1.8.0",
8276
"constructs": "10.4.2",
8377
"core-js": "3.33.3",
84-
"eslint": "8.56.0",
78+
"eslint": "8.57.1",
8579
"eslint-plugin-jsx-a11y": "6.7.1",
8680
"eslint-plugin-react": "7.33.2",
8781
"express": "5.1.0",
@@ -95,7 +89,7 @@
9589
"react-dom": "18.3.1",
9690
"react-test-renderer": "18.3.1",
9791
"require-from-string": "2.0.2",
98-
"storybook": "8.6.14",
92+
"storybook": "9.1.13",
9993
"thrift": "0.20.0",
10094
"ts-jest": "29.1.2",
10195
"ts-loader": "9.5.4",

apps-rendering/src/client/article.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,28 @@ function followToggle(
8585
if (isFollowing) {
8686
void bridgetClient.unfollow(topic).then((unfollow) => {
8787
// unfollow will be true if the update was successful
88-
unfollow &&
88+
if (unfollow) {
8989
ReactDOM.render(
9090
h(followStatusComponent, {
9191
isFollowing: false,
9292
contributorName: topic.displayName,
9393
}),
9494
followStatus,
9595
);
96+
}
9697
});
9798
} else {
9899
void bridgetClient.follow(topic).then((follow) => {
99100
// follow will be true if the update was successful
100-
follow &&
101+
if (follow) {
101102
ReactDOM.render(
102103
h(followStatusComponent, {
103104
isFollowing: true,
104105
contributorName: topic.displayName,
105106
}),
106107
followStatus,
107108
);
109+
}
108110
});
109111
}
110112
});
@@ -167,16 +169,19 @@ function conditionallyRenderFollowTagComponent(
167169
isMyGuardianEnabled,
168170
tagIsFollowingState,
169171
]) => {
170-
isBridgetCompatible &&
172+
if (
173+
isBridgetCompatible &&
171174
isMyGuardianEnabled &&
172-
followTagStatus &&
175+
followTagStatus
176+
) {
173177
ReactDOM.render(
174178
h(FollowTagStatus, {
175179
isFollowing: tagIsFollowingState,
176180
contributorName: topic.displayName,
177181
}),
178182
followTagStatus,
179183
);
184+
}
180185

181186
followTag?.addEventListener('click', followTagClick);
182187
followTag?.setAttribute('aria-hidden', 'false');

apps-rendering/src/components/Layout/Layout.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Edition } from '@guardian/apps-rendering-api-models/edition';
44
import { ArticleSpecial, formatToString } from '../../articleFormat';
55
import { breakpoints } from '@guardian/source/foundations';
6-
import type { StoryFn } from '@storybook/react';
6+
import type { StoryFn } from '@storybook/react-webpack5';
77
import {
88
analysis,
99
article,

apps-rendering/src/components/Pagination/Pagination.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
formatToString,
55
} from '../../articleFormat';
66
import { breakpoints } from '@guardian/source/foundations';
7-
import type { StoryFn } from '@storybook/react';
7+
import type { StoryFn } from '@storybook/react-webpack5';
88
import { getAllThemes } from 'fixtures/article';
99
import { Pagination } from '.';
1010

0 commit comments

Comments
 (0)