Merge branch 'RED-8904' into 'master'
RED-8904: changed from list to table display for some dialogs. See merge request redactmanager/red-ui!404
This commit is contained in:
commit
2dc379e378
@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
<div class="dialog-content redaction" [class.fixed-height]="isRedacted && isImage">
|
<div class="dialog-content redaction" [class.fixed-height]="isRedacted && isImage">
|
||||||
<div class="iqser-input-group" *ngIf="!isImage && redactedTexts.length && !allRectangles">
|
<div class="iqser-input-group" *ngIf="!isImage && redactedTexts.length && !allRectangles">
|
||||||
<redaction-selected-annotations-list [values]="redactedTexts"></redaction-selected-annotations-list>
|
<redaction-selected-annotations-table
|
||||||
|
[columns]="tableColumns"
|
||||||
|
[data]="tableData"
|
||||||
|
[staticColumns]="true"
|
||||||
|
></redaction-selected-annotations-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!isManualRedaction" class="iqser-input-group w-450" [class.required]="!form.controls.type.disabled">
|
<div *ngIf="!isManualRedaction" class="iqser-input-group w-450" [class.required]="!form.controls.type.disabled">
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
@use 'common-mixins';
|
|
||||||
|
|
||||||
.dialog-content {
|
.dialog-content {
|
||||||
|
padding-top: 8px;
|
||||||
|
|
||||||
&.fixed-height {
|
&.fixed-height {
|
||||||
height: 386px;
|
height: 386px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { EditRedactionData, EditRedactResult } from '../../utils/dialog-types';
|
|||||||
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import { DialogHelpModeKeys } from '../../utils/constants';
|
import { DialogHelpModeKeys } from '../../utils/constants';
|
||||||
|
import { ValueColumn } from '../../components/selected-annotations-table/selected-annotations-table.component';
|
||||||
|
|
||||||
interface TypeSelectOptions {
|
interface TypeSelectOptions {
|
||||||
type: string;
|
type: string;
|
||||||
@ -38,6 +39,20 @@ export class EditRedactionDialogComponent
|
|||||||
readonly isRedacted = this.annotations.every(annotation => annotation.isRedacted);
|
readonly isRedacted = this.annotations.every(annotation => annotation.isRedacted);
|
||||||
readonly isImported: boolean = this.annotations.every(annotation => annotation.imported);
|
readonly isImported: boolean = this.annotations.every(annotation => annotation.imported);
|
||||||
readonly allRectangles = this.annotations.reduce((acc, a) => acc && a.AREA, true);
|
readonly allRectangles = this.annotations.reduce((acc, a) => acc && a.AREA, true);
|
||||||
|
readonly tableColumns = [
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Type',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
readonly tableData: ValueColumn[][] = this.data.annotations.map(redaction => [
|
||||||
|
{ label: redaction.value, show: true, bold: true },
|
||||||
|
{ label: redaction.typeLabel, show: true },
|
||||||
|
]);
|
||||||
protected readonly roles = Roles;
|
protected readonly roles = Roles;
|
||||||
|
|
||||||
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
options: DetailsRadioOption<RedactOrHintOption>[] | undefined;
|
||||||
|
|||||||
@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
<div class="dialog-content redaction">
|
<div class="dialog-content redaction">
|
||||||
<div class="iqser-input-group">
|
<div class="iqser-input-group">
|
||||||
<redaction-selected-annotations-list [values]="selectedValues"></redaction-selected-annotations-list>
|
<redaction-selected-annotations-table
|
||||||
|
[columns]="tableColumns"
|
||||||
|
[data]="tableData"
|
||||||
|
[staticColumns]="true"
|
||||||
|
></redaction-selected-annotations-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<iqser-details-radio
|
<iqser-details-radio
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
.redaction {
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
@ -12,9 +12,11 @@ import { tap } from 'rxjs/operators';
|
|||||||
import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options';
|
import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options';
|
||||||
import { RedactRecommendationData, RedactRecommendationResult } from '../../utils/dialog-types';
|
import { RedactRecommendationData, RedactRecommendationResult } from '../../utils/dialog-types';
|
||||||
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component';
|
||||||
|
import { ValueColumn } from '../../components/selected-annotations-table/selected-annotations-table.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './redact-recommendation-dialog.component.html',
|
templateUrl: './redact-recommendation-dialog.component.html',
|
||||||
|
styleUrl: './redact-recommendation-dialog.component.scss',
|
||||||
})
|
})
|
||||||
export class RedactRecommendationDialogComponent
|
export class RedactRecommendationDialogComponent
|
||||||
extends IqserDialogComponent<RedactRecommendationDialogComponent, RedactRecommendationData, RedactRecommendationResult>
|
extends IqserDialogComponent<RedactRecommendationDialogComponent, RedactRecommendationData, RedactRecommendationResult>
|
||||||
@ -30,7 +32,6 @@ export class RedactRecommendationDialogComponent
|
|||||||
dictionaryRequest = false;
|
dictionaryRequest = false;
|
||||||
legalOptions: LegalBasisOption[] = [];
|
legalOptions: LegalBasisOption[] = [];
|
||||||
dictionaries: Dictionary[] = [];
|
dictionaries: Dictionary[] = [];
|
||||||
readonly selectedValues = this.data.annotations.map(annotation => annotation.value);
|
|
||||||
readonly form = inject(FormBuilder).group({
|
readonly form = inject(FormBuilder).group({
|
||||||
selectedText: this.isMulti ? null : this.firstEntry.value,
|
selectedText: this.isMulti ? null : this.firstEntry.value,
|
||||||
comment: [null],
|
comment: [null],
|
||||||
@ -39,6 +40,21 @@ export class RedactRecommendationDialogComponent
|
|||||||
reason: [null],
|
reason: [null],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
readonly tableColumns = [
|
||||||
|
{
|
||||||
|
label: 'Value',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Type',
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
readonly tableData: ValueColumn[][] = this.data.annotations.map(redaction => [
|
||||||
|
{ label: redaction.value, show: true, bold: true },
|
||||||
|
{ label: redaction.typeLabel, show: true },
|
||||||
|
]);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _justificationsService: JustificationsService,
|
private readonly _justificationsService: JustificationsService,
|
||||||
private readonly _dictionaryService: DictionaryService,
|
private readonly _dictionaryService: DictionaryService,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user