Skip to content

Commit

Permalink
Fix incorrect syntax in property assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaRobert committed Jan 8, 2025
1 parent 06699e5 commit b25bb9b
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,56 @@ export class ProcessFilterCloudModel {
this._suspendedFrom = obj._suspendedFrom || null;
this._suspendedTo = obj._suspendedTo || null;

this.processDefinitionNames = obj.processDefinitionNames || obj.processDefinitionName ? [obj.processDefinitionName] : null;
this.processNames = obj.processNames || obj.processName ? [obj.processName] : null;
this.processInstanceIds = obj.processInstanceIds || obj.processInstanceId ? [obj.processInstanceId] : null;
this.parentIds = obj.parentIds || obj.parentId ? [obj.parentId] : null;
this.initiators = obj.initiators || obj.initiator ? [obj.initiator] : null;
this.appVersions = obj.appVersions || obj.appVersion ? [`${obj.appVersion}`] : null;
this.statuses = obj.statuses || obj.status ? [obj.status] : null;
this.processVariableFilters = obj.processVariableFilters ?? [];
this.initArrayProperties(obj);
}
}

private initArrayProperties(obj) {
if (obj.processDefinitionNames) {
this.processDefinitionNames = obj.processDefinitionNames;
} else {
this.processDefinitionNames = obj.processDefinitionName ? [obj.processDefinitionName] : null;
}

if (obj.processNames) {
this.processNames = obj.processNames;
} else {
this.processNames = obj.processName ? [obj.processName] : null;
}

if (obj.processInstanceIds) {
this.processInstanceIds = obj.processInstanceIds;
} else {
this.processInstanceIds = obj.processInstanceId ? [obj.processInstanceId] : null;
}

if (obj.parentIds) {
this.parentIds = obj.parentIds;
} else {
this.parentIds = obj.parentId ? [obj.parentId] : null;
}

if (obj.initiators) {
this.initiators = obj.initiators;
} else {
this.initiators = obj.initiator ? [obj.initiator] : null;
}

if (obj.appVersions) {
this.appVersions = obj.appVersions;
} else {
this.appVersions = obj.appVersion ? [`${obj.appVersion}`] : null;
}

if (obj.statuses) {
this.statuses = obj.statuses;
} else {
this.statuses = obj.status ? [obj.status] : null;
}

this.processVariableFilters = obj.processVariableFilters ?? [];
}

set completedFrom(completedFrom: string) {
this._completedFrom = completedFrom;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,74 @@ export class TaskFilterCloudModel {
this.candidateGroups = obj.candidateGroups || null;
this.showCounter = obj.showCounter || false;

this.taskNames = obj.taskNames || obj.taskName ? [obj.taskName] : null;
this.statuses = obj.statuses || obj.status ? [obj.status] : null;
this.assignees = obj.assignees || obj.assignee ? [obj.assignee] : null;
this.processNames = obj.processNames || obj.processName ? [obj.processName] : null;
this.processDefinitionNames = obj.processDefinitionNames || obj.processDefinitionName ? [obj.processDefinitionName] : null;
this.taskIds = obj.taskIds || obj.taskId ? [obj.taskId] : null;
this.parentTaskIds = obj.parentTaskIds || obj.parentTaskId ? [obj.parentTaskId] : null;
this.processInstanceIds = obj.processInstanceIds || obj.processInstanceId ? [obj.processInstanceId] : null;
this.priorities = obj.priorities || obj.priority ? [obj.priority] : null;
this.completedByUsers = obj.completedByUsers || obj.completedBy ? [obj.completedBy] : null;
this.processVariableFilters = obj.processVariableFilters ?? [];
this.initArrayProperties(obj);
}
}

private initArrayProperties(obj) {
if (obj.taskNames) {
this.taskNames = obj.taskNames;
} else {
this.taskNames = obj.taskName ? [obj.taskName] : null;
}

if (obj.statuses) {
this.statuses = obj.statuses;
} else {
this.statuses = obj.status ? [obj.status] : null;
}

if (obj.assignees) {
this.assignees = obj.assignees;
} else {
this.assignees = obj.assignee ? [obj.assignee] : null;
}

if (obj.processNames) {
this.processNames = obj.processNames;
} else {
this.processNames = obj.processName ? [obj.processName] : null;
}

if (obj.processDefinitionNames) {
this.processDefinitionNames = obj.processDefinitionNames;
} else {
this.processDefinitionNames = obj.processDefinitionName ? [obj.processDefinitionName] : null;
}

if (obj.taskIds) {
this.taskIds = obj.taskIds;
} else {
this.taskIds = obj.taskId ? [obj.taskId] : null;
}

if (obj.parentTaskIds) {
this.parentTaskIds = obj.parentTaskIds;
} else {
this.parentTaskIds = obj.parentTaskId ? [obj.parentTaskId] : null;
}

if (obj.processInstanceIds) {
this.processInstanceIds = obj.processInstanceIds;
} else {
this.processInstanceIds = obj.processInstanceId ? [obj.processInstanceId] : null;
}

if (obj.priorities) {
this.priorities = obj.priorities;
} else {
this.priorities = obj.priority ? [obj.priority] : null;
}

if (obj.completedByUsers) {
this.completedByUsers = obj.completedByUsers;
} else {
this.completedByUsers = obj.completedBy ? [obj.completedBy] : null;
}

this.processVariableFilters = obj.processVariableFilters ?? [];
}

set dueDateFrom(dueDateFrom: string) {
this._dueDateFrom = dueDateFrom;
}
Expand Down

0 comments on commit b25bb9b

Please sign in to comment.