@sumaris-net/ngx-components 2.5.10 → 2.5.11-rc2
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/account/account.page.mjs +6 -3
- package/esm2020/src/app/core/form/properties/properties.table.mjs +1 -28
- package/esm2020/src/app/shared/form/field.model.mjs +1 -1
- package/fesm2015/sumaris-net.ngx-components.mjs +5 -29
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +5 -29
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/form/field.model.d.ts +2 -0
|
@@ -26218,27 +26218,6 @@ class AppPropertiesTable extends AppInMemoryTable {
|
|
|
26218
26218
|
this.translationsByKey = {};
|
|
26219
26219
|
this.filterCriteriaCount = 0;
|
|
26220
26220
|
this.filterPanelFloating = true;
|
|
26221
|
-
// confirmEditCreate(event?: Event, row?: TableElement<PropertyEntity>): boolean {
|
|
26222
|
-
// try {
|
|
26223
|
-
// return super.confirmEditCreate(event, row);
|
|
26224
|
-
// } finally {
|
|
26225
|
-
// this.updateAvailableDefinitions();
|
|
26226
|
-
// }
|
|
26227
|
-
// }
|
|
26228
|
-
// async updateView(res: LoadResult<PropertyEntity> | undefined, opts?: { emitEvent?: boolean }): Promise<void> {
|
|
26229
|
-
// await super.updateView(res, opts);
|
|
26230
|
-
// this.updateAvailableDefinitions();
|
|
26231
|
-
// }
|
|
26232
|
-
// protected async updateAvailableDefinitions() {
|
|
26233
|
-
// const usedDefinitionsKeys = this.dataSource.getRows().map(row => row.currentData?.id).filter(isNotNilOrBlank) || [];
|
|
26234
|
-
// const availableDefinitions: TranslatedFormFieldDefinition[] = (this.definitions || []).slice()
|
|
26235
|
-
// .filter(value => !usedDefinitionsKeys.includes(value.key))
|
|
26236
|
-
// .map(this.toTranslatedFormFieldDefinition);
|
|
26237
|
-
//
|
|
26238
|
-
// EntityUtils.sort(availableDefinitions, 'translatedName', 'asc');
|
|
26239
|
-
//
|
|
26240
|
-
// this.availableDefinitions$.next(availableDefinitions);
|
|
26241
|
-
// }
|
|
26242
26221
|
this.toTranslatedFormFieldDefinition = (definition) => ({ ...definition, translatedName: this.translationsByKey[definition.label] });
|
|
26243
26222
|
this.inlineEdition = true;
|
|
26244
26223
|
this.defaultSortBy = 'definition';
|
|
@@ -26257,12 +26236,6 @@ class AppPropertiesTable extends AppInMemoryTable {
|
|
|
26257
26236
|
this.definitions?.forEach(o => {
|
|
26258
26237
|
this.definitionsMapByKey[o.key] = o;
|
|
26259
26238
|
});
|
|
26260
|
-
// this.registerAutocompleteField('definition', {
|
|
26261
|
-
// attributes: ['translatedName'],
|
|
26262
|
-
// columnNames: [this.i18nColumnPrefix + 'DEFINITION'],
|
|
26263
|
-
// items: this.availableDefinitions$,
|
|
26264
|
-
// equals: (o1, o2) => o1?.key === o2?.key,
|
|
26265
|
-
// });
|
|
26266
26239
|
this.registerCellValueChanges('definition').subscribe((definition) => {
|
|
26267
26240
|
if (isNotNil(definition) && this.editedRow?.id === -1) {
|
|
26268
26241
|
this.editedRow.validator.patchValue({ id: definition.key, value: definition.defaultValue });
|
|
@@ -26886,7 +26859,8 @@ class AccountPage extends AppForm {
|
|
|
26886
26859
|
ngOnInit() {
|
|
26887
26860
|
super.ngOnInit();
|
|
26888
26861
|
// Get user options
|
|
26889
|
-
this.optionDefinitions = this.accountService.optionDefs.slice()
|
|
26862
|
+
this.optionDefinitions = this.accountService.optionDefs.slice()
|
|
26863
|
+
.filter(definition => !definition.minProfile || this.accountService.hasMinProfile(definition.minProfile));
|
|
26890
26864
|
// Observed some events
|
|
26891
26865
|
this.registerSubscription(this.accountService.onLogin.pipe(filter(() => !this.saving)).subscribe(account => this.onLogin(account)));
|
|
26892
26866
|
this.registerSubscription(this.accountService.onLogout.subscribe(() => this.onLogout()));
|
|
@@ -26960,7 +26934,9 @@ class AccountPage extends AppForm {
|
|
|
26960
26934
|
// Set options
|
|
26961
26935
|
const properties = data?.settings?.asLocalSettings()?.properties || {};
|
|
26962
26936
|
const propertiesEntities = [];
|
|
26963
|
-
this.optionDefinitions
|
|
26937
|
+
this.optionDefinitions
|
|
26938
|
+
.filter(definition => !definition.minProfile || this.accountService.hasMinProfile(definition.minProfile))
|
|
26939
|
+
.map(definition => definition.key).forEach(key => {
|
|
26964
26940
|
if (isNotNil(properties[key])) {
|
|
26965
26941
|
propertiesEntities.push(PropertyEntity.fromObject({ id: key, value: properties[key] }));
|
|
26966
26942
|
}
|