mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[ACA-3881] Able to start form with preselected ACS nodes (#6700)
* Move the node to ps before loading * Add unit test on start process with preseleted nodes * Fix unit test * Wrap calls and improve if * Add type
This commit is contained in:
@@ -84,6 +84,12 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
||||
return;
|
||||
}
|
||||
|
||||
const data = changes['data'];
|
||||
if (data && data.currentValue) {
|
||||
this.parseRefreshVisibilityValidateForm(this.form.json);
|
||||
return;
|
||||
}
|
||||
|
||||
const processId = changes['processId'];
|
||||
if (processId && processId.currentValue) {
|
||||
this.visibilityService.cleanProcessVariable();
|
||||
@@ -103,11 +109,7 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
||||
if (instance.variables) {
|
||||
form.processVariables = instance.variables;
|
||||
}
|
||||
this.form = this.parseForm(form);
|
||||
this.visibilityService.refreshVisibility(this.form);
|
||||
this.form.validateForm();
|
||||
this.form.readOnly = this.readOnlyForm;
|
||||
this.onFormLoaded(this.form);
|
||||
this.parseRefreshVisibilityValidateForm(form);
|
||||
},
|
||||
(error) => this.handleError(error)
|
||||
);
|
||||
@@ -120,16 +122,20 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
||||
.subscribe(
|
||||
(form) => {
|
||||
this.formName = form.processDefinitionName;
|
||||
this.form = this.parseForm(form);
|
||||
this.visibilityService.refreshVisibility(this.form);
|
||||
this.form.validateForm();
|
||||
this.form.readOnly = this.readOnlyForm;
|
||||
this.onFormLoaded(this.form);
|
||||
this.parseRefreshVisibilityValidateForm(form);
|
||||
},
|
||||
(error) => this.handleError(error)
|
||||
);
|
||||
}
|
||||
|
||||
parseRefreshVisibilityValidateForm(form) {
|
||||
this.form = this.parseForm(form);
|
||||
this.visibilityService.refreshVisibility(this.form);
|
||||
this.form.validateForm();
|
||||
this.form.readOnly = this.readOnlyForm;
|
||||
this.onFormLoaded(this.form);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
isOutcomeButtonVisible(outcome: FormOutcomeModel, isFormReadOnly: boolean): boolean {
|
||||
if (outcome && outcome.isSystem && (outcome.name === FormOutcomeModel.SAVE_ACTION ||
|
||||
|
Reference in New Issue
Block a user