@sumaris-net/ngx-components 2.4.0-rc4 → 2.4.0-rc6
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.
- package/esm2020/src/app/core/services/local-settings.service.mjs +5 -5
- package/esm2020/src/app/core/table/async-table.class.mjs +2 -2
- package/esm2020/src/app/core/table/entities-async-table-datasource.class.mjs +5 -6
- package/fesm2015/sumaris-net.ngx-components.mjs +9 -10
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +9 -10
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -13326,11 +13326,11 @@ class LocalSettingsService extends StartableService {
|
|
|
13326
13326
|
async restoreLocally() {
|
|
13327
13327
|
let data = this._data || {};
|
|
13328
13328
|
// Restore from storage
|
|
13329
|
-
const
|
|
13329
|
+
const settings = await this.storage.get(SETTINGS_STORAGE_KEY);
|
|
13330
13330
|
// Restore local settings (or keep old settings)
|
|
13331
|
-
if (
|
|
13331
|
+
if (isNotNil(settings)) {
|
|
13332
13332
|
console.info('[settings] Restoring previous settings...');
|
|
13333
|
-
const restoredData = JSON.parse(
|
|
13333
|
+
const restoredData = (typeof settings === 'string') ? JSON.parse(settings) : settings;
|
|
13334
13334
|
// Avoid to override transient properties
|
|
13335
13335
|
SETTINGS_TRANSIENT_PROPERTIES.forEach(transientKey => {
|
|
13336
13336
|
delete restoredData[transientKey];
|
|
@@ -13624,7 +13624,7 @@ class LocalSettingsService extends StartableService {
|
|
|
13624
13624
|
}
|
|
13625
13625
|
else {
|
|
13626
13626
|
console.debug('[settings] Store local settings', this._data);
|
|
13627
|
-
return this.storage.set(SETTINGS_STORAGE_KEY,
|
|
13627
|
+
return this.storage.set(SETTINGS_STORAGE_KEY, this._data);
|
|
13628
13628
|
}
|
|
13629
13629
|
}
|
|
13630
13630
|
// Execute with delay
|
|
@@ -29119,13 +29119,12 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
|
|
|
29119
29119
|
// Sometime, the service miss deletion, or GraphQl cache remove failed.
|
|
29120
29120
|
// In this case, apply missing deletion using the parent delete() function
|
|
29121
29121
|
const rowNotDeleted = this.getRows().filter(row => rows.includes(row));
|
|
29122
|
-
const deleteFn = super.delete;
|
|
29123
29122
|
if (isNotEmptyArray(rowNotDeleted)) {
|
|
29124
29123
|
console.warn(`[entities-table-datasource] Force deletion of ${rowNotDeleted.length} rows! Please check that data service update the cache, after deletion`);
|
|
29125
|
-
|
|
29126
|
-
|
|
29127
|
-
.
|
|
29128
|
-
|
|
29124
|
+
// Start at the end
|
|
29125
|
+
for (const r of rowNotDeleted.sort((a, b) => a.id > b.id ? -1 : 1)) {
|
|
29126
|
+
await super.delete(r.id);
|
|
29127
|
+
}
|
|
29129
29128
|
}
|
|
29130
29129
|
}
|
|
29131
29130
|
catch (err) {
|
|
@@ -30606,7 +30605,7 @@ class AppAsyncTable {
|
|
|
30606
30605
|
const confirmed = (!opts || opts.interactive !== false);
|
|
30607
30606
|
// Ask user confirmation, if cancel
|
|
30608
30607
|
if (!confirmed && row.dirty && (this.confirmBeforeCancel || this.onBeforeCancelRows.observers.length > 0)) {
|
|
30609
|
-
event
|
|
30608
|
+
event?.stopPropagation();
|
|
30610
30609
|
if (!await this.canCancelRows([row], opts)) {
|
|
30611
30610
|
return;
|
|
30612
30611
|
}
|