@sumaris-net/ngx-components 1.19.3 → 1.20.0-rc1
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/bundles/sumaris-net.ngx-components.umd.js +214 -122
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +1 -0
- package/esm2015/src/app/admin/users/list/users.js +5 -1
- package/esm2015/src/app/core/core.module.js +3 -1
- package/esm2015/src/app/core/services/model/entity.model.js +5 -1
- package/esm2015/src/app/core/table/entities-table-datasource.class.js +136 -99
- package/esm2015/src/app/core/table/memory-table.class.js +3 -3
- package/esm2015/src/app/core/table/table.class.js +4 -5
- package/esm2015/src/app/shared/validator/validators.js +2 -2
- package/fesm2015/sumaris-net.ngx-components.js +146 -102
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +2 -2
- package/src/app/core/services/model/entity.model.d.ts +1 -0
- package/src/app/core/table/entities-table-datasource.class.d.ts +20 -26
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -2908,7 +2908,7 @@ const moment$2 = momentImported;
|
|
|
2908
2908
|
// @dynamic
|
|
2909
2909
|
class SharedValidators {
|
|
2910
2910
|
static getDoubleRegexp(maxDecimals) {
|
|
2911
|
-
if (isNil(maxDecimals))
|
|
2911
|
+
if (isNil(maxDecimals) || maxDecimals === -1)
|
|
2912
2912
|
return this._REGEXP_CACHE.DOUBLE_BY_MAX_DECIMALS.NO_LIMIT;
|
|
2913
2913
|
if (maxDecimals < 0)
|
|
2914
2914
|
throw new Error(`Invalid maxDecimals value: ${maxDecimals}`);
|
|
@@ -9730,6 +9730,10 @@ class EntityUtils {
|
|
|
9730
9730
|
return isNotNil(obj.__typename) && (typeof obj.fromObject === 'function') && (typeof obj.asObject === 'function');
|
|
9731
9731
|
}
|
|
9732
9732
|
// Check that the object has a NOT nil attribute (ID by default)
|
|
9733
|
+
static isNotEntity(obj) {
|
|
9734
|
+
return isNil(obj.__typename) || (typeof obj.fromObject !== 'function') || (typeof obj.asObject !== 'function');
|
|
9735
|
+
}
|
|
9736
|
+
// Check that the object has a NOT nil attribute (ID by default)
|
|
9733
9737
|
static isNotEmpty(obj, checkedAttribute) {
|
|
9734
9738
|
return !!obj && obj[checkedAttribute] !== null && obj[checkedAttribute] !== undefined;
|
|
9735
9739
|
}
|
|
@@ -20974,6 +20978,7 @@ CoreModule.decorators = [
|
|
|
20974
20978
|
CacheModule,
|
|
20975
20979
|
IonicStorageModule,
|
|
20976
20980
|
NgxJdenticonModule,
|
|
20981
|
+
TranslateModule.forChild(),
|
|
20977
20982
|
// Sub modules
|
|
20978
20983
|
AppGraphQLModule,
|
|
20979
20984
|
AppMenuModule
|
|
@@ -21562,8 +21567,6 @@ class AppTableUtils {
|
|
|
21562
21567
|
}
|
|
21563
21568
|
}
|
|
21564
21569
|
|
|
21565
|
-
class AppTableDataSourceOptions {
|
|
21566
|
-
}
|
|
21567
21570
|
// @dynamic
|
|
21568
21571
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
21569
21572
|
class EntitiesTableDataSource extends TableDataSource {
|
|
@@ -21572,34 +21575,27 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21572
21575
|
*
|
|
21573
21576
|
* @param dataService A service to load and save data
|
|
21574
21577
|
* @param dataType Type of data contained by the Table. If not specified, then `data` with at least one element must be specified.
|
|
21575
|
-
* @param environment
|
|
21576
21578
|
* @param validatorService Service that create instances of the FormGroup used to validate row fields.
|
|
21577
21579
|
* @param config Additional configuration for table.
|
|
21578
21580
|
*/
|
|
21579
21581
|
constructor(dataType, dataService, validatorService, config) {
|
|
21580
|
-
super([], dataType, validatorService, config);
|
|
21582
|
+
super([], dataType, validatorService, Object.assign({ dataServiceOptions: {}, debug: config && config.suppressErrors === false, keepOriginalDataAfterConfirm: false }, config));
|
|
21581
21583
|
this.dataService = dataService;
|
|
21582
21584
|
this._creating = false;
|
|
21583
21585
|
this._saving = false;
|
|
21584
|
-
this._useValidator = false;
|
|
21585
21586
|
this._stopWatching$ = new Subject();
|
|
21586
21587
|
this._editingRowCount = 0;
|
|
21587
21588
|
this._fetchMoreFn = null;
|
|
21588
21589
|
this.loadingSubject = new BehaviorSubject(undefined);
|
|
21589
|
-
this._options = Object.assign({ dataServiceOptions: {}, debug: config && config.suppressErrors === false, keepOriginalDataAfterConfirm: false }, config);
|
|
21590
|
-
this._useValidator = isNotNil(validatorService);
|
|
21591
21590
|
this._logTypeName = removeEnd((new dataType()).__typename || 'UnknownVO', 'VO');
|
|
21592
21591
|
// For DEV ONLY
|
|
21593
|
-
this._debug = this.
|
|
21592
|
+
this._debug = this.config.debug === true;
|
|
21594
21593
|
}
|
|
21595
21594
|
get serviceOptions() {
|
|
21596
|
-
return this.
|
|
21595
|
+
return this.config.dataServiceOptions;
|
|
21597
21596
|
}
|
|
21598
21597
|
set serviceOptions(value) {
|
|
21599
|
-
this.
|
|
21600
|
-
}
|
|
21601
|
-
get options() {
|
|
21602
|
-
return this._options;
|
|
21598
|
+
this.config.dataServiceOptions = value;
|
|
21603
21599
|
}
|
|
21604
21600
|
get loaded() {
|
|
21605
21601
|
return this.loadingSubject.value === false; // Should be false when undefined (initial state)
|
|
@@ -21607,12 +21603,11 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21607
21603
|
get loading() {
|
|
21608
21604
|
return this.loadingSubject.value !== false; // Should be true when undefined (initial state)
|
|
21609
21605
|
}
|
|
21610
|
-
|
|
21606
|
+
disconnect(collectionViewer) {
|
|
21607
|
+
super.disconnect(collectionViewer);
|
|
21611
21608
|
this._stopWatching$.next();
|
|
21612
21609
|
this._stopWatching$.complete();
|
|
21613
|
-
this._stopWatching$.unsubscribe();
|
|
21614
21610
|
this.loadingSubject.complete();
|
|
21615
|
-
this.loadingSubject.unsubscribe();
|
|
21616
21611
|
}
|
|
21617
21612
|
watchAll(offset, size, sortBy, sortDirection, filter) {
|
|
21618
21613
|
this._stopWatching$.next();
|
|
@@ -21656,27 +21651,26 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21656
21651
|
// Get all rows
|
|
21657
21652
|
const rows = yield this.getRows();
|
|
21658
21653
|
// Finish editing all rows
|
|
21659
|
-
const
|
|
21654
|
+
const confirmed = yield this.confirmRows(rows);
|
|
21660
21655
|
// Cannot finish some rows: error
|
|
21661
|
-
if (
|
|
21656
|
+
if (!confirmed) {
|
|
21662
21657
|
// log errors
|
|
21663
21658
|
if (this._debug)
|
|
21664
|
-
|
|
21659
|
+
this.getEditingRows(rows).forEach(row => AppTableUtils.logRowErrors(row, `[table-datasource] ${this._logTypeName} row #${row.id}`));
|
|
21665
21660
|
// Stop with an error
|
|
21666
21661
|
throw { code: ErrorCodes.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
|
|
21667
21662
|
}
|
|
21668
21663
|
this._editingRowCount = 0;
|
|
21669
21664
|
let data;
|
|
21670
21665
|
let dataToSave;
|
|
21671
|
-
if (this.
|
|
21666
|
+
if (!!this.validatorService) {
|
|
21672
21667
|
dataToSave = [];
|
|
21673
21668
|
data = rows.map(row => {
|
|
21674
|
-
const
|
|
21675
|
-
currentData.fromObject(row.currentData);
|
|
21669
|
+
const entity = this.toEntity(row.currentData);
|
|
21676
21670
|
// Filter to keep only dirty row
|
|
21677
21671
|
if (onlyDirtyRows && row.validator.dirty)
|
|
21678
|
-
dataToSave.push(
|
|
21679
|
-
return
|
|
21672
|
+
dataToSave.push(entity);
|
|
21673
|
+
return entity;
|
|
21680
21674
|
});
|
|
21681
21675
|
if (!onlyDirtyRows)
|
|
21682
21676
|
dataToSave = data;
|
|
@@ -21713,25 +21707,33 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21713
21707
|
}
|
|
21714
21708
|
});
|
|
21715
21709
|
}
|
|
21716
|
-
|
|
21717
|
-
if (
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
if (!opts || opts.emitEvent !== false) {
|
|
21721
|
-
this.markAsLoaded();
|
|
21710
|
+
getDataFromRows(rows, options = { originalData: false, toEntity: false }) {
|
|
21711
|
+
if (options.toEntity) {
|
|
21712
|
+
return super.getDataFromRows(rows, options)
|
|
21713
|
+
.map(data => this.toEntity(data));
|
|
21722
21714
|
}
|
|
21715
|
+
return super.getDataFromRows(rows, options);
|
|
21723
21716
|
}
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
return
|
|
21717
|
+
toEntity(data) {
|
|
21718
|
+
if (EntityUtils.isNotEntity(data)) {
|
|
21719
|
+
const entity = new this.dataConstructor();
|
|
21720
|
+
entity.fromObject(data);
|
|
21721
|
+
return entity;
|
|
21722
|
+
}
|
|
21723
|
+
return data;
|
|
21731
21724
|
}
|
|
21732
|
-
|
|
21733
|
-
|
|
21734
|
-
|
|
21725
|
+
updateDatasource(data, opts = { emitEvent: true }) {
|
|
21726
|
+
const _super = Object.create(null, {
|
|
21727
|
+
updateDatasource: { get: () => super.updateDatasource }
|
|
21728
|
+
});
|
|
21729
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21730
|
+
if (this._debug)
|
|
21731
|
+
console.debug(`[table-datasource] Updating datasource with data:`, data);
|
|
21732
|
+
yield _super.updateDatasource.call(this, data, opts);
|
|
21733
|
+
if (opts.emitEvent) {
|
|
21734
|
+
this.markAsLoaded();
|
|
21735
|
+
}
|
|
21736
|
+
});
|
|
21735
21737
|
}
|
|
21736
21738
|
waitIdle(debounceTimeMs) {
|
|
21737
21739
|
return firstFalsePromise(this.loadingSubject
|
|
@@ -21740,34 +21742,60 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21740
21742
|
));
|
|
21741
21743
|
}
|
|
21742
21744
|
confirmCreate(row) {
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
|
|
21749
|
-
|
|
21745
|
+
const _super = Object.create(null, {
|
|
21746
|
+
confirmCreate: { get: () => super.confirmCreate }
|
|
21747
|
+
});
|
|
21748
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21749
|
+
if (!(yield _super.confirmCreate.call(this, row)))
|
|
21750
|
+
return false;
|
|
21751
|
+
if (row.editing && row.validator) {
|
|
21752
|
+
console.warn('[table-datasource] Row still has {editing: true} after confirmCreate()! Force editing to false');
|
|
21753
|
+
row.validator.disable({ onlySelf: true, emitEvent: false });
|
|
21754
|
+
}
|
|
21755
|
+
return true;
|
|
21756
|
+
});
|
|
21750
21757
|
}
|
|
21751
21758
|
confirmEdit(row) {
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
+
const _super = Object.create(null, {
|
|
21760
|
+
confirmEdit: { get: () => super.confirmEdit }
|
|
21761
|
+
});
|
|
21762
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21763
|
+
if (!(yield _super.confirmEdit.call(this, row)))
|
|
21764
|
+
return false;
|
|
21765
|
+
if (row.editing && row.validator) {
|
|
21766
|
+
console.warn('[table-datasource] Row still has {editing: true} after confirmCreate()! Force editing to false');
|
|
21767
|
+
row.validator.disable({ onlySelf: true, emitEvent: false });
|
|
21768
|
+
}
|
|
21769
|
+
return true;
|
|
21770
|
+
});
|
|
21759
21771
|
}
|
|
21760
21772
|
startEdit(row) {
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
this
|
|
21773
|
+
const _super = Object.create(null, {
|
|
21774
|
+
startEdit: { get: () => super.startEdit }
|
|
21775
|
+
});
|
|
21776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21777
|
+
if (row.editing)
|
|
21778
|
+
return; // Already editing
|
|
21779
|
+
if (this._debug)
|
|
21780
|
+
console.debug('[table-datasource] Start to edit row', row);
|
|
21781
|
+
const done = yield _super.startEdit.call(this, row);
|
|
21782
|
+
if (done)
|
|
21783
|
+
this._editingRowCount++;
|
|
21784
|
+
return done;
|
|
21785
|
+
});
|
|
21765
21786
|
}
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
this
|
|
21787
|
+
cancel(row) {
|
|
21788
|
+
const _super = Object.create(null, {
|
|
21789
|
+
cancel: { get: () => super.cancel }
|
|
21790
|
+
});
|
|
21791
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21792
|
+
if (this._debug)
|
|
21793
|
+
console.debug('[table-datasource] Cancelling row', row);
|
|
21794
|
+
const done = yield _super.cancel.call(this, row);
|
|
21795
|
+
if (done)
|
|
21796
|
+
this._editingRowCount--;
|
|
21797
|
+
return done;
|
|
21798
|
+
});
|
|
21771
21799
|
}
|
|
21772
21800
|
handleError(error, message) {
|
|
21773
21801
|
const errorMsg = error && error.message || error;
|
|
@@ -21782,37 +21810,47 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21782
21810
|
throw error;
|
|
21783
21811
|
}
|
|
21784
21812
|
delete(id) {
|
|
21785
|
-
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
|
|
21789
|
-
|
|
21790
|
-
|
|
21791
|
-
|
|
21792
|
-
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21813
|
+
const _super = Object.create(null, {
|
|
21814
|
+
delete: { get: () => super.delete }
|
|
21815
|
+
});
|
|
21816
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21817
|
+
// If new row: not need to propagate to the dataService
|
|
21818
|
+
if (id === -1) {
|
|
21819
|
+
return _super.delete.call(this, id);
|
|
21820
|
+
}
|
|
21821
|
+
const row = this.getRow(id);
|
|
21822
|
+
if (!row) {
|
|
21823
|
+
console.error(`[table-datasource] Row to delete with id=${id} not found`);
|
|
21824
|
+
return;
|
|
21825
|
+
}
|
|
21826
|
+
this.markAsLoading();
|
|
21827
|
+
try {
|
|
21828
|
+
yield this.dataService.deleteAll([row.currentData], this.serviceOptions);
|
|
21829
|
+
// Make sure row has been deleted (because GrapQHl cache remove can failed)
|
|
21830
|
+
yield sleep(300);
|
|
21800
21831
|
const present = this.getRow(id) === row;
|
|
21801
|
-
if (present)
|
|
21802
|
-
|
|
21803
|
-
|
|
21804
|
-
|
|
21832
|
+
if (present) {
|
|
21833
|
+
console.warn('[table-datasource] Force deletion of 1 row (Is service applying deletion to observable ?)');
|
|
21834
|
+
yield _super.delete.call(this, id);
|
|
21835
|
+
}
|
|
21836
|
+
}
|
|
21837
|
+
catch (err) {
|
|
21838
|
+
this.handleErrorPromise(err);
|
|
21839
|
+
}
|
|
21840
|
+
finally {
|
|
21841
|
+
this.markAsLoaded();
|
|
21842
|
+
}
|
|
21805
21843
|
});
|
|
21806
21844
|
}
|
|
21807
21845
|
deleteAll(rows) {
|
|
21808
21846
|
this.markAsLoading();
|
|
21809
|
-
const data =
|
|
21847
|
+
const data = this.getDataFromRows(rows);
|
|
21810
21848
|
const rowsById = rows.reduce((res, row) => {
|
|
21811
21849
|
res[row.id] = row;
|
|
21812
21850
|
return res;
|
|
21813
21851
|
}, {});
|
|
21814
21852
|
const self = this;
|
|
21815
|
-
const
|
|
21853
|
+
const inheritedDelete = super.delete;
|
|
21816
21854
|
return this.dataService.deleteAll(data, this.serviceOptions)
|
|
21817
21855
|
.catch(err => this.handleErrorPromise(err))
|
|
21818
21856
|
.then(() => {
|
|
@@ -21826,13 +21864,13 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21826
21864
|
// Apply missing deletion
|
|
21827
21865
|
if (isNotEmptyArray(rowNotDeleted)) {
|
|
21828
21866
|
console.warn(`[table-datasource] Force deletion of ${rowNotDeleted.length} rows (Is service applying deletion to observable ?)`);
|
|
21829
|
-
rowNotDeleted.forEach(r =>
|
|
21867
|
+
rowNotDeleted.forEach(r => inheritedDelete.call(self, r.id));
|
|
21830
21868
|
}
|
|
21831
21869
|
this.loadingSubject.next(false);
|
|
21832
21870
|
});
|
|
21833
21871
|
}
|
|
21834
21872
|
getRows() {
|
|
21835
|
-
return
|
|
21873
|
+
return this.rowsSubject.toPromise();
|
|
21836
21874
|
}
|
|
21837
21875
|
asyncCreateNew(insertAt) {
|
|
21838
21876
|
const _super = Object.create(null, {
|
|
@@ -21844,8 +21882,8 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21844
21882
|
this._creating = true;
|
|
21845
21883
|
_super.createNew.call(this, insertAt);
|
|
21846
21884
|
const row = this.getRow(-1);
|
|
21847
|
-
if (row && this.
|
|
21848
|
-
const res = this.
|
|
21885
|
+
if (row && this.config.onRowCreated) {
|
|
21886
|
+
const res = this.config.onRowCreated(row);
|
|
21849
21887
|
// If async function, wait the end before ending
|
|
21850
21888
|
if (res instanceof Promise) {
|
|
21851
21889
|
try {
|
|
@@ -21872,21 +21910,24 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
21872
21910
|
});
|
|
21873
21911
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21874
21912
|
if (!this._fetchMoreFn)
|
|
21875
|
-
return false;
|
|
21913
|
+
return false;
|
|
21876
21914
|
if (this._editingRowCount > 0) {
|
|
21877
21915
|
console.warn('Cannot fetch more because still editing row');
|
|
21878
21916
|
return;
|
|
21879
21917
|
}
|
|
21918
|
+
// Forget the fetchMore function, to avoid multiple call
|
|
21919
|
+
const fetchMoreFn = this._fetchMoreFn;
|
|
21920
|
+
this._fetchMoreFn = null;
|
|
21880
21921
|
// Fetch next page
|
|
21881
|
-
|
|
21882
|
-
const res = yield this._fetchMoreFn();
|
|
21922
|
+
const res = yield fetchMoreFn();
|
|
21883
21923
|
// Skip if empty (no more data)
|
|
21884
21924
|
if (isNotEmptyArray(res === null || res === void 0 ? void 0 : res.data))
|
|
21885
21925
|
return false;
|
|
21886
21926
|
// Update the data source
|
|
21927
|
+
// TODO review this, to keep existing rows, instead of creating new TableElement + validator !
|
|
21887
21928
|
const existingData = yield this.getData();
|
|
21888
|
-
_super.updateDatasource.call(this, existingData.concat(...res.data), opts);
|
|
21889
|
-
//
|
|
21929
|
+
yield _super.updateDatasource.call(this, existingData.concat(...res.data), opts);
|
|
21930
|
+
// Store next fetchMore function
|
|
21890
21931
|
this._fetchMoreFn = res.fetchMore;
|
|
21891
21932
|
return true;
|
|
21892
21933
|
});
|
|
@@ -21909,8 +21950,8 @@ EntitiesTableDataSource.decorators = [
|
|
|
21909
21950
|
EntitiesTableDataSource.ctorParameters = () => [
|
|
21910
21951
|
{ type: Function },
|
|
21911
21952
|
{ type: undefined },
|
|
21912
|
-
{ type:
|
|
21913
|
-
{ type:
|
|
21953
|
+
{ type: undefined },
|
|
21954
|
+
{ type: undefined }
|
|
21914
21955
|
];
|
|
21915
21956
|
|
|
21916
21957
|
const SETTINGS_DISPLAY_COLUMNS = 'displayColumns';
|
|
@@ -22302,7 +22343,6 @@ class AppTable {
|
|
|
22302
22343
|
}
|
|
22303
22344
|
}
|
|
22304
22345
|
ngOnDestroy() {
|
|
22305
|
-
var _a;
|
|
22306
22346
|
this._subscription.unsubscribe();
|
|
22307
22347
|
// Unsubscribe column value changes
|
|
22308
22348
|
Object.keys(this._cellValueChangesDefs).forEach(col => this.stopCellValueChanges(col, true));
|
|
@@ -22327,7 +22367,6 @@ class AppTable {
|
|
|
22327
22367
|
this.onError.unsubscribe();
|
|
22328
22368
|
this._destroy$.next();
|
|
22329
22369
|
this._destroy$.unsubscribe();
|
|
22330
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.ngOnDestroy();
|
|
22331
22370
|
}
|
|
22332
22371
|
updateView(res, opts) {
|
|
22333
22372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -22369,7 +22408,7 @@ class AppTable {
|
|
|
22369
22408
|
this._dataSourceLoadingSubscription.unsubscribe();
|
|
22370
22409
|
this._subscription.remove(this._dataSourceLoadingSubscription);
|
|
22371
22410
|
}
|
|
22372
|
-
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.
|
|
22411
|
+
(_a = this._dataSource) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
22373
22412
|
this._dataSource = null;
|
|
22374
22413
|
}
|
|
22375
22414
|
addColumnDef(column) {
|
|
@@ -22540,6 +22579,7 @@ class AppTable {
|
|
|
22540
22579
|
// Keep edited row id (should be done BEFORE confirmEditCreate() )
|
|
22541
22580
|
this.previouslyEditedRowId = opts.keepEditing ? ((((_a = this.editedRow) === null || _a === void 0 ? void 0 : _a.editing) ? this.editedRow.id : undefined) || ((_b = this.singleSelectedRow) === null || _b === void 0 ? void 0 : _b.id)) : undefined;
|
|
22542
22581
|
const previouslyEditedData = opts.keepEditing ? (isNotNil(this.previouslyEditedRowId) && ((_c = this.editedRow) === null || _c === void 0 ? void 0 : _c.currentData) || ((_d = this.singleSelectedRow) === null || _d === void 0 ? void 0 : _d.currentData)) : undefined;
|
|
22582
|
+
// TODO: remove this, has it redundant with dataSource.confirmAllRows() called in dataSource.save()
|
|
22543
22583
|
if (!this.confirmEditCreate()) {
|
|
22544
22584
|
throw { code: ErrorCodes.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR' };
|
|
22545
22585
|
}
|
|
@@ -23377,7 +23417,7 @@ class AppTable {
|
|
|
23377
23417
|
var _a, _b;
|
|
23378
23418
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23379
23419
|
// Mark row as pristine
|
|
23380
|
-
const markRowAsPristine = ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.
|
|
23420
|
+
const markRowAsPristine = ((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.config.keepOriginalDataAfterConfirm) === true;
|
|
23381
23421
|
if (markRowAsPristine) {
|
|
23382
23422
|
(_b = row.validator) === null || _b === void 0 ? void 0 : _b.markAsPristine();
|
|
23383
23423
|
// Check if table is now pristine
|
|
@@ -24786,7 +24826,7 @@ AppInMemoryTable.ctorParameters = () => [
|
|
|
24786
24826
|
{ type: Function },
|
|
24787
24827
|
{ type: InMemoryEntitiesService },
|
|
24788
24828
|
{ type: ValidatorService },
|
|
24789
|
-
{ type:
|
|
24829
|
+
{ type: undefined },
|
|
24790
24830
|
{ type: undefined }
|
|
24791
24831
|
];
|
|
24792
24832
|
AppInMemoryTable.propDecorators = {
|
|
@@ -25962,7 +26002,11 @@ class UsersPage extends AppTable {
|
|
|
25962
26002
|
switch (authTokenType) {
|
|
25963
26003
|
case "basic":
|
|
25964
26004
|
this.setShowColumn('pubkey', false, { emitEvent: false });
|
|
26005
|
+
this.setShowColumn('username', true, { emitEvent: false });
|
|
26006
|
+
this.setShowColumn('usernameExtranet', true, { emitEvent: false });
|
|
26007
|
+
break;
|
|
25965
26008
|
case "basic-and-token":
|
|
26009
|
+
this.setShowColumn('pubkey', true, { emitEvent: false });
|
|
25966
26010
|
this.setShowColumn('username', true, { emitEvent: false });
|
|
25967
26011
|
this.setShowColumn('usernameExtranet', true, { emitEvent: false });
|
|
25968
26012
|
break;
|
|
@@ -27493,5 +27537,5 @@ CoreTestingModule.decorators = [
|
|
|
27493
27537
|
* Generated bundle index. Do not edit.
|
|
27494
27538
|
*/
|
|
27495
27539
|
|
|
27496
|
-
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_TESTING_PAGES, AboutModal, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable,
|
|
27540
|
+
export { APP_ABOUT_DEVELOPERS, APP_ABOUT_PARTNERS, APP_CONFIG_OPTIONS, APP_FORM_ERROR_I18N_KEYS, APP_GRAPHQL_TYPE_POLICIES, APP_HOME_BUTTONS, APP_LOCALES, APP_LOCAL_SETTINGS, APP_LOCAL_SETTINGS_OPTIONS, APP_LOCAL_STORAGE_TYPE_POLICIES, APP_MENU_ITEMS, APP_TESTING_PAGES, AboutModal, Account, AccountPage, AccountService, AccountToStringPipe, ActionsColumnComponent, AdminModule, AdminRoutingModule, Alerts, AndroidOsEnvironment, AnimationState, AppEditor, AppEditorOptions, AppEntityEditor, AppForm, AppFormField, AppFormProvider, AppFormUtils, AppGestureConfig, AppGraphQLModule, AppHelpModal, AppInMemoryTable, AppInstallUpgradeCard, AppListForm, AppLoadingSpinner, AppMenuModule, AppNullForm, AppPropertiesForm, AppTabEditor, AppTabEditorOptions, AppTable, AppTableUtils, AppValidatorService, AppendToInputDirective, ArrayFilterPipe, ArrayFirstPipe, ArrayIncludesPipe, ArrayLengthPipe, ArrayPluckPipe, AudioProvider, AuthForm, AuthGuardService, AuthModal, AutocompleteTestPage, AutofocusDirective, Base58, BaseEntityService, BaseGraphqlService, BaseGraphqlServiceOptions, BaseReferential, Beans, CORE_CONFIG_OPTIONS, CORE_TESTING_PAGES, CellValueChangeListener, ChipsTestPage, Color, ColorScale, ComponentDirtyGuard, ConfigService, Configuration, CoreModule, CoreTestingModule, CryptoService, DATE_ISO_PATTERN, DATE_UNIX_MS_TIMESTAMP, DATE_UNIX_TIMESTAMP, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PLACEHOLDER_CHAR, DEFAULT_REQUIRED_COLUMNS, DateDiffDurationPipe, DateFormatPipe, DateFromNowPipe, DateTimeTestPage, DateUtils, Department, DepartmentToStringPipe, DragAndDropDirective, DurationPipe, ENTITIES_STORAGE_KEY_PREFIX, ENVIRONMENT, EmptyArrayPipe, EntitiesService, EntitiesStorage, EntitiesTableDataSource, Entity, EntityClass, EntityClasses, EntityFilter, EntityFilterUtils, EntityMetadataComponent, EntityStore, EntityUtils, Environment, EvenPipe, FileResponse, FileService, FileSizePipe, FilesUtils, FormArrayHelper, FormButtonsBarComponent, FormButtonsBarToken, FormErrorTranslatePipe, FormErrorTranslator, FormFieldValuesHolder, FormGetArrayPipe, FormGetControlPipe, FormGetGroupPipe, FormGetPipe, Fragments$1 as Fragments, GraphqlService, HAMMER_PRESS_TIME, HAMMER_TAP_TIME, HighlightPipe, HomePage, Hotkeys, HotkeysDialogComponent, InMemoryEntitiesService, IsLoginAccountPipe, IsNilOrBlankPipe, IsNotNilOrBlankPipe, IsNotOnFieldModePipe, IsOnFieldModePipe, JobUtils, KEYBOARD_HIDE_DELAY_MS, LAT_LONG_DEFAULT_MAX_DECIMALS, LAT_LONG_PATTERNS, LatLongFormatPipe, LatLongTestPage, LatitudeFormatPipe, LocalSettingsService, LongitudeFormatPipe, MINIFY_ENTITY_FOR_LOCAL_STORAGE, MINIFY_ENTITY_FOR_POD, MapGetPipe, MapKeysPipe, MapValuesPipe, MatAutocompleteConfigHolder, MatAutocompleteField, MatBadgeIconDirective, MatBooleanField, MatChipsField, MatDate, MatDateShort, MatDateTime, MatDuration, MatLatLongField, MatNumpadComponent, MatNumpadContainerComponent, MatNumpadContent, MatPaginatorI18n, MatStepperI18n, MatSwipeField, MaterialTestingModule, MathAbsPipe, MenuComponent, MenuItems, MenuService, Message, MessageFilter, MessageForm, MessageModal, MessageService, MessageTypeList, MessageTypes, ModalToolbarComponent, NetworkService, NgInitDirective, NgVarDirective, NotEmptyArrayPipe, NumberFormatPipe, NumpadDirective, OddPipe, PRIORITIZED_AUTHORITIES, PUBKEY_REGEXP, Peer, Person, PersonFilter, PersonFragments, PersonService, PersonToStringPipe, PersonUtils, PersonValidatorService, PlatformService, ProgressBarService, ProgressInterceptor, PropertyGetPipe, RESERVED_END_COLUMNS, RESERVED_START_COLUMNS, Referential, ReferentialFilter, ReferentialRef, ReferentialUtils, ReferentialValidatorService, RegisterConfirmPage, SETTINGS_DISPLAY_COLUMNS, SETTINGS_FILTER, SETTINGS_PAGE_SIZE, SETTINGS_SORTED_COLUMN, SETTINGS_STORAGE_KEY, SETTINGS_TRANSIENT_PROPERTIES, SHARED_MATERIAL_TESTING_PAGES, SHARED_TESTING_PAGES, SPACE_PLACEHOLDER_CHAR, SelectPeerModal, SettingsPage, SharedAsyncValidators, SharedDirectivesModule, SharedFormArrayValidators, SharedFormGroupValidators, SharedHotkeysModule, SharedMatAutocompleteModule, SharedMatBadgeIconModule, SharedMatBooleanModule, SharedMatChipsModule, SharedMatDateTimeModule, SharedMatDurationModule, SharedMatLatLongModule, SharedMatNumpadModule, SharedMatSwipeModule, SharedMaterialModule, SharedModule, SharedPipesModule, SharedRoutingModule, SharedTestingModule, SharedTestsPage, SharedValidators, SocialErrorCodes, SocialModule, Software, StartableService, StatusById, StatusIds, StatusList, StrIncludesPipe, StrLengthPipe, SwipeTestPage, TableSelectColumnsComponent, TableTestPage, TableTestingModule, TextForm, TextPopover, TextPopoverTestingModule, TextPopoverTestingPage, ToStringPipe, Toasts, ToolbarComponent, ToolbarToken, TranslatablePipe, TranslateContextPipe, TranslateContextService, UploadFile, UploadFileComponent, UploadFilePopover, UploadFileTestingModule, UploadFileTestingPage, UserEvent, UserEventFilter, UserEventFragments, UserEventService, UserEventTypes, UserEventsTable, UserSettings, UsersPage, accountToString, adaptValueToControl, addValueInArray, arrayDistinct, arrayGroupBy, arraySize, asInputElement, canHaveFocus, capitalizeFirstLetter, chainPromises, changeCaseToUnderscore, clearValueInArray, copyEntity2Form, createPromiseEvent, createPromiseEventEmitter, departmentToString, departmentsToString, disableControls, emitPromiseEvent, entityToString, equals, equalsOrNil, fadeInAnimation, fadeInOutAnimation, filterFalse, filterNotNil, filterNumberInput, filterTrue, firstArrayValue, firstFalse, firstFalsePromise, firstNotNil, firstNotNilPromise, firstTrue, firstTruePromise, focusInput, focusNextInput, focusPreviousInput, formatLatitude, formatLongitude, fromDateISOString, fromScrollEndEvent, fromUnixMsTimestamp, fromUnixTimestamp, getCaretPosition, getColorContrast, getColorShade, getColorTint, getConnectionType, getControlFromPath, getFocusableInputElements, getFormErrors, getFormValueFromEntity, getProperty, getPropertyByPath, getPropertyByPathAsString, getRandomImage, hexToRgb, hexToRgbArray, isAndroid, isBlankString, isControlHasInput, isCordova, isEmptyArray, isIOS, isInputElement, isInstanceOf, isInt, isMobile, isNil, isNilOrBlank, isNilOrNaN, isNotEmptyArray, isNotNil, isNotNilBoolean, isNotNilOrBlank, isNotNilOrNaN, isNotNilString, isNumber, isNumberRange, isProgressEvent, isResponseEvent, isTouchUi, isWindows, joinProperties, joinPropertiesPath, logFormErrors, markAllAsTouched, markAsUntouched, markControlAsTouched, markFormGroupAsTouched, matchMedia, matchUpperCase, mergeLoadResult, mixHex, moveInputCaretToSeparator, noTrailingSlash, notNilOrDefault, nullIfUndefined, parseLatitudeOrLongitude, propertiesPathComparator, propertyComparator, propertyPathComparator, referentialToString, referentialsToString, remove, removeAll, removeDiacritics, removeDuplicatesFromArray, removeEnd, removeValueInArray, replaceAll, resetCalculatedValue, resizeArray, rgbArrayToHex, rgbToHex, round, scrollFactory, selectInputContent, selectInputRange, setCalculatedValue, setTabIndex, sleep, slideInOutAnimation, slideUpDownAnimation, sort, splitById, splitByProperty, startsWithUpperCase, suggestFromArray, suggestFromStringArray, tabindexComparator, testUserAgent, toBoolean, toDateISOString, toDuration, toFloat, toInt, toNotNil, toNumber, trimEmptyToNull, uncapitalizeFirstLetter, updateValueAndValidity, waitFor, waitForTrue, waitIdle, waitWhilePending, ɵ0, CustomReuseStrategy as ɵa, MatNumpadDomService as ɵb, isFocusableElement as ɵc, RegisterForm as ɵd, AccountValidatorService as ɵe, RegisterModal as ɵf, UserSettingsValidatorService as ɵg, LocalSettingsValidatorService as ɵh, AppIconComponent as ɵi, DateTestPage as ɵj, NumpadTestPage as ɵk, MatBadgeIconTestPage as ɵl, ToastTestingModule as ɵm, ToastTestingPage as ɵn };
|
|
27497
27541
|
//# sourceMappingURL=sumaris-net.ngx-components.js.map
|