@applica-software-guru/react-admin 1.5.269 → 1.5.274
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/Layout.d.ts +1 -16
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Navigation/NavItem.d.ts.map +1 -1
- package/dist/components/Layout/Provider.d.ts +1 -8
- package/dist/components/Layout/Provider.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-fields/AttachmentField.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +31 -31
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +1520 -1518
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +31 -31
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/Navigation/NavItem.tsx +3 -1
- package/src/components/Layout/Provider.tsx +1 -1
- package/src/components/ra-buttons/CreateInDialogButton.tsx +0 -1
- package/src/components/ra-fields/AttachmentField.tsx +6 -3
package/package.json
CHANGED
|
@@ -30,7 +30,9 @@ function NavItem({ item, level }: NavItemProps) {
|
|
|
30
30
|
|
|
31
31
|
const listItemProps: NavListItemProps =
|
|
32
32
|
item?.external !== false
|
|
33
|
-
? {
|
|
33
|
+
? {
|
|
34
|
+
component: forwardRef((props, ref) => <Link {...props} to={item.url} target={itemTarget} ref={ref as any} />)
|
|
35
|
+
}
|
|
34
36
|
: { component: 'a', href: item.url, target: itemTarget };
|
|
35
37
|
|
|
36
38
|
const Icon = item.icon;
|
|
@@ -238,7 +238,7 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
function withLayoutProvider<P, T>(Component: React.ComponentType<P>) {
|
|
241
|
-
return forwardRef((props: P & ILayoutProviderProps, ref: React.ForwardedRef<T>) => {
|
|
241
|
+
return forwardRef((props: P & ILayoutProviderProps & any, ref: React.ForwardedRef<T>) => {
|
|
242
242
|
const { logoIcon, logoMain, enableNotification, notification } = props;
|
|
243
243
|
return (
|
|
244
244
|
<LayoutProvider
|
|
@@ -3,7 +3,7 @@ import { Box, Typography } from '@mui/material';
|
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import { get } from 'lodash';
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
-
import { useDataProvider, useRecordContext, useResourceContext, useTranslate } from 'react-admin';
|
|
6
|
+
import { useDataProvider, useNotify, useRecordContext, useResourceContext, useTranslate } from 'react-admin';
|
|
7
7
|
|
|
8
8
|
function AttachmentField({
|
|
9
9
|
entityId: _entityId,
|
|
@@ -18,12 +18,15 @@ function AttachmentField({
|
|
|
18
18
|
const record = useRecordContext(props);
|
|
19
19
|
const dataProvider = useDataProvider();
|
|
20
20
|
const resource = useResourceContext();
|
|
21
|
+
const notify = useNotify();
|
|
21
22
|
const handleClick = useCallback(
|
|
22
23
|
async (e: any) => {
|
|
23
24
|
e.preventDefault();
|
|
24
25
|
e.stopPropagation();
|
|
26
|
+
notify('ra.notification.download', { type: 'info' });
|
|
27
|
+
|
|
25
28
|
const item = get(record, props?.source);
|
|
26
|
-
const entity = _resource || resource.replace('entities/', '');
|
|
29
|
+
const entity = (_resource || resource).replace('entities/', '');
|
|
27
30
|
const entityId = _entityId || record?.id;
|
|
28
31
|
const attachment = await dataProvider.getFile(
|
|
29
32
|
`/attachments/${entity}/${entityId}/${property || props?.source}/${item?.id || record?.id}`
|
|
@@ -33,7 +36,7 @@ function AttachmentField({
|
|
|
33
36
|
link.download = get(record, props?.title || props?.source);
|
|
34
37
|
link.click();
|
|
35
38
|
},
|
|
36
|
-
[dataProvider, record, _entityId, resource, _resource, property, props?.source, props?.title]
|
|
39
|
+
[dataProvider, record, _entityId, resource, _resource, property, props?.source, props?.title, notify]
|
|
37
40
|
);
|
|
38
41
|
const _record = useMemo(
|
|
39
42
|
() => ({
|