form0-core 0.1.18 → 0.1.19
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
CHANGED
|
@@ -32,6 +32,9 @@ const toFiniteNumberOrNull = (value) => {
|
|
|
32
32
|
return Number.isFinite(parsed) ? parsed : null;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
const toBooleanOrDefault = (value, fallback = false) =>
|
|
36
|
+
typeof value === 'boolean' ? value : fallback;
|
|
37
|
+
|
|
35
38
|
const toSchemaFormNode = (schema) => {
|
|
36
39
|
if (!isRecord(schema)) {
|
|
37
40
|
return null;
|
|
@@ -471,6 +474,8 @@ const collectRepeatableDatasets = (elements, context, datasets) => {
|
|
|
471
474
|
repeatable_field_id: repeatableFieldId,
|
|
472
475
|
repeatable_output_key: repeatableOutputKey,
|
|
473
476
|
root_dataset_id: ROOT_DATASET_ID,
|
|
477
|
+
location_enabled: toBooleanOrDefault(element.location_enabled),
|
|
478
|
+
location_required: toBooleanOrDefault(element.location_required),
|
|
474
479
|
fields: [],
|
|
475
480
|
};
|
|
476
481
|
|
|
@@ -507,6 +512,8 @@ export function buildDatasetDescriptors(schema) {
|
|
|
507
512
|
repeatable_field_id: null,
|
|
508
513
|
repeatable_output_key: null,
|
|
509
514
|
root_dataset_id: ROOT_DATASET_ID,
|
|
515
|
+
location_enabled: toBooleanOrDefault(formNode.location_enabled),
|
|
516
|
+
location_required: toBooleanOrDefault(formNode.location_required),
|
|
510
517
|
fields: [],
|
|
511
518
|
};
|
|
512
519
|
|