@vgip/meta-ui 1.3.4 → 1.3.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.
@@ -348,7 +348,7 @@ const fieldNormalizer = (field, uniqFieldNames) => {
348
348
  type: field.name ? 'list' : 'missing name',
349
349
  label: field.label,
350
350
  name: field.name,
351
- list: fieldNormalizer(uniqueNameFilter(list, uniqFieldNames, !list.name), uniqFieldNames)
351
+ list: fieldNormalizer(uniqueNameFilter(list, uniqFieldNames), uniqFieldNames)
352
352
  };
353
353
  }
354
354
  else {
@@ -3429,7 +3429,7 @@ class FieldReference extends FieldAbstract {
3429
3429
  value = null;
3430
3430
  }
3431
3431
  if (this.multiple) {
3432
- if (value) {
3432
+ if (value && value instanceof Array) {
3433
3433
  for (const v of value) {
3434
3434
  if (!this.model) {
3435
3435
  this.model = [];
@@ -3442,7 +3442,9 @@ class FieldReference extends FieldAbstract {
3442
3442
  });
3443
3443
  }
3444
3444
  }
3445
- // this.value = value;
3445
+ }
3446
+ else {
3447
+ value = null; // protect when value from server is not array
3446
3448
  }
3447
3449
  }
3448
3450
  else {
@@ -3461,10 +3463,13 @@ class FieldReference extends FieldAbstract {
3461
3463
  // }
3462
3464
  }
3463
3465
  this.model = value;
3464
- this.value = this.modelToValue(value, this.meta.valueType || 'object');
3465
3466
  if (!this.multiple) {
3467
+ this.value = this.modelToValue(value, this.meta.valueType || 'object');
3466
3468
  this.buildExternalLink();
3467
3469
  }
3470
+ else {
3471
+ this.value = !this.model ? this.model : this.model.map((m) => this.modelToValue(m, this.meta.valueType || 'object'));
3472
+ }
3468
3473
  this.meta.$optional = this.isOptional;
3469
3474
  },
3470
3475
  get: () => this.value,
@@ -4503,7 +4508,7 @@ class MetaResource {
4503
4508
  }
4504
4509
  this.model._vgis.layoutId = this.currentLayoutId;
4505
4510
  // eslint-disable-next-line max-len
4506
- this.model._vgis.timeZoneOffsetInMinutes = 0; // we are not providing timezone anymore (as V3), instead the 'time' and 'date' objects are converted so the UTC time/date is correct
4511
+ // this.model._vgis.timeZoneOffsetInMinutes = 0; // we are not providing timezone anymore (as V3), instead the 'time' and 'date' objects are converted so the UTC time/date is correct
4507
4512
  this.model._vgis.eventId = this.metaContext.vgipEventId;
4508
4513
  /* eslint-enable no-underscore-dangle */
4509
4514
  }