-
-
-
-
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.scss
index fd8ec46a6..78c516a5c 100644
--- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.scss
+++ b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.scss
@@ -1,20 +1,55 @@
@use 'common-mixins';
.dialog-content {
- height: 470px;
+ padding-top: 8px;
+ padding-bottom: 35px;
}
-cdk-virtual-scroll-viewport {
- @include common-mixins.scroll-bar;
+table {
+ max-width: 100%;
+ min-width: 100%;
+ border-spacing: 0;
+
+ tbody {
+ padding-top: 2px;
+ overflow-y: auto;
+ display: block;
+ @include common-mixins.scroll-bar;
+ }
+
+ tr {
+ max-inline-size: 100%;
+ min-width: 100%;
+ display: table;
+
+ th {
+ border-bottom: 1px solid var(--iqser-grey-1);
+
+ label {
+ opacity: 0.7;
+ }
+ }
+
+ th,
+ td {
+ max-width: 0;
+ width: 25%;
+ text-align: start;
+
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ list-style-position: inside;
+ overflow: hidden;
+ }
+
+ th:last-child,
+ td:last-child {
+ max-width: 0;
+ width: 50%;
+ }
+ }
}
-:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper {
- max-width: 100% !important;
-}
-
-li {
- white-space: nowrap;
- text-overflow: ellipsis;
- list-style-position: inside;
- overflow: hidden;
+.hide {
+ visibility: hidden;
}
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts
index 214503f57..acc251e7d 100644
--- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts
@@ -1,15 +1,17 @@
-import { Component } from '@angular/core';
+import { Component, computed } from '@angular/core';
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
import { DetailsRadioOption, IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui';
-import {
- getRemoveRedactionOptions,
- RemoveAnnotationOptions,
- RemoveRedactionOption,
- RemoveRedactionOptions,
-} from '../../utils/dialog-options';
+import { getRemoveRedactionOptions, RemoveRedactionOption, RemoveRedactionOptions } from '../../utils/dialog-options';
import { RemoveRedactionData, RemoveRedactionResult } from '../../utils/dialog-types';
import { Roles } from '@users/roles';
import { DialogHelpModeKeys } from '../../utils/constants';
+import { toSignal } from '@angular/core/rxjs-interop';
+import { map } from 'rxjs/operators';
+
+interface ValuesColumns {
+ label: string;
+ show: boolean;
+}
@Component({
templateUrl: './remove-redaction-dialog.component.html',
@@ -27,16 +29,32 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
readonly skipped = this.data.redactions.some(annotation => annotation.isSkipped);
readonly redactedTexts = this.data.redactions.map(annotation => annotation.value);
readonly isImage = this.data.redactions.every(redaction => redaction.isImage);
+
protected readonly roles = Roles;
- form!: UntypedFormGroup;
+ form: UntypedFormGroup = this._formBuilder.group({
+ comment: [null],
+ option: [this.defaultOption],
+ });
+
+ readonly selectedOption = toSignal(this.form.get('option').valueChanges.pipe(map(value => value.value)));
+ readonly isFalsePositive = computed(() => this.selectedOption() === RemoveRedactionOptions.FALSE_POSITIVE);
+ readonly columns = computed(() => [
+ {
+ label: 'Value',
+ show: true,
+ },
+ {
+ label: 'Type',
+ show: true,
+ },
+ {
+ label: 'Context',
+ show: this.isFalsePositive(),
+ },
+ ]);
constructor(private readonly _formBuilder: FormBuilder) {
super();
- this.form = this.#getForm();
- }
-
- get isFalsePositive(): boolean {
- return this.form.get('option').value.value === RemoveAnnotationOptions.FALSE_POSITIVE;
}
get helpButtonKey() {
@@ -66,14 +84,15 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
return this.data.redactions.length > 1;
}
+ get redactedTextsAreaHeight() {
+ return this.redactedTexts.length <= 10 ? 18 * this.redactedTexts.length : 180;
+ }
+
+ get dialogContentHeight() {
+ return this.options.length * 75 + 230;
+ }
+
save(): void {
this.close(this.form.getRawValue());
}
-
- #getForm() {
- return this._formBuilder.group({
- comment: [null],
- option: [this.defaultOption],
- });
- }
}
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 4596c62fd..23a115d14 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
@@ -354,15 +354,15 @@ export class AnnotationActionsService {
let text: string;
if (annotation.hasTextAfter) {
text = getFirstRelevantTextPart(annotation.textAfter, 'FORWARD');
- return text ? (`${annotation.value}` + text).trim() : `${annotation.value}`;
+ return text ? (annotation.value + text).trim() : annotation.value;
}
if (annotation.hasTextBefore) {
text = getFirstRelevantTextPart(annotation.textBefore, 'BACKWARD');
- return text ? (text + `${annotation.value}`).trim() : `${annotation.value}`;
+ return text ? (text + annotation.value).trim() : annotation.value;
}
- return `${annotation.value}`;
+ return annotation.value;
}
async #extractTextAndPositions(annotationId: string) {