Skip to content

Commit d56bcec

Browse files
Merge pull request #1334 from CodeForAfrica/ft/upgrade-payload
build(payload): fix images not loading
2 parents 66308aa + 0714c9e commit d56bcec

File tree

8 files changed

+429
-697
lines changed

8 files changed

+429
-697
lines changed

apps/trustlab/.env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ S3_BUCKET=
1111
S3_ACCESS_KEY_ID=
1212
S3_SECRET_ACCESS_KEY=
1313
S3_REGION=
14+
S3_MAX_ATTEMPTS=3
15+
S3_MAX_SOCKETS=1000
16+
S3_CONNECTION_TIMEOUT=5000
1417

1518
# Sentry
1619
NEXT_PUBLIC_SENTRY_DSN=

apps/trustlab/src/components/Incubator/Incubator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Section } from "@commons-ui/core";
22
import { Figure, Link } from "@commons-ui/next";
33
import { LexicalRichText } from "@commons-ui/payload";
4-
import { Grid, Box, Button, SvgIcon } from "@mui/material";
4+
import { Grid, Box, Button, SvgIcon, Typography } from "@mui/material";
55
import React, { forwardRef } from "react";
66

77
import VisitIcon from "@/trustlab/assets/icons/Type=visit, Size=20, Color=CurrentColor.svg";
@@ -13,6 +13,7 @@ const Incubator = forwardRef((props, ref) => {
1313
buttonLink,
1414
image,
1515
content,
16+
title,
1617
} = props;
1718

1819
if (!content && !image) {
@@ -28,6 +29,9 @@ const Incubator = forwardRef((props, ref) => {
2829
ref={ref}
2930
>
3031
<Section sx={{ py: 8, px: { xs: 2.5, md: 0 } }}>
32+
<Typography sx={{ whiteSpace: "nowrap", mb: 2 }} variant="display4">
33+
{title}
34+
</Typography>
3135
<Grid container spacing={2} alignItems="center">
3236
<Grid item xs={12} sm={7}>
3337
<LexicalRichText

apps/trustlab/src/components/Incubator/Incubator.snap.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ exports[`<Incubator /> renders unchanged 1`] = `
88
<div
99
class="MuiContainer-root MuiContainer-maxWidthLg MuiContainer-fixed MuiContainer-disableGutters css-1be4fpk-MuiContainer-root"
1010
>
11+
<h2
12+
class="MuiTypography-root MuiTypography-display4 css-283xsv-MuiTypography-root"
13+
>
14+
Incubator
15+
</h2>
1116
<div
1217
class="MuiGrid-root MuiGrid-container MuiGrid-spacing-xs-2 css-1cth5tq-MuiGrid-root"
1318
>

apps/trustlab/src/components/Incubator/Incubator.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const render = createRender({ theme });
99

1010
const defaultProps = {
1111
content: null,
12+
title: "Incubator",
1213
image: {
1314
url: "https://example.com/image.jpg",
1415
alt: "Incubator Image",

apps/trustlab/src/payload/plugins/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const bucket = process.env.S3_BUCKET ?? "";
1414
const region = process.env.S3_REGION ?? "";
1515
const secretAccessKey = process.env.S3_SECRET_ACCESS_KEY ?? "";
1616
const s3Enabled = !!accessKeyId && !!region && !!secretAccessKey;
17+
const s3MaxAttempts = Number(process.env.S3_MAX_ATTEMPTS) || 3;
18+
const s3MaxSockets = Number(process.env.S3_MAX_SOCKETS) || 1000;
19+
const s3ConnectionTimeout = Number(process.env.S3_CONNECTION_TIMEOUT) || 5000;
1720

1821
const plugins = [
1922
nestedDocsPlugin({
@@ -32,6 +35,19 @@ const plugins = [
3235
secretAccessKey,
3336
},
3437
region,
38+
maxAttempts: s3MaxAttempts,
39+
requestHandler: {
40+
httpAgent: {
41+
maxSockets: s3MaxSockets,
42+
keepAlive: true,
43+
},
44+
httpsAgent: {
45+
maxSockets: s3MaxSockets,
46+
keepAlive: true,
47+
},
48+
connectionTimeout: s3ConnectionTimeout,
49+
requestTimeout: s3ConnectionTimeout,
50+
},
3551
},
3652
enabled: s3Enabled,
3753
}),

apps/trustlab/turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"REVALIDATE_SECRET",
99
"S3_ACCESS_KEY_ID",
1010
"S3_BUCKET",
11+
"S3_CONNECTION_TIMEOUT",
12+
"S3_MAX_ATTEMPTS",
13+
"S3_MAX_SOCKETS",
1114
"S3_REGION",
1215
"S3_SECRET_ACCESS_KEY",
1316
"SENTRY_ENVIRONMENT"

pnpm-lock.yaml

Lines changed: 379 additions & 679 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -227,24 +227,24 @@ catalogs:
227227
"@mui/private-theming": ^5.16.6
228228
payload-v3:
229229
"@nouance/payload-better-fields-plugin": ^2.0.2
230-
"@payloadcms/admin-bar": ^3.39.0
231-
"@payloadcms/db-mongodb": ^3.39.0
232-
"@payloadcms/email-nodemailer": ^3.39.0
233-
"@payloadcms/live-preview-react": ^3.39.0
234-
"@payloadcms/next": ^3.39.0
235-
"@payloadcms/payload-cloud": ^3.39.0
236-
"@payloadcms/plugin-cloud-storage": ^3.39.0
237-
"@payloadcms/plugin-form-builder": ^3.39.0
238-
"@payloadcms/plugin-nested-docs": ^3.39.0
239-
"@payloadcms/plugin-redirects": ^3.39.0
240-
"@payloadcms/plugin-search": ^3.39.0
241-
"@payloadcms/plugin-sentry": ^3.39.0
242-
"@payloadcms/plugin-seo": ^3.39.0
243-
"@payloadcms/richtext-lexical": ^3.39.0
244-
"@payloadcms/storage-s3": ^3.39.0
245-
"@payloadcms/ui": ^3.39.0
230+
"@payloadcms/admin-bar": ^3.60.0
231+
"@payloadcms/db-mongodb": ^3.60.0
232+
"@payloadcms/email-nodemailer": ^3.60.0
233+
"@payloadcms/live-preview-react": ^3.60.0
234+
"@payloadcms/next": ^3.60.0
235+
"@payloadcms/payload-cloud": ^3.60.0
236+
"@payloadcms/plugin-cloud-storage": ^3.60.0
237+
"@payloadcms/plugin-form-builder": ^3.60.0
238+
"@payloadcms/plugin-nested-docs": ^3.60.0
239+
"@payloadcms/plugin-redirects": ^3.60.0
240+
"@payloadcms/plugin-search": ^3.60.0
241+
"@payloadcms/plugin-sentry": ^3.60.0
242+
"@payloadcms/plugin-seo": ^3.60.0
243+
"@payloadcms/richtext-lexical": ^3.60.0
244+
"@payloadcms/storage-s3": ^3.60.0
245+
"@payloadcms/ui": ^3.60.0
246246
graphql: ^16.11.0
247-
payload: ^3.39.0
247+
payload: ^3.60.0
248248
require-in-the-middle: ^7.5.2
249249
react-19:
250250
"react": ^19.1.0

0 commit comments

Comments
 (0)