diff --git a/apps/red-ui/src/app/modules/admin/admin-routing.module.ts b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts index 252f8806d..3d4098c35 100644 --- a/apps/red-ui/src/app/modules/admin/admin-routing.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin-routing.module.ts @@ -19,6 +19,7 @@ import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-scre import { PermissionsGuard } from '@guards/permissions-guard'; import { Roles } from '@users/roles'; import { IqserAuthGuard } from '@iqser/common-ui/lib/users'; +import { ComponentMappingsScreenComponent } from './screens/component-mappings/component-mappings-screen.component'; const dossierTemplateIdRoutes: IqserRoutes = [ { @@ -76,6 +77,14 @@ const dossierTemplateIdRoutes: IqserRoutes = [ }, loadChildren: () => import('./screens/rules/rules.module').then(m => m.RulesModule), }, + { + path: 'component-mappings', + component: ComponentMappingsScreenComponent, + canActivate: [CompositeRouteGuard], + data: { + routeGuards: [IqserAuthGuard, RedRoleGuard], + }, + }, { path: 'file-attributes', component: BaseDossierTemplateScreenComponent, diff --git a/apps/red-ui/src/app/modules/admin/admin.module.ts b/apps/red-ui/src/app/modules/admin/admin.module.ts index f34a45611..f41dbc11b 100644 --- a/apps/red-ui/src/app/modules/admin/admin.module.ts +++ b/apps/red-ui/src/app/modules/admin/admin.module.ts @@ -57,6 +57,7 @@ import { IqserUsersModule } from '@iqser/common-ui/lib/users'; import { SelectComponent } from '@shared/components/select/select.component'; import { PaginationComponent } from '@common-ui/pagination/pagination.component'; import { AddCloneDossierTemplateDialogComponent } from './dialogs/add-clone-dossier-template-dialog/add-clone-dossier-template-dialog.component'; +import { ComponentMappingsScreenComponent } from './screens/component-mappings/component-mappings-screen.component'; const dialogs = [ AddCloneDossierTemplateDialogComponent, @@ -76,6 +77,7 @@ const screens = [ DigitalSignatureScreenComponent, UserListingScreenComponent, GeneralConfigScreenComponent, + ComponentMappingsScreenComponent, ]; const components = [ diff --git a/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.html b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.html new file mode 100644 index 000000000..a43c42fcf --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.html @@ -0,0 +1,65 @@ +
+
+
+
+
+
+ + +
+ +
+ + {{ data.mapping.version }} +
+
+ +
+ + +
+ +
+
+ + +
+ +
+ + + + + {{ translations[type] | translate }} + + + +
+
+
+ +
+ +
+
+ + +
diff --git a/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.scss b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.scss new file mode 100644 index 000000000..56ceac53a --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.scss @@ -0,0 +1,21 @@ +.row { + display: flex; + margin-top: 14px; + + > *:not(:last-child) { + margin-right: 16px; + } + + .iqser-input-group { + margin-top: 0; + } + + .version { + margin-left: 50px; + + span { + margin-top: 10px; + font-size: 15px; + } + } +} diff --git a/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.ts b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.ts new file mode 100644 index 000000000..680565a72 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/component-mappings/add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component.ts @@ -0,0 +1,91 @@ +import { Component, OnInit } from '@angular/core'; +import { CircleButtonComponent, IconButtonComponent, IconButtonTypes, IqserDialogComponent, IqserUploadFileModule } from '@iqser/common-ui'; +import { FileAttributeEncodingTypes, IComponentMapping } from '@red/domain'; +import { FormBuilder, ReactiveFormsModule, UntypedFormGroup, Validators } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgForOf, NgIf } from '@angular/common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatDialogClose } from '@angular/material/dialog'; +import { MatOption } from '@angular/material/autocomplete'; +import { MatSelect } from '@angular/material/select'; +import { fileAttributeEncodingTypesTranslations } from '@translations/file-attribute-encoding-types-translations'; +import { firstValueFrom } from 'rxjs'; +import { ComponentMappingsService } from '@services/entity-services/component-mappings.service'; + +interface DialogData { + dossierTemplateId: string; + mapping: IComponentMapping; +} +interface DialogResult { + id: string; + name: string; + file: Blob; + encoding: string; + delimiter: string; +} + +@Component({ + templateUrl: './add-edit-component-mapping-dialog.component.html', + styleUrls: ['./add-edit-component-mapping-dialog.component.scss'], + standalone: true, + imports: [ + TranslateModule, + ReactiveFormsModule, + NgIf, + MatFormFieldModule, + NgForOf, + CircleButtonComponent, + MatDialogClose, + IqserUploadFileModule, + MatOption, + MatSelect, + IconButtonComponent, + ], +}) +export class AddEditComponentMappingDialogComponent + extends IqserDialogComponent + implements OnInit +{ + protected readonly encodingTypeOptions = Object.keys(FileAttributeEncodingTypes); + protected readonly translations = fileAttributeEncodingTypesTranslations; + protected readonly iconButtonTypes = IconButtonTypes; + activeFile: File; + form!: UntypedFormGroup; + + constructor( + private readonly _formBuilder: FormBuilder, + private readonly _componentMappingService: ComponentMappingsService, + ) { + super(); + this.form = this.#getForm(); + } + + async ngOnInit() { + if (this.data.mapping?.fileName) { + this.activeFile = { name: this.data.mapping.fileName } as File; + const fileContent = await firstValueFrom( + this._componentMappingService.getComponentMappingFile(this.data.dossierTemplateId, this.data.mapping.id), + ); + const file = new Blob([fileContent], { type: 'text/csv' }); + this.form.get('file').setValue(file); + this.initialFormValue = this.form.getRawValue(); + } + } + + fileChanged(file: Blob) { + this.form.get('file').setValue(file); + } + + save() { + this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue() }); + } + + #getForm(): UntypedFormGroup { + return this._formBuilder.group({ + name: [this.data?.mapping?.name, Validators.required], + file: [null, Validators.required], + encoding: this.encodingTypeOptions.find(e => e === this.data?.mapping?.encoding) ?? this.encodingTypeOptions[0], + delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required], + }); + } +} diff --git a/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.html new file mode 100644 index 000000000..ad4765486 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.html @@ -0,0 +1,73 @@ +
+ + +
+
+ + + +
+ + +
+
+
+ + +
+ +
+ +
+
+
+ + +
+
+ {{ entity.name }} +
+ +
+ {{ entity.version }} +
+ +
+
+ + + +
+
+
+
diff --git a/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.ts new file mode 100644 index 000000000..966ff36c7 --- /dev/null +++ b/apps/red-ui/src/app/modules/admin/screens/component-mappings/component-mappings-screen.component.ts @@ -0,0 +1,92 @@ +import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { + ListingComponent, + TableColumnConfig, + listingProvidersFactory, + LoadingService, + IconButtonTypes, + IqserDialog, +} from '@iqser/common-ui'; +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { defaultColorsTranslations } from '@translations/default-colors-translations'; +import { Roles } from '@users/roles'; +import { getCurrentUser } from '@common-ui/users'; +import { DOSSIER_TEMPLATE_ID, User } from '@red/domain'; +import { ComponentMapping } from '@red/domain'; +import { combineLatest, firstValueFrom } from 'rxjs'; +import { ComponentMappingsService } from '@services/entity-services/component-mappings.service'; +import { map, tap } from 'rxjs/operators'; +import { AddEditComponentMappingDialogComponent } from './add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component'; +import { AdminDialogService } from '../../services/admin-dialog.service'; +import { getParam } from '@common-ui/utils'; + +@Component({ + templateUrl: './component-mappings-screen.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + providers: listingProvidersFactory(ComponentMappingsScreenComponent), +}) +export class ComponentMappingsScreenComponent extends ListingComponent implements OnInit { + tableColumnConfigs: readonly TableColumnConfig[] = [ + { label: _('component-mappings-screen.table-col-names.name'), sortByKey: 'searchKey' }, + { label: _('component-mappings-screen.table-col-names.version') }, + ]; + readonly tableHeaderLabel = _('component-mappings-screen.table-header.title'); + protected readonly context$; + protected readonly currentUser = getCurrentUser(); + protected readonly translations = defaultColorsTranslations; + protected readonly roles = Roles; + protected readonly iconButtonTypes = IconButtonTypes; + readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID); + + constructor( + private readonly _loadingService: LoadingService, + private readonly _componentMappingService: ComponentMappingsService, + private readonly _iqserDialog: IqserDialog, + private readonly _dialogService: AdminDialogService, + ) { + super(); + this.context$ = this.loadData$(); + } + + loadData$() { + return combineLatest([this._componentMappingService.getComponentMappings(this.#dossierTemplateId)]).pipe( + map(([mappingList]) => mappingList.componentMappingList), + tap(mappings => this.entitiesService.setEntities(mappings)), + ); + } + + ngOnInit() { + this._loadingService.stop(); + } + + async openAddEditComponentMappingDialog(mapping?: ComponentMapping) { + const dialog = this._iqserDialog.openDefault(AddEditComponentMappingDialogComponent, { + data: { + dossierTemplateId: this.#dossierTemplateId, + mapping, + }, + }); + const result = await dialog.result(); + if (result) { + this._loadingService.start(); + const { id, name, encoding, delimiter } = result; + const newMapping = { id, name, encoding, delimiter }; + await firstValueFrom( + this._componentMappingService.createUpdateComponentMapping(this.#dossierTemplateId, newMapping, result.file), + ); + await firstValueFrom(this.loadData$()); + this._loadingService.stop(); + } + } + + openDeleteComponentMappingDialog(entity: ComponentMapping) { + this._dialogService.openDialog('confirm', null, async confirmation => { + if (confirmation) { + this._loadingService.start(); + await firstValueFrom(this._componentMappingService.deleteComponentMapping(this.#dossierTemplateId, entity.id)); + await firstValueFrom(this.loadData$()); + this._loadingService.stop(); + } + }); + } +} diff --git a/apps/red-ui/src/app/modules/admin/shared/components/admin-side-nav/admin-side-nav.component.ts b/apps/red-ui/src/app/modules/admin/shared/components/admin-side-nav/admin-side-nav.component.ts index 1d9d63c4a..83620ad86 100644 --- a/apps/red-ui/src/app/modules/admin/shared/components/admin-side-nav/admin-side-nav.component.ts +++ b/apps/red-ui/src/app/modules/admin/shared/components/admin-side-nav/admin-side-nav.component.ts @@ -106,6 +106,11 @@ export class AdminSideNavComponent implements OnInit { (this.isIqserDevMode || this.canAccessRulesInDocumine) && this._permissionsService.has(Roles.rules.read), }, + { + screen: 'component-mappings', + label: _('admin-side-nav.component-mappings'), + show: this.isDocumine, + }, { screen: 'default-colors', label: _('admin-side-nav.default-colors'), diff --git a/apps/red-ui/src/app/services/entity-services/component-mappings.service.ts b/apps/red-ui/src/app/services/entity-services/component-mappings.service.ts new file mode 100644 index 000000000..2aec147d7 --- /dev/null +++ b/apps/red-ui/src/app/services/entity-services/component-mappings.service.ts @@ -0,0 +1,60 @@ +import { Injectable } from '@angular/core'; +import { EntitiesService, QueryParam } from '@iqser/common-ui'; +import { ComponentMapping, IComponentMapping, IComponentMappingList } from '@red/domain'; +import { Observable } from 'rxjs'; +import { HeadersConfiguration, List } from '@common-ui/utils'; + +interface CreateMappingParams { + dossierTemplateId: string; + name: string; + encoding: string; + delimiter: string; +} + +@Injectable({ + providedIn: 'root', +}) +export class ComponentMappingsService extends EntitiesService { + getComponentMappings(dossierTemplateId: string): Observable { + return this._http.get(`/api/dossier-templates/${dossierTemplateId}/component-mappings`); + } + + createUpdateComponentMapping( + dossierTemplateId: string, + componentMapping: Partial, + file: Blob, + ): Observable { + const formParams = new FormData(); + formParams.append('file', file); + + const queryParams: List = [ + { key: 'name', value: componentMapping.name }, + { key: 'encoding', value: componentMapping.encoding }, + { key: 'delimiter', value: componentMapping.delimiter }, + ]; + + if (componentMapping.id) { + return this._http.put( + `/api/dossier-templates/${dossierTemplateId}/component-mappings/${componentMapping.id}`, + formParams, + { + params: this._queryParams(queryParams), + }, + ); + } + + return this._http.post(`/api/dossier-templates/${dossierTemplateId}/component-mappings`, formParams, { + params: this._queryParams(queryParams), + }); + } + + deleteComponentMapping(dossierTemplateId: string, componentMappingId: string) { + return this._http.delete(`/api/dossier-templates/${dossierTemplateId}/component-mappings/${componentMappingId}`); + } + + getComponentMappingFile(dossierTemplateId: string, componentMappingId: string) { + return this._http.get(`/api/dossier-templates/${dossierTemplateId}/component-mappings/${componentMappingId}`, { + responseType: 'text', + }); + } +} diff --git a/apps/red-ui/src/app/users/roles.ts b/apps/red-ui/src/app/users/roles.ts index 2ae41147f..dc7ee3b70 100644 --- a/apps/red-ui/src/app/users/roles.ts +++ b/apps/red-ui/src/app/users/roles.ts @@ -21,6 +21,10 @@ export const Roles = { read: 'red-read-rules', write: 'red-write-rules', }, + componentMappings: { + read: 'red-read-rules', + write: 'red-write-rules', + }, redactions: { write: 'red-add-redaction', readManual: 'red-read-manual-redactions', diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 05e852247..dd0ca58ae 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -94,6 +94,23 @@ }, "save": "Dossier-Vorlage speichern" }, + "add-edit-component-mapping": { + "actions": { + "save": "" + }, + "dialog": { + "title": "" + }, + "form": { + "delimiter": "", + "delimiter-placeholder": "", + "encoding-type": "", + "file": "", + "name": "", + "name-placeholder": "", + "version": "" + } + }, "add-edit-dossier-attribute": { "error": { "generic": "Attribut konnte nicht gespeichert werden!" @@ -231,6 +248,7 @@ }, "admin-side-nav": { "audit": "Audit", + "component-mappings": "", "component-rule-editor": "", "configurations": "Configurations", "default-colors": "Default colors", @@ -254,9 +272,6 @@ "watermarks": "Watermarks" }, "analysis-disabled": "", - "annotation": { - "pending": "(Pending analysis)" - }, "annotation-actions": { "accept-recommendation": { "label": "Empfehlung annehmen" @@ -311,14 +326,14 @@ "error": "Rekategorisierung des Bildes gescheitert: {error}", "success": "Bild wurde einer neuen Kategorie zugeordnet." }, - "remove": { - "error": "Fehler beim Entfernen der Schwärzung: {error}", - "success": "Schwärzung entfernt!" - }, "remove-hint": { "error": "Failed to remove hint: {error}", "success": "Hint removed" }, + "remove": { + "error": "Fehler beim Entfernen der Schwärzung: {error}", + "success": "Schwärzung entfernt!" + }, "undo": { "error": "Die Aktion konnte nicht rückgängig gemacht werden. Fehler: {error}", "success": "erfolgreich Rückgängig gemacht" @@ -331,15 +346,15 @@ "remove-highlights": { "label": "Remove selected earmarks" }, - "resize": { - "label": "Größe ändern" - }, "resize-accept": { "label": "Größe speichern" }, "resize-cancel": { "label": "Größenänderung abbrechen" }, + "resize": { + "label": "Größe ändern" + }, "see-references": { "label": "See references" }, @@ -372,6 +387,9 @@ "skipped": "Übersprungen", "text-highlight": "Earmark" }, + "annotation": { + "pending": "(Pending analysis)" + }, "archived-dossiers-listing": { "no-data": { "title": "No archived dossiers." @@ -517,6 +535,24 @@ }, "title": "Component view" }, + "component-mappings-screen": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk-actions": { + "delete": "" + }, + "search": "", + "table-col-names": { + "name": "", + "version": "" + }, + "table-header": { + "title": "" + } + }, "component-rules-screen": { "error": { "generic": "" @@ -577,18 +613,14 @@ "warning": "Achtung: Diese Aktion kann nicht rückgängig gemacht werden!" }, "confirmation-dialog": { - "approve-file": { - "question": "Dieses Dokument enthält ungesehene Änderungen. Möchten Sie es trotzdem genehmigen?", - "title": "Warnung!" - }, "approve-file-without-analysis": { "confirmationText": "Approve without analysis", "denyText": "Abbrechen", "question": "Analysis required to detect new redactions.", "title": "Warning!" }, - "approve-multiple-files": { - "question": "Mindestens eine der ausgewählten Dateien enthält ungesehene Änderungen. Möchten Sie sie trotzdem genehmigen?", + "approve-file": { + "question": "Dieses Dokument enthält ungesehene Änderungen. Möchten Sie es trotzdem genehmigen?", "title": "Warnung!" }, "approve-multiple-files-without-analysis": { @@ -597,6 +629,10 @@ "question": "Analysis required to detect new redactions for at least one file.", "title": "Warning" }, + "approve-multiple-files": { + "question": "Mindestens eine der ausgewählten Dateien enthält ungesehene Änderungen. Möchten Sie sie trotzdem genehmigen?", + "title": "Warnung!" + }, "assign-file-to-me": { "question": { "multiple": "Dieses Dokument wird gerade von einer anderen Person geprüft. Möchten Sie Reviewer werden und sich selbst dem Dokument zuweisen?", @@ -960,13 +996,13 @@ "recent": "Neu ({hours} h)", "unassigned": "Niemandem zugewiesen" }, - "reanalyse": { - "action": "Datei analysieren" - }, "reanalyse-dossier": { "error": "Die Dateien konnten nicht für eine Reanalyse eingeplant werden. Bitte versuchen Sie es erneut.", "success": "Dateien für Reanalyse vorgesehen." }, + "reanalyse": { + "action": "Datei analysieren" + }, "start-auto-analysis": "Enable auto-analysis", "stop-auto-analysis": "Stop auto-analysis", "table-col-names": { @@ -1036,14 +1072,6 @@ "total-documents": "Anzahl der Dokumente", "total-people": "{count} {count, plural, one{user} other {users}}" }, - "dossier-templates": { - "label": "Dossier-Vorlagen", - "status": { - "active": "Active", - "inactive": "Inactive", - "incomplete": "Incomplete" - } - }, "dossier-templates-listing": { "action": { "clone": "Clone template", @@ -1079,6 +1107,14 @@ "title": "{length} {length, plural, one{Dossier-Vorlage} other{Dossier-Vorlagen}}" } }, + "dossier-templates": { + "label": "Dossier-Vorlagen", + "status": { + "active": "Active", + "inactive": "Inactive", + "incomplete": "Incomplete" + } + }, "dossier-watermark-selector": { "heading": "Watermarks on documents", "no-watermark": "No watermark available in dossier template:
Please ask your admin to configure a watermark.", @@ -1297,19 +1333,28 @@ "warning-text": "Warning: experimental feature!", "warnings-found": "{warnings, plural, one{A warning} other{{warnings} warnings}} found in rules" }, + "entity": { + "info": { + "actions": { + "revert": "Revert", + "save": "Save changes" + }, + "heading": "Edit entity" + } + }, "error": { "deleted-entity": { "dossier": { "action": "Zurück zur Übersicht", "label": "Dieses Dossier wurde gelöscht!" }, - "file": { - "action": "Zurück zum Dossier", - "label": "Diese Datei wurde gelöscht!" - }, "file-dossier": { "action": "Zurück zur Übersicht", "label": "Das Dossier dieser Datei wurde gelöscht!" + }, + "file": { + "action": "Zurück zum Dossier", + "label": "Diese Datei wurde gelöscht!" } }, "file-preview": { @@ -1343,6 +1388,12 @@ "number": "Nummer", "text": "Freier Text" }, + "file-attribute": { + "update": { + "error": "Failed to update file attribute value!", + "success": "File attribute value has been updated successfully!" + } + }, "file-attributes-configurations": { "cancel": "Abbrechen", "form": { @@ -1561,15 +1612,6 @@ "csv": "File attributes were imported successfully from uploaded CSV file." } }, - "filter": { - "analysis": "Analyse erforderlich", - "comment": "Kommentare", - "hint": "Nut Hinweise", - "image": "Bilder", - "none": "Keine Anmerkungen", - "redaction": "Geschwärzt", - "updated": "Aktualisiert" - }, "filter-menu": { "filter-options": "Filteroptionen", "filter-types": "Filter", @@ -1579,6 +1621,15 @@ "unseen-pages": "Nur Anmerkungen auf unsichtbaren Seiten", "with-comments": "Nur Anmerkungen mit Kommentaren" }, + "filter": { + "analysis": "Analyse erforderlich", + "comment": "Kommentare", + "hint": "Nut Hinweise", + "image": "Bilder", + "none": "Keine Anmerkungen", + "redaction": "Geschwärzt", + "updated": "Aktualisiert" + }, "filters": { "assigned-people": "Beauftragt", "documents-status": "Documents state", @@ -1852,13 +1903,6 @@ "user-promoted-to-approver": "{user} wurde im Dossier {dossierHref, select, null{{dossierName}} other{{dossierName}}} zum Genehmiger ernannt!", "user-removed-as-dossier-member": "{user} wurde als Mitglied von: {dossierHref, select, null{{dossierName}} other{{dossierName}}} entfernt!" }, - "notifications": { - "button-text": "Notifications", - "deleted-dossier": "Deleted dossier", - "label": "Benachrichtigungen", - "mark-all-as-read": "Alle als gelesen markieren", - "mark-as": "Mark as {type, select, read{read} unread{unread} other{}}" - }, "notifications-screen": { "category": { "email-notifications": "E-Mail Benachrichtigungen", @@ -1872,6 +1916,7 @@ "dossier": "Dossierbezogene Benachrichtigungen", "other": "Andere Benachrichtigungen" }, + "options-title": "Wählen Sie aus, in welcher Kategorie Sie benachrichtigt werden möchten", "options": { "ASSIGN_APPROVER": "Wenn ich einem Dokument als Genehmiger zugewiesen bin", "ASSIGN_REVIEWER": "Wenn ich einem Dokument als Überprüfer zugewiesen bin", @@ -1889,7 +1934,6 @@ "USER_PROMOTED_TO_APPROVER": "Wenn ich Genehmiger in einem Dossier werde", "USER_REMOVED_AS_DOSSIER_MEMBER": "Wenn ich die Dossier-Mitgliedschaft verliere" }, - "options-title": "Wählen Sie aus, in welcher Kategorie Sie benachrichtigt werden möchten", "schedule": { "daily": "Tägliche Zusammenfassung", "instant": "Sofortig", @@ -1897,6 +1941,13 @@ }, "title": "Benachrichtigungseinstellungen" }, + "notifications": { + "button-text": "Notifications", + "deleted-dossier": "Deleted dossier", + "label": "Benachrichtigungen", + "mark-all-as-read": "Alle als gelesen markieren", + "mark-as": "Mark as {type, select, read{read} unread{unread} other{}}" + }, "ocr": { "confirmation-dialog": { "cancel": "Cancel", @@ -1988,16 +2039,16 @@ "warnings-label": "Prompts and dialogs", "warnings-subtitle": "Do not show again options" }, - "processing": { - "basic": "Processing", - "ocr": "OCR" - }, "processing-status": { "ocr": "OCR", "pending": "Pending", "processed": "processed", "processing": "Processing" }, + "processing": { + "basic": "Processing", + "ocr": "OCR" + }, "readonly": "Lesemodus", "readonly-archived": "Read only (archived)", "redact-text": { @@ -2223,12 +2274,6 @@ "red-user-admin": "Benutzer-Admin", "regular": "Regulär" }, - "search": { - "active-dossiers": "ganze Plattform", - "all-dossiers": "all documents", - "placeholder": "Nach Dokumenten oder Dokumenteninhalt suchen", - "this-dossier": "in diesem Dossier" - }, "search-screen": { "cols": { "assignee": "Bevollmächtigter", @@ -2252,6 +2297,12 @@ "no-match": "Keine Dokumente entsprechen Ihren aktuellen Filtern.", "table-header": "{length} {length, plural, one{Suchergebnis} other{Suchergebnisse}}" }, + "search": { + "active-dossiers": "ganze Plattform", + "all-dossiers": "all documents", + "placeholder": "Nach Dokumenten oder Dokumenteninhalt suchen", + "this-dossier": "in diesem Dossier" + }, "seconds": "seconds", "size": "Size", "smtp-auth-config": { @@ -2506,4 +2557,4 @@ } }, "yesterday": "Gestern" -} \ No newline at end of file +} diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 20e187968..b480e2a13 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -94,6 +94,23 @@ }, "save": "Save dossier template" }, + "add-edit-component-mapping": { + "actions": { + "save": "Save mapping" + }, + "dialog": { + "title": "{type, select, add{Add New} edit{Edit} other{}} Component Mapping" + }, + "form": { + "delimiter": "", + "delimiter-placeholder": "", + "encoding-type": "", + "file": "Mapping file", + "name": "Mapping name", + "name-placeholder": "Mapping name", + "version": "Version" + } + }, "add-edit-dossier-attribute": { "error": { "generic": "Failed to save attribute" @@ -231,6 +248,7 @@ }, "admin-side-nav": { "audit": "Audit", + "component-mappings": "Component mappings", "component-rule-editor": "", "configurations": "Configurations", "default-colors": "Default colors", @@ -517,6 +535,24 @@ }, "title": "Component view" }, + "component-mappings-screen": { + "action": { + "delete": "Delete mapping", + "edit": "Edit mapping" + }, + "add-new": "New Mapping", + "bulk-actions": { + "delete": "Delete selected mappings" + }, + "search": "Search by name...", + "table-col-names": { + "name": "name", + "version": "version" + }, + "table-header": { + "title": "Component mapping" + } + }, "component-rules-screen": { "error": { "generic": "" @@ -2506,4 +2542,4 @@ } }, "yesterday": "Yesterday" -} \ No newline at end of file +} diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index b09f3a85d..c1b6a94de 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -94,6 +94,23 @@ }, "save": "Dossier-Vorlage speichern" }, + "add-edit-component-mapping": { + "actions": { + "save": "" + }, + "dialog": { + "title": "" + }, + "form": { + "delimiter": "", + "delimiter-placeholder": "", + "encoding-type": "", + "file": "", + "name": "", + "name-placeholder": "", + "version": "" + } + }, "add-edit-dossier-attribute": { "error": { "generic": "Attribut konnte nicht gespeichert werden!" @@ -231,6 +248,7 @@ }, "admin-side-nav": { "audit": "Audit", + "component-mappings": "", "component-rule-editor": "Component rule editor", "configurations": "Configurations", "default-colors": "Default colors", @@ -254,9 +272,6 @@ "watermarks": "Watermarks" }, "analysis-disabled": "Analysis disabled", - "annotation": { - "pending": "(Pending analysis)" - }, "annotation-actions": { "accept-recommendation": { "label": "Empfehlung annehmen" @@ -311,14 +326,14 @@ "error": "Rekategorisierung des Bildes gescheitert: {error}", "success": "Bild wurde einer neuen Kategorie zugeordnet." }, - "remove": { - "error": "Fehler beim Entfernen der Schwärzung: {error}", - "success": "Schwärzung entfernt!" - }, "remove-hint": { "error": "Failed to remove hint: {error}", "success": "Hint removed!" }, + "remove": { + "error": "Fehler beim Entfernen der Schwärzung: {error}", + "success": "Schwärzung entfernt!" + }, "undo": { "error": "Die Aktion konnte nicht rückgängig gemacht werden. Fehler: {error}", "success": "erfolgreich Rückgängig gemacht" @@ -331,15 +346,15 @@ "remove-highlights": { "label": "Remove selected earmarks" }, - "resize": { - "label": "Größe ändern" - }, "resize-accept": { "label": "Größe speichern" }, "resize-cancel": { "label": "Größenänderung abbrechen" }, + "resize": { + "label": "Größe ändern" + }, "see-references": { "label": "See references" }, @@ -372,6 +387,9 @@ "skipped": "Übersprungen", "text-highlight": "Earmark" }, + "annotation": { + "pending": "(Pending analysis)" + }, "archived-dossiers-listing": { "no-data": { "title": "No archived dossiers." @@ -517,6 +535,24 @@ }, "title": "Structured Component Management" }, + "component-mappings-screen": { + "action": { + "delete": "", + "edit": "" + }, + "add-new": "", + "bulk-actions": { + "delete": "" + }, + "search": "", + "table-col-names": { + "name": "", + "version": "" + }, + "table-header": { + "title": "" + } + }, "component-rules-screen": { "error": { "generic": "Something went wrong... Component rules update failed!" @@ -577,18 +613,14 @@ "warning": "Achtung: Diese Aktion kann nicht rückgängig gemacht werden!" }, "confirmation-dialog": { - "approve-file": { - "question": "Dieses Dokument enthält ungesehene Änderungen. Möchten Sie es trotzdem genehmigen?", - "title": "Warnung!" - }, "approve-file-without-analysis": { "confirmationText": "Approve without analysis", "denyText": "Cancel", "question": "Analysis required to detect new components.", "title": "Warning!" }, - "approve-multiple-files": { - "question": "Mindestens eine der ausgewählten Dateien enthält ungesehene Änderungen. Möchten Sie sie trotzdem genehmigen?", + "approve-file": { + "question": "Dieses Dokument enthält ungesehene Änderungen. Möchten Sie es trotzdem genehmigen?", "title": "Warnung!" }, "approve-multiple-files-without-analysis": { @@ -597,6 +629,10 @@ "question": "Analysis required to detect new components for at least one file.", "title": "Warning" }, + "approve-multiple-files": { + "question": "Mindestens eine der ausgewählten Dateien enthält ungesehene Änderungen. Möchten Sie sie trotzdem genehmigen?", + "title": "Warnung!" + }, "assign-file-to-me": { "question": { "multiple": "Dieses Dokument wird gerade von einer anderen Person geprüft. Möchten Sie Reviewer werden und sich selbst dem Dokument zuweisen?", @@ -960,13 +996,13 @@ "recent": "Neu ({hours} h)", "unassigned": "Niemandem zugewiesen" }, - "reanalyse": { - "action": "Datei analysieren" - }, "reanalyse-dossier": { "error": "Die Dateien konnten nicht für eine Reanalyse eingeplant werden. Bitte versuchen Sie es erneut.", "success": "Dateien für Reanalyse vorgesehen." }, + "reanalyse": { + "action": "Datei analysieren" + }, "start-auto-analysis": "Enable auto-analysis", "stop-auto-analysis": "Stop auto-analysis", "table-col-names": { @@ -1036,14 +1072,6 @@ "total-documents": "Anzahl der Dokumente", "total-people": "{count} {count, plural, one{user} other {users}}" }, - "dossier-templates": { - "label": "Dossier-Vorlagen", - "status": { - "active": "Active", - "inactive": "Inactive", - "incomplete": "Incomplete" - } - }, "dossier-templates-listing": { "action": { "clone": "Clone template", @@ -1079,6 +1107,14 @@ "title": "{length} dossier {length, plural, one{template} other{templates}}" } }, + "dossier-templates": { + "label": "Dossier-Vorlagen", + "status": { + "active": "Active", + "inactive": "Inactive", + "incomplete": "Incomplete" + } + }, "dossier-watermark-selector": { "heading": "Watermarks on documents", "no-watermark": "There is no watermark defined for the dossier template.
Contact your app admin to define one.", @@ -1274,15 +1310,6 @@ "title": "{length} {length, plural, one{entity} other{entities}}" } }, - "entity": { - "info": { - "actions": { - "revert": "Revert", - "save": "Save changes" - }, - "heading": "Edit entity" - } - }, "entity-rules-screen": { "error": { "generic": "Something went wrong... Entity rules update failed!" @@ -1297,19 +1324,28 @@ "warning-text": "Warning: experimental feature!", "warnings-found": "{warnings, plural, one{A warning} other{{warnings} warnings}} found in rules" }, + "entity": { + "info": { + "actions": { + "revert": "Revert", + "save": "Save changes" + }, + "heading": "Edit entity" + } + }, "error": { "deleted-entity": { "dossier": { "action": "Zurück zur Übersicht", "label": "Dieses Dossier wurde gelöscht!" }, - "file": { - "action": "Zurück zum Dossier", - "label": "Diese Datei wurde gelöscht!" - }, "file-dossier": { "action": "Zurück zur Übersicht", "label": "Das Dossier dieser Datei wurde gelöscht!" + }, + "file": { + "action": "Zurück zum Dossier", + "label": "Diese Datei wurde gelöscht!" } }, "file-preview": { @@ -1327,12 +1363,6 @@ }, "exact-date": "{day} {month} {year} um {hour}:{minute} Uhr", "file": "Datei", - "file-attribute": { - "update": { - "error": "Failed to update file attribute value!", - "success": "File attribute value has been updated successfully!" - } - }, "file-attribute-encoding-types": { "ascii": "ASCII", "iso": "ISO-8859-1", @@ -1343,6 +1373,12 @@ "number": "Nummer", "text": "Freier Text" }, + "file-attribute": { + "update": { + "error": "Failed to update file attribute value!", + "success": "File attribute value has been updated successfully!" + } + }, "file-attributes-configurations": { "cancel": "Cancel", "form": { @@ -1561,15 +1597,6 @@ "csv": "File attributes were imported successfully from uploaded CSV file." } }, - "filter": { - "analysis": "Analyse erforderlich", - "comment": "Kommentare", - "hint": "Nut Hinweise", - "image": "Bilder", - "none": "Keine Anmerkungen", - "redaction": "Geschwärzt", - "updated": "Aktualisiert" - }, "filter-menu": { "filter-options": "Filteroptionen", "filter-types": "Filter", @@ -1579,6 +1606,15 @@ "unseen-pages": "Nur Anmerkungen auf unsichtbaren Seiten", "with-comments": "Nur Anmerkungen mit Kommentaren" }, + "filter": { + "analysis": "Analyse erforderlich", + "comment": "Kommentare", + "hint": "Nut Hinweise", + "image": "Bilder", + "none": "Keine Anmerkungen", + "redaction": "Geschwärzt", + "updated": "Aktualisiert" + }, "filters": { "assigned-people": "Beauftragt", "documents-status": "Documents state", @@ -1852,13 +1888,6 @@ "user-promoted-to-approver": "{user} wurde im Dossier {dossierHref, select, null{{dossierName}} other{{dossierName}}} zum Genehmiger ernannt!", "user-removed-as-dossier-member": "{user} wurde als Mitglied von: {dossierHref, select, null{{dossierName}} other{{dossierName}}} entfernt!" }, - "notifications": { - "button-text": "Notifications", - "deleted-dossier": "Deleted dossier", - "label": "Benachrichtigungen", - "mark-all-as-read": "Alle als gelesen markieren", - "mark-as": "Mark as {type, select, read{read} unread{unread} other{}}" - }, "notifications-screen": { "category": { "email-notifications": "E-Mail Benachrichtigungen", @@ -1872,6 +1901,7 @@ "dossier": "Dossierbezogene Benachrichtigungen", "other": "Andere Benachrichtigungen" }, + "options-title": "Wählen Sie aus, in welcher Kategorie Sie benachrichtigt werden möchten", "options": { "ASSIGN_APPROVER": "Wenn ich einem Dokument als Genehmiger zugewiesen bin", "ASSIGN_REVIEWER": "Wenn ich einem Dokument als Überprüfer zugewiesen bin", @@ -1889,7 +1919,6 @@ "USER_PROMOTED_TO_APPROVER": "Wenn ich Genehmiger in einem Dossier werde", "USER_REMOVED_AS_DOSSIER_MEMBER": "Wenn ich die Dossier-Mitgliedschaft verliere" }, - "options-title": "Wählen Sie aus, in welcher Kategorie Sie benachrichtigt werden möchten", "schedule": { "daily": "Tägliche Zusammenfassung", "instant": "Sofortig", @@ -1897,6 +1926,13 @@ }, "title": "Benachrichtigungseinstellungen" }, + "notifications": { + "button-text": "Notifications", + "deleted-dossier": "Deleted dossier", + "label": "Benachrichtigungen", + "mark-all-as-read": "Alle als gelesen markieren", + "mark-as": "Mark as {type, select, read{read} unread{unread} other{}}" + }, "ocr": { "confirmation-dialog": { "cancel": "Cancel", @@ -1988,16 +2024,16 @@ "warnings-label": "Prompts and dialogs", "warnings-subtitle": "Do not show again options" }, - "processing": { - "basic": "Processing", - "ocr": "OCR" - }, "processing-status": { "ocr": "OCR", "pending": "Pending", "processed": "Processed", "processing": "Processing" }, + "processing": { + "basic": "Processing", + "ocr": "OCR" + }, "readonly": "Lesemodus", "readonly-archived": "Read only (archived)", "redact-text": { @@ -2223,12 +2259,6 @@ "red-user-admin": "Benutzer-Admin", "regular": "Regulär" }, - "search": { - "active-dossiers": "ganze Plattform", - "all-dossiers": "all documents", - "placeholder": "Nach Dokumenten oder Dokumenteninhalt suchen", - "this-dossier": "in diesem Dossier" - }, "search-screen": { "cols": { "assignee": "Bevollmächtigter", @@ -2252,6 +2282,12 @@ "no-match": "Keine Dokumente entsprechen Ihren aktuellen Filtern.", "table-header": "{length} search {length, plural, one{result} other{results}}" }, + "search": { + "active-dossiers": "ganze Plattform", + "all-dossiers": "all documents", + "placeholder": "Nach Dokumenten oder Dokumenteninhalt suchen", + "this-dossier": "in diesem Dossier" + }, "seconds": "seconds", "size": "Size", "smtp-auth-config": { @@ -2506,4 +2542,4 @@ } }, "yesterday": "Gestern" -} \ No newline at end of file +} diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 69bd8a163..ab8576d70 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -94,6 +94,23 @@ }, "save": "Save dossier template" }, + "add-edit-component-mapping": { + "actions": { + "save": "Save mapping" + }, + "dialog": { + "title": "{type, select, add{Add New} edit{Edit} other{}} Component Mapping" + }, + "form": { + "delimiter": "Delimiter", + "delimiter-placeholder": "Delimiter", + "encoding-type": "Encoding type", + "file": "Mapping file", + "name": "Mapping name", + "name-placeholder": "Mapping name", + "version": "Version" + } + }, "add-edit-dossier-attribute": { "error": { "generic": "Failed to save attribute!" @@ -231,6 +248,7 @@ }, "admin-side-nav": { "audit": "Audit", + "component-mappings": "Component mappings", "component-rule-editor": "Component rule editor", "configurations": "Configurations", "default-colors": "Default colors", @@ -517,6 +535,24 @@ }, "title": "Component view" }, + "component-mappings-screen": { + "action": { + "delete": "Delete mapping", + "edit": "Edit mapping" + }, + "add-new": "New Mapping", + "bulk-actions": { + "delete": "Delete selected mappings" + }, + "search": "Search by name...", + "table-col-names": { + "name": "name", + "version": "version" + }, + "table-header": { + "title": "Component mapping" + } + }, "component-rules-screen": { "error": { "generic": "Something went wrong... Component rules update failed!" @@ -2506,4 +2542,4 @@ } }, "yesterday": "Yesterday" -} \ No newline at end of file +} diff --git a/libs/common-ui b/libs/common-ui index 3a9f36e71..5eef6d403 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 3a9f36e71b184e66eb791af19deeb258f8ec333d +Subproject commit 5eef6d403a57c224eec836d9d98787c6a128c50a diff --git a/libs/red-domain/src/index.ts b/libs/red-domain/src/index.ts index e324c83a5..4d040b981 100644 --- a/libs/red-domain/src/index.ts +++ b/libs/red-domain/src/index.ts @@ -29,3 +29,4 @@ export * from './lib/digital-signature'; export * from './lib/watermarks'; export * from './lib/colors'; export * from './lib/component-log'; +export * from './lib/component-mappings'; diff --git a/libs/red-domain/src/lib/component-mappings/component-mapping-list.model.ts b/libs/red-domain/src/lib/component-mappings/component-mapping-list.model.ts new file mode 100644 index 000000000..24425c4a7 --- /dev/null +++ b/libs/red-domain/src/lib/component-mappings/component-mapping-list.model.ts @@ -0,0 +1,16 @@ +import { ComponentMapping, IComponentMapping } from './component-mapping'; + +export interface IComponentMappingList { + dossierTemplateId: string; + componentMappingList: IComponentMapping[]; +} + +export class ComponentMappingList implements IComponentMappingList { + readonly dossierTemplateId: string; + readonly componentMappingList: ComponentMapping[]; + + constructor(componentMappingList: IComponentMappingList) { + this.dossierTemplateId = componentMappingList.dossierTemplateId; + this.componentMappingList = componentMappingList.componentMappingList; + } +} diff --git a/libs/red-domain/src/lib/component-mappings/component-mapping.ts b/libs/red-domain/src/lib/component-mappings/component-mapping.ts new file mode 100644 index 000000000..b8e1e7745 --- /dev/null +++ b/libs/red-domain/src/lib/component-mappings/component-mapping.ts @@ -0,0 +1,38 @@ +import { IListable } from '@iqser/common-ui'; + +export interface IComponentMapping extends IListable { + id: string; + name: string; + fileName: string; + version: number; + columnLabels: string[]; + numberOfLines: number; + encoding: string; + delimiter: string; +} + +export class ComponentMapping implements IComponentMapping, IListable { + readonly id: string; + readonly name: string; + readonly fileName: string; + readonly version: number; + readonly columnLabels: string[]; + readonly numberOfLines: number; + readonly encoding: string; + readonly delimiter: string; + + constructor(componentMapping: IComponentMapping) { + this.id = componentMapping.id; + this.name = componentMapping.name; + this.fileName = componentMapping.fileName; + this.version = componentMapping.version; + this.columnLabels = componentMapping.columnLabels; + this.numberOfLines = componentMapping.numberOfLines; + this.encoding = componentMapping.encoding; + this.delimiter = componentMapping.delimiter; + } + + get searchKey(): string { + return this.name; + } +} diff --git a/libs/red-domain/src/lib/component-mappings/index.ts b/libs/red-domain/src/lib/component-mappings/index.ts new file mode 100644 index 000000000..88026faa7 --- /dev/null +++ b/libs/red-domain/src/lib/component-mappings/index.ts @@ -0,0 +1,2 @@ +export * from './component-mapping-list.model'; +export * from './component-mapping';