extended false positive action
This commit is contained in:
parent
b83119fda9
commit
9ecb37c549
@ -89,14 +89,14 @@ export class AnnotationActionsService {
|
||||
});
|
||||
}
|
||||
|
||||
if (annotationPermissions.canMarkRecommendationAsFalsePositive) {
|
||||
if (annotationPermissions.canMarkTextOnlyAsFalsePositive) {
|
||||
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);
|
||||
this.markTextOnlyAsFalsePositive(null, annotation, annotationsChanged);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -183,7 +183,7 @@ export class AnnotationActionsService {
|
||||
return availableActions;
|
||||
}
|
||||
|
||||
markRecommendationAsFalsePositive($event: MouseEvent, annotation: AnnotationWrapper, annotationsChanged: EventEmitter<AnnotationWrapper>) {
|
||||
markTextOnlyAsFalsePositive($event: MouseEvent, annotation: AnnotationWrapper, annotationsChanged: EventEmitter<AnnotationWrapper>) {
|
||||
this._markAsFalsePositive($event, annotation, annotation.value, annotationsChanged);
|
||||
}
|
||||
|
||||
|
||||
@ -10,14 +10,15 @@
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<div
|
||||
(click)="annotationActionsService.markRecommendationAsFalsePositive($event, annotation, annotationsChanged)"
|
||||
mat-menu-item
|
||||
*ngIf="annotationPermissions.canMarkRecommendationAsFalsePositive"
|
||||
<redaction-circle-button
|
||||
(action)="annotationActionsService.markTextOnlyAsFalsePositive($event, annotation, annotationsChanged)"
|
||||
type="dark-bg"
|
||||
*ngIf="annotationPermissions.canMarkTextOnlyAsFalsePositive"
|
||||
tooltipPosition="before"
|
||||
tooltip="annotation-actions.remove-annotation.false-positive"
|
||||
icon="red:thumb-down"
|
||||
>
|
||||
<mat-icon svgIcon="red:thumb-down" class="false-positive-icon"></mat-icon>
|
||||
<div translate="annotation-actions.remove-annotation.false-positive"></div>
|
||||
</div>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="annotationActionsService.acceptSuggestion($event, annotation, annotationsChanged)"
|
||||
@ -117,6 +118,14 @@
|
||||
<mat-icon svgIcon="red:thumb-down" class="false-positive-icon"></mat-icon>
|
||||
<div translate="annotation-actions.remove-annotation.false-positive"></div>
|
||||
</div>
|
||||
<div
|
||||
(click)="annotationActionsService.markTextOnlyAsFalsePositive($event, annotation, annotationsChanged)"
|
||||
mat-menu-item
|
||||
*ngIf="annotationPermissions.canMarkTextOnlyAsFalsePositive"
|
||||
>
|
||||
<mat-icon svgIcon="red:thumb-down" class="false-positive-icon"></mat-icon>
|
||||
<div translate="annotation-actions.remove-annotation.false-positive"></div>
|
||||
</div>
|
||||
</mat-menu>
|
||||
</div>
|
||||
</redaction-hidden-action>
|
||||
|
||||
@ -5,7 +5,7 @@ export class AnnotationPermissions {
|
||||
canUndo: boolean;
|
||||
|
||||
canAcceptRecommendation: boolean;
|
||||
canMarkRecommendationAsFalsePositive: boolean;
|
||||
canMarkTextOnlyAsFalsePositive: boolean;
|
||||
canMarkAsFalsePositive: boolean;
|
||||
|
||||
canRemoveOrSuggestToRemoveOnlyHere: boolean;
|
||||
@ -20,9 +20,9 @@ export class AnnotationPermissions {
|
||||
permissions.canUndo = annotation.userId === user.id && annotation.isUndoableSuperType;
|
||||
|
||||
permissions.canAcceptRecommendation = annotation.isRecommendation;
|
||||
permissions.canMarkRecommendationAsFalsePositive = annotation.isRecommendation;
|
||||
|
||||
permissions.canMarkAsFalsePositive = annotation.canBeMarkedAsFalsePositive;
|
||||
permissions.canMarkTextOnlyAsFalsePositive = annotation.canBeMarkedAsFalsePositiveWithTextOnly;
|
||||
|
||||
permissions.canRemoveOrSuggestToRemoveOnlyHere = annotation.isRedacted;
|
||||
permissions.canRemoveOrSuggestToRemoveFromDictionary = annotation.isRedacted && !annotation.isManualRedaction && annotation.isModifyDictionary;
|
||||
|
||||
@ -75,6 +75,10 @@ export class AnnotationWrapper {
|
||||
return this.superType === 'redaction' && (this.hasTextAfter || this.hasTextBefore);
|
||||
}
|
||||
|
||||
get canBeMarkedAsFalsePositiveWithTextOnly() {
|
||||
return !this.canBeMarkedAsFalsePositive && (this.isRecommendation || this.superType === 'redaction');
|
||||
}
|
||||
|
||||
get isSuperTypeBasedColor() {
|
||||
return this.isSkipped || this.isSuggestion || this.isReadyForAnalysis || this.isDeclinedSuggestion;
|
||||
}
|
||||
|
||||
@ -522,6 +522,7 @@ export class AppStateService {
|
||||
type: 'suggestion-add',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['suggestion-remove-dictionary'] = {
|
||||
hexColor: colors.dictionaryRequestColor,
|
||||
type: 'suggestion-add',
|
||||
@ -533,37 +534,44 @@ export class AppStateService {
|
||||
type: 'skipped',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['default'] = {
|
||||
hexColor: colors.defaultColor,
|
||||
type: 'default',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['add'] = {
|
||||
hexColor: colors.requestAdd,
|
||||
type: 'add',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['analysis'] = {
|
||||
hexColor: colors.analysisColor,
|
||||
type: 'analysis',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['pending-analysis'] = {
|
||||
hexColor: colors.analysisColor,
|
||||
type: 'analysis',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['hint'] = {
|
||||
hexColor: '#fa98f7',
|
||||
type: 'hint',
|
||||
virtual: true,
|
||||
hint: true
|
||||
};
|
||||
|
||||
dictionaryData['redaction'] = {
|
||||
hexColor: colors.previewColor,
|
||||
type: 'redaction',
|
||||
virtual: true
|
||||
};
|
||||
|
||||
dictionaryData['updated'] = {
|
||||
hexColor: colors.updatedColor,
|
||||
type: 'updated',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user