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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'current'
node-version: 'lts/*'
-
name: Enable corepack
run: corepack enable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 'current'
node-version: 'lts/*'
registry-url: https://registry.npmjs.org
-
name: Install dependencies
Expand Down
8 changes: 7 additions & 1 deletion api/frankenphp/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@
}

mercure {
# Share the hub between the addresses listed in SERVER_NAME (e.g. "localhost, php:80")
name default
# Transport to use (default to Bolt)
transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
transport bolt {
path /data/mercure.db
}
# Publisher JWT key
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Subscriber JWT key
Expand All @@ -56,6 +60,8 @@
anonymous
# Enable the subscription API (double-check that it's what you want)
subscriptions
# Keep legacy publisher_jwt/subscriber_jwt directives (newer Mercure versions require an explicit opt-in)
protocol_version_compatibility 8
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES}
}
Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure}
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_EXTRA_DIRECTIVES: demo
MERCURE_EXTRA_DIRECTIVES: debugger
# See https://xdebug.org/docs/all_settings#mode
XDEBUG_MODE: "${XDEBUG_MODE:-off}"
ports:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@api-platform/api-doc-parser": "^0.16.8",
"jsonld": "^8.3.2",
"lodash.isplainobject": "^4.0.6",
"react-admin": "^5.8.3"
"react-admin": "^5.15.5"
},
"devDependencies": {
"@babel/preset-env": "^7.23.3",
Expand Down
6 changes: 3 additions & 3 deletions src/stories/custom/AdvancedCustomization.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const BookCreate = () => (
helperText={false}
validate={required()}
/>
<Stack direction="row" gap={2} width="100%">
<Stack direction="row" sx={{ gap: 2, width: '100%' }}>
<InputGuesser source="isbn" label="ISBN" helperText={false} />
<InputGuesser source="publicationDate" helperText={false} />
</Stack>
Expand All @@ -72,7 +72,7 @@ const BookEdit = () => (
helperText={false}
validate={required()}
/>
<Stack direction="row" gap={2} width="100%">
<Stack direction="row" sx={{ gap: 2, width: '100%' }}>
<InputGuesser source="isbn" label="ISBN" helperText={false} />
<InputGuesser source="publicationDate" helperText={false} />
</Stack>
Expand All @@ -87,7 +87,7 @@ const BookShow = () => (
<TextField source="title" variant="h5" />
<TextField source="author" variant="body1" />
<TextField source="description" variant="body1" />
<SimpleShowLayout direction="row" gap={2} sx={{ p: 0 }}>
<SimpleShowLayout direction="row" sx={{ gap: 2, p: 0 }}>
<TextField source="isbn" label="ISBN" variant="body1" />
<DateField source="publicationDate" variant="body1" />
</SimpleShowLayout>
Expand Down
8 changes: 2 additions & 6 deletions src/useOnSubmit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { jest } from '@jest/globals';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import * as reactAdminActual from 'react-admin';
import {
type CreateResult,
DataProviderContext,
Expand Down Expand Up @@ -29,12 +30,7 @@ const onSubmitProps = {

jest.mock('./getIdentifierValue.js');
const notify = jest.fn();
const reactAdminActual = jest.requireActual('react-admin') as Record<
string,
unknown
>;
jest.mock('react-admin', () => ({
__esModule: true,
jest.unstable_mockModule('react-admin', () => ({
...reactAdminActual,
useNotify: () => notify,
}));
Expand Down
5 changes: 5 additions & 0 deletions src/useOnSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useCallback } from 'react';
import { useCreate, useNotify, useRedirect, useUpdate } from 'react-admin';
import type { HttpError, RaRecord } from 'react-admin';
import { useParams } from 'react-router-dom';
import { useQueryClient } from '@tanstack/react-query';
import lodashIsPlainObject from 'lodash.isplainobject';

import getIdentifierValue from './getIdentifierValue.js';
Expand Down Expand Up @@ -33,6 +34,7 @@ const useOnSubmit = ({
const [update] = useUpdate();
const notify = useNotify();
const redirect = useRedirect();
const queryClient = useQueryClient();

return useCallback(
async (values: Partial<RaRecord>) => {
Expand Down Expand Up @@ -83,6 +85,7 @@ const useOnSubmit = ({
...(isCreate ? {} : { id, previousData: values }),
},
{},
{ client: queryClient, meta: mutationOptions?.meta },
);

return undefined;
Expand Down Expand Up @@ -119,6 +122,7 @@ const useOnSubmit = ({
...(isCreate ? {} : { id, previousData: values }),
},
{},
{ client: queryClient, meta: mutationOptions?.meta },
);
return submissionErrors ?? {};
}
Expand All @@ -136,6 +140,7 @@ const useOnSubmit = ({
transform,
create,
update,
queryClient,
],
);
};
Expand Down
Loading
Loading