diff --git a/examples/example_pro/src/FirestoreApp/views/ExampleCMSView.tsx b/examples/example_pro/src/FirestoreApp/views/ExampleCMSView.tsx index 7b53f5d68..2ac452059 100644 --- a/examples/example_pro/src/FirestoreApp/views/ExampleCMSView.tsx +++ b/examples/example_pro/src/FirestoreApp/views/ExampleCMSView.tsx @@ -235,7 +235,7 @@ export function ExampleCMSView() { variant={"outlined"} onClick={() => sideEntityController.open({ entityId: "B003WT1622", - path: "/products-test", + path: "/products", collection: customProductCollection, width: 1000 })}> diff --git a/packages/firecms_core/src/core/EntityEditView.tsx b/packages/firecms_core/src/core/EntityEditView.tsx index c671d35fd..72ac89c2c 100644 --- a/packages/firecms_core/src/core/EntityEditView.tsx +++ b/packages/firecms_core/src/core/EntityEditView.tsx @@ -332,7 +332,6 @@ export function EntityEditViewInner>({ }, [authController, usedEntity, status]); const readOnly = !canEdit; - console.log("readOnly", readOnly); const onPreSaveHookError = useCallback((e: Error) => { setSaving(false); diff --git a/packages/firecms_core/src/core/EntitySidePanel.tsx b/packages/firecms_core/src/core/EntitySidePanel.tsx index 9af5b0264..5910de496 100644 --- a/packages/firecms_core/src/core/EntitySidePanel.tsx +++ b/packages/firecms_core/src/core/EntitySidePanel.tsx @@ -62,20 +62,18 @@ export function EntitySidePanel(props: EntitySidePanelProps) { }, [navigationController, props.path]); const collection = useMemo(() => { - if (!props) return undefined; - let usedCollection = props.collection; + if (props.collection) { + return props.collection; + } const registryCollection = navigationController.getCollection(props.path); if (registryCollection) { - usedCollection = registryCollection; - } - if (!usedCollection) { - console.error("ERROR: No collection found in path `", props.path, "`. Entity id: ", props.entityId); - throw Error("ERROR: No collection found in path `" + props.path + "`. Make sure you have defined a collection for this path in the root navigation."); + return registryCollection; } - return usedCollection; - }, [navigationController, props]); + console.error("ERROR: No collection found in path `", props.path, "`. Entity id: ", props.entityId); + throw Error("ERROR: No collection found in path `" + props.path + "`. Make sure you have defined a collection for this path in the root navigation."); + }, [navigationController, props.collection]); useEffect(() => { function beforeunload(e: any) {