@firecms/core 3.0.0-canary.136 → 3.0.0-canary.138
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/README.md +1 -1
- package/dist/components/PropertyConfigBadge.d.ts +2 -1
- package/dist/index.es.js +49 -52
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +50 -53
- package/dist/index.umd.js.map +1 -1
- package/dist/types/property_config.d.ts +0 -2
- package/dist/util/resolutions.d.ts +6 -6
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +3 -4
- package/src/components/DeleteEntityDialog.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -2
- package/src/components/EntityPreview.tsx +1 -1
- package/src/components/EntityView.tsx +1 -1
- package/src/components/PropertyConfigBadge.tsx +9 -3
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -2
- package/src/components/common/default_entity_actions.tsx +2 -2
- package/src/core/DefaultAppBar.tsx +69 -73
- package/src/core/EntityEditView.tsx +4 -4
- package/src/core/FireCMS.tsx +1 -4
- package/src/form/PropertyFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -1
- package/src/hooks/data/save.ts +3 -3
- package/src/internal/useBuildDataSource.ts +1 -1
- package/src/preview/PropertyPreview.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +1 -1
- package/src/types/property_config.tsx +0 -2
- package/src/util/property_utils.tsx +1 -1
- package/src/util/resolutions.ts +8 -8
package/src/util/resolutions.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
38
38
|
values,
|
|
39
39
|
previousValues,
|
|
40
40
|
userConfigPersistence,
|
|
41
|
-
|
|
41
|
+
propertyConfigs,
|
|
42
42
|
ignoreMissingFields = false
|
|
43
43
|
}: {
|
|
44
44
|
collection: EntityCollection<M> | ResolvedEntityCollection<M>;
|
|
@@ -47,7 +47,7 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
47
47
|
values?: Partial<EntityValues<M>>,
|
|
48
48
|
previousValues?: Partial<EntityValues<M>>,
|
|
49
49
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
50
|
-
|
|
50
|
+
propertyConfigs?: Record<string, PropertyConfig>;
|
|
51
51
|
ignoreMissingFields?: boolean;
|
|
52
52
|
}): ResolvedEntityCollection<M> => {
|
|
53
53
|
|
|
@@ -67,7 +67,7 @@ export const resolveCollection = <M extends Record<string, any>, >
|
|
|
67
67
|
previousValues: usedPreviousValues,
|
|
68
68
|
path,
|
|
69
69
|
entityId,
|
|
70
|
-
|
|
70
|
+
propertyConfigs: propertyConfigs,
|
|
71
71
|
ignoreMissingFields
|
|
72
72
|
});
|
|
73
73
|
if (!childResolvedProperty) return {};
|
|
@@ -111,7 +111,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
111
111
|
entityId?: string,
|
|
112
112
|
index?: number,
|
|
113
113
|
fromBuilder?: boolean;
|
|
114
|
-
|
|
114
|
+
propertyConfigs?: Record<string, PropertyConfig<any>>;
|
|
115
115
|
ignoreMissingFields?: boolean;
|
|
116
116
|
}): ResolvedProperty<T> | null {
|
|
117
117
|
|
|
@@ -182,7 +182,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
if (resolvedProperty.propertyConfig && !isDefaultFieldConfigId(resolvedProperty.propertyConfig)) {
|
|
185
|
-
const cmsFields = props.
|
|
185
|
+
const cmsFields = props.propertyConfigs;
|
|
186
186
|
if (!cmsFields && !ignoreMissingFields) {
|
|
187
187
|
throw Error(`Trying to resolve a property with key '${resolvedProperty.propertyConfig}' that inherits from a custom property config but no custom property configs were provided. Use the property 'propertyConfigs' in your app config to provide them`);
|
|
188
188
|
}
|
|
@@ -233,7 +233,7 @@ export function getArrayResolvedProperties<M>({
|
|
|
233
233
|
entityId?: string;
|
|
234
234
|
index?: number;
|
|
235
235
|
fromBuilder?: boolean;
|
|
236
|
-
|
|
236
|
+
propertyConfigs?: Record<string, PropertyConfig>
|
|
237
237
|
}) {
|
|
238
238
|
|
|
239
239
|
const of = property.of;
|
|
@@ -263,7 +263,7 @@ export function resolveArrayProperty<T extends any[], M>({
|
|
|
263
263
|
entityId?: string,
|
|
264
264
|
index?: number,
|
|
265
265
|
fromBuilder?: boolean;
|
|
266
|
-
|
|
266
|
+
propertyConfigs?: Record<string, PropertyConfig>;
|
|
267
267
|
ignoreMissingFields?: boolean;
|
|
268
268
|
}): ResolvedArrayProperty {
|
|
269
269
|
const propertyValue = propertyKey ? getIn(props.values, propertyKey) : undefined;
|
|
@@ -370,7 +370,7 @@ export function resolveProperties<M extends Record<string, any>>({
|
|
|
370
370
|
entityId?: string,
|
|
371
371
|
index?: number,
|
|
372
372
|
fromBuilder?: boolean;
|
|
373
|
-
|
|
373
|
+
propertyConfigs?: Record<string, PropertyConfig>;
|
|
374
374
|
ignoreMissingFields?: boolean;
|
|
375
375
|
}): ResolvedProperties<M> {
|
|
376
376
|
return Object.entries<PropertyOrBuilder>(properties as Record<string, PropertyOrBuilder>)
|