linked some APIs

This commit is contained in:
Timo Bejan 2020-10-19 12:54:47 +03:00
parent 2a627d3ce3
commit 270b216cc9
4 changed files with 14 additions and 4 deletions

View File

@ -129,7 +129,7 @@
</div>
<div class="annotation-actions">
<button mat-icon-button>
<button mat-icon-button (click)="suggestRemoveAnnotation($event, annotation)">
<mat-icon svgIcon="red:trash"></mat-icon>
</button>
</div>

View File

@ -257,9 +257,12 @@ export class FilePreviewScreenComponent implements OnInit {
maxWidth: '90vw'
});
const parts = annotation.Id.split(':');
const annotationId = parts[parts.length-1];
dialogRef.afterClosed().subscribe(result => {
if (result) {
this._manualRedactionControllerService.undo(this.appStateService.activeProjectId, this.appStateService.activeFile.fileId, annotation.Id).subscribe(ok => {
this._manualRedactionControllerService.undo(this.appStateService.activeProjectId, this.appStateService.activeFile.fileId, annotationId).subscribe(ok => {
this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.remove-annotation.success.label'), null, NotificationType.SUCCESS);
}, (err) => {
this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.remove-annotation.failed.label', err), null, NotificationType.ERROR);

View File

@ -49,6 +49,9 @@ export class ManualRedactionDialogComponent implements OnInit {
saveManualRedaction() {
const mre = Object.assign({}, this.addRedactionRequest);
this._enhanceManualRedaction(mre);
// mre.comment = {
// text: 'Lorem ipsum'
// };
this._manualRedactionControllerService.addRedaction(mre, this._appStateService.activeProject.project.projectId, this._appStateService.activeFile.fileId).subscribe(ok => {
this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.dialog.add-redaction.success.label'), null, NotificationType.SUCCESS);
this.dialogRef.close();

View File

@ -143,13 +143,17 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnDestroy {
}
private toPosition(page: number, selectedQuad: any): Rectangle {
console.log(selectedQuad);
const pageHeight = this.wvInstance.docViewer.getPageHeight(page);
const height = selectedQuad.y2 - selectedQuad.y4;
return {
page: page,
topLeft: {
x: selectedQuad.x4,
y: selectedQuad.y4
y: pageHeight - (selectedQuad.y4 + height)
},
height: selectedQuad.y2 - selectedQuad.y4,
height: height,
width: selectedQuad.x3 - selectedQuad.x4
}
}