diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts
index 274d9789f..37ce4623e 100644
--- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.ts
@@ -47,15 +47,11 @@ export class EditColorDialogComponent {
};
try {
- await this._dictionaryControllerService
- .setColors(colors, this._dossierTemplateId)
- .toPromise();
+ await this._dictionaryControllerService.setColors(colors, this._dossierTemplateId).toPromise();
this._dialogRef.close(true);
this._notificationService.showToastNotification(
this._translateService.instant('edit-color-dialog.success', {
- color: this._translateService.instant(
- 'default-colors-screen.types.' + this.colorKey
- )
+ color: this._translateService.instant('default-colors-screen.types.' + this.colorKey)
})
);
} catch (e) {
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html
index a77d8178e..7dc532184 100644
--- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html
+++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.html
@@ -7,7 +7,7 @@
>
- {{ 'file-attributes-csv-import.table-header.title' | translate: { length: allEntities.length } }}
+ {{ 'file-attributes-csv-import.table-header.title' | translate: { length: (allEntities$ | async)?.length } }}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts
index abd4dbd85..e1301401a 100644
--- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts
+++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/active-fields-listing/active-fields-listing.component.ts
@@ -23,38 +23,36 @@ export class ActiveFieldsListingComponent extends BaseListingComponent im
constructor(protected readonly _injector: Injector) {
super(_injector);
- this._screenStateService.setIdKey('csvColumn');
}
ngOnChanges(changes: SimpleChanges): void {
if (changes.entities) {
- this._screenStateService.setEntities(this.entities);
- this._screenStateService.setDisplayedEntities(this.entities);
- this._screenStateService.updateSelection();
+ this.screenStateService.setEntities(this.entities);
+ this.screenStateService.setDisplayedEntities(this.entities);
+ this.screenStateService.updateSelection();
}
}
deactivateSelection() {
this.allEntities.filter(field => this.isSelected(field)).forEach(field => (field.primaryAttribute = false));
- this._screenStateService.setEntities([...this.allEntities.filter(field => !this.isSelected(field))]);
+ this.screenStateService.setEntities(this.allEntities.filter(field => !this.isSelected(field)));
this.entitiesChange.emit(this.allEntities);
- this._screenStateService.setSelectedEntitiesIds([]);
+ this.screenStateService.setSelectedEntities([]);
}
setAttributeForSelection(attribute: string, value: any) {
- for (const csvColumn of this._screenStateService.selectedEntitiesIds) {
- this.allEntities.find(f => f.csvColumn === csvColumn)[attribute] = value;
+ for (const item of this.screenStateService.selectedEntities) {
+ this.allEntities.find(f => f.csvColumn === item.csvColumn)[attribute] = value;
}
}
togglePrimary(field: Field) {
if (field.primaryAttribute) {
field.primaryAttribute = false;
- } else {
- for (const f of this.allEntities) {
- f.primaryAttribute = false;
- }
- field.primaryAttribute = true;
+ return;
}
+
+ for (const f of this.allEntities) f.primaryAttribute = false;
+ field.primaryAttribute = true;
}
}
diff --git a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html
index 71d54c5c2..1b5300bfd 100644
--- a/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html
+++ b/apps/red-ui/src/app/modules/admin/dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component.html
@@ -4,37 +4,25 @@
-