From 7016dabb6cc8dcf39cbc320a6184e81098fc9815 Mon Sep 17 00:00:00 2001 From: Deepak Paul Date: Wed, 1 May 2019 17:32:16 +0530 Subject: [PATCH] [ADF-4454] Map upload field to UploadCloudWidget in task cloud form (#4672) * [ADF-4454] Moved upload widget maping to task form * Update community-task-details-cloud.component.ts --- .../community/community-task-details-cloud.component.ts | 6 +----- .../components/cloud/task-details-cloud-demo.component.ts | 5 +---- .../task/task-form/components/task-form-cloud.component.ts | 6 +++++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts index b08e56669b..91ffdf593f 100644 --- a/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts +++ b/demo-shell/src/app/components/cloud/community/community-task-details-cloud.component.ts @@ -17,8 +17,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UploadCloudWidgetComponent } from '@alfresco/adf-process-services-cloud'; -import { NotificationService, FormRenderingService } from '@alfresco/adf-core'; +import { NotificationService } from '@alfresco/adf-core'; @Component({ templateUrl: './community-task-details-cloud.component.html', @@ -32,7 +31,6 @@ export class CommunityTaskDetailsCloudDemoComponent { constructor( private route: ActivatedRoute, private router: Router, - private formRenderingService: FormRenderingService, private notificationService: NotificationService ) { this.route.params.subscribe((params) => { @@ -41,8 +39,6 @@ export class CommunityTaskDetailsCloudDemoComponent { this.route.parent.params.subscribe((params) => { this.appName = params.appName; }); - this.formRenderingService.setComponentTypeResolver('upload', () => UploadCloudWidgetComponent, true); - } isTaskValid(): boolean { diff --git a/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.ts index d003313993..ec04eca612 100644 --- a/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.ts +++ b/demo-shell/src/app/components/cloud/task-details-cloud-demo.component.ts @@ -17,8 +17,7 @@ import { Component } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { UploadCloudWidgetComponent } from '@alfresco/adf-process-services-cloud'; -import { NotificationService, FormRenderingService } from '@alfresco/adf-core'; +import { NotificationService } from '@alfresco/adf-core'; @Component({ templateUrl: './task-details-cloud-demo.component.html', @@ -32,7 +31,6 @@ export class TaskDetailsCloudDemoComponent { constructor( private route: ActivatedRoute, private router: Router, - private formRenderingService: FormRenderingService, private notificationService: NotificationService ) { this.route.params.subscribe((params) => { @@ -41,7 +39,6 @@ export class TaskDetailsCloudDemoComponent { this.route.parent.params.subscribe((params) => { this.appName = params.appName; }); - this.formRenderingService.setComponentTypeResolver('upload', () => UploadCloudWidgetComponent, true); } diff --git a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts index 34ff76b407..962eaaca4b 100644 --- a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts @@ -22,6 +22,8 @@ import { import { FormCloud } from '../../../form/models/form-cloud.model'; import { TaskDetailsCloudModel } from '../../start-task/models/task-details-cloud.model'; import { TaskCloudService } from '../../services/task-cloud.service'; +import { FormRenderingService } from '@alfresco/adf-core'; +import { UploadCloudWidgetComponent } from '../../../form/components/upload-cloud.widget'; @Component({ selector: 'adf-cloud-task-form', @@ -89,7 +91,9 @@ export class TaskFormCloudComponent implements OnChanges { taskDetails: TaskDetailsCloudModel; constructor( - private taskCloudService: TaskCloudService) { + private taskCloudService: TaskCloudService, + private formRenderingService: FormRenderingService) { + this.formRenderingService.setComponentTypeResolver('upload', () => UploadCloudWidgetComponent, true); } ngOnChanges(changes: SimpleChanges) {