mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1542] Print file (#518)
* Add Services and Behaviors to support print file dialog, which opens a browser renderable version of the file with the print dialog; after which, closes the window when the print dialog is closed.
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
[fileNodeId]="nodeId"
|
||||
[allowNavigate]="navigateMultiple"
|
||||
[allowSidebar]="true"
|
||||
[allowPrint] ="true"
|
||||
[canNavigateBefore]="previousNodeId"
|
||||
[canNavigateNext]="nextNodeId"
|
||||
[overlayMode]="true"
|
||||
(print) = "printFile($event)"
|
||||
(showViewerChange)="onVisibilityChanged($event)"
|
||||
(navigateBefore)="onNavigateBefore()"
|
||||
(navigateNext)="onNavigateNext()">
|
||||
|
@@ -33,6 +33,7 @@ import { PageComponent } from '../page.component';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ExtensionService } from '../../extensions/extension.service';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { ViewUtilService } from '../../services/view-util.service';
|
||||
import { ContentActionRef } from '../../extensions/action.extensions';
|
||||
@Component({
|
||||
selector: 'app-preview',
|
||||
@@ -59,6 +60,7 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
private preferences: UserPreferencesService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private viewUtils: ViewUtilService,
|
||||
store: Store<AppStore>,
|
||||
extensions: ExtensionService,
|
||||
content: ContentManagementService) {
|
||||
@@ -341,6 +343,10 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
this.onVisibilityChanged(false);
|
||||
}
|
||||
|
||||
printFile(event: any) {
|
||||
this.viewUtils.printFileGeneric(this.nodeId, this.node.content.mimeType);
|
||||
}
|
||||
|
||||
private getNavigationCommands(url: string): any[] {
|
||||
const urlTree: UrlTree = this.router.parseUrl(url);
|
||||
const urlSegmentGroup: UrlSegmentGroup = urlTree.root.children[PRIMARY_OUTLET];
|
||||
|
Reference in New Issue
Block a user