From e1ff2909bdc45b5ae8ea8f4dcae0a7f43192ab78 Mon Sep 17 00:00:00 2001 From: Maurizio Vitale Date: Thu, 12 Dec 2019 13:41:40 +0000 Subject: [PATCH] Fix the attach content from alfresco and local (#5328) --- .../start-process-cloud-demo.component.html | 1 + .../cloud/start-process-cloud-demo.component.ts | 6 ++++++ .../lib/form/components/form-cloud.component.ts | 2 ++ .../attach-file-cloud-widget.component.html | 1 - .../attach-file-cloud-widget.component.ts | 16 +++++----------- .../start-process-cloud.component.html | 1 + .../components/start-process-cloud.component.ts | 10 +++++++++- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.html b/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.html index 6e1e8728e5..1862ea1a6e 100644 --- a/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.html +++ b/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.html @@ -5,5 +5,6 @@ [variables]="variables" (error)="openSnackMessage($event)" (success)="onStartProcessSuccess()" + (formContentClicked)="onFormContentClicked($event)" (cancel)="onCancelStartProcess()"> diff --git a/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.ts index 2d6470ca29..ee2dfe8f04 100644 --- a/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.ts +++ b/demo-shell/src/app/components/cloud/start-process-cloud-demo.component.ts @@ -19,6 +19,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { NotificationService, AppConfigService } from '@alfresco/adf-core'; import { CloudLayoutService } from './services/cloud-layout.service'; +import { PreviewService } from 'app/services/preview.service'; @Component({ templateUrl: './start-process-cloud-demo.component.html', @@ -34,6 +35,7 @@ export class StartProcessCloudDemoComponent implements OnInit { constructor(private appConfig: AppConfigService, private cloudLayoutService: CloudLayoutService, private route: ActivatedRoute, + private previewService: PreviewService, private notificationService: NotificationService, private router: Router) { } @@ -61,4 +63,8 @@ export class StartProcessCloudDemoComponent implements OnInit { openSnackMessage(event: any) { this.notificationService.openSnackMessage(event.response.body.entry.message); } + + onFormContentClicked(resourceClicked: any) { + this.previewService.showResource(resourceClicked.nodeId); + } } diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts index 8f6a44707d..3f7341d5c5 100644 --- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts @@ -210,6 +210,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges, this.visibilityService.refreshVisibility( parsedForm); parsedForm.validateForm(); this.form = parsedForm; + this.form.nodeId = '-my-'; this.form.contentHost = this.appConfigService.get('ecmHost'); this.onFormLoaded(this.form); resolve(this.form); @@ -238,6 +239,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges, this.visibilityService.refreshVisibility( parsedForm); parsedForm.validateForm(); this.form = parsedForm; + this.form.nodeId = '-my-'; this.form.contentHost = this.appConfigService.get('ecmHost'); this.onFormLoaded(this.form); }, diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.html b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.html index 9a4dee3a7e..1d127e9e09 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.html +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.html @@ -53,7 +53,6 @@