@sumaris-net/ngx-components 1.23.18 → 1.23.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.
@@ -25928,15 +25928,15 @@
25928
25928
  console.warn(this.constructor.name + ".listenChanges() not implemented yet. Will empty observable");
25929
25929
  return rxjs.of();
25930
25930
  }
25931
- var variables = opts && opts.variables || {
25931
+ var variables = (opts === null || opts === void 0 ? void 0 : opts.variables) || {
25932
25932
  id: id,
25933
25933
  interval: toNumber(opts && opts.interval, 0) // no timer by default
25934
25934
  };
25935
25935
  if (this._debug)
25936
25936
  console.debug(this._logPrefix + ("[WS] Listening for changes on " + this._logTypeName + " {" + id + "}..."));
25937
25937
  return this.graphql.subscribe({
25938
- query: opts && opts.query || this.subscriptions.listenChanges,
25939
- fetchPolicy: opts && opts.fetchPolicy || 'no-cache',
25938
+ query: (opts === null || opts === void 0 ? void 0 : opts.query) || this.subscriptions.listenChanges,
25939
+ fetchPolicy: (opts === null || opts === void 0 ? void 0 : opts.fetchPolicy) || 'no-cache',
25940
25940
  variables: variables,
25941
25941
  error: {
25942
25942
  code: ErrorCodes.SUBSCRIBE_DATA_ERROR,
@@ -25946,8 +25946,7 @@
25946
25946
  .pipe(operators.map(function (_b) {
25947
25947
  var data = _b.data;
25948
25948
  var entity = (!opts || opts.toEntity !== false) ? data && _this.fromObject(data) : data;
25949
- if (entity && _this._debug)
25950
- console.debug(_this._logPrefix + ("[WS] Received changes on " + _this._logTypeName + " {" + id + "}"), entity);
25949
+ //if (entity && this._debug) console.debug(this._logPrefix + `[WS] Received changes on ${this._logTypeName} {${id}}`, entity);
25951
25950
  // TODO: missing = deleted ?
25952
25951
  if (!entity)
25953
25952
  console.warn(_this._logPrefix + ("[WS] Received deletion on " + _this._logTypeName + " {" + id + "} - TODO check implementation"));
@@ -27367,8 +27366,10 @@
27367
27366
  if (!this.saveBeforeDelete) return [3 /*break*/, 3];
27368
27367
  // Exclude invalid rows (because of save() will fail, when exists some invalid rows)
27369
27368
  tempRows = tempRows.filter(function (row) {
27370
- // Delete the row, if newly created row (id = -1), or if invalid and not editing (= not cancellable)
27371
- if (row.id === -1 || (!row.valid && !row.editing)) {
27369
+ // Delete the row :
27370
+ // - if newly created row (id = -1),
27371
+ // - or if invalid and not editing (= not cancellable)
27372
+ if (row.id === -1 || (!row.editing && row.invalid)) {
27372
27373
  if (_this.debug)
27373
27374
  console.debug("[table] Delete row #" + row.id);
27374
27375
  row.delete();
@@ -27380,7 +27381,7 @@
27380
27381
  return false; // Exclude from the list to delete using the service
27381
27382
  }
27382
27383
  // Cancel the row (and mark as pristine), when not valid but in edition
27383
- else if (!row.valid && row.editing) {
27384
+ else if (row.editing && !row.valid) {
27384
27385
  row.cancel();
27385
27386
  // Mark row as pristine (if possible)
27386
27387
  _this.checkIfRowPristine(row, { emitEvent: false, onlySelf: true /*avoid propagation to table*/ });