diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.html index 563f7d03f..4b779a302 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.html @@ -1,34 +1,34 @@
-
+

-
{{ 'rss-dialog.table-header.component' | translate }}
-
{{ 'rss-dialog.table-header.value' | translate }}
-
{{ 'rss-dialog.table-header.transformation-rule' | translate }}
-
{{ 'rss-dialog.table-header.annotation-references' | translate }}
+
{{ 'component-log-dialog.table-header.component' | translate }}
+
{{ 'component-log-dialog.table-header.value' | translate }}
+
{{ 'component-log-dialog.table-header.transformation-rule' | translate }}
+
{{ 'component-log-dialog.table-header.annotation-references' | translate }}
- -
{{ entry.key }}
+ +
{{ entry.value }}
-
{{ entry.value.transformation }}
+
{{ entry.componentRuleId }}
-
    +
    - - + -
@@ -64,7 +62,7 @@
@@ -84,9 +82,9 @@ label="Export All" > -
+
{{ 'rss-dialog.actions.display-by-default' | translate }} + >{{ 'component-log-dialog.actions.display-by-default' | translate }}
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.ts index d65d765e2..4f71475d1 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/structured-component-management-dialog/structured-component-management-dialog.component.ts @@ -5,11 +5,11 @@ import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/materia import { ReplaceNbspPipe } from '@common-ui/pipes/replace-nbsp.pipe'; import { BaseDialogComponent, CircleButtonComponent, EditableInputComponent, IconButtonComponent } from '@iqser/common-ui'; import { TranslateModule } from '@ngx-translate/core'; -import { IFile, RssEntry, WorkflowFileStatuses } from '@red/domain'; +import { ComponentLogEntry, IFile, WorkflowFileStatuses } from '@red/domain'; import { FilesMapService } from '@services/files/files-map.service'; -import { RssService } from '@services/files/rss.service'; import { UserPreferenceService } from '@users/user-preference.service'; import { firstValueFrom } from 'rxjs'; +import { ComponentLogService } from '@services/files/component-log.service'; interface ScmData { file: IFile; @@ -34,12 +34,12 @@ interface ScmData { ], }) export class StructuredComponentManagementDialogComponent extends BaseDialogComponent implements OnInit { - readonly scmData = signal(undefined); + readonly scmData = signal(undefined); readonly openScmDialogByDefault = signal(this.userPreferences.getOpenScmDialogByDefault()); constructor( protected readonly _dialogRef: MatDialogRef, - private readonly _rssService: RssService, + private readonly _componentLogService: ComponentLogService, readonly userPreferences: UserPreferenceService, private readonly _filesMapService: FilesMapService, @Inject(MAT_DIALOG_DATA) readonly data: ScmData, @@ -62,18 +62,22 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp originalOrder = (): number => 0; exportJSON() { - return firstValueFrom(this._rssService.exportJSON(this.data.file.dossierId, this.data.file.fileId, this.data.file.filename)); + return firstValueFrom( + this._componentLogService.exportJSON(this.data.file.dossierId, this.data.file.fileId, this.data.file.filename), + ); } exportXML() { - return firstValueFrom(this._rssService.exportXML(this.data.file.dossierId, this.data.file.fileId, this.data.file.filename)); + return firstValueFrom( + this._componentLogService.exportXML(this.data.file.dossierId, this.data.file.fileId, this.data.file.filename), + ); } async exportAllInDossier() { const allFilesInDossier = this._filesMapService.get(this.data.file.dossierId); for (const file of allFilesInDossier) { - await firstValueFrom(this._rssService.exportJSON(file.dossierId, file.fileId, file.filename)); - await firstValueFrom(this._rssService.exportXML(file.dossierId, file.fileId, file.filename)); + await firstValueFrom(this._componentLogService.exportJSON(file.dossierId, file.fileId, file.filename)); + await firstValueFrom(this._componentLogService.exportXML(file.dossierId, file.fileId, file.filename)); } } @@ -89,20 +93,22 @@ export class StructuredComponentManagementDialogComponent extends BaseDialogComp async undo(originalKey: string) { this._loadingService.start(); - await firstValueFrom(this._rssService.revertOverride(this.data.file.dossierId, this.data.file.fileId, [originalKey])); + await firstValueFrom(this._componentLogService.revertOverride(this.data.file.dossierId, this.data.file.fileId, [originalKey])); await this.#loadData(); } async saveEdit(event: string, originalKey: string) { this._loadingService.start(); - await firstValueFrom(this._rssService.override(this.data.file.dossierId, this.data.file.fileId, { [originalKey]: event })); + await firstValueFrom(this._componentLogService.override(this.data.file.dossierId, this.data.file.fileId, { [originalKey]: event })); await this.#loadData(); } async #loadData(): Promise { this._loadingService.start(); - const rssData = await firstValueFrom(this._rssService.getRSSData(this.data.file.dossierId, this.data.file.fileId)); - this.scmData.set(rssData); + const componentLogData = await firstValueFrom( + this._componentLogService.getComponentLogData(this.data.file.dossierId, this.data.file.fileId), + ); + this.scmData.set(componentLogData); this._loadingService.stop(); } } diff --git a/apps/red-ui/src/app/services/files/rss.service.ts b/apps/red-ui/src/app/services/files/component-log.service.ts similarity index 71% rename from apps/red-ui/src/app/services/files/rss.service.ts rename to apps/red-ui/src/app/services/files/component-log.service.ts index 9fa3d8e61..b528603ce 100644 --- a/apps/red-ui/src/app/services/files/rss.service.ts +++ b/apps/red-ui/src/app/services/files/component-log.service.ts @@ -1,33 +1,33 @@ import { Injectable } from '@angular/core'; import { GenericService, QueryParam } from '@iqser/common-ui'; -import { IRssData, IRssEntry, RssEntry } from '@red/domain'; import { catchError, map, tap } from 'rxjs/operators'; import { Observable, of } from 'rxjs'; import { HttpHeaders } from '@angular/common/http'; import { saveAs } from 'file-saver'; +import { ComponentLogEntry, IComponentLogData, IComponentLogEntry } from '@red/domain'; @Injectable({ providedIn: 'root' }) -export class RssService extends GenericService { +export class ComponentLogService extends GenericService { protected readonly _defaultModelPath = 'import-redactions'; - getRSSData(dossierId: string, fileId: string): Observable { + getComponentLogData(dossierId: string, fileId: string): Observable { const queryParams: QueryParam[] = []; queryParams.push({ key: 'fileId', value: fileId }); - return this._getOne([dossierId], 'rss/detailed', queryParams).pipe( - map(data => data.files[0]), - catchError(() => of({} as IRssEntry)), - map(data => new RssEntry(data)), + return this._getOne([dossierId], 'componentLog', queryParams).pipe( + map(data => data.componentLogEntries[0]), + catchError(() => of({} as IComponentLogEntry)), + map(data => new ComponentLogEntry(data)), ); } - getRSSExportData(dossierId: string, fileId: string): Observable { + getComponentLogExportData(dossierId: string, fileId: string): Observable { const queryParams: QueryParam[] = []; queryParams.push({ key: 'fileId', value: fileId }); return this._getOne([dossierId], 'rss', queryParams).pipe( map(data => data.files[0]), - catchError(() => of({} as IRssEntry)), + catchError(() => of({} as IComponentLogEntry)), ); } @@ -39,8 +39,8 @@ export class RssService extends GenericService { return this._post({ components }, `rss/override/revert/${dossierId}/${fileId}`); } - exportJSON(dossierId: string, fileId: string, name: string): Observable { - return this.getRSSExportData(dossierId, fileId).pipe( + exportJSON(dossierId: string, fileId: string, name: string): Observable { + return this.getComponentLogExportData(dossierId, fileId).pipe( tap(data => { const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); saveAs(blob, name + '.rss.json'); @@ -49,7 +49,7 @@ export class RssService extends GenericService { } exportXML(dossierId: string, fileId: string, name: string): Observable { - return this._getRSSDataAsXML(dossierId, fileId).pipe( + return this._getComponentLogDataAsXML(dossierId, fileId).pipe( tap(data => { const blob = new Blob([data], { type: 'application/xml' }); saveAs(blob, name + '.rss.xml'); @@ -57,7 +57,7 @@ export class RssService extends GenericService { ); } - private _getRSSDataAsXML(dossierId: string, fileId: string) { + private _getComponentLogDataAsXML(dossierId: string, fileId: string) { const queryParams: QueryParam[] = []; queryParams.push({ key: 'fileId', value: fileId }); diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 42bf5941f..441ade243 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -1,9 +1,9 @@ { "ADMIN_CONTACT_NAME": null, "ADMIN_CONTACT_URL": null, - "API_URL": "https://dan.iqser.cloud", + "API_URL": "https://dan1.iqser.cloud", "APP_NAME": "RedactManager", - "IS_DOCUMINE": false, + "IS_DOCUMINE": true, "RULE_EDITOR_DEV_ONLY": false, "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", @@ -13,13 +13,13 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dan.iqser.cloud/auth", + "OAUTH_URL": "https://dan1.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", "ANNOTATIONS_THRESHOLD": 1000, - "THEME": "redact", - "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/redact/", + "THEME": "scm", + "BASE_TRANSLATIONS_DIRECTORY": "/assets/i18n/scm/", "AVAILABLE_NOTIFICATIONS_DAYS": 30, "AVAILABLE_OLD_NOTIFICATIONS_MINUTES": 60, "NOTIFICATIONS_THRESHOLD": 1000, diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index b5fba93d1..6737f6df7 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -558,6 +558,26 @@ "title": "Aktion bestätigen" } }, + "component-log-dialog": { + "actions": { + "cancel-edit": "Cancel", + "close": "Close", + "display-by-default": "", + "edit": "Edit", + "export-json": "Export JSON", + "export-xml": "Export XML", + "save": "Save", + "undo": "Undo" + }, + "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", + "table-header": { + "annotation-references": "Annotation references", + "component": "Component", + "transformation-rule": "Transformation rule", + "value": "Value" + }, + "title": "Structured Component Management" + }, "component-rules-screen": { "error": { "generic": "" @@ -2232,26 +2252,6 @@ "red-user-admin": "Benutzer-Admin", "regular": "Regulär" }, - "rss-dialog": { - "actions": { - "cancel-edit": "Cancel", - "close": "Close", - "display-by-default": "", - "edit": "Edit", - "export-json": "Export JSON", - "export-xml": "Export XML", - "save": "Save", - "undo": "Undo" - }, - "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", - "table-header": { - "annotation-references": "Annotation references", - "component": "Component", - "transformation-rule": "Transformation rule", - "value": "Value" - }, - "title": "Structured Component Management" - }, "search": { "active-dossiers": "ganze Plattform", "all-dossiers": "all documents", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 68c6b48ab..ef362c9b9 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -558,6 +558,26 @@ "title": "Confirm Action" } }, + "component-log-dialog": { + "actions": { + "cancel-edit": "Cancel", + "close": "Close", + "display-by-default": "Display by default when opening documents", + "edit": "Edit", + "export-json": "Export JSON", + "export-xml": "Export XML", + "save": "Save", + "undo": "Undo to: {value}" + }, + "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", + "table-header": { + "annotation-references": "Annotation references", + "component": "Component", + "transformation-rule": "Transformation rule", + "value": "Value" + }, + "title": "Component View" + }, "component-rules-screen": { "error": { "generic": "" @@ -1778,8 +1798,8 @@ "licensed-page-count": "Licensed Pages", "licensed-retention-capacity": "Licensed Retention Capacity", "licensed-to": "Licensed to", - "section-title": "Licensing Details", - "licensing-period": "Licensing Period" + "licensing-period": "Licensing Period", + "section-title": "Licensing Details" }, "page-usage": { "cumulative-pages": "Cumulative Pages", @@ -2237,26 +2257,6 @@ "red-user-admin": "Users Admin", "regular": "Regular" }, - "rss-dialog": { - "actions": { - "cancel-edit": "Cancel", - "close": "Close", - "display-by-default": "", - "edit": "Edit", - "export-json": "Export JSON", - "export-xml": "Export XML", - "save": "Save", - "undo": "Undo" - }, - "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", - "table-header": { - "annotation-references": "Annotation references", - "component": "Component", - "transformation-rule": "Transformation rule", - "value": "Value" - }, - "title": "Structured Component Management" - }, "search-screen": { "cols": { "assignee": "Assignee", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index d54e790c0..c87dcb87c 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -558,6 +558,26 @@ "title": "Aktion bestätigen" } }, + "component-log-dialog": { + "actions": { + "cancel-edit": "Cancel", + "close": "Close", + "display-by-default": "", + "edit": "Edit", + "export-json": "Export JSON", + "export-xml": "Export XML", + "save": "Save", + "undo": "Undo" + }, + "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", + "table-header": { + "annotation-references": "Annotation references", + "component": "Component", + "transformation-rule": "Transformation rule", + "value": "Value" + }, + "title": "Structured Component Management" + }, "component-rules-screen": { "error": { "generic": "" @@ -2237,26 +2257,6 @@ "red-user-admin": "Benutzer-Admin", "regular": "Regulär" }, - "rss-dialog": { - "actions": { - "cancel-edit": "", - "close": "", - "display-by-default": "", - "edit": "", - "export-json": "", - "export-xml": "", - "save": "", - "undo": "" - }, - "annotations": "", - "table-header": { - "annotation-references": "", - "component": "", - "transformation-rule": "", - "value": "" - }, - "title": "" - }, "search-screen": { "cols": { "assignee": "Bevollmächtigter", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 3511678ef..bbaa90dea 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -558,6 +558,26 @@ "title": "Confirm Action" } }, + "component-log-dialog": { + "actions": { + "cancel-edit": "Cancel", + "close": "Close", + "display-by-default": "Display by default when opening documents", + "edit": "Edit", + "export-json": "Export JSON", + "export-xml": "Export XML", + "save": "Save", + "undo": "Undo to: {value}" + }, + "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", + "table-header": { + "annotation-references": "Annotation references", + "component": "Component", + "transformation-rule": "Transformation rule", + "value": "Value" + }, + "title": "Component View" + }, "component-rules-screen": { "error": { "generic": "Something went wrong... Component rules update failed!" @@ -1778,8 +1798,8 @@ "licensed-page-count": "Licensed Pages", "licensed-retention-capacity": "Licensed Retention Capacity", "licensed-to": "Licensed to", - "section-title": "Licensing Details", - "licensing-period": "Licensing Period" + "licensing-period": "Licensing Period", + "section-title": "Licensing Details" }, "page-usage": { "cumulative-pages": "Cumulative Pages", @@ -2237,26 +2257,6 @@ "red-user-admin": "Users Admin", "regular": "Regular" }, - "rss-dialog": { - "actions": { - "cancel-edit": "Cancel", - "close": "Close", - "display-by-default": "Display by default when opening documents", - "edit": "Edit", - "export-json": "Export JSON", - "export-xml": "Export XML", - "save": "Save", - "undo": "Undo to: {value}" - }, - "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}", - "table-header": { - "annotation-references": "Annotation references", - "component": "Component", - "transformation-rule": "Transformation rule", - "value": "Value" - }, - "title": "Component View" - }, "search-screen": { "cols": { "assignee": "Assignee", diff --git a/libs/red-domain/src/index.ts b/libs/red-domain/src/index.ts index dd4b6515d..e324c83a5 100644 --- a/libs/red-domain/src/index.ts +++ b/libs/red-domain/src/index.ts @@ -28,4 +28,4 @@ export * from './lib/license'; export * from './lib/digital-signature'; export * from './lib/watermarks'; export * from './lib/colors'; -export * from './lib/rss'; +export * from './lib/component-log'; diff --git a/libs/red-domain/src/lib/component-log/component-log-data.ts b/libs/red-domain/src/lib/component-log/component-log-data.ts new file mode 100644 index 000000000..005bc3a71 --- /dev/null +++ b/libs/red-domain/src/lib/component-log/component-log-data.ts @@ -0,0 +1,7 @@ +import { IComponentLogEntry } from './component-log-entry'; + +export interface IComponentLogData { + analysisNumber: number; + componentRulesVersion: number; + componentLogEntries: Array; +} diff --git a/libs/red-domain/src/lib/component-log/component-log-entry.ts b/libs/red-domain/src/lib/component-log/component-log-entry.ts new file mode 100644 index 000000000..223b9b647 --- /dev/null +++ b/libs/red-domain/src/lib/component-log/component-log-entry.ts @@ -0,0 +1,16 @@ +import { ComponentValue, IComponentValue } from './component-value'; + +export interface IComponentLogEntry { + name: string; + componentValues: IComponentValue[]; +} + +export class ComponentLogEntry implements IComponentLogEntry { + readonly name: string; + readonly componentValues: ComponentValue[]; + + constructor(entry: IComponentLogEntry) { + this.name = entry.name; + this.componentValues = entry.componentValues; + } +} diff --git a/libs/red-domain/src/lib/component-log/component-value.ts b/libs/red-domain/src/lib/component-log/component-value.ts new file mode 100644 index 000000000..ec01a2957 --- /dev/null +++ b/libs/red-domain/src/lib/component-log/component-value.ts @@ -0,0 +1,27 @@ +export interface ComponentLogEntityReference { + readonly id: string; + readonly type: string; + readonly entityRuleId: string; + readonly page: number; +} + +export interface IComponentValue { + readonly value: string; + readonly originalValue: string; + readonly componentRuleId: string; + readonly componentLogEntityReferences: ComponentLogEntityReference[]; +} + +export class ComponentValue implements IComponentValue { + readonly value: string; + readonly originalValue: string; + readonly componentRuleId: string; + readonly componentLogEntityReferences: ComponentLogEntityReference[]; + + constructor(value: IComponentValue) { + this.value = value.value; + this.originalValue = value.originalValue; + this.componentRuleId = value.componentRuleId; + this.componentLogEntityReferences = value.componentLogEntityReferences ?? []; + } +} diff --git a/libs/red-domain/src/lib/component-log/index.ts b/libs/red-domain/src/lib/component-log/index.ts new file mode 100644 index 000000000..ea8f97269 --- /dev/null +++ b/libs/red-domain/src/lib/component-log/index.ts @@ -0,0 +1,3 @@ +export * from './component-log-data'; +export * from './component-log-entry'; +export * from './component-value'; diff --git a/libs/red-domain/src/lib/rss/index.ts b/libs/red-domain/src/lib/rss/index.ts deleted file mode 100644 index b39f0579d..000000000 --- a/libs/red-domain/src/lib/rss/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './rss-data'; -export * from './rss-entry'; -export * from './rss-result'; diff --git a/libs/red-domain/src/lib/rss/rss-data.ts b/libs/red-domain/src/lib/rss/rss-data.ts deleted file mode 100644 index 8e0ff7334..000000000 --- a/libs/red-domain/src/lib/rss/rss-data.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IRssEntry } from './rss-entry'; - -export interface IRssData { - files: Array; -} diff --git a/libs/red-domain/src/lib/rss/rss-entry.ts b/libs/red-domain/src/lib/rss/rss-entry.ts deleted file mode 100644 index 71dcf6d5d..000000000 --- a/libs/red-domain/src/lib/rss/rss-entry.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { IRssResult, RssResult } from './rss-result'; - -export interface IRssEntry { - filename: string; - result: Record; -} - -export class RssEntry implements IRssEntry { - readonly filename: string; - readonly result: Record; - - constructor(entry: IRssEntry) { - this.filename = entry.filename; - - const mappedResult: Record = {}; - for (const key of Object.keys(entry.result)) { - const newKey = key.replace(new RegExp('_', 'g'), ' '); - mappedResult[newKey] = new RssResult(entry.result[key], key); - } - this.result = mappedResult; - } -} diff --git a/libs/red-domain/src/lib/rss/rss-result.ts b/libs/red-domain/src/lib/rss/rss-result.ts deleted file mode 100644 index 64b3282ca..000000000 --- a/libs/red-domain/src/lib/rss/rss-result.ts +++ /dev/null @@ -1,33 +0,0 @@ -export interface IScmAnnotation { - readonly type: string; - readonly pages: number[]; - readonly ruleIdentifier: string; - readonly reason: string; -} - -export interface IRssResult { - readonly value: string; - readonly originalValue: string; - readonly scmAnnotations: IScmAnnotation[]; - readonly transformation: string; -} - -export type RssResultAnnotation = IScmAnnotation & { readonly displayName: string }; - -export class RssResult implements IRssResult { - readonly value: string; - readonly originalValue: string; - readonly scmAnnotations: RssResultAnnotation[]; - readonly transformation: string; - - constructor(result: IRssResult, readonly originalKey: string) { - this.value = result.value; - this.originalValue = result.originalValue; - const scmAnnotations = result.scmAnnotations ?? []; - this.scmAnnotations = scmAnnotations.map(annotation => ({ - ...annotation, - displayName: annotation.reason.split('found')?.[0]?.trim(), - })); - this.transformation = result.transformation; - } -}