@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.4.207",
3
+ "version": "1.4.209",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,13 +46,14 @@ export type CreateInDialogContentProps = CreateControllerProps & {
46
46
  redirect: RedirectionSideEffect | boolean | undefined;
47
47
  children: React.ReactElement;
48
48
  /**
49
- * @deprecated Use mutationOptions.onSubmit instead
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]
@@ -76,7 +76,7 @@ export function TabbedForm(props: TabbedFormProps): JSX.Element {
76
76
  m: 2.5,
77
77
  mb: 0
78
78
  },
79
- '& .tabbed-form .MuiDivider-root': {
79
+ '& .tabbed-form > .MuiDivider-root': {
80
80
  ml: 2.5,
81
81
  mr: 2.5
82
82
  },
@@ -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,