diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html index cb5b3a1f0..eae5e9d7d 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.html @@ -35,7 +35,12 @@
-
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html index c2c06a91d..f272c2b53 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html @@ -1,13 +1,8 @@
@@ -36,8 +31,7 @@
- - +
@@ -58,12 +52,12 @@
-
-
- - -
+
+ + +
+
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts index 2df530cec..5cdc94841 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.ts @@ -27,13 +27,12 @@ export class EditRedactionDialogComponent readonly isManualRedaction: boolean; readonly showLegalReason: boolean; readonly isHint: boolean; + readonly showExtras: boolean; options: DetailsRadioOption[] | undefined; legalOptions: LegalBasisOption[] = []; dictionaries: Dictionary[] = []; form: UntypedFormGroup; - readonly #initialType: string; - readonly #initialReason: string; readonly #dossier: Dossier; #applyToAllDossiers: boolean; @@ -49,29 +48,13 @@ export class EditRedactionDialogComponent this.#applyToAllDossiers = this.data.applyToAllDossiers; const annotations = this.data.annotations; const firstEntry = annotations[0]; - this.isImage = IMAGE_CATEGORIES.includes(firstEntry.type); + this.isImage = [...IMAGE_CATEGORIES, 'ocr'].includes(firstEntry.type); this.redactedText = annotations.length === 1 && !this.isImage ? firstEntry.value : null; - this.#initialReason = firstEntry.legalBasis; - this.#initialType = firstEntry.type; this.isModifyDictionary = firstEntry.isModifyDictionary; this.isManualRedaction = firstEntry.type === SuperTypes.ManualRedaction; this.isHint = firstEntry.isHint; - this.showLegalReason = !(firstEntry.isSkipped || firstEntry.isHint || this.isImage); + this.showExtras = !(this.isImage || this.isHint); this.form = this.#getForm(); - console.log(firstEntry); - - // this.form.valueChanges - // .pipe( - // tap(value => { - // const reasonChanged = this.#initialReason !== value?.reason?.legalBasis; - // const typeChanged = this.#initialType !== value?.type; - // if (typeChanged || reasonChanged) { - // this.#setOptions(value.type, reasonChanged); - // } - // }), - // takeUntilDestroyed(), - // ) - // .subscribe(); } get displayedDictionaryLabel() { @@ -109,9 +92,8 @@ export class EditRedactionDialogComponent save(): void { const value = this.form.value; - this.dialogRef.close({ - typeChanged: this.#initialType !== value.type, - legalBasis: value.reason?.legalBasis ?? null, + this.close({ + legalBasis: value.reason?.legalBasis ?? '', section: value.section, comment: value.comment, type: value.type, @@ -120,7 +102,12 @@ export class EditRedactionDialogComponent } #setTypes() { - this.dictionaries = this._dictionaryService.getEditableRedactionTypes(this.#dossier.dossierTemplateId, this.isImage, this.isHint); + this.dictionaries = this._dictionaryService.getEditableRedactionTypes( + this.#dossier.dossierTemplateId, + this.isImage, + this.isHint, + this.data.annotations[0].isOCR, + ); } #setOptions(type: string, reasonChanged = false) { diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index ffa1e89be..43e6136a1 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -117,7 +117,7 @@ export class AnnotationActionsService { return; } - if (!this.#isDocumine) { + if (!this.#isDocumine && result.legalBasis !== annotations[0].legalBasis) { const changeLegalBasisBody = annotations.map(annotation => ({ annotationId: annotation.id, legalBasis: result.legalBasis, @@ -126,7 +126,7 @@ export class AnnotationActionsService { })); requests.push(this._manualRedactionService.changeLegalBasis(changeLegalBasisBody, dossierId, fileId)); } - if (result.typeChanged || this.#isDocumine) { + if (result.type !== annotations[0].type || this.#isDocumine) { const recategorizeBody: List = annotations.map(({ id }) => ({ annotationId: id, type: result.type, @@ -134,6 +134,10 @@ export class AnnotationActionsService { requests.push(this._manualRedactionService.recategorizeRedactions(recategorizeBody, dossierId, fileId)); } + if (!requests.length) { + return; + } + if (result.comment) { requests.push( from(Promise.all(annotations.map(a => this._manualRedactionService.addComment(result.comment, a.id, dossierId, fileId)))), diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts index 238727638..ab888107e 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts @@ -51,7 +51,12 @@ export class PdfAnnotationActionsService { availableActions.push(resizeButton); } - if (permissions.canChangeLegalBasis || permissions.canRecategorizeAnnotation) { + if ( + permissions.canChangeLegalBasis || + permissions.canRecategorizeAnnotation || + permissions.canForceHint || + permissions.canForceRedaction + ) { const editButton = this.#getButton('edit', _('annotation-actions.edit-redaction.label'), () => this.#annotationActionsService.editRedaction(annotations), ); diff --git a/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts index 679285324..11d89beee 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts @@ -35,7 +35,6 @@ export interface RedactRecommendationResult { } export interface EditRedactResult { - typeChanged: boolean; legalBasis: string; section: string; comment: string; diff --git a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts index 2a7330941..732595cd0 100644 --- a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts +++ b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts @@ -166,15 +166,17 @@ export class DictionaryService extends EntitiesService return dictionaries.sort((a, b) => a.label.localeCompare(b.label)); } - getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean, isHint: boolean): Dictionary[] { - return this._dictionariesMapService + getEditableRedactionTypes(dossierTemplateId: string, isImage: boolean, isHint: boolean, isOCR: boolean): Dictionary[] { + const types = []; + this._dictionariesMapService .get(dossierTemplateId) .filter(d => isImage - ? IMAGE_CATEGORIES.includes(d.type) - : (isHint ? d.hint : !d.hint) && !d.systemManaged && !d.virtual && d.hasDictionary, + ? (isOCR ? [...IMAGE_CATEGORIES, 'ocr'] : IMAGE_CATEGORIES).includes(d.type) + : (isHint ? d.hint : !d.hint) && !d.virtual && ![...IMAGE_CATEGORIES, 'ocr'].includes(d.type), ) - .sort((a, b) => a.label.localeCompare(b.label)); + .forEach(d => !types.find(t => t.id === d.id) && types.push(d)); + return types.sort((a, b) => a.label.localeCompare(b.label)); } getAddHintDictionaries(dossierTemplateId: string, dossierDictionaryOnly: boolean, dictionaryRequest: boolean): Dictionary[] { diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index e01cadedb..42bf5941f 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", + "API_URL": "https://dan.iqser.cloud", "APP_NAME": "RedactManager", "IS_DOCUMINE": false, "RULE_EDITOR_DEV_ONLY": false, @@ -13,7 +13,7 @@ "MAX_RETRIES_ON_SERVER_ERROR": 3, "OAUTH_CLIENT_ID": "redaction", "OAUTH_IDP_HINT": null, - "OAUTH_URL": "https://dev-08.iqser.cloud/auth", + "OAUTH_URL": "https://dan.iqser.cloud/auth", "RECENT_PERIOD_IN_HOURS": 24, "SELECTION_MODE": "structural", "MANUAL_BASE_URL": "https://docs.redactmanager.com/preview", diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index a913bda73..591f92a3d 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1239,9 +1239,7 @@ "section": "", "type": "" }, - "title-edit-image": "", - "title-edit-text": "", - "title-hint": "" + "title": "" } }, "entities-listing": { @@ -1927,6 +1925,7 @@ "search": "" } }, + "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layers", "toggle-readable-redactions": "", "toggle-tooltips": "{active, select, true{Disable} false{Enable} other{}} Kurzinfos für Anmerkungen", "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layout grid" @@ -1958,8 +1957,7 @@ "auto-expand-filters-on-action": "", "load-all-annotations-warning": "", "open-structured-view-by-default": "", - "table-extraction-type": "", - "unapproved-suggestions-warning": "" + "table-extraction-type": "" }, "label": "", "title": "", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index a663ff7a1..5b2a6669b 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -1239,9 +1239,7 @@ "section": "Paragraph / Location", "type": "Type" }, - "title-edit-image": "Edit image redaction", - "title-edit-text": "Edit redaction", - "title-hint": "Edit hint" + "title": "Edit {type, select, image{Image} hint{Hint} other{Redaction}}" } }, "entities-listing": { @@ -1927,6 +1925,7 @@ "search": "Search for selection" } }, + "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layers", "toggle-readable-redactions": "Show redactions {active, select, true{as in final document} false{in preview color} other{}}", "toggle-tooltips": "{active, select, true{Disable} false{Enable} other{}} annotation tooltips", "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layout grid" @@ -1958,8 +1957,7 @@ "auto-expand-filters-on-action": "Auto-expand filters on my actions", "load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview", "open-structured-view-by-default": "Display structured component management modal by default", - "table-extraction-type": "Table extraction type", - "unapproved-suggestions-warning": "Warning regarding unapproved suggestions in document Preview mode" + "table-extraction-type": "Table extraction type" }, "label": "Preferences", "title": "Edit preferences", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 4620accb8..a1bb24c2d 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -1239,9 +1239,7 @@ "section": "", "type": "" }, - "title-edit-image": "", - "title-edit-text": "", - "title-hint": "" + "title": "" } }, "entities-listing": { @@ -1927,6 +1925,7 @@ "search": "" } }, + "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layers grid", "toggle-readable-redactions": "", "toggle-tooltips": "{active, select, true{Disable} false{Enable} other{}} Kurzinfos für Anmerkungen", "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layout grid" @@ -1958,8 +1957,7 @@ "auto-expand-filters-on-action": "", "load-all-annotations-warning": "", "open-structured-view-by-default": "", - "table-extraction-type": "", - "unapproved-suggestions-warning": "" + "table-extraction-type": "" }, "label": "", "title": "", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index cfd6ff7ea..71d27015a 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -1239,9 +1239,7 @@ "section": "", "type": "Type" }, - "title-edit-image": "", - "title-edit-text": "Edit annotation", - "title-hint": "" + "title": "Edit annotation" } }, "entities-listing": { @@ -1927,6 +1925,7 @@ "search": "Search for selection" } }, + "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layers grid", "toggle-readable-redactions": "Show components {active, select, true{as in final document} false{in preview color} other{}}", "toggle-tooltips": "{active, select, true{Disable} false{Enable} other{}} annotation tooltips", "toggle-layers": "{active, select, true{Disable} false{Enable} other{}} layout grid" @@ -1958,8 +1957,7 @@ "auto-expand-filters-on-action": "Auto expand filters on my actions", "load-all-annotations-warning": "Warning regarding loading all annotations at once in file preview", "open-structured-view-by-default": "Display Component View by default when opening a document", - "table-extraction-type": "Table extraction type", - "unapproved-suggestions-warning": "Warning regarding unapproved suggestions in document Preview mode" + "table-extraction-type": "Table extraction type" }, "label": "Preferences", "title": "Edit preferences", diff --git a/libs/common-ui b/libs/common-ui index db37aa625..fed7c6a18 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit db37aa6257764e20a3c2ba602fc5cf875200d987 +Subproject commit fed7c6a180745043c5bfdbaf8b7eecaed03eca5e