Skip to content

Commit b1d31e6

Browse files
committed
Fix for entity creation bug
1 parent 3697a46 commit b1d31e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/example_pro/src/FirestoreApp/collections/products_collection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const productsCollection = buildCollection<Product>({
124124
create: true,
125125
delete: true
126126
}),
127-
includeJsonView: false,
127+
includeJsonView: true,
128128
Actions: [SampleCollectionActions],
129129
subcollections: [localeCollection],
130130
// defaultSelectedView: "sample_custom_view",

packages/firecms_core/src/core/EntityEditView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
315315
}
316316
};
317317

318-
const entityReadOnlyView = <div
318+
const entityReadOnlyView = !canEdit && entity ? <div
319319
className={cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", (canEdit || !mainViewVisible || selectedSecondaryForm) ? "hidden" : "")}>
320320
<div
321321
className={cls("relative flex flex-col max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit")}>
@@ -324,11 +324,11 @@ export function EntityEditViewInner<M extends Record<string, any>>({
324324
</Typography>
325325
<EntityView
326326
className={"px-8 h-full overflow-auto"}
327-
entity={entity as Entity<M>}
327+
entity={entity}
328328
path={path}
329329
collection={collection}/>
330330
</div>
331-
</div>;
331+
</div> : null;
332332

333333
const entityView = <EntityForm<M>
334334
collection={collection}

0 commit comments

Comments
 (0)