Fixed various issues for efsa. Improved UI RED-3303 and others.
This commit is contained in:
parent
9fecd6b889
commit
1af8be9d39
@ -70,7 +70,7 @@
|
||||
<p class="download-includes">{{ 'download-includes' | translate }}</p>
|
||||
<div class="d-flex">
|
||||
<redaction-select
|
||||
[height]="150"
|
||||
[height]="165"
|
||||
[label]="'report-type.label' | translate: { length: reportTemplateIdsLength }"
|
||||
[optionTemplate]="reportTemplateOptionTemplate"
|
||||
[options]="availableReportTypes"
|
||||
@ -79,7 +79,7 @@
|
||||
formControlName="reportTemplateIds"
|
||||
></redaction-select>
|
||||
<redaction-select
|
||||
[height]="150"
|
||||
[height]="165"
|
||||
[label]="'download-type.label' | translate: { length: downloadFileTypesLength }"
|
||||
[options]="downloadTypes"
|
||||
formControlName="downloadFileTypes"
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<input formControlName="classification" name="classification" type="text" />
|
||||
</div>
|
||||
|
||||
<div [class.required]="!isDocumentAdmin" class="iqser-input-group w-300">
|
||||
<div [class.required]="commentIsMandatory" class="iqser-input-group w-300">
|
||||
<label translate="manual-annotation.dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" name="comment" redactionHasScrollbar rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -113,11 +113,15 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
||||
dictionary: this.isDictionaryRequest
|
||||
? [this.isFalsePositiveRequest ? 'false_positive' : null, Validators.required]
|
||||
: ['manual', Validators.required],
|
||||
comment: this.isDocumentAdmin ? [null] : [null, Validators.required],
|
||||
comment: this.commentIsMandatory ? [null, Validators.required] : [null],
|
||||
classification: ['non-readable content'],
|
||||
});
|
||||
}
|
||||
|
||||
get commentIsMandatory() {
|
||||
return !this.isDocumentAdmin && !this.isDictionaryRequest;
|
||||
}
|
||||
|
||||
private _enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) {
|
||||
const legalOption: LegalBasisOption = this.form.get('reason').value;
|
||||
addRedactionRequest.type = this.form.get('dictionary').value;
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div [class.required]="!permissionsService.isApprover(this.data.dossier)" class="iqser-input-group w-300">
|
||||
<div [class.required]="commentIsMandatory" class="iqser-input-group w-300">
|
||||
<label translate="manual-annotation.dialog.content.comment"></label>
|
||||
<textarea formControlName="comment" iqserHasScrollbar name="comment" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
|
||||
@ -29,7 +29,7 @@ export class RemoveAnnotationsDialogComponent extends BaseDialogComponent {
|
||||
) {
|
||||
super(_injector, _dialogRef);
|
||||
this.form = this._formBuilder.group({
|
||||
comment: this.permissionsService.isApprover(this.data.dossier) ? [null] : [null, Validators.required],
|
||||
comment: this.commentIsMandatory ? [null, Validators.required] : [null],
|
||||
});
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
@ -38,6 +38,14 @@ export class RemoveAnnotationsDialogComponent extends BaseDialogComponent {
|
||||
this._dialogRef.close({ comment: this.form.getRawValue().comment });
|
||||
}
|
||||
|
||||
get disabled(): boolean {
|
||||
return !this.valid;
|
||||
}
|
||||
|
||||
get commentIsMandatory() {
|
||||
return !this.permissionsService.isApprover(this.data.dossier) && !this.data.removeFromDictionary;
|
||||
}
|
||||
|
||||
printable(annotation: AnnotationWrapper) {
|
||||
if (annotation.isImage) {
|
||||
return this._translateService.instant('remove-annotations-dialog.image-type', {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<div class="needs-work">
|
||||
<redaction-annotation-icon *ngIf="file.analysisRequired" [color]="analysisColor" label="A" type="square"></redaction-annotation-icon>
|
||||
<redaction-annotation-icon
|
||||
*ngIf="file.hasUpdates && file.assignee === userService.currentUser.id"
|
||||
*ngIf="file.hasUpdates && file.assignee === userService.currentUser.id && !file.isApproved"
|
||||
[color]="updatedColor"
|
||||
label="U"
|
||||
type="square"
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
@use 'variables';
|
||||
|
||||
:host {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
background-color: variables.$grey-6;
|
||||
color: variables.$grey-3;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import {
|
||||
ErrorService,
|
||||
FilterService,
|
||||
LoadingService,
|
||||
NestedFilter,
|
||||
OnAttach,
|
||||
OnDetach,
|
||||
processFilters,
|
||||
@ -652,12 +653,15 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return;
|
||||
}
|
||||
|
||||
const currentFilters = this._filterService.getGroup('primaryFilters')?.filters || [];
|
||||
this.rebuildFilters();
|
||||
|
||||
if (this.viewModeService.viewMode === 'STANDARD') {
|
||||
const startTime = new Date().getTime();
|
||||
const newAnnotations = newAnnotationsFilter ? this.visibleAnnotations.filter(newAnnotationsFilter) : this.visibleAnnotations;
|
||||
this._handleDeltaAnnotationFilters(currentAnnotations ?? [], newAnnotations);
|
||||
if (currentFilters) {
|
||||
this._handleDeltaAnnotationFilters(currentFilters, this.visibleAnnotations);
|
||||
}
|
||||
await this._redrawAnnotations(newAnnotations);
|
||||
console.log(
|
||||
`[REDACTION] Annotations redraw time: ${new Date().getTime() - startTime} ms for ${newAnnotations.length} annotations`,
|
||||
@ -675,7 +679,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
);
|
||||
}
|
||||
|
||||
private _handleDeltaAnnotationFilters(currentPageAnnotations: AnnotationWrapper[], newPageAnnotations: AnnotationWrapper[]) {
|
||||
private _handleDeltaAnnotationFilters(currentFilters: NestedFilter[], newAnnotations: AnnotationWrapper[]) {
|
||||
const primaryFilterGroup = this._filterService.getGroup('primaryFilters');
|
||||
const primaryFilters = primaryFilterGroup.filters;
|
||||
const secondaryFilters = this._filterService.getGroup('secondaryFilters').filters;
|
||||
@ -685,10 +689,9 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return;
|
||||
}
|
||||
|
||||
const oldPageSpecificFilters = this._annotationProcessingService.getAnnotationFilter(currentPageAnnotations);
|
||||
const newPageSpecificFilters = this._annotationProcessingService.getAnnotationFilter(newPageAnnotations);
|
||||
const newPageSpecificFilters = this._annotationProcessingService.getAnnotationFilter(newAnnotations);
|
||||
|
||||
handleFilterDelta(oldPageSpecificFilters, newPageSpecificFilters, primaryFilters);
|
||||
handleFilterDelta(currentFilters, newPageSpecificFilters, primaryFilters);
|
||||
this._filterService.addFilterGroup({
|
||||
...primaryFilterGroup,
|
||||
filters: primaryFilters,
|
||||
|
||||
@ -21,7 +21,8 @@
|
||||
|
||||
.mat-chip-list-wrapper {
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,8 @@ export function handleFilterDelta(oldFilters: INestedFilter[], newFilters: INest
|
||||
}
|
||||
}
|
||||
|
||||
console.log(newFiltersDelta);
|
||||
|
||||
for (const key of Object.keys(newFiltersDelta)) {
|
||||
const foundFilter = allFilters.find(f => f.id === key);
|
||||
if (foundFilter) {
|
||||
|
||||
@ -31,7 +31,7 @@ export function hexToRgb(hex) {
|
||||
export function getFirstRelevantTextPart(text, direction: 'FORWARD' | 'BACKWARD') {
|
||||
let spaceCount = 0;
|
||||
let accumulator = '';
|
||||
const breakChars = ['/', ':', ' '];
|
||||
const breakChars = [':', ' '];
|
||||
|
||||
const handle = i => {
|
||||
const char = text[i];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user