react-admin-base-bootstrap 0.8.19 → 0.8.21
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/bun.lockb +0 -0
- package/lib/esm/Components/CRUD.js +2 -1
- package/package.json +1 -1
- package/src/Components/CRUD.tsx +3 -2
- package/.idea/modules.xml +0 -8
- package/.idea/react-admin-base-bootstrap.iml +0 -12
- package/.idea/vcs.xml +0 -6
package/bun.lockb
ADDED
|
Binary file
|
|
@@ -28,7 +28,7 @@ import BootstrapDataTable, { Actions } from './BootstrapDataTable';
|
|
|
28
28
|
import BootstrapModal from './BootstrapModal';
|
|
29
29
|
import { useBootstrapOptions } from "./BootstrapOptions";
|
|
30
30
|
export function ModalEntityEditor({ entity, title, size, url, onReload, disabled, children }) {
|
|
31
|
-
const [, , save, loading, dirty] = entity;
|
|
31
|
+
const [data, , save, loading, dirty] = entity;
|
|
32
32
|
const bsOptions = useBootstrapOptions();
|
|
33
33
|
const [open, setOpen] = useState(true);
|
|
34
34
|
const [saved, setSaved] = useState(false);
|
|
@@ -62,6 +62,7 @@ export function ModalEntityEditor({ entity, title, size, url, onReload, disabled
|
|
|
62
62
|
}, [save, saved, error, onReload, url]);
|
|
63
63
|
return React.createElement(React.Fragment, null,
|
|
64
64
|
((!bsOptions.noCloseOnSave && saved) || !open) && url && React.createElement(Navigate, { to: url, replace: true }),
|
|
65
|
+
bsOptions.noCloseOnSave && saved && open && url && React.createElement(Navigate, { to: url + "/" + data.id + "/edit", replace: true }),
|
|
65
66
|
React.createElement(BootstrapModal, { isOpen: true, size: size, toggle: () => url ? setOpen(false) : onReload(null), fade: false },
|
|
66
67
|
title && React.createElement(ModalHeader, { toggle: () => url ? setOpen(false) : onReload(null) },
|
|
67
68
|
React.createElement("b", null, title)),
|
package/package.json
CHANGED
package/src/Components/CRUD.tsx
CHANGED
|
@@ -19,7 +19,7 @@ type ModalEntityEditorParams = {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function ModalEntityEditor({ entity, title, size, url, onReload, disabled, children } : ModalEntityEditorParams) {
|
|
22
|
-
const [ , , save, loading, dirty ] = entity;
|
|
22
|
+
const [ data, , save, loading, dirty ] = entity;
|
|
23
23
|
const bsOptions = useBootstrapOptions();
|
|
24
24
|
|
|
25
25
|
const [ open, setOpen ] = useState(true);
|
|
@@ -60,9 +60,10 @@ export function ModalEntityEditor({ entity, title, size, url, onReload, disabled
|
|
|
60
60
|
|
|
61
61
|
return <>
|
|
62
62
|
{ ((!bsOptions.noCloseOnSave && saved) || !open) && url && <Navigate to={url} replace />}
|
|
63
|
+
{ bsOptions.noCloseOnSave && saved && open && url && <Navigate to={url + "/" + data.id + "/edit"} replace />}
|
|
63
64
|
<BootstrapModal isOpen size={size} toggle={() => url ? setOpen(false) : onReload(null)} fade={false}>
|
|
64
65
|
{ title && <ModalHeader toggle={() => url ? setOpen(false) : onReload(null)}>
|
|
65
|
-
|
|
66
|
+
<b>{ title }</b>
|
|
66
67
|
</ModalHeader> }
|
|
67
68
|
<ValidatorProvider>
|
|
68
69
|
<Form onSubmit={onSubmit} disabled={!!loading || disabled}>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/react-admin-base-bootstrap.iml" filepath="$PROJECT_DIR$/.idea/react-admin-base-bootstrap.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|