[ADF-4424] Pdf Viewer - password dialog does not close when pressing Escape (#4622)

* return to previous page on close

* update e2e

* [ADF-4424] Improve PreviousRouteService to use it in pdfViewer

* change previous Url logic

* remove navigation logic

* remove test

* Update pdfViewer.component.spec.ts

* back button logic for viewer outlet

* unit tests

* remove fdescribe

* remove unused service

* e2e

* return to location

* remove click filter step

* remove unnecessary test steps

* remove un existen export

* unify preview between PS and CS in demo shell

* fix dispalyname property
This commit is contained in:
Cilibiu Bogdan
2019-07-11 19:33:15 +03:00
committed by Eugenio Romano
parent 72b3a75a85
commit ccdcba8778
18 changed files with 149 additions and 317 deletions

View File

@@ -79,6 +79,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
@Output()
error = new EventEmitter<any>();
@Output()
close = new EventEmitter<any>();
loadingTask: any;
currentPdfDocument: any;
page: number;
@@ -188,11 +191,11 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
this.currentPdfDocument.getPage(1).then(() => {
this.scalePage('auto');
}, (error) => {
}, () => {
this.error.emit();
});
}, (error) => {
}, () => {
this.error.emit();
});
}
@@ -461,13 +464,14 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
this.dialog
.open(PdfPasswordDialogComponent, {
width: '400px',
disableClose: true,
data: { reason }
})
.afterClosed().subscribe((password) => {
if (password) {
callback(password);
}
if (password) {
callback(password);
} else {
this.close.emit();
}
});
}