[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:
Maurizio Vitale
2021-02-19 13:25:03 +00:00
committed by GitHub
parent e96617a676
commit 75f011292e
6 changed files with 261 additions and 17 deletions

View File

@@ -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 ||