mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
update
This commit is contained in:
-1
@@ -1,4 +1,3 @@
|
|||||||
{{processDefinitionLoaded}}
|
|
||||||
@if (processDefinitionLoaded) {
|
@if (processDefinitionLoaded) {
|
||||||
<mat-card appearance="outlined" class="adf-start-process">
|
<mat-card appearance="outlined" class="adf-start-process">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
|
|||||||
+20
-42
@@ -173,8 +173,8 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
|||||||
customOutcomeId: string;
|
customOutcomeId: string;
|
||||||
|
|
||||||
isProcessStarting = false;
|
isProcessStarting = false;
|
||||||
|
isFormCloudLoading = false;
|
||||||
isFormCloudLoaded = false;
|
isFormCloudLoaded = false;
|
||||||
isFormCloudLoading = true;
|
|
||||||
processDefinitionLoaded = false;
|
processDefinitionLoaded = false;
|
||||||
|
|
||||||
showStartProcessButton$: Observable<boolean>;
|
showStartProcessButton$: Observable<boolean>;
|
||||||
@@ -340,13 +340,19 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
|||||||
if (cancelLabel) {
|
if (cancelLabel) {
|
||||||
this.cancelButtonLabel = cancelLabel?.value?.trim()?.length > 0 ? cancelLabel.value.trim() : this.defaultCancelProcessButtonLabel;
|
this.cancelButtonLabel = cancelLabel?.value?.trim()?.length > 0 ? cancelLabel.value.trim() : this.defaultCancelProcessButtonLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isFormCloudLoading = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setProcessDefinitionOnForm(selectedProcessDefinitionName: string) {
|
setProcessDefinitionOnForm(selectedProcessDefinitionName: string) {
|
||||||
|
this.isFormCloudLoading = true;
|
||||||
|
|
||||||
this.fetchStaticVariablesAndConstants(selectedProcessDefinitionName).subscribe({
|
this.fetchStaticVariablesAndConstants(selectedProcessDefinitionName).subscribe({
|
||||||
next: ([staticMappings, constants]) => this.onFetchStaticVariablesAndConstants([staticMappings, constants])
|
next: ([staticMappings, constants]) => this.onFetchStaticVariablesAndConstants([staticMappings, constants]),
|
||||||
|
error: () => {
|
||||||
|
this.isFormCloudLoading = false;
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
this.isFormCloudLoading = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.processPayloadCloud.processDefinitionKey = this.processDefinitionCurrent.key;
|
this.processPayloadCloud.processDefinitionKey = this.processDefinitionCurrent.key;
|
||||||
@@ -399,24 +405,26 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
|||||||
this.processDefinitionList = processDefinitionRepresentations;
|
this.processDefinitionList = processDefinitionRepresentations;
|
||||||
}),
|
}),
|
||||||
switchMap((processDefinitionRepresentations: ProcessDefinitionCloud[]) => {
|
switchMap((processDefinitionRepresentations: ProcessDefinitionCloud[]) => {
|
||||||
|
if (!this.processDefinitionName) {
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
if (processDefinitionRepresentations.length === 1) {
|
if (processDefinitionRepresentations.length === 1) {
|
||||||
this.selectDefaultProcessDefinition();
|
this.selectDefaultProcessDefinition();
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.processDefinitionName) {
|
|
||||||
this.processDefinition.setValue(this.processDefinitionName);
|
this.processDefinition.setValue(this.processDefinitionName);
|
||||||
|
|
||||||
const processDefinition = this.processDefinitionList.find((process) => process.name === this.processDefinitionName);
|
const processDefinition = this.processDefinitionList.find((process) => process.name === this.processDefinitionName);
|
||||||
if (processDefinition) {
|
|
||||||
|
if (!processDefinition) {
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
this.filteredProcesses = this.getProcessDefinitionListByNameOrKey(processDefinition.name);
|
this.filteredProcesses = this.getProcessDefinitionListByNameOrKey(processDefinition.name);
|
||||||
this.processDefinitionSelectionChanged(processDefinition);
|
this.processDefinitionSelectionChanged(processDefinition);
|
||||||
|
|
||||||
return this.fetchStaticVariablesAndConstants(processDefinition.name);
|
return this.fetchStaticVariablesAndConstants(processDefinition.name);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return EMPTY;
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
@@ -424,45 +432,15 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
|||||||
if (staticMappings && constants) {
|
if (staticMappings && constants) {
|
||||||
this.onFetchStaticVariablesAndConstants([staticMappings, constants]);
|
this.onFetchStaticVariablesAndConstants([staticMappings, constants]);
|
||||||
}
|
}
|
||||||
this.isFormCloudLoading = false;
|
|
||||||
this.processDefinitionLoaded = true;
|
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.errorMessageId = 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.LOAD_PROCESS_DEFS';
|
this.errorMessageId = 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.LOAD_PROCESS_DEFS';
|
||||||
this.isFormCloudLoading = false;
|
this.processDefinitionLoaded = true;
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
this.isFormCloudLoading = false;
|
|
||||||
this.processDefinitionLoaded = true;
|
this.processDefinitionLoaded = true;
|
||||||
console.log('complete');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// .subscribe({
|
|
||||||
// next: (processDefinitionRepresentations: ProcessDefinitionCloud[]) => {
|
|
||||||
// this.processDefinitionList = processDefinitionRepresentations;
|
|
||||||
// if (processDefinitionRepresentations.length === 1) {
|
|
||||||
// this.selectDefaultProcessDefinition();
|
|
||||||
// } else if (this.processDefinitionName) {
|
|
||||||
// this.processDefinition.setValue(this.processDefinitionName);
|
|
||||||
|
|
||||||
// const processDefinition = this.processDefinitionList.find((process) => process.name === this.processDefinitionName);
|
|
||||||
// if (processDefinition) {
|
|
||||||
// this.filteredProcesses = this.getProcessDefinitionListByNameOrKey(processDefinition.name);
|
|
||||||
// this.processDefinitionSelectionChanged(processDefinition);
|
|
||||||
// this.setProcessDefinitionOnForm(processDefinition.name);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// this.isFormCloudLoading = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.processDefinitionLoaded = true;
|
|
||||||
// },
|
|
||||||
// error: () => {
|
|
||||||
// this.errorMessageId = 'ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.LOAD_PROCESS_DEFS';
|
|
||||||
// this.isFormCloudLoading = false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private isValidName(name: string): boolean {
|
private isValidName(name: string): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user