Merge branch 'RED-8904' into 'master'

RED-8904: adjusted the table columns width for specific cases.

See merge request redactmanager/red-ui!399
This commit is contained in:
Dan Percic 2024-04-22 12:05:21 +02:00
commit f23c671f69
6 changed files with 25 additions and 4 deletions

View File

@ -1,14 +1,14 @@
<table>
<thead>
<tr>
<th *ngFor="let column of columns" [ngClass]="{ hide: !column.show }">
<th *ngFor="let column of columns" [ngClass]="{ hide: !column.show, 'w-50': staticColumns }">
<label>{{ column.label }}</label>
</th>
</tr>
</thead>
<tbody [ngStyle]="{ height: redactedTextsAreaHeight + 'px' }">
<tr *ngFor="let row of data">
<td *ngFor="let cell of row" [ngClass]="{ hide: !cell.show, bold: cell.bold }">
<td *ngFor="let cell of row" [ngClass]="{ hide: !cell.show, bold: cell.bold, 'w-50': staticColumns }">
{{ cell.label }}
</td>
</tr>

View File

@ -27,8 +27,10 @@ table {
th,
td {
&:not(.w-50) {
width: 25%;
}
max-width: 0;
width: 25%;
text-align: start;
white-space: nowrap;
@ -58,6 +60,15 @@ tbody tr:nth-child(odd) {
visibility: hidden;
}
.w-50 {
max-width: 0;
min-width: 50%;
&.hide {
display: none;
}
}
.bold {
font-weight: bold;
}

View File

@ -20,6 +20,7 @@ const MAX_ITEMS_DISPLAY = 10;
export class SelectedAnnotationsTableComponent {
@Input({ required: true }) columns: ValueColumn[];
@Input({ required: true }) data: ValueColumn[][];
@Input() staticColumns = false;
get redactedTextsAreaHeight() {
return this.data.length <= MAX_ITEMS_DISPLAY ? TABLE_ROW_SIZE * this.data.length : TABLE_ROW_SIZE * MAX_ITEMS_DISPLAY;

View File

@ -4,7 +4,11 @@
<div *ngIf="isHintDialog" class="dialog-header heading-l" [translate]="'manual-annotation.dialog.header.force-hint'"></div>
<div class="dialog-content">
<redaction-selected-annotations-table [columns]="tableColumns" [data]="tableData"></redaction-selected-annotations-table>
<redaction-selected-annotations-table
[columns]="tableColumns"
[data]="tableData"
[staticColumns]="true"
></redaction-selected-annotations-table>
<div *ngIf="!isHintDialog && !isDocumine" class="iqser-input-group required w-400">
<label [translate]="'manual-annotation.dialog.content.reason'"></label>
<mat-form-field>

View File

@ -10,6 +10,7 @@
<redaction-selected-annotations-table
[columns]="tableColumns()"
[data]="tableData()"
[staticColumns]="!hasFalsePositiveOption"
></redaction-selected-annotations-table>
</div>

View File

@ -73,6 +73,10 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
return DialogHelpModeKeys.REDACTION_REMOVE;
}
get hasFalsePositiveOption() {
return !!this.options.find(option => option.value === RemoveRedactionOptions.FALSE_POSITIVE);
}
get defaultOption() {
const removeHereOption = this.options.find(option => option.value === RemoveRedactionOptions.ONLY_HERE);
if (!!removeHereOption && !removeHereOption.disabled) return removeHereOption;