@firecms/core 3.0.0-canary.219 → 3.0.0-canary.220
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 +1 -12
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/core/EntityEditView.tsx +0 -4
- package/src/form/EntityForm.tsx +1 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-canary.
|
|
4
|
+
"version": "3.0.0-canary.220",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"./package.json": "./package.json"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@firecms/editor": "^3.0.0-canary.
|
|
54
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
55
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
53
|
+
"@firecms/editor": "^3.0.0-canary.220",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.220",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.220",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.3",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"dist",
|
|
106
106
|
"src"
|
|
107
107
|
],
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "3566ee76e9bd1e8f7c72f54c435b5b522d852097",
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
@@ -98,10 +98,6 @@ export function EntityEditView<M extends Record<string, any>, USER extends User>
|
|
|
98
98
|
}
|
|
99
99
|
}, [authController, entity, status]);
|
|
100
100
|
|
|
101
|
-
console.log({
|
|
102
|
-
canEdit
|
|
103
|
-
})
|
|
104
|
-
|
|
105
101
|
if ((dataLoading && !cachedValues) || (!entity || canEdit === undefined) && (status === "existing" || status === "copy")) {
|
|
106
102
|
return <CircularProgressCenter/>;
|
|
107
103
|
}
|
package/src/form/EntityForm.tsx
CHANGED
|
@@ -119,15 +119,12 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
119
119
|
children
|
|
120
120
|
}: EntityFormProps<M>) {
|
|
121
121
|
|
|
122
|
-
console.log("disabledProp", disabledProp);
|
|
123
|
-
|
|
124
122
|
if (collection.customId && collection.formAutoSave) {
|
|
125
123
|
console.warn(`The collection ${collection.path} has customId and formAutoSave enabled. This is not supported and formAutoSave will be ignored`);
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
const authController = useAuthController();
|
|
129
127
|
const [status, setStatus] = useState<EntityStatus>(initialStatus);
|
|
130
|
-
const [saving, setSaving] = useState(false);
|
|
131
128
|
|
|
132
129
|
const updateStatus = (status: EntityStatus) => {
|
|
133
130
|
setStatus(status);
|
|
@@ -265,7 +262,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
265
262
|
}), [collection, path, entityId, formex.values, formex.initialValues, customizationController.propertyConfigs]);
|
|
266
263
|
|
|
267
264
|
const onPreSaveHookError = useCallback((e: Error) => {
|
|
268
|
-
setSaving(false);
|
|
269
265
|
snackbarController.open({
|
|
270
266
|
type: "error",
|
|
271
267
|
message: "Error before saving: " + e?.message
|
|
@@ -274,7 +270,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
274
270
|
}, [snackbarController]);
|
|
275
271
|
|
|
276
272
|
const onSaveSuccessHookError = useCallback((e: Error) => {
|
|
277
|
-
setSaving(false);
|
|
278
273
|
snackbarController.open({
|
|
279
274
|
type: "error",
|
|
280
275
|
message: "Error after saving (entity is saved): " + e?.message
|
|
@@ -294,7 +289,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
294
289
|
|
|
295
290
|
clearDirtyCache();
|
|
296
291
|
onValuesModified?.(false);
|
|
297
|
-
setSaving(false);
|
|
298
292
|
if (!autoSave)
|
|
299
293
|
snackbarController.open({
|
|
300
294
|
type: "success",
|
|
@@ -316,7 +310,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
316
310
|
};
|
|
317
311
|
|
|
318
312
|
const onSaveFailure = useCallback((e: Error) => {
|
|
319
|
-
setSaving(false);
|
|
320
313
|
snackbarController.open({
|
|
321
314
|
type: "error",
|
|
322
315
|
message: "Error saving: " + e?.message
|
|
@@ -338,7 +331,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
338
331
|
values: M,
|
|
339
332
|
previousValues?: M,
|
|
340
333
|
}) => {
|
|
341
|
-
setSaving(true);
|
|
342
334
|
return saveEntityWithCallbacks({
|
|
343
335
|
path,
|
|
344
336
|
entityId,
|
|
@@ -348,7 +340,7 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
348
340
|
status,
|
|
349
341
|
dataSource,
|
|
350
342
|
context,
|
|
351
|
-
onSaveSuccess
|
|
343
|
+
onSaveSuccess,
|
|
352
344
|
onSaveFailure,
|
|
353
345
|
onPreSaveHookError,
|
|
354
346
|
onSaveSuccessHookError
|
|
@@ -409,7 +401,6 @@ export function EntityForm<M extends Record<string, any>>({
|
|
|
409
401
|
};
|
|
410
402
|
|
|
411
403
|
const disabled = formex.isSubmitting || Boolean(disabledProp);
|
|
412
|
-
console.log("disabled", disabled);
|
|
413
404
|
|
|
414
405
|
const formContext: FormContext<M> = {
|
|
415
406
|
// @ts-ignore
|