@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.
@@ -22410,15 +22410,15 @@ class BaseEntityService extends BaseGraphqlService {
22410
22410
  console.warn(`${this.constructor.name}.listenChanges() not implemented yet. Will empty observable`);
22411
22411
  return of();
22412
22412
  }
22413
- const variables = opts && opts.variables || {
22413
+ const variables = (opts === null || opts === void 0 ? void 0 : opts.variables) || {
22414
22414
  id,
22415
22415
  interval: toNumber(opts && opts.interval, 0) // no timer by default
22416
22416
  };
22417
22417
  if (this._debug)
22418
22418
  console.debug(this._logPrefix + `[WS] Listening for changes on ${this._logTypeName} {${id}}...`);
22419
22419
  return this.graphql.subscribe({
22420
- query: opts && opts.query || this.subscriptions.listenChanges,
22421
- fetchPolicy: opts && opts.fetchPolicy || 'no-cache',
22420
+ query: (opts === null || opts === void 0 ? void 0 : opts.query) || this.subscriptions.listenChanges,
22421
+ fetchPolicy: (opts === null || opts === void 0 ? void 0 : opts.fetchPolicy) || 'no-cache',
22422
22422
  variables,
22423
22423
  error: {
22424
22424
  code: ErrorCodes.SUBSCRIBE_DATA_ERROR,
@@ -22427,8 +22427,7 @@ class BaseEntityService extends BaseGraphqlService {
22427
22427
  })
22428
22428
  .pipe(map(({ data }) => {
22429
22429
  const entity = (!opts || opts.toEntity !== false) ? data && this.fromObject(data) : data;
22430
- if (entity && this._debug)
22431
- console.debug(this._logPrefix + `[WS] Received changes on ${this._logTypeName} {${id}}`, entity);
22430
+ //if (entity && this._debug) console.debug(this._logPrefix + `[WS] Received changes on ${this._logTypeName} {${id}}`, entity);
22432
22431
  // TODO: missing = deleted ?
22433
22432
  if (!entity)
22434
22433
  console.warn(this._logPrefix + `[WS] Received deletion on ${this._logTypeName} {${id}} - TODO check implementation`);
@@ -23639,8 +23638,10 @@ class AppTable {
23639
23638
  if (this.saveBeforeDelete) {
23640
23639
  // Exclude invalid rows (because of save() will fail, when exists some invalid rows)
23641
23640
  tempRows = tempRows.filter(row => {
23642
- // Delete the row, if newly created row (id = -1), or if invalid and not editing (= not cancellable)
23643
- if (row.id === -1 || (!row.valid && !row.editing)) {
23641
+ // Delete the row :
23642
+ // - if newly created row (id = -1),
23643
+ // - or if invalid and not editing (= not cancellable)
23644
+ if (row.id === -1 || (!row.editing && row.invalid)) {
23644
23645
  if (this.debug)
23645
23646
  console.debug(`[table] Delete row #${row.id}`);
23646
23647
  row.delete();
@@ -23652,7 +23653,7 @@ class AppTable {
23652
23653
  return false; // Exclude from the list to delete using the service
23653
23654
  }
23654
23655
  // Cancel the row (and mark as pristine), when not valid but in edition
23655
- else if (!row.valid && row.editing) {
23656
+ else if (row.editing && !row.valid) {
23656
23657
  row.cancel();
23657
23658
  // Mark row as pristine (if possible)
23658
23659
  this.checkIfRowPristine(row, { emitEvent: false, onlySelf: true /*avoid propagation to table*/ });