mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3639] Fix default selected process at Start Process Component (#3848)
* [ADF-3639] Fix default selected process at Start Process Component * [ADF-3639] Fix default selected process at Start Process Component fix e2e * lint fix
This commit is contained in:
committed by
Eugenio Romano
parent
718b3e8817
commit
07fb1da8c6
@@ -161,18 +161,19 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit {
|
||||
(processDefinitionRepresentations: ProcessDefinitionRepresentation[]) => {
|
||||
this.processDefinitions = processDefinitionRepresentations;
|
||||
|
||||
if (this.hasSingleProcessDefinition()) {
|
||||
if (!this.isProcessDefinitionsEmpty()) {
|
||||
this.selectedProcessDef = this.processDefinitions[0];
|
||||
} else {
|
||||
this.selectedProcessDef = this.processDefinitions.find((currentProcessDefinition) => {
|
||||
return currentProcessDefinition.name === this.processDefinitionName;
|
||||
});
|
||||
}
|
||||
|
||||
if (this.selectedProcessDef) {
|
||||
if (this.processDefinitionInput) {
|
||||
this.processDefinitionInput.setValue(this.selectedProcessDef.name);
|
||||
if (this.processDefinitionName) {
|
||||
let selectedProcess = this.processDefinitions.find((currentProcessDefinition) => {
|
||||
return currentProcessDefinition.name === this.processDefinitionName;
|
||||
});
|
||||
if (selectedProcess) {
|
||||
this.selectedProcessDef = selectedProcess;
|
||||
}
|
||||
}
|
||||
|
||||
this.processDefinitionInput.setValue(this.selectedProcessDef.name);
|
||||
}
|
||||
},
|
||||
() => {
|
||||
@@ -180,8 +181,8 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
hasSingleProcessDefinition(): boolean {
|
||||
return this.processDefinitions.length === 1;
|
||||
isProcessDefinitionsEmpty(): boolean {
|
||||
return this.processDefinitions.length === 0;
|
||||
}
|
||||
|
||||
getAlfrescoRepositoryName(): string {
|
||||
|
Reference in New Issue
Block a user