nuxeo-development-framework 5.9.4 → 5.9.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.
@@ -1108,7 +1108,7 @@
1108
1108
  doFetch$1(options.url, fetchOptions)
1109
1109
  .then(function (res) {
1110
1110
  _this._activeRequests -= 1;
1111
- if (res.status === 302 || (res.status === 401 && !opts.refreshedAuthentication)) {
1111
+ if (res.status === 401 && !opts.refreshedAuthentication) {
1112
1112
  // try re-authenticate
1113
1113
  opts.refreshedAuthentication = true;
1114
1114
  return _this.refreshAccessToken()
@@ -6481,17 +6481,32 @@
6481
6481
  this.onSelecting.emit(value);
6482
6482
  };
6483
6483
  DynamicFormVocabularyItemComponent.prototype.writeValue = function (value) {
6484
+ var _this = this;
6484
6485
  // if (value) { removed to allow reseting ui when resetting form
6485
- if (this.data.some(function (item) { return item.id === value; })) {
6486
- this.selection = value;
6486
+ // this.selection = value;
6487
+ // }
6488
+ if (this.multiple) {
6489
+ // Ensure it's an array
6490
+ var incoming = Array.isArray(value) ? value : [];
6491
+ // Keep only IDs that exist in this.data
6492
+ this.selection = incoming.filter(function (id) { return _this.data.some(function (item) { return item.id === id; }); });
6493
+ // If after filtering it's empty, propagate null
6494
+ if (this.selection.length === 0 && this.propagateChange) {
6495
+ this.propagateChange(null);
6496
+ }
6487
6497
  }
6488
6498
  else {
6489
- this.selection = null;
6490
- if (this.propagateChange) {
6491
- this.propagateChange(null);
6499
+ // Single value mode
6500
+ if (this.data.some(function (item) { return item.id === value; })) {
6501
+ this.selection = value;
6502
+ }
6503
+ else {
6504
+ this.selection = null;
6505
+ if (this.propagateChange) {
6506
+ this.propagateChange(null);
6507
+ }
6492
6508
  }
6493
6509
  }
6494
- // }
6495
6510
  };
6496
6511
  DynamicFormVocabularyItemComponent.prototype.registerOnChange = function (fn) {
6497
6512
  this.propagateChange = fn;
@@ -12357,7 +12372,7 @@
12357
12372
  this.pageIndex = 0;
12358
12373
  this.fetchUsersByCustomApi = false;
12359
12374
  this.onSearch = new i0.EventEmitter();
12360
- this.searchFn = function (term, item) { return true; };
12375
+ this.searchFn = null;
12361
12376
  if (this.control) {
12362
12377
  this.control.valueAccessor = this;
12363
12378
  }