@griddo/ax 1.65.3 → 1.65.6
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/package.json +2 -2
- package/src/forms/validators.tsx +16 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "1.65.
|
|
4
|
+
"version": "1.65.6",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -220,5 +220,5 @@
|
|
|
220
220
|
"publishConfig": {
|
|
221
221
|
"access": "public"
|
|
222
222
|
},
|
|
223
|
-
"gitHead": "
|
|
223
|
+
"gitHead": "35baa12c2aab095804b0cae77be0da855c1ded86"
|
|
224
224
|
}
|
package/src/forms/validators.tsx
CHANGED
|
@@ -151,9 +151,11 @@ const isEmptyField = (value: any, fieldType: string, multiple: boolean) => {
|
|
|
151
151
|
case "ArrayFieldGroup":
|
|
152
152
|
return !value || !value.length;
|
|
153
153
|
case "ReferenceField":
|
|
154
|
-
return value.fixed && !value.fixed.length;
|
|
155
|
-
case "ComponentContainer":
|
|
156
|
-
|
|
154
|
+
return !value || (value.fixed && !value.fixed.length);
|
|
155
|
+
case "ComponentContainer": {
|
|
156
|
+
const { isEmpty } = isEmptyContainer(value, multiple);
|
|
157
|
+
return isEmpty;
|
|
158
|
+
}
|
|
157
159
|
default:
|
|
158
160
|
return typeof value === "string" && value.trim().length === 0;
|
|
159
161
|
}
|
|
@@ -228,16 +230,17 @@ const findFieldsErrors = (content: any): IErrorItem[] => {
|
|
|
228
230
|
if (currentObj.component && !isComponentEmpty(currentObj)) {
|
|
229
231
|
let schemaErrors: any[] = [];
|
|
230
232
|
const schema: any = getSchema(currentObj.component);
|
|
231
|
-
schema
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
233
|
+
schema &&
|
|
234
|
+
schema.configTabs.forEach((tab: any) => {
|
|
235
|
+
const valErrors: IErrorItem[] = getValidationErrors(
|
|
236
|
+
tab.fields,
|
|
237
|
+
currentObj,
|
|
238
|
+
schema.displayName,
|
|
239
|
+
tab.title,
|
|
240
|
+
false
|
|
241
|
+
);
|
|
242
|
+
schemaErrors = [...schemaErrors, ...valErrors];
|
|
243
|
+
});
|
|
241
244
|
errors = [...errors, ...schemaErrors];
|
|
242
245
|
}
|
|
243
246
|
|