Skip to content

Commit 86e5fe2

Browse files
Merge branch 'api-platform:main' into main
2 parents 65b8da2 + ae4e2b6 commit 86e5fe2

13 files changed

Lines changed: 1682 additions & 1750 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- 'v*'
77
workflow_dispatch: ~
88

9+
permissions:
10+
id-token: write
11+
contents: read
12+
913
jobs:
1014
release:
1115
name: Create and publish a release
@@ -35,5 +39,3 @@ jobs:
3539
-
3640
name: Publish to npm
3741
run: npm publish
38-
env:
39-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

api/composer.lock

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

api/config/packages/api_platform.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ api_platform:
1616
stateless: true
1717
cache_headers:
1818
vary: ['Content-Type', 'Authorization', 'Origin']
19+
pagination_client_items_per_page: true

package.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api-platform/admin",
3-
"version": "4.0.7",
3+
"version": "4.0.9",
44
"description": "Automatic administration interface for Hydra-enabled APIs.",
55
"files": [
66
"*.md",
@@ -21,23 +21,24 @@
2121
"@api-platform/api-doc-parser": "^0.16.8",
2222
"jsonld": "^8.3.2",
2323
"lodash.isplainobject": "^4.0.6",
24-
"react-admin": "^5.0.3"
24+
"react-admin": "^5.8.3"
2525
},
2626
"devDependencies": {
2727
"@babel/preset-env": "^7.23.3",
2828
"@babel/preset-react": "^7.23.3",
2929
"@babel/preset-typescript": "^7.23.3",
30-
"@storybook/addon-essentials": "^8.0.5",
31-
"@storybook/addon-interactions": "^8.0.5",
32-
"@storybook/addon-links": "^8.0.5",
33-
"@storybook/addon-mdx-gfm": "^8.0.5",
34-
"@storybook/addon-onboarding": "^8.0.5",
30+
"@storybook/addon-essentials": "^8.6.15",
31+
"@storybook/addon-interactions": "^8.6.15",
32+
"@storybook/addon-links": "^8.6.15",
33+
"@storybook/addon-mdx-gfm": "^8.6.15",
34+
"@storybook/addon-onboarding": "^8.6.15",
3535
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
36-
"@storybook/blocks": "^8.0.5",
37-
"@storybook/react": "^8.0.5",
38-
"@storybook/react-webpack5": "^8.0.5",
39-
"@storybook/test": "^8.0.5",
36+
"@storybook/blocks": "^8.6.15",
37+
"@storybook/react": "^8.6.15",
38+
"@storybook/react-webpack5": "^8.6.15",
39+
"@storybook/test": "^8.6.15",
4040
"@storybook/test-runner": "^0.17.0",
41+
"@tanstack/react-query-devtools": "^5.80.6",
4142
"@testing-library/jest-dom": "^6.1.0",
4243
"@testing-library/react": "^14.0.0",
4344
"@testing-library/user-event": "^14.0.0",
@@ -72,7 +73,7 @@
7273
"react-test-renderer": "^18.0.0",
7374
"rimraf": "^5.0.0",
7475
"serve": "^14.2.1",
75-
"storybook": "^8.0.5",
76+
"storybook": "^8.6.15",
7677
"ts-jest": "^29.0.0",
7778
"ts-node": "^10.4.0",
7879
"typescript": "^5.2.0"
@@ -94,5 +95,9 @@
9495
"storybook:serve": "serve storybook-static",
9596
"storybook:test": "test-storybook"
9697
},
97-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
98+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
99+
"resolutions": {
100+
"react-router-dom": "^6",
101+
"react-router": "^6"
102+
}
98103
}

src/core/AdminGuesser.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const AdminGuesser = ({
4848
defaultTheme,
4949
layout = Layout,
5050
loginPage = LoginPage,
51-
loading: loadingPage,
51+
loading: LoadingPage = Loading,
5252
theme = defaultLightTheme,
5353
darkTheme = defaultDarkTheme,
5454
// Other props
@@ -97,7 +97,7 @@ const AdminGuesser = ({
9797
);
9898

9999
if (loading) {
100-
return <Loading />;
100+
return <LoadingPage />;
101101
}
102102

103103
return (
@@ -120,7 +120,7 @@ const AdminGuesser = ({
120120
dataProvider={dataProvider}
121121
layout={layout}
122122
loginPage={loginPage}
123-
loadingPage={loadingPage}
123+
loadingPage={LoadingPage}
124124
theme={theme}
125125
error={error}
126126
{...rest}>

src/stories/Basic.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import type { Meta, StoryObj } from '@storybook/react';
33
import { within } from '@storybook/test';
44
import { HydraAdmin, type HydraAdminProps } from '../hydra';
55
import { OpenApiAdmin } from '../openapi';
6+
import DevtoolsLayout from './layout/DevtoolsLayout';
67

78
/**
89
* # Basic `<HydraAdmin>` component
910
* The `<HydraAdmin>` component without any parameter.
1011
*/
1112
const Basic = ({ entrypoint }: BasicProps) => (
12-
<HydraAdmin entrypoint={entrypoint} />
13+
<HydraAdmin entrypoint={entrypoint} layout={DevtoolsLayout} />
1314
);
1415

1516
interface BasicProps extends Pick<HydraAdminProps, 'entrypoint'> {}

src/stories/Basic.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React from 'react';
22
import { HydraAdmin, type HydraAdminProps } from '../hydra';
3+
import DevtoolsLayout from './layout/DevtoolsLayout';
34

45
/**
56
* # Basic `<HydraAdmin>` component
67
* The `<HydraAdmin>` component without any parameter.
78
*/
89
const Basic = ({ entrypoint }: BasicProps) => (
9-
<HydraAdmin entrypoint={entrypoint} />
10+
<HydraAdmin entrypoint={entrypoint} layout={DevtoolsLayout} />
1011
);
1112

1213
export default Basic;

src/stories/auth/Admin.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { HydraAdmin, type HydraAdminProps } from '../../hydra';
33
import authProvider from './basicAuth';
4+
import DevtoolsLayout from '../layout/DevtoolsLayout';
45

56
/**
67
* # Protected `<HydraAdmin>`
@@ -9,7 +10,12 @@ import authProvider from './basicAuth';
910
* Login with: john/123
1011
*/
1112
const Admin = ({ entrypoint }: JwtAuthProps) => (
12-
<HydraAdmin entrypoint={entrypoint} authProvider={authProvider} requireAuth />
13+
<HydraAdmin
14+
entrypoint={entrypoint}
15+
authProvider={authProvider}
16+
requireAuth
17+
layout={DevtoolsLayout}
18+
/>
1319
);
1420

1521
export default Admin;

src/stories/custom/AdvancedCustomization.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
DateField,
1111
Edit,
1212
Labeled,
13-
Layout,
1413
List,
1514
NumberField,
1615
ReferenceArrayField,
@@ -34,6 +33,7 @@ import ResourceGuesser from '../../core/ResourceGuesser';
3433
import FieldGuesser from '../../field/FieldGuesser';
3534
import { HydraAdmin } from '../../hydra';
3635
import InputGuesser from '../../input/InputGuesser';
36+
import DevtoolsLayout from '../layout/DevtoolsLayout';
3737

3838
export default {
3939
title: 'Admin/Custom/AdvancedCustomization',
@@ -222,7 +222,7 @@ const ReviewList = () => (
222222
export const AdvancedCustomization = () => (
223223
<HydraAdmin
224224
entrypoint={process.env.ENTRYPOINT}
225-
layout={Layout}
225+
layout={DevtoolsLayout}
226226
theme={defaultLightTheme}
227227
darkTheme={defaultDarkTheme}>
228228
<ResourceGuesser

src/stories/custom/UsingGuessers.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import FieldGuesser from '../../field/FieldGuesser';
99
import EditGuesser from '../../edit/EditGuesser';
1010
import InputGuesser from '../../input/InputGuesser';
1111
import CreateGuesser from '../../create/CreateGuesser';
12+
import DevtoolsLayout from '../layout/DevtoolsLayout';
1213

1314
export default {
1415
title: 'Admin/Custom/UsingGuessers',
@@ -98,7 +99,7 @@ const ReviewList = () => (
9899
);
99100

100101
export const UsingGuessers = () => (
101-
<HydraAdmin entrypoint={process.env.ENTRYPOINT}>
102+
<HydraAdmin entrypoint={process.env.ENTRYPOINT} layout={DevtoolsLayout}>
102103
<ResourceGuesser
103104
name="books"
104105
list={BookList}

0 commit comments

Comments
 (0)