Skip to content

Commit

Permalink
AAE-28584 Fix process tasks not showing after clicking in the list (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaRobert authored Nov 20, 2024
1 parent b575d16 commit ab1b545
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class TaskListRequestModel {
status?: string[];
completedBy?: string[];
assignee?: string[];
processInstanceId?: string;
createdFrom?: string;
createdTo?: string;
lastModifiedFrom?: string;
Expand Down Expand Up @@ -148,6 +149,7 @@ export class TaskListRequestModel {
this.status = obj.status;
this.completedBy = obj.completedBy;
this.assignee = obj.assignee;
this.processInstanceId = obj.processInstanceId;
this.createdFrom = obj.createdFrom;
this.createdTo = obj.createdTo;
this.lastModifiedFrom = obj.lastModifiedFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { BaseCloudService } from '../../../services/base-cloud.service';
import { map } from 'rxjs/operators';
import { TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
import { TaskListRequestModel, TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
import { TaskCloudNodePaging } from '../../../models/task-cloud.model';
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';

Expand Down Expand Up @@ -55,6 +55,30 @@ export class ProcessTaskListCloudService extends BaseCloudService {
}
}

/**
* Retrieves a list of tasks using an object with optional query properties.
*
* @param requestNode Query object
* @param queryUrl Query url
* @returns List of tasks
*/
fetchTaskList(requestNode: TaskListRequestModel, queryUrl?: string): Observable<any> {
return this.getTaskByRequest(
new TaskQueryCloudRequestModel({
appName: requestNode.appName,
processInstanceId: requestNode.processInstanceId
}),
queryUrl
);
}

getTaskListCounter(requestNode: TaskListRequestModel): Observable<number> {
if (!requestNode.appName) {
return throwError(() => new Error('Appname not configured'));
}
return this.fetchTaskList(requestNode).pipe(map((tasks) => tasks.list.pagination.totalItems));
}

protected buildQueryParams(requestNode: TaskQueryCloudRequestModel): any {
const queryParam: any = {};
for (const property in requestNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
import { TaskListRequestModel, TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
import { BaseTaskListCloudComponent } from './base-task-list-cloud.component';
import { TaskCloudService } from '../../services/task-cloud.service';
import {
TASK_LIST_CLOUD_TOKEN,
TASK_LIST_PREFERENCES_SERVICE_TOKEN,
TASK_SEARCH_API_METHOD_TOKEN
} from '../../../services/cloud-token.service';
import { TASK_LIST_CLOUD_TOKEN, TASK_LIST_PREFERENCES_SERVICE_TOKEN, TASK_SEARCH_API_METHOD_TOKEN } from '../../../services/cloud-token.service';
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud.service.interface';
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
Expand Down Expand Up @@ -266,6 +262,7 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
onlyStandalone: this.standalone,
name: this.names,
processDefinitionName: this.processDefinitionNames,
processInstanceId: this.processInstanceId,
priority: this.priorities,
status: this.statuses,
completedBy: this.completedByUsers,
Expand Down

0 comments on commit ab1b545

Please sign in to comment.