fixed bugs

This commit is contained in:
Timo Bejan 2020-11-08 19:30:06 +02:00
parent bad4d05ec0
commit 6bbf300168
4 changed files with 16 additions and 44 deletions

View File

@ -110,7 +110,7 @@ export class DialogService {
ref.afterClosed().subscribe((result) => {
if (result) {
this._manualAnnotationService
.acceptSuggestion(annotation.id)
.approveRequest(annotation.id)
.subscribe((acceptResult) => {
if (callback) {
callback(acceptResult);
@ -136,7 +136,7 @@ export class DialogService {
ref.afterClosed().subscribe((result) => {
if (result) {
this._manualAnnotationService.rejectSuggestion(annotation).subscribe(() => {
this._manualAnnotationService.declineOrRemoveRequest(annotation).subscribe(() => {
rejectCallback();
});
}

View File

@ -60,34 +60,18 @@ export class ManualAnnotationDialogComponent implements OnInit {
handleAddRedaction() {
this._enhanceManualRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry);
if (this.isDictionaryRequest) {
this._manualAnnotationService
.makeDictionaryEntry(this.manualRedactionEntryWrapper.manualRedactionEntry)
.subscribe(
(response) => {
this.dialogRef.close(
new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response)
);
},
() => {
this.dialogRef.close();
}
);
} else {
this._manualAnnotationService
.makeRedaction(this.manualRedactionEntryWrapper.manualRedactionEntry)
.subscribe(
(response) => {
this.dialogRef.close(
new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response)
);
},
() => {
this.dialogRef.close();
}
);
}
this._manualAnnotationService
.addAnnotation(this.manualRedactionEntryWrapper.manualRedactionEntry)
.subscribe(
(response) => {
this.dialogRef.close(
new ManualAnnotationResponse(this.manualRedactionEntryWrapper, response)
);
},
() => {
this.dialogRef.close();
}
);
}
get title() {

View File

@ -1,12 +1,8 @@
<div
[class.visible]="isAnnotationMenuOpen()"
*ngIf="canPerformAnnotationActions"
class="annotation-actions"
>
<div [class.visible]="menuOpen" *ngIf="canPerformAnnotationActions" class="annotation-actions">
<button
(click)="openAcceptSuggestionMenu($event)"
*ngIf="canAcceptSuggestion"
[class.active]="isAnnotationMenuOpen()"
[class.active]="menuOpen"
[matMenuTriggerFor]="menu"
class="confirm"
mat-icon-button

View File

@ -21,10 +21,6 @@ export class AnnotationActionsComponent implements OnInit {
this.suggestionType = this.appStateService.getDictionaryTypeValue('suggestion');
}
public isAnnotationMenuOpen() {
return this.annotation.id === this.activeMenuAnnotation?.id;
}
get canAcceptSuggestion() {
return (
this.appStateService.isActiveProjectOwnerAndManager &&
@ -33,8 +29,6 @@ export class AnnotationActionsComponent implements OnInit {
);
}
onSuggestionMenuClose() {}
acceptSuggestion($event: MouseEvent, annotation: AnnotationWrapper) {
$event.stopPropagation();
}
@ -47,8 +41,6 @@ export class AnnotationActionsComponent implements OnInit {
$event.stopPropagation();
}
openAcceptSuggestionMenu($event: MouseEvent, annotation: AnnotationWrapper) {}
public openAcceptSuggestionMenu($event: MouseEvent) {
$event.preventDefault();
this.menuOpen = true;