mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2188] Start Process - Change processDefinition property and fix bug (#2884)
* Change processDefinition property and fix bug * Fix unit test * Fix async * Fix id
This commit is contained in:
committed by
Eugenio Romano
parent
abca6e481d
commit
657c28491a
@@ -50,7 +50,7 @@ export class StartProcessInstanceComponent implements OnChanges {
|
||||
appId: number;
|
||||
|
||||
@Input()
|
||||
processDefinition: string;
|
||||
processDefinitionName: string;
|
||||
|
||||
@Input()
|
||||
variables: ProcessInstanceVariable[];
|
||||
@@ -106,16 +106,12 @@ export class StartProcessInstanceComponent implements OnChanges {
|
||||
(processDefinitionRepresentations: ProcessDefinitionRepresentation[]) => {
|
||||
this.processDefinitions = processDefinitionRepresentations;
|
||||
|
||||
if (this.processDefinitions.length === 1 || !this.processDefinition) {
|
||||
if (this.hasSingleProcessDefinition()) {
|
||||
this.selectedProcessDef = this.processDefinitions[0];
|
||||
} else {
|
||||
this.selectedProcessDef = this.processDefinitions.find((currentProcessDefinition) => {
|
||||
return currentProcessDefinition.name === this.processDefinition;
|
||||
return currentProcessDefinition.name === this.processDefinitionName;
|
||||
});
|
||||
|
||||
if (!this.selectedProcessDef) {
|
||||
this.selectedProcessDef = this.processDefinitions[0];
|
||||
}
|
||||
}
|
||||
},
|
||||
() => {
|
||||
@@ -124,6 +120,10 @@ export class StartProcessInstanceComponent implements OnChanges {
|
||||
|
||||
}
|
||||
|
||||
hasSingleProcessDefinition(): boolean {
|
||||
return this.processDefinitions.length === 1;
|
||||
}
|
||||
|
||||
getAlfrescoRepositoryName(): string {
|
||||
let alfrescoRepositoryName = this.appConfig.get<string>('alfrescoRepositoryName');
|
||||
if (!alfrescoRepositoryName) {
|
||||
|
Reference in New Issue
Block a user