@applica-software-guru/react-admin 1.5.243 → 1.5.247
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/bitbucket-pipelines.yml +1 -1
- package/dist/components/Layout/MenuProvider.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Tab.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +3 -3
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +8 -7
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +3 -3
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/MenuProvider.tsx +4 -2
- package/src/components/Layout/Provider.tsx +1 -1
- package/src/components/ra-buttons/CreateInDialogButton.tsx +4 -3
- package/src/components/ra-forms/LongForm/Tab.tsx +1 -0
package/package.json
CHANGED
|
@@ -348,11 +348,12 @@ function useBreadcrumbs() {
|
|
|
348
348
|
const menu = _.cloneDeep(_menu);
|
|
349
349
|
let id = pathname;
|
|
350
350
|
let menuItem = findInMenu(menu!, pathname);
|
|
351
|
-
|
|
351
|
+
|
|
352
|
+
if (!menuItem || menuItem.type === 'collapse' || menuItem.type === 'group') {
|
|
352
353
|
menuItem = findInMenu(menu!, pathArgs[pathArgs.length - 1]);
|
|
353
354
|
id = menuItem ? menuItem.id : id;
|
|
354
355
|
}
|
|
355
|
-
if (!menuItem) {
|
|
356
|
+
if (!menuItem || menuItem.type === 'collapse' || menuItem.type === 'group') {
|
|
356
357
|
for (let i = pathArgs.length; i >= 0; i--) {
|
|
357
358
|
const path = pathArgs.slice(0, i).join('/');
|
|
358
359
|
menuItem = findInMenu(menu!, path);
|
|
@@ -363,6 +364,7 @@ function useBreadcrumbs() {
|
|
|
363
364
|
}
|
|
364
365
|
}
|
|
365
366
|
|
|
367
|
+
console.log('menuItem:', menuItem);
|
|
366
368
|
const urlParts = menuItem?.url?.split('/');
|
|
367
369
|
const urlPartsLength = urlParts?.length || 0;
|
|
368
370
|
if (pathArgs.length >= urlPartsLength) {
|
|
@@ -95,7 +95,7 @@ function reducer(state: ILayoutState, action: ILayoutAction) {
|
|
|
95
95
|
}
|
|
96
96
|
case LayoutActionType.UPDATE_NOTIFICATIONS: {
|
|
97
97
|
const notifications = _.chain(newState.notifications).clone().extend(payload).value();
|
|
98
|
-
return _.extend(newState, notifications);
|
|
98
|
+
return _.extend(newState, { notifications: notifications });
|
|
99
99
|
}
|
|
100
100
|
case LayoutActionType.UPDATE_THEME: {
|
|
101
101
|
const theme = _.chain(newState.theme).clone().extend(payload).value();
|
|
@@ -36,7 +36,7 @@ type ResponsiveButtonProps = CreateButtonProps &
|
|
|
36
36
|
disableFloatingButton?: boolean;
|
|
37
37
|
};
|
|
38
38
|
function ResponsiveButton(props: ResponsiveButtonProps): JSX.Element {
|
|
39
|
-
const { disableFloatingButton, startIcon = <PlusCircleOutlined />, ...rest } = props;
|
|
39
|
+
const { disableFloatingButton, label = 'ra.action.create', startIcon = <PlusCircleOutlined />, ...rest } = props;
|
|
40
40
|
const handleClick = useCallback(
|
|
41
41
|
(event: any) => {
|
|
42
42
|
(event as Event).preventDefault();
|
|
@@ -45,12 +45,13 @@ function ResponsiveButton(props: ResponsiveButtonProps): JSX.Element {
|
|
|
45
45
|
},
|
|
46
46
|
[props]
|
|
47
47
|
);
|
|
48
|
+
|
|
48
49
|
return disableFloatingButton ? (
|
|
49
|
-
<RaButton {...rest} onClick={handleClick}>
|
|
50
|
+
<RaButton {...rest} onClick={handleClick} label={label}>
|
|
50
51
|
{startIcon as any}
|
|
51
52
|
</RaButton>
|
|
52
53
|
) : (
|
|
53
|
-
<CreateButton {...props} onClick={handleClick}>
|
|
54
|
+
<CreateButton {...props} onClick={handleClick} label={label}>
|
|
54
55
|
{startIcon as any}
|
|
55
56
|
</CreateButton>
|
|
56
57
|
);
|
|
@@ -17,6 +17,7 @@ function walkChildren(children: ReactNode = [], callback: (el: ReactElement) =>
|
|
|
17
17
|
const validChildren = _.filter(_children, (child) => isValidElement(child));
|
|
18
18
|
_.each(validChildren, (child) => {
|
|
19
19
|
callback(child);
|
|
20
|
+
// @ts-ignore @ts-expect-error Property 'children' does not exist on type '{}'.
|
|
20
21
|
walkChildren(child?.props?.children ?? [], callback);
|
|
21
22
|
});
|
|
22
23
|
}
|