[ADF-4519] Attach an ACS content to a form (#4842)

* * Process-storage

* * Used jsapiServcie

* Be able to upload a file on the content with the createNode api

* Refactor

* [ADF-4519] Attach an ACS content to a form.

* * Created attachfile-cloud-widget component

* * Created a component to attach an acs content to a form.

* * Added unit tests

* * Removed unused methods* FIxed tslint errors.

* * Reverted demo shell changes.

* * Removed unnecessary methods

* * Fixed at able to remove attached file

* * After rebase.

* * Removed tempFile and currentFile properties.* Refactored attach-file-cloud-widget.

* Update upload-cloud.widget.html

* fix

* Fixed readonly form
This commit is contained in:
siva kumar
2019-06-18 23:24:33 +05:30
committed by Eugenio Romano
parent 3d4ea197ee
commit 957a76b1b5
12 changed files with 665 additions and 44 deletions

View File

@@ -38,7 +38,7 @@ import { FormCloudService } from '../services/form-cloud.service';
import { FormCloud } from '../models/form-cloud.model';
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
import { DropdownCloudWidgetComponent } from './dropdown-cloud/dropdown-cloud.widget';
import { UploadCloudWidgetComponent } from './upload-cloud.widget';
import { AttachFileCloudWidgetComponent } from './attach-file-cloud-widget/attach-file-cloud-widget.component';
@Component({
selector: 'adf-cloud-form',
@@ -106,11 +106,11 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
super();
this.formService.formContentClicked
.pipe(takeUntil(this.onDestroy$))
.subscribe((content: any) => {
this.formContentClicked.emit(content);
});
this.formRenderingService.setComponentTypeResolver('upload', () => UploadCloudWidgetComponent, true);
.pipe(takeUntil(this.onDestroy$))
.subscribe((content: any) => {
this.formContentClicked.emit(content);
});
this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileCloudWidgetComponent, true);
this.formRenderingService.setComponentTypeResolver('dropdown', () => DropdownCloudWidgetComponent, true);
}
@@ -236,7 +236,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
await this.getFormByTaskId(appName, taskId);
const hasUploadWidget = (<any> this.form).hasUpload;
if (hasUploadWidget) {
if (hasUploadWidget && !this.readOnly) {
try {
const processStorageCloudModel = await this.formCloudService.getProcessStorageFolderTask(appName, taskId, processInstanceId).toPromise();
this.form.nodeId = processStorageCloudModel.nodeId;