Skip to content

Commit e3ee250

Browse files
committed
Merge branch 'seven' into plate-september-update
* seven: (36 commits) [Seven] Fixed icon docs (#7521) Fixed @plone/layout tests [Seven] unify image and file views (#7525) [Seven] fixed layout package styles (#7526) Added Image content type view (#7513) [Seven] Use a single folder for autogenerated files (#7520) Included a File content view. refs #6707 (#7516) 7463 docs cleanup (#7504) Added RSC support to plone components (#7499) Fixed root loader type (#7493) [Seven] Added i18n documentation (#7491) Fixed make install (#7495) Seven and @plone/components Icon system Documentation (#7492) Fix default view on non plone content types (#7490) Better centering of the header (still preliminar). (#7488) Hide tools in prod (#7487) [Seven] Added PoC for content types views (#7475) Fix logo CSS (#7480) Avoid including always the original size in the Image component. (#7486) [Seven] Added Brain to image component item types (#7474) ...
2 parents 178a7f2 + 147989b commit e3ee250

File tree

243 files changed

+4382
-2811
lines changed

Some content is hidden

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

243 files changed

+4382
-2811
lines changed

.github/workflows/cookieplone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Cookieplone
22
on: [push, pull_request]
33

44
env:
5-
python-version: "3.13"
5+
python-version: '3.13'
66
CYPRESS_RETRIES: 2
77

88
jobs:
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Generate Cookieplone-based frontend addon
3232
run: |
33-
COOKIEPLONE_REPOSITORY_TAG=seventemplate uvx cookieplone seven_addon --no-input
33+
uvx cookieplone seven_addon --no-input
3434
3535
- name: Install generated package
3636
working-directory: seven-add-on

.github/workflows/unit.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
name: ["@plone/registry", "@plone/components", "@plone/helpers"]
15+
name:
16+
# - '@plone/blocks'
17+
- '@plone/cmsui'
18+
- '@plone/components'
19+
- '@plone/helpers'
20+
- '@plone/layout'
21+
- '@plone/react-router'
22+
- '@plone/registry'
1623
node-version: [22.x]
1724
steps:
1825
- uses: actions/checkout@v4

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,3 @@ _build/
7272
docs/news
7373

7474
tsconfig.tsbuildinfo
75-
76-
# @plone/registry generated files
77-
registry.loader.js
78-
addons.styles.css

apps/seven/.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ node_modules
44
/build
55
.env
66
.react-router
7-
registry.loader.js
8-
publicui.css
9-
cmsui.css
10-
/locales/
7+
.plone
118
/packages/
9+
public/locales/

apps/seven/app/config.server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import config from '@plone/registry';
55
import PloneClient from '@plone/client';
66
// eslint-disable-next-line import/no-unresolved
7-
import applyAddonConfiguration from '../registry.loader';
7+
import applyAddonConfiguration from '../.plone/registry.loader';
8+
// eslint-disable-next-line import/no-unresolved
9+
import applyServerAddonConfiguration from '../.plone/registry.loader.server';
810

911
export default function install() {
1012
config.settings.apiPath =
@@ -24,6 +26,7 @@ export default function install() {
2426
config.settings.supportedLanguages = ['en'];
2527

2628
applyAddonConfiguration(config);
29+
applyServerAddonConfiguration(config);
2730

2831
// eslint-disable-next-line no-console
2932
// console.log('API_PATH is:', config.settings.apiPath);

apps/seven/app/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import config from '@plone/registry';
55
// eslint-disable-next-line import/no-unresolved
6-
import applyAddonConfiguration from '../registry.loader';
6+
import applyAddonConfiguration from '../.plone/registry.loader';
77

88
export default function install() {
99
config.settings.defaultLanguage = 'en';

apps/seven/app/entry.server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default async function handleRequest(
4343
...i18n, // spread the configuration
4444
lng, // The locale we detected above
4545
ns, // The namespaces the routes about to render wants to use
46-
backend: { loadPath: resolve('./locales/{{lng}}/{{ns}}.json') },
46+
backend: { loadPath: resolve('./public/locales/{{lng}}/{{ns}}.json') },
4747
});
4848

4949
return new Promise((resolve, reject) => {

apps/seven/app/root.tsx

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { Route } from './+types/root';
66
import { flattenToAppURL } from '@plone/helpers';
77
import type PloneClient from '@plone/client';
88
import config from '@plone/registry';
9+
import type { Content } from '@plone/types';
910
import {
1011
getAPIResourceWithAuth,
1112
installServerMiddleware,
@@ -32,15 +33,45 @@ export async function loader({ params, request }: Route.LoaderArgs) {
3233

3334
const path = `/${params['*'] || ''}`;
3435

36+
const rootLoaderDataUtilities = config.getUtilities({
37+
type: 'rootLoaderData',
38+
}) as Array<{
39+
method: (args: {
40+
cli: PloneClient;
41+
content: Content;
42+
request: typeof request;
43+
path: string;
44+
params: typeof params;
45+
locale: string;
46+
}) => Promise<{ status: number; data: unknown }>;
47+
}>;
48+
3549
try {
3650
const [content, site] = await Promise.all([
3751
cli.getContent({ path, expand }),
3852
cli.getSite(),
3953
]);
54+
55+
const rootLoaderDataUtilitiesData = await Promise.all([
56+
...rootLoaderDataUtilities.map((utility) =>
57+
utility.method({
58+
cli,
59+
content: content.data,
60+
request,
61+
path,
62+
params,
63+
locale,
64+
}),
65+
),
66+
]);
67+
4068
return {
4169
content: flattenToAppURL(content.data),
4270
site: flattenToAppURL(site.data),
4371
locale,
72+
...rootLoaderDataUtilitiesData
73+
.filter((item) => item)
74+
.reduce((acc, item) => ({ ...acc, ...item }), {}),
4475
};
4576
} catch (error: any) {
4677
throw data('Content Not Found', {
@@ -75,16 +106,27 @@ export function Layout({
75106
return children;
76107
}
77108

109+
// ToDo: improve error page and error handling
78110
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
79111
let message = 'Oops!';
80112
let details = 'An unexpected error occurred.';
81113
let stack: string | undefined;
82114
if (isRouteErrorResponse(error)) {
83-
message = error.status === 404 ? '404' : 'Error';
84-
details =
85-
error.status === 404
86-
? 'The requested page could not be found.'
87-
: error.statusText || details;
115+
switch (error.status) {
116+
case 404:
117+
message = '404';
118+
details = 'The requested page could not be found.';
119+
break;
120+
case 500:
121+
message = '500';
122+
details =
123+
'The server encountered an internal error. Did you start the backend?';
124+
break;
125+
default:
126+
message = 'Error';
127+
details = error.statusText || details;
128+
break;
129+
}
88130
} else if (import.meta.env.DEV && error && error instanceof Error) {
89131
details = error.message;
90132
stack = error.stack;

apps/seven/app/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { route } from '@react-router/dev/routes';
33
import { getAddonRoutesConfig } from '@plone/react-router';
44
import config from '@plone/registry';
55
// eslint-disable-next-line import/no-unresolved
6-
import applyAddonConfiguration, { addonsInfo } from '../registry.loader';
6+
import applyAddonConfiguration, { addonsInfo } from '../.plone/registry.loader';
77

88
applyAddonConfiguration(config);
99

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed cookieplone test now that the Seven template has been merged there. @pnicolli

0 commit comments

Comments
 (0)