mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-3110] Move upload button inside the node selector dialog (#5901)
* Open select dialog on all types, fetch destination folder from a relative path * Dialog UI refactor, multiple upload from local * Fix document list should automatically reload after upload * Remove not used ViewChild * Fix imports, read destination folder from form field * support different alias * Remove not needed property, reuse selection mode * Remove unused methods * Fix unit tests * * Added unit tests * Fixed failing unit tests * * Added unit for upload button * Skipped failing e2e * * Removed process-storage related code * * Removed unncessory model and code * * * Removed contentHost from formCloud model * * Skiped content-services e2e * Skip failing process e2e related to attachment Co-authored-by: sivakumar414ram <siva.kumar@muraai.com> Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
@@ -28,12 +28,10 @@ import {
|
||||
FormOutcomeModel,
|
||||
WidgetVisibilityService,
|
||||
FormService,
|
||||
NotificationService,
|
||||
FORM_FIELD_VALIDATORS,
|
||||
FormFieldValidator,
|
||||
FormValues,
|
||||
FormModel,
|
||||
AppConfigService,
|
||||
ContentLinkModel
|
||||
} from '@alfresco/adf-core';
|
||||
import { FormCloudService } from '../services/form-cloud.service';
|
||||
@@ -106,9 +104,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
|
||||
constructor(protected formCloudService: FormCloudService,
|
||||
protected formService: FormService,
|
||||
private notificationService: NotificationService,
|
||||
protected visibilityService: WidgetVisibilityService,
|
||||
private appConfigService: AppConfigService) {
|
||||
protected visibilityService: WidgetVisibilityService) {
|
||||
super();
|
||||
|
||||
this.formService.formContentClicked
|
||||
@@ -123,7 +119,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
|
||||
if (appName && appName.currentValue) {
|
||||
if (this.taskId) {
|
||||
this.getFormDefinitionWithFolderTask(this.appName, this.taskId, this.processInstanceId);
|
||||
this.getFormByTaskId(appName.currentValue, this.taskId, this.appVersion);
|
||||
} else if (this.formId) {
|
||||
this.getFormById(appName.currentValue, this.formId, this.appVersion);
|
||||
}
|
||||
@@ -200,7 +196,6 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
parsedForm.validateForm();
|
||||
this.form = parsedForm;
|
||||
this.form.nodeId = '-my-';
|
||||
this.form.contentHost = this.appConfigService.get('ecmHost');
|
||||
this.onFormLoaded(this.form);
|
||||
resolve(this.form);
|
||||
},
|
||||
@@ -230,7 +225,6 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
parsedForm.validateForm();
|
||||
this.form = parsedForm;
|
||||
this.form.nodeId = '-my-';
|
||||
this.form.contentHost = this.appConfigService.get('ecmHost');
|
||||
this.onFormLoaded(this.form);
|
||||
},
|
||||
(error) => {
|
||||
@@ -239,31 +233,6 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
);
|
||||
}
|
||||
|
||||
getFormDefinitionWithFolderTask(appName: string, taskId: string, processInstanceId: string) {
|
||||
this.getFormDefinitionWithFolder(appName, taskId, processInstanceId);
|
||||
}
|
||||
|
||||
async getFormDefinitionWithFolder(appName: string, taskId: string, processInstanceId: string) {
|
||||
try {
|
||||
await this.getFormByTaskId(appName, taskId, this.appVersion);
|
||||
|
||||
const hasUploadWidget = (<any> this.form).hasUpload;
|
||||
if (hasUploadWidget) {
|
||||
try {
|
||||
const processStorageCloudModel = await this.formCloudService.getProcessStorageFolderTask(appName, taskId, processInstanceId).toPromise();
|
||||
this.form.nodeId = processStorageCloudModel.nodeId;
|
||||
this.form.contentHost = processStorageCloudModel.path;
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage('The content repo is not configured');
|
||||
}
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage('Form service an error occour');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
saveTaskForm() {
|
||||
if (this.form && this.appName && this.taskId) {
|
||||
this.formCloudService
|
||||
|
Reference in New Issue
Block a user