fixed some critical bugs

This commit is contained in:
Timo 2021-06-28 12:43:18 +03:00
parent 1883c0eb20
commit 770374ea61
7 changed files with 40 additions and 36 deletions

View File

@ -136,6 +136,7 @@
<!-- exclude from redaction -->
<div class="red-input-group">
<mat-slide-toggle
(click)="$event.stopPropagation()"
(change)="toggleAnalysis()"
[checked]="!fileStatus?.isExcluded"
[class.mr-24]="screen === 'dossier-overview'"

View File

@ -72,7 +72,7 @@ export class FileWorkloadComponent {
private _multiSelectActive = false;
get isProcessing(): boolean {
return this.fileData.fileStatus.isProcessing;
return this.fileData.fileStatus?.isProcessing;
}
get activeAnnotationsLength(): number | undefined {

View File

@ -422,6 +422,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy, OnAttach,
}
async annotationsChangedByReviewAction(annotation: AnnotationWrapper) {
console.log(annotation);
await this._cleanupAndRedrawManualAnnotationsForEntirePage(annotation.pageNumber);
}

View File

@ -165,6 +165,25 @@ export class AnnotationActionsService {
)
}));
const canRemoveOrSuggestToRemoveFromDictionary = annotationPermissions.reduce(
(acc, next) => acc && next.permissions.canRemoveOrSuggestToRemoveFromDictionary,
true
);
if (canRemoveOrSuggestToRemoveFromDictionary) {
availableActions.push({
type: 'actionButton',
img: this._convertPath('/assets/icons/general/remove-from-dict.svg'),
title: this._translateService.instant(
'annotation-actions.remove-annotation.remove-from-dict'
),
onClick: () => {
this._ngZone.run(() => {
this.suggestRemoveAnnotation(null, annotations, true, annotationsChanged);
});
}
});
}
const canAcceptRecommendation = annotationPermissions.reduce(
(acc, next) => acc && next.permissions.canAcceptRecommendation,
true
@ -286,9 +305,7 @@ export class AnnotationActionsService {
availableActions.push({
type: 'actionButton',
img: this._convertPath('/assets/icons/general/trash.svg'),
title: this._translateService.instant(
'annotation-actions.suggest-remove-annotation'
),
title: this._translateService.instant('remove-annotation.only-here'),
onClick: () => {
this._ngZone.run(() => {
this.suggestRemoveAnnotation(null, annotations, false, annotationsChanged);
@ -297,25 +314,6 @@ export class AnnotationActionsService {
});
}
const canRemoveOrSuggestToRemoveFromDictionary = annotationPermissions.reduce(
(acc, next) => acc && next.permissions.canRemoveOrSuggestToRemoveFromDictionary,
true
);
if (canRemoveOrSuggestToRemoveFromDictionary) {
availableActions.push({
type: 'actionButton',
img: this._convertPath('/assets/icons/general/trash.svg'),
title: this._translateService.instant(
'annotation-actions.remove-annotation.remove-from-dict'
),
onClick: () => {
this._ngZone.run(() => {
this.suggestRemoveAnnotation(null, annotations, true, annotationsChanged);
});
}
});
}
return availableActions;
}

View File

@ -33,8 +33,8 @@ export class FileActionService {
fileStatusWrapper = this._appStateService.activeFile;
}
return this._reanalysisControllerService.toggleAnalysis(
fileStatusWrapper.fileId,
fileStatusWrapper.dossierId,
fileStatusWrapper.fileId,
!fileStatusWrapper.isExcluded
);
}
@ -112,8 +112,8 @@ export class FileActionService {
return this._statusControllerService.setStatusUnderApprovalForList(
fileStatus.map(f => f.fileId),
this._appStateService.activeDossierId,
approverId
approverId,
this._appStateService.activeDossierId
);
}

View File

@ -107,9 +107,9 @@ export class ManualAnnotationService {
undoRequest(annotationWrapper: AnnotationWrapper) {
return this._manualRedactionControllerService
.undo(
annotationWrapper.id,
this._appStateService.activeDossierId,
this._appStateService.activeFileId,
annotationWrapper.id
this._appStateService.activeFileId
)
.pipe(
tap(
@ -286,8 +286,8 @@ export class ManualAnnotationService {
return this._manualRedactionControllerService
.requestForceRedaction(
forceRedactionRequest,
this._appStateService.activeDossier.dossier.dossierId,
this._appStateService.activeFile.fileId
this._appStateService.activeDossierId,
this._appStateService.activeFileId
)
.pipe(
tap(
@ -306,8 +306,8 @@ export class ManualAnnotationService {
return this._manualRedactionControllerService
.forceRedaction(
forceRedactionRequest,
this._appStateService.activeDossier.dossier.dossierId,
this._appStateService.activeFile.fileId
this._appStateService.activeDossierId,
this._appStateService.activeFileId
)
.pipe(
tap(
@ -326,8 +326,8 @@ export class ManualAnnotationService {
return this._manualRedactionControllerService
.requestAddRedaction(
manualRedactionEntry,
this._appStateService.activeDossier.dossier.dossierId,
this._appStateService.activeFile.fileId
this._appStateService.activeDossierId,
this._appStateService.activeFileId
)
.pipe(
tap(
@ -349,8 +349,8 @@ export class ManualAnnotationService {
return this._manualRedactionControllerService
.addRedaction(
manualRedactionEntry,
this._appStateService.activeDossier.dossier.dossierId,
this._appStateService.activeFile.fileId
this._appStateService.activeDossierId,
this._appStateService.activeFileId
)
.pipe(
tap(

View File

@ -23,6 +23,10 @@ export class UserWrapper {
: this._currentUser.username;
}
get username() {
return this.email || this.userId;
}
get userId() {
return this.id;
}