@firecms/collection_editor 3.0.0-alpha.54 → 3.0.0-alpha.56
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 +136 -132
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/ConfigControllerProvider.tsx +1 -0
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +5 -0
- package/src/useCollectionEditorPlugin.tsx +10 -12
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.56",
|
|
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.56",
|
|
18
|
+
"@firecms/schema_inference": "^3.0.0-alpha.56",
|
|
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": "a03621e95fe5b24491289fb9c3b5d71ec8e0c90d"
|
|
82
82
|
}
|
|
@@ -256,6 +256,7 @@ export const ConfigControllerProvider = React.memo(
|
|
|
256
256
|
collectionEditable={currentPropertyDialog?.collectionEditable ?? false}
|
|
257
257
|
getData={getData && currentPropertyDialog?.editedCollectionPath
|
|
258
258
|
? () => {
|
|
259
|
+
console.debug("get data for property", currentPropertyDialog?.editedCollectionPath);
|
|
259
260
|
const resolvedPath = navigation.resolveAliasesFrom(currentPropertyDialog.editedCollectionPath!)
|
|
260
261
|
return getData(resolvedPath);
|
|
261
262
|
}
|
|
@@ -431,6 +431,11 @@ export function CollectionEditorDialogInternal<M extends {
|
|
|
431
431
|
|
|
432
432
|
const path = values.path ?? editedCollectionPath;
|
|
433
433
|
const updatedFullPath = fullPath?.includes("/") ? fullPath?.split("/").slice(0, -1).join("/") + "/" + path : path; // TODO: this path is wrong
|
|
434
|
+
console.log("CollectionEditorDialog", {
|
|
435
|
+
fullPath,
|
|
436
|
+
path,
|
|
437
|
+
updatedFullPath
|
|
438
|
+
});
|
|
434
439
|
const resolvedPath = navigation.resolveAliasesFrom(updatedFullPath);
|
|
435
440
|
const getDataWithPath = resolvedPath && getData ? () => getData(resolvedPath) : undefined;
|
|
436
441
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import {
|
|
3
3
|
EntityCollection,
|
|
4
4
|
FireCMSPlugin,
|
|
@@ -85,17 +85,15 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
85
85
|
onAnalyticsEvent
|
|
86
86
|
}: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection> {
|
|
87
87
|
|
|
88
|
-
const injectCollections =
|
|
89
|
-
(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
[collectionConfigController.collections, modifyCollection]);
|
|
88
|
+
const injectCollections = (collections: EntityCollection[]) => {
|
|
89
|
+
const markAsEditable = (c: PersistedCollection) => {
|
|
90
|
+
makePropertiesEditable(c.properties as Properties);
|
|
91
|
+
c.subcollections?.forEach(markAsEditable);
|
|
92
|
+
};
|
|
93
|
+
const storedCollections = collectionConfigController.collections ?? [];
|
|
94
|
+
storedCollections.forEach(markAsEditable);
|
|
95
|
+
return joinCollectionLists(collections, storedCollections, [], modifyCollection);
|
|
96
|
+
};
|
|
99
97
|
|
|
100
98
|
return {
|
|
101
99
|
name: "Collection Editor",
|