@open-mercato/ui 0.6.6-develop.6205.1.109e4b6a84 → 0.6.6-develop.6228.1.cf483c68b5
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/backend/CrudForm.js +12 -0
- package/dist/backend/CrudForm.js.map +2 -2
- package/dist/backend/notifications/useNotificationActions.js +48 -20
- package/dist/backend/notifications/useNotificationActions.js.map +2 -2
- package/dist/backend/utils/customFieldForms.js +32 -0
- package/dist/backend/utils/customFieldForms.js.map +2 -2
- package/dist/primitives/tag-input.js +6 -2
- package/dist/primitives/tag-input.js.map +2 -2
- package/package.json +3 -3
- package/src/backend/CrudForm.tsx +12 -0
- package/src/backend/__tests__/CrudForm.custom-fields.test.tsx +67 -0
- package/src/backend/__tests__/custom-field-filters.test.ts +12 -0
- package/src/backend/__tests__/custom-field-forms.test.ts +29 -0
- package/src/backend/notifications/__tests__/useNotificationActions.failedWrites.test.tsx +8 -2
- package/src/backend/notifications/__tests__/useNotificationActions.test.tsx +147 -0
- package/src/backend/notifications/useNotificationActions.ts +58 -20
- package/src/backend/utils/customFieldForms.ts +34 -0
- package/src/primitives/__tests__/tag-input.test.tsx +7 -0
- package/src/primitives/tag-input.tsx +11 -1
package/dist/backend/CrudForm.js
CHANGED
|
@@ -2041,6 +2041,12 @@ function CrudForm({
|
|
|
2041
2041
|
for (const injectedId of injectedFieldIdSet) {
|
|
2042
2042
|
delete coreValues[injectedId];
|
|
2043
2043
|
}
|
|
2044
|
+
if (customEntity) {
|
|
2045
|
+
const allowedKeys = new Set(cfDefinitions.map((definition) => definition.key).filter(Boolean));
|
|
2046
|
+
for (const key of Object.keys(coreValues)) {
|
|
2047
|
+
if (!allowedKeys.has(key)) delete coreValues[key];
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2044
2050
|
let parsedValues;
|
|
2045
2051
|
if (schema) {
|
|
2046
2052
|
const res = schema.safeParse(collapseDotPathFields(coreValues, dotPathBaseFieldIds));
|
|
@@ -2073,6 +2079,12 @@ function CrudForm({
|
|
|
2073
2079
|
for (const injectedId of injectedFieldIdSet) {
|
|
2074
2080
|
delete projectedCoreValues[injectedId];
|
|
2075
2081
|
}
|
|
2082
|
+
if (customEntity) {
|
|
2083
|
+
const allowedKeys = new Set(cfDefinitions.map((definition) => definition.key).filter(Boolean));
|
|
2084
|
+
for (const key of Object.keys(projectedCoreValues)) {
|
|
2085
|
+
if (!allowedKeys.has(key)) delete projectedCoreValues[key];
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2076
2088
|
coreSubmitValues = schema ? schema.parse(collapseDotPathFields(projectedCoreValues, dotPathBaseFieldIds)) : projectedCoreValues;
|
|
2077
2089
|
if (result.applyToForm) {
|
|
2078
2090
|
setValues(result.data);
|