diff --git a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html index bd2ab1b20..b2adbaaba 100644 --- a/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html +++ b/apps/red-ui/src/app/modules/dossier/components/file-actions/file-actions.component.html @@ -136,6 +136,7 @@
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; } diff --git a/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts b/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts index 0c09f65b4..3c6634fae 100644 --- a/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/file-action.service.ts @@ -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 ); } diff --git a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts index 4302b925d..07a761d14 100644 --- a/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts +++ b/apps/red-ui/src/app/modules/dossier/services/manual-annotation.service.ts @@ -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( diff --git a/apps/red-ui/src/app/services/user.service.ts b/apps/red-ui/src/app/services/user.service.ts index 7d79f946c..624f90dc1 100644 --- a/apps/red-ui/src/app/services/user.service.ts +++ b/apps/red-ui/src/app/services/user.service.ts @@ -23,6 +23,10 @@ export class UserWrapper { : this._currentUser.username; } + get username() { + return this.email || this.userId; + } + get userId() { return this.id; }