mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4389] StartProcessCloud - add validation for processName (#4707)
* [ADF-4389] StartProcessCloud - add validation for processName * [ADF-4389] - change function definition name * [ADF-4389] - add return type
This commit is contained in:
committed by
Maurizio Vitale
parent
164d398abc
commit
d1bc5a608a
@@ -122,11 +122,11 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
||||
}
|
||||
|
||||
private getProcessDefinitionList(processDefinitionName: string): ProcessDefinitionCloud[] {
|
||||
return this.processDefinitionList.filter((option) => option.name && option.name.toLowerCase().includes(processDefinitionName.toLowerCase()));
|
||||
return this.processDefinitionList.filter((option) => this.isValidName(option.name) && option.name.toLowerCase().includes(processDefinitionName.toLowerCase()));
|
||||
}
|
||||
|
||||
private getProcessIfExists(processDefinitionName: string): ProcessDefinitionCloud {
|
||||
let matchedProcess = this.processDefinitionList.find((option) => option.name.toLowerCase() === processDefinitionName.toLowerCase());
|
||||
let matchedProcess = this.processDefinitionList.find((option) => this.isValidName(option.name) && option.name.toLowerCase() === processDefinitionName.toLowerCase());
|
||||
if (!matchedProcess) {
|
||||
matchedProcess = new ProcessDefinitionCloud();
|
||||
}
|
||||
@@ -162,6 +162,10 @@ export class StartProcessCloudComponent implements OnChanges, OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
private isValidName(name: string): boolean {
|
||||
return !!name;
|
||||
}
|
||||
|
||||
isProcessDefinitionsEmpty(): boolean {
|
||||
return this.processDefinitionList.length === 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user