@applica-software-guru/react-admin 1.4.207 → 1.4.209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts +3 -2
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react-admin.cjs.js +2 -2
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +35 -32
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +2 -2
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-buttons/CreateInDialogButton.tsx +5 -5
- package/src/components/ra-forms/TabbedForm.tsx +1 -1
- package/src/components/ra-pages/RecoverPage.tsx +1 -1
- package/src/index.jsx +3 -0
package/package.json
CHANGED
|
@@ -46,13 +46,14 @@ export type CreateInDialogContentProps = CreateControllerProps & {
|
|
|
46
46
|
redirect: RedirectionSideEffect | boolean | undefined;
|
|
47
47
|
children: React.ReactElement;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* You can use it to handle the form submission yourself.
|
|
50
|
+
* Good luck with that.
|
|
50
51
|
*/
|
|
51
52
|
onSubmit?: (record: any, close: () => void) => void;
|
|
52
53
|
/**
|
|
53
54
|
* @deprecated Use mutationOptions.onSuccess instead
|
|
54
55
|
*/
|
|
55
|
-
onSuccess?: (data: any) => void;
|
|
56
|
+
onSuccess?: (data: any, close: () => void) => void;
|
|
56
57
|
/**
|
|
57
58
|
* @deprecated Use mutationOptions.onError instead
|
|
58
59
|
*/
|
|
@@ -93,11 +94,10 @@ const CreateInDialogContent = ({
|
|
|
93
94
|
redirect(_redirect as RedirectionSideEffect, resource, data.id, data);
|
|
94
95
|
}
|
|
95
96
|
if (onSuccess) {
|
|
96
|
-
onSuccess(data);
|
|
97
|
+
onSuccess(data, onClose);
|
|
97
98
|
}
|
|
98
|
-
// WARN: This is a temporary solution to handle onSuccess from mutationOptions
|
|
99
99
|
if (props?.mutationOptions?.onSuccess) {
|
|
100
|
-
props.mutationOptions.onSuccess(data, variables, context);
|
|
100
|
+
props.mutationOptions.onSuccess(data, variables, { ...(context as any), onClose });
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
[onClose, onSuccess, queryClient, resource, notify, redirect, _redirect]
|
|
@@ -29,7 +29,7 @@ const RecoverPage = ({ name, copy, logo, version, background }: BaseAuthProps) =
|
|
|
29
29
|
redirect('/login');
|
|
30
30
|
})
|
|
31
31
|
.catch((error: any) => {
|
|
32
|
-
notify(error, { type: 'error' });
|
|
32
|
+
notify(error?.message || error?.toString(), { type: 'error' });
|
|
33
33
|
})
|
|
34
34
|
.finally(() => setLoading(false));
|
|
35
35
|
};
|
package/src/index.jsx
CHANGED
|
@@ -57,9 +57,11 @@ export {
|
|
|
57
57
|
useAuthProvider,
|
|
58
58
|
useChoices,
|
|
59
59
|
useChoicesContext,
|
|
60
|
+
useCreateContext,
|
|
60
61
|
useCreateController,
|
|
61
62
|
useDataProvider,
|
|
62
63
|
useEditContext,
|
|
64
|
+
useEditController,
|
|
63
65
|
useGetIdentity,
|
|
64
66
|
useGetList,
|
|
65
67
|
useGetMany,
|
|
@@ -67,6 +69,7 @@ export {
|
|
|
67
69
|
useGetOne,
|
|
68
70
|
useInput,
|
|
69
71
|
useListContext,
|
|
72
|
+
useListController,
|
|
70
73
|
useLocaleState,
|
|
71
74
|
useNotify,
|
|
72
75
|
usePermissions,
|