-
-
+
+
+
+
+
+
+
+ {{ entry.key }}
+
+
+
+
+
+
+
+ {{ entry.value.transformation }}
+
+
+
-
-
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss
index fa01814c2..cf04f8aa6 100644
--- a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss
+++ b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.scss
@@ -19,3 +19,47 @@
.dialog-content {
overflow: auto;
}
+
+.table {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+
+ > div {
+ padding: 8px 10px;
+ }
+
+ .bold {
+ font-weight: 600;
+ }
+
+ .value-content {
+ .value {
+ }
+
+ .actions {
+ }
+ }
+
+ .table-header {
+ margin: 10px 0;
+ border-bottom: 1px solid var(--iqser-separator);
+ background-color: var(--iqser-grey-2);
+ font-weight: 600;
+ }
+}
+
+.annotation-grid {
+ display: grid;
+ grid-template-columns: 3fr 1fr 1fr 5fr;
+}
+
+ul {
+ margin: 0;
+}
+
+.output-data > div:nth-child(8n + 9),
+.output-data > div:nth-child(8n + 10),
+.output-data > div:nth-child(8n + 11),
+.output-data > div:nth-child(8n + 12) {
+ background: var(--iqser-grey-8);
+}
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.ts
index 2b8eb4b21..62a8119ab 100644
--- a/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/file-preview/dialogs/rss-dialog/rss-dialog.component.ts
@@ -1,9 +1,9 @@
-import { Component, Inject } from '@angular/core';
-import { BaseDialogComponent } from '@iqser/common-ui';
+import { Component, Inject, OnInit } from '@angular/core';
+import { BaseDialogComponent, IconButtonTypes } from '@iqser/common-ui';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { RssService } from '@services/files/rss.service';
import { IFile, IRssEntry } from '@red/domain';
-import { firstValueFrom, Observable } from 'rxjs';
+import { BehaviorSubject, firstValueFrom } from 'rxjs';
import { map } from 'rxjs/operators';
import { FilesMapService } from '@services/files/files-map.service';
import { UserPreferenceService } from '@users/user-preference.service';
@@ -17,10 +17,10 @@ interface RssData {
templateUrl: './rss-dialog.component.html',
styleUrls: ['./rss-dialog.component.scss'],
})
-export class RssDialogComponent extends BaseDialogComponent {
- rssData$: Observable
;
+export class RssDialogComponent extends BaseDialogComponent implements OnInit {
+ readonly iconButtonTypes = IconButtonTypes;
- originalOrder = (a: KeyValue, b: KeyValue): number => 0;
+ rssData$ = new BehaviorSubject(null);
constructor(
protected readonly _dialogRef: MatDialogRef,
@@ -30,21 +30,14 @@ export class RssDialogComponent extends BaseDialogComponent {
@Inject(MAT_DIALOG_DATA) readonly data: RssData,
) {
super(_dialogRef);
- this.rssData$ = this._rssService.getRSSData(this.data.file.dossierId, this.data.file.fileId).pipe(
- map(entry => {
- const mapped = {};
- for (const key of Object.keys(entry.result)) {
- const newKey = key.replace(new RegExp('_', 'g'), ' ');
- mapped[newKey] = entry.result[key];
- }
- return {
- filaName: entry.filaName,
- result: mapped,
- };
- }),
- );
}
+ async ngOnInit(): Promise {
+ await this.#loadData();
+ }
+
+ originalOrder = (a: KeyValue, b: KeyValue): number => 0;
+
exportJSON() {
this._rssService.exportJSON(this.data.file.dossierId, this.data.file.fileId, this.data.file.filename).subscribe();
}
@@ -64,4 +57,40 @@ export class RssDialogComponent extends BaseDialogComponent {
save(): void {
this.exportJSON();
}
+
+ async undo(entry: KeyValue) {
+ this._loadingService.start();
+ await firstValueFrom(this._rssService.revertOverride(this.data.file.dossierId, this.data.file.fileId, [entry.value.originalKey]));
+ await this.#loadData();
+ }
+
+ async saveEdit(event: string, entry: KeyValue) {
+ this._loadingService.start();
+ await firstValueFrom(
+ this._rssService.override(this.data.file.dossierId, this.data.file.fileId, { [entry.value.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).pipe(
+ map(entry => {
+ const mapped = {};
+ for (const key of Object.keys(entry.result)) {
+ const newKey = key.replace(new RegExp('_', 'g'), ' ');
+ (entry.result[key]).originalKey = key;
+ mapped[newKey] = entry.result[key];
+ }
+ return {
+ filaName: entry.filaName,
+ result: mapped,
+ };
+ }),
+ ),
+ );
+ this.rssData$.next(rssData);
+ this._loadingService.stop();
+ }
}
diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts
index f3fa8143c..8c2391e64 100644
--- a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts
+++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts
@@ -253,13 +253,15 @@ export class PdfProxyService {
onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.REDACTION),
});
- popups.push({
- type: 'actionButton',
- dataElement: TextPopups.ADD_DICTIONARY,
- img: this.#addDictIcon,
- title: this.#getTitle(ManualRedactionEntryTypes.DICTIONARY),
- onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.DICTIONARY),
- });
+ if (!this._iqserPermissionsService.has(ROLES.getRss)) {
+ popups.push({
+ type: 'actionButton',
+ dataElement: TextPopups.ADD_DICTIONARY,
+ img: this.#addDictIcon,
+ title: this.#getTitle(ManualRedactionEntryTypes.DICTIONARY),
+ onClick: () => this._addManualRedactionOfType(ManualRedactionEntryTypes.DICTIONARY),
+ });
+ }
}
this._pdf.configureTextPopups(popups);
diff --git a/apps/red-ui/src/app/services/files/rss.service.ts b/apps/red-ui/src/app/services/files/rss.service.ts
index 71f639f6d..25f60ea1d 100644
--- a/apps/red-ui/src/app/services/files/rss.service.ts
+++ b/apps/red-ui/src/app/services/files/rss.service.ts
@@ -15,7 +15,7 @@ export class RssService extends GenericService {
const queryParams: QueryParam[] = [];
queryParams.push({ key: 'fileId', value: fileId });
- const rssData$ = this._getOne([dossierId], 'rss', queryParams);
+ const rssData$ = this._getOne([dossierId], 'rss/detailed', queryParams);
return rssData$.pipe(
map(data => data.files[0]),
catchError(() => of({} as IRssEntry)),
@@ -40,6 +40,20 @@ export class RssService extends GenericService {
});
}
+ @Validate()
+ override(
+ @RequiredParam() dossierId: string,
+ @RequiredParam() fileId: string,
+ @RequiredParam() componentOverrides: Record,
+ ) {
+ return this._post({ componentOverrides }, `rss/override/${dossierId}/${fileId}`);
+ }
+
+ @Validate()
+ revertOverride(@RequiredParam() dossierId: string, @RequiredParam() fileId: string, @RequiredParam() components: string[]) {
+ return this._post({ components }, `rss/override/revert/${dossierId}/${fileId}`);
+ }
+
exportJSON(dossierId: string, fileId: string, name: string) {
return this.getRSSData(dossierId, fileId).pipe(
tap(data => {
diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json
index f4b69417a..ef98789d9 100644
--- a/apps/red-ui/src/assets/config/config.json
+++ b/apps/red-ui/src/assets/config/config.json
@@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
- "API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
+ "API_URL": "https://syngenta-scm.iqser.cloud/redaction-gateway-v1",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 3,
"BACKEND_APP_VERSION": "4.4.40",
@@ -11,11 +11,11 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
- "OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
+ "OAUTH_URL": "https://syngenta-scm.iqser.cloud/auth/realms/redaction",
"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/"
}
diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json
index 6fbb77a45..1045a6ad2 100644
--- a/apps/red-ui/src/assets/i18n/redact/de.json
+++ b/apps/red-ui/src/assets/i18n/redact/de.json
@@ -1953,9 +1953,13 @@
},
"rss-dialog": {
"actions": {
+ "cancel-edit": "",
"close": "",
+ "edit": "",
"export-json": "",
- "export-xml": ""
+ "export-xml": "",
+ "save": "",
+ "undo": ""
},
"title": ""
},
diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json
index c08cefd6c..4ba768210 100644
--- a/apps/red-ui/src/assets/i18n/redact/en.json
+++ b/apps/red-ui/src/assets/i18n/redact/en.json
@@ -1953,9 +1953,13 @@
},
"rss-dialog": {
"actions": {
+ "cancel-edit": "Cancel",
"close": "Close",
+ "edit": "Edit",
"export-json": "Export JSON",
- "export-xml": "Export XML"
+ "export-xml": "Export XML",
+ "save": "Save",
+ "undo": "Undo"
},
"title": "Structured Component Management"
},
diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json
index 7cf98b4e0..2e29848a1 100644
--- a/apps/red-ui/src/assets/i18n/scm/de.json
+++ b/apps/red-ui/src/assets/i18n/scm/de.json
@@ -1953,9 +1953,13 @@
},
"rss-dialog": {
"actions": {
+ "cancel-edit": "",
"close": "",
+ "edit": "",
"export-json": "",
- "export-xml": ""
+ "export-xml": "",
+ "save": "",
+ "undo": ""
},
"title": ""
},
diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json
index 097c86b11..634c5d846 100644
--- a/apps/red-ui/src/assets/i18n/scm/en.json
+++ b/apps/red-ui/src/assets/i18n/scm/en.json
@@ -1953,10 +1953,15 @@
},
"rss-dialog": {
"actions": {
+ "cancel-edit": "Cancel",
"close": "Close",
+ "edit": "Edit",
"export-json": "Export JSON",
- "export-xml": "Export XML"
+ "export-xml": "Export XML",
+ "save": "Save",
+ "undo": "Undo to: {value}"
},
+ "annotations": "{type} found on {pageCount, plural, one{page} other{pages}} {pages} by rule #{ruleNumber}",
"title": "Structured Component Management"
},
"rules-screen": {