@sumaris-net/ngx-components 1.23.3 → 1.23.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.
@@ -17509,6 +17509,7 @@ class AppForm {
17509
17509
  this._subscription = new Subscription();
17510
17510
  this._enable = false;
17511
17511
  this.i18nFieldPrefix = null;
17512
+ this.destroySubject = new Subject();
17512
17513
  this.readySubject = new BehaviorSubject(false);
17513
17514
  this.loadingSubject = new BehaviorSubject(true);
17514
17515
  this.errorSubject = new BehaviorSubject(undefined);
@@ -17630,6 +17631,8 @@ class AppForm {
17630
17631
  this.errorSubject.unsubscribe();
17631
17632
  this.onCancel.unsubscribe();
17632
17633
  this.onSubmit.unsubscribe();
17634
+ this.destroySubject.next();
17635
+ this.destroySubject.unsubscribe();
17633
17636
  }
17634
17637
  cancel() {
17635
17638
  return __awaiter(this, void 0, void 0, function* () {
@@ -22592,24 +22595,17 @@ class EntitiesTableDataSource extends TableDataSource {
22592
22595
  return __awaiter(this, void 0, void 0, function* () {
22593
22596
  this.markAsLoading();
22594
22597
  const data = this.getDataFromRows(rows);
22595
- const rowsById = Beans.collectById(rows);
22596
22598
  try {
22597
22599
  // Call service deletion
22598
22600
  yield this.dataService.deleteAll(data, this.serviceOptions);
22599
22601
  // Workaround, to be sure all rows have been deleted
22600
- // Sometimes, the service miss deletion, or GrapQHl cache remove failed
22601
- const rowNotDeleted = Object.getOwnPropertyNames(rowsById)
22602
- .reduce((res, id) => {
22603
- const row = rowsById[id];
22604
- const present = this.getRow(+id) === row;
22605
- return present ? res.concat(row) : res;
22606
- }, []);
22607
- //this.getRows().filter(row => rows.includes(row));
22608
- // Apply missing deletion
22602
+ // Sometime, the service miss deletion, or GraphQl cache remove failed.
22603
+ // In this case, apply missing deletion using the super.delete() function
22604
+ const rowNotDeleted = this.getRows().filter(rows.includes);
22609
22605
  if (isNotEmptyArray(rowNotDeleted)) {
22610
- console.warn(`[table-datasource] Force deletion of ${rowNotDeleted.length} rows (Is service update the cache ?)`);
22606
+ console.warn(`[table-datasource] Force deletion of ${rowNotDeleted.length} rows! Please check that data service update the cache, after deletion`);
22611
22607
  rowNotDeleted
22612
- // Start from the end
22608
+ // Start at the end
22613
22609
  .sort((a, b) => a.id > b.id ? -1 : 1)
22614
22610
  .forEach(r => _super.delete.call(this, r.id));
22615
22611
  }
@@ -22736,8 +22732,8 @@ class AppTable {
22736
22732
  this._subscription = new Subscription();
22737
22733
  this._cellValueChangesDefs = {};
22738
22734
  this._enabled = true;
22739
- this._destroy$ = new Subject();
22740
22735
  this.allowRowDetail = true;
22736
+ this.destroySubject = new Subject();
22741
22737
  this.excludesColumns = [];
22742
22738
  this.totalRowCount = null;
22743
22739
  this.readySubject = new BehaviorSubject(false);
@@ -23032,7 +23028,7 @@ class AppTable {
23032
23028
  // Stop if next another row, or destroying
23033
23029
  combineLatest([
23034
23030
  this.onStartEditingRow,
23035
- this._destroy$
23031
+ this.destroySubject
23036
23032
  ])
23037
23033
  // DEBUG
23038
23034
  //.pipe(
@@ -23129,8 +23125,8 @@ class AppTable {
23129
23125
  this.onSort.unsubscribe();
23130
23126
  this.onDirty.unsubscribe();
23131
23127
  this.onError.unsubscribe();
23132
- this._destroy$.next();
23133
- this._destroy$.unsubscribe();
23128
+ this.destroySubject.next();
23129
+ this.destroySubject.unsubscribe();
23134
23130
  (_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.ngOnDestroy();
23135
23131
  }
23136
23132
  updateView(res, opts) {
@@ -24349,6 +24345,7 @@ class AppEditor {
24349
24345
  this._subscription = new Subscription();
24350
24346
  this._enabled = false;
24351
24347
  this._dirty = false;
24348
+ this.destroySubject = new Subject();
24352
24349
  this.readySubject = new BehaviorSubject(false);
24353
24350
  this.loadingSubject = new BehaviorSubject(true);
24354
24351
  this.errorSubject = new BehaviorSubject(undefined);
@@ -24433,13 +24430,15 @@ class AppEditor {
24433
24430
  }
24434
24431
  }
24435
24432
  ngAfterViewInit() {
24436
- // Can be override by subclasses
24433
+ // Can be overridden by subclasses
24437
24434
  }
24438
24435
  ngOnDestroy() {
24439
24436
  this._subscription.unsubscribe();
24440
24437
  this.readySubject.unsubscribe();
24441
24438
  this.loadingSubject.unsubscribe();
24442
24439
  this.errorSubject.unsubscribe();
24440
+ this.destroySubject.next();
24441
+ this.destroySubject.unsubscribe();
24443
24442
  }
24444
24443
  addChildForm(form) {
24445
24444
  if (!form)