diff --git a/apps/red-ui/src/app/common/service/annotation-actions.service.ts b/apps/red-ui/src/app/common/service/annotation-actions.service.ts index 36e8e6025..6ba9401d3 100644 --- a/apps/red-ui/src/app/common/service/annotation-actions.service.ts +++ b/apps/red-ui/src/app/common/service/annotation-actions.service.ts @@ -47,17 +47,7 @@ export class AnnotationActionsService { } public markAsFalsePositive($event: MouseEvent, annotation: AnnotationWrapper, annotationsChanged: EventEmitter) { - $event?.stopPropagation(); - - const falsePositiveRequest: AddRedactionRequest = {}; - falsePositiveRequest.reason = annotation.id; - falsePositiveRequest.value = this._getFalsePositiveText(annotation); - falsePositiveRequest.type = 'false_positive'; - falsePositiveRequest.positions = annotation.positions; - falsePositiveRequest.addToDictionary = true; - falsePositiveRequest.comment = { text: 'False Positive' }; - - this._processObsAndEmit(this._manualAnnotationService.addAnnotation(falsePositiveRequest), annotation, annotationsChanged); + this._markAsFalsePositive($event, annotation, this._getFalsePositiveText(annotation), annotationsChanged); } public undoDirectAction($event: MouseEvent, annotation: AnnotationWrapper, annotationsChanged: EventEmitter) { @@ -99,6 +89,19 @@ export class AnnotationActionsService { }); } + if (annotationPermissions.canMarkRecommendationAsFalsePositive) { + availableActions.push({ + type: 'actionButton', + img: '/assets/icons/general/thumb-down.svg', + title: this._translateService.instant('annotation-actions.remove-annotation.false-positive'), + onClick: () => { + this._ngZone.run(() => { + this.markRecommendationAsFalsePositive(null, annotation, annotationsChanged); + }); + } + }); + } + if (annotationPermissions.canAcceptSuggestion) { availableActions.push({ type: 'actionButton', @@ -180,6 +183,10 @@ export class AnnotationActionsService { return availableActions; } + markRecommendationAsFalsePositive($event: MouseEvent, annotation: AnnotationWrapper, annotationsChanged: EventEmitter) { + this._markAsFalsePositive($event, annotation, annotation.value, annotationsChanged); + } + private _getFalsePositiveText(annotation: AnnotationWrapper) { if (annotation.canBeMarkedAsFalsePositive) { let text; @@ -192,4 +199,18 @@ export class AnnotationActionsService { } } } + + private _markAsFalsePositive($event: MouseEvent, annotation: AnnotationWrapper, text: string, annotationsChanged: EventEmitter) { + $event?.stopPropagation(); + + const falsePositiveRequest: AddRedactionRequest = {}; + falsePositiveRequest.reason = annotation.id; + falsePositiveRequest.value = text; + falsePositiveRequest.type = 'false_positive'; + falsePositiveRequest.positions = annotation.positions; + falsePositiveRequest.addToDictionary = true; + falsePositiveRequest.comment = { text: 'False Positive' }; + + this._processObsAndEmit(this._manualAnnotationService.addAnnotation(falsePositiveRequest), annotation, annotationsChanged); + } } diff --git a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html b/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html index 45e9e83fc..0fb51e34b 100644 --- a/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html +++ b/apps/red-ui/src/app/components/simple-doughnut-chart/simple-doughnut-chart.component.html @@ -31,7 +31,8 @@ { length: val.value, color: val.color, - label: getLabel(val) + label: getLabel(val), + cssClass: val.color === 'PROCESSING' ? 'loading' : '' } ]" > diff --git a/apps/red-ui/src/app/components/status-bar/status-bar.component.html b/apps/red-ui/src/app/components/status-bar/status-bar.component.html index 1672ac375..bff0ce872 100644 --- a/apps/red-ui/src/app/components/status-bar/status-bar.component.html +++ b/apps/red-ui/src/app/components/status-bar/status-bar.component.html @@ -6,6 +6,6 @@ 'background-color': rect.color.includes('#') ? rect.color : '' }" > -
{{ rect.label }}
+
{{ rect.label }}
diff --git a/apps/red-ui/src/app/components/status-bar/status-bar.component.ts b/apps/red-ui/src/app/components/status-bar/status-bar.component.ts index 0ef84ee55..b1e4df16d 100644 --- a/apps/red-ui/src/app/components/status-bar/status-bar.component.ts +++ b/apps/red-ui/src/app/components/status-bar/status-bar.component.ts @@ -13,6 +13,7 @@ export class StatusBarComponent implements OnInit { length: number; color: Color; label?: string; + cssClass?: string; }[] = []; @Input() @@ -20,5 +21,7 @@ export class StatusBarComponent implements OnInit { constructor() {} - ngOnInit(): void {} + ngOnInit(): void { + console.log(this.config); + } } diff --git a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html b/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html index 088ef9a81..c4fbf483e 100644 --- a/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html +++ b/apps/red-ui/src/app/screens/file/annotation-actions/annotation-actions.component.html @@ -10,6 +10,15 @@ > +
+ +
+
+
-
+