From 685349c61732b1db3494374f5c642be7c14162e4 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Fri, 11 Nov 2016 15:57:52 +0000 Subject: [PATCH] Added more check for file component on demo shell --- .../app/components/files/files.component.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index 2951b41fc9..817d7279b0 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -17,6 +17,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; +import { AlfrescoAuthenticationService } from 'ng2-alfresco-core'; import { DocumentActionsService, DocumentList, @@ -50,6 +51,7 @@ export class FilesComponent implements OnInit { documentList: DocumentList; constructor(private documentActions: DocumentActionsService, + public auth: AlfrescoAuthenticationService, private formService: FormService, private router: Router) { documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this)); @@ -104,10 +106,14 @@ export class FilesComponent implements OnInit { } ngOnInit() { - this.formService.getProcessDefinitions().subscribe( - defs => this.setupBpmActions(defs || []), - err => console.log(err) - ); + if ( this.auth.isBpmLoggedIn() ) { + this.formService.getProcessDefinitions().subscribe( + defs => this.setupBpmActions(defs || []), + err => console.log(err) + ); + } else { + console.log('You are not logged in'); + } } viewActivitiForm(event?: any) {