mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[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:
committed by
Eugenio Romano
parent
72b3a75a85
commit
ccdcba8778
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router, PRIMARY_OUTLET } from '@angular/router';
|
||||
import { ContentService, AllowableOperationsEnum, PermissionsEnum, NodesApiService } from '@alfresco/adf-core';
|
||||
import { MatSnackBar } from '@angular/material';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-file-view',
|
||||
@@ -57,12 +58,15 @@ export class FileViewComponent implements OnInit {
|
||||
showTabWithIconAndLabel = false;
|
||||
desiredAspect: string = null;
|
||||
showAspect: string = null;
|
||||
content: Blob;
|
||||
name: string;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private snackBar: MatSnackBar,
|
||||
private nodeApiService: NodesApiService,
|
||||
private contentServices: ContentService) {
|
||||
private contentServices: ContentService,
|
||||
private preview: PreviewService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -81,10 +85,18 @@ export class FileViewComponent implements OnInit {
|
||||
},
|
||||
() => this.router.navigate(['/files', id])
|
||||
);
|
||||
} else if (this.preview.content) {
|
||||
this.content = this.preview.content;
|
||||
this.displayName = this.preview.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onViewerVisibilityChanged() {
|
||||
const primaryUrl = this.router.parseUrl(this.router.url).root.children[PRIMARY_OUTLET].toString();
|
||||
this.router.navigateByUrl(primaryUrl);
|
||||
}
|
||||
|
||||
onUploadError(errorMessage: string) {
|
||||
this.snackBar.open(errorMessage, '', { duration: 4000 });
|
||||
}
|
||||
|
Reference in New Issue
Block a user