@firecms/collection_editor 3.0.0-alpha.53 → 3.0.0-alpha.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
- "version": "3.0.0-alpha.53",
3
+ "version": "3.0.0-alpha.55",
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.53",
18
- "@firecms/schema_inference": "^3.0.0-alpha.53",
17
+ "@firecms/data_import_export": "^3.0.0-alpha.55",
18
+ "@firecms/schema_inference": "^3.0.0-alpha.55",
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": "2a6df3b8ddeeea1c82007538837e273150c54d0a"
81
+ "gitHead": "958d93702495bd28b2e22d6c4aec0bccf03c71dc"
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, { useCallback } from "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 = useCallback(
89
- (collections: EntityCollection[]) => {
90
- const markAsEditable = (c: PersistedCollection) => {
91
- makePropertiesEditable(c.properties as Properties);
92
- c.subcollections?.forEach(markAsEditable);
93
- };
94
- const storedCollections = collectionConfigController.collections ?? [];
95
- storedCollections.forEach(markAsEditable);
96
- return joinCollectionLists(collections, storedCollections, [], modifyCollection);
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",