@firecms/collection_editor 3.0.0-alpha.44 → 3.0.0-alpha.46
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/index.es.js +279 -270
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/ConfigControllerProvider.tsx +2 -2
- package/src/ui/EditorCollectionAction.tsx +2 -2
- package/src/ui/RootCollectionSuggestions.tsx +3 -3
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +2 -2
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/collection_editor",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.46",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@firecms/data_import_export": "^3.0.0-alpha.
|
|
18
|
-
"@firecms/schema_inference": "^3.0.0-alpha.
|
|
17
|
+
"@firecms/data_import_export": "^3.0.0-alpha.46",
|
|
18
|
+
"@firecms/schema_inference": "^3.0.0-alpha.46",
|
|
19
19
|
"json5": "^2.2.3",
|
|
20
20
|
"prism-react-renderer": "^2.3.0"
|
|
21
21
|
},
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "53ef13adab3db13baeea2ad7953e37cf3552fd62"
|
|
82
82
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
EntityCollection,
|
|
7
7
|
Property,
|
|
8
8
|
useFireCMSContext,
|
|
9
|
-
|
|
9
|
+
useNavigationController,
|
|
10
10
|
User,
|
|
11
11
|
useSnackbarController
|
|
12
12
|
} from "@firecms/core";
|
|
@@ -70,7 +70,7 @@ export const ConfigControllerProvider = React.memo(
|
|
|
70
70
|
getData
|
|
71
71
|
}: PropsWithChildren<ConfigControllerProviderProps>) {
|
|
72
72
|
|
|
73
|
-
const navigation =
|
|
73
|
+
const navigation = useNavigationController();
|
|
74
74
|
const navigate = useNavigate();
|
|
75
75
|
const snackbarController = useSnackbarController();
|
|
76
76
|
const { propertyConfigs } = useFireCMSContext();
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
SettingsIcon,
|
|
10
10
|
Tooltip,
|
|
11
11
|
useAuthController,
|
|
12
|
-
|
|
12
|
+
useNavigationController,
|
|
13
13
|
useSnackbarController
|
|
14
14
|
} from "@firecms/core";
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ export function EditorCollectionAction({
|
|
|
25
25
|
}: CollectionActionsProps) {
|
|
26
26
|
|
|
27
27
|
const authController = useAuthController();
|
|
28
|
-
const navigationController =
|
|
28
|
+
const navigationController = useNavigationController();
|
|
29
29
|
const collectionEditorController = useCollectionEditorController();
|
|
30
30
|
const configController = useCollectionsConfigController();
|
|
31
31
|
const snackbarController = useSnackbarController();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AddIcon, Chip, Collapse, Typography, unslugify, useAuthController,
|
|
1
|
+
import { AddIcon, Chip, Collapse, Typography, unslugify, useAuthController, useNavigationController } from "@firecms/core";
|
|
2
2
|
import { useCollectionEditorController } from "../useCollectionEditorController";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
export function RootCollectionSuggestions() {
|
|
6
6
|
|
|
7
7
|
const authController = useAuthController();
|
|
8
|
-
const
|
|
8
|
+
const navigationController = useNavigationController();
|
|
9
9
|
|
|
10
10
|
const collectionEditorController = useCollectionEditorController();
|
|
11
11
|
const canCreateCollections = collectionEditorController.configPermissions
|
|
@@ -16,7 +16,7 @@ export function RootCollectionSuggestions() {
|
|
|
16
16
|
|
|
17
17
|
const rootPathSuggestions = collectionEditorController.rootPathSuggestions ?? [];
|
|
18
18
|
|
|
19
|
-
const showSuggestions = rootPathSuggestions.length > 3 || (
|
|
19
|
+
const showSuggestions = rootPathSuggestions.length > 3 || (navigationController.collections.length === 0 && rootPathSuggestions.length > 0);
|
|
20
20
|
return <Collapse
|
|
21
21
|
in={showSuggestions}>
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
TopNavigationResult,
|
|
31
31
|
useAuthController,
|
|
32
32
|
useFireCMSContext,
|
|
33
|
-
|
|
33
|
+
useNavigationController,
|
|
34
34
|
User,
|
|
35
35
|
useSnackbarController
|
|
36
36
|
} from "@firecms/core";
|
|
@@ -158,7 +158,7 @@ export function CollectionEditorDialogInternal<M extends {
|
|
|
158
158
|
) {
|
|
159
159
|
|
|
160
160
|
const { propertyConfigs } = useFireCMSContext();
|
|
161
|
-
const navigation =
|
|
161
|
+
const navigation = useNavigationController();
|
|
162
162
|
const {
|
|
163
163
|
topLevelNavigation,
|
|
164
164
|
collections
|
|
@@ -327,14 +327,14 @@ export function CollectionPropertiesEditorForm({
|
|
|
327
327
|
</div>}
|
|
328
328
|
|
|
329
329
|
<div className="ml-1 mt-2 flex flex-row gap-2">
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
330
|
+
<Tooltip title={"Get the code for this collection"}>
|
|
331
|
+
<IconButton
|
|
332
|
+
variant={"filled"}
|
|
333
|
+
disabled={inferringProperties}
|
|
334
|
+
onClick={() => setCodeDialogOpen(true)}>
|
|
335
|
+
<CodeIcon/>
|
|
336
|
+
</IconButton>
|
|
337
|
+
</Tooltip>
|
|
338
338
|
{inferPropertiesFromData && <Tooltip title={"Add new properties based on data"}>
|
|
339
339
|
<IconButton
|
|
340
340
|
variant={"filled"}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
SelectItem,
|
|
11
11
|
StringProperty,
|
|
12
12
|
Typography,
|
|
13
|
-
|
|
13
|
+
useNavigationController
|
|
14
14
|
} from "@firecms/core";
|
|
15
15
|
import { FieldHelperView } from "./FieldHelperView";
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ export function ReferencePropertyField({
|
|
|
30
30
|
setFieldValue
|
|
31
31
|
} = useFormikContext<StringProperty | NumberProperty>();
|
|
32
32
|
|
|
33
|
-
const navigation =
|
|
33
|
+
const navigation = useNavigationController();
|
|
34
34
|
|
|
35
35
|
if (!navigation)
|
|
36
36
|
return <div className={"col-span-12"}>
|
|
@@ -88,7 +88,7 @@ export function CollectionsSelect({
|
|
|
88
88
|
|
|
89
89
|
console.log("error", error)
|
|
90
90
|
|
|
91
|
-
const navigation =
|
|
91
|
+
const navigation = useNavigationController();
|
|
92
92
|
|
|
93
93
|
if (!navigation)
|
|
94
94
|
return <div className={"col-span-12"}>
|