mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5260] Fix Service task list initialization in DemoShell (#6184)
* [ADF-5260] Fix Service task list initialization in DemoShell * Improve layout
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
<div fxLayout="column" fxFill fxLayoutGap="2px">
|
||||
<adf-cloud-edit-service-task-filter
|
||||
[id]="'myFilter'"
|
||||
<div fxLayout="row"
|
||||
fxFill
|
||||
fxLayoutGap="2px">
|
||||
<adf-cloud-service-task-filters [appName]="appName"
|
||||
[filterParam]="{index: 0}"
|
||||
(filterClick)="onTaskFilterSelected($event)">
|
||||
|
||||
</adf-cloud-service-task-filters>
|
||||
<div fxLayout="column"
|
||||
fxFill
|
||||
fxLayoutGap="2px">
|
||||
|
||||
<adf-cloud-edit-service-task-filter [id]="filterId"
|
||||
[appName]="appName"
|
||||
[filterProperties]="taskFilterProperties.filterProperties"
|
||||
[sortProperties]="taskFilterProperties.sortProperties"
|
||||
[actions]="taskFilterProperties.actions"
|
||||
(filterChange)="onFilterChange($event)">
|
||||
</adf-cloud-edit-service-task-filter>
|
||||
<div fxLayout="column" fxFlex fxLayoutAlign="space-between" *ngIf="editedFilter">
|
||||
<div fxLayout="column"
|
||||
fxFlex
|
||||
fxLayoutAlign="space-between"
|
||||
*ngIf="editedFilter">
|
||||
<adf-cloud-service-task-list #taskCloud
|
||||
fxFlex
|
||||
[queryParams]="editedFilter"
|
||||
@@ -19,11 +33,11 @@
|
||||
[showActions]="actionMenu"
|
||||
[showContextMenu]="contextMenu">
|
||||
</adf-cloud-service-task-list>
|
||||
<adf-pagination
|
||||
[target]="taskCloud"
|
||||
<adf-pagination [target]="taskCloud"
|
||||
(changePageSize)="onChangePageSize($event)"
|
||||
(nextPage)="resetSelectedRows()"
|
||||
(prevPage)="resetSelectedRows()">
|
||||
</adf-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -34,6 +34,8 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('taskCloud')
|
||||
taskCloud: ServiceTaskListCloudComponent;
|
||||
|
||||
appName = 'simpleapp';
|
||||
|
||||
isFilterLoaded = false;
|
||||
|
||||
selectedRow: any;
|
||||
@@ -50,6 +52,7 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
|
||||
selectedAction: { id: number, name: string, actionType: string};
|
||||
selectedContextAction: { id: number, name: string, actionType: string};
|
||||
selectionMode: string;
|
||||
filterId: string;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
@@ -86,6 +89,11 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
onTaskFilterSelected(filter: ServiceTaskFilterCloudModel) {
|
||||
this.filterId = filter.id;
|
||||
this.editedFilter = filter;
|
||||
}
|
||||
|
||||
onChangePageSize(event: PaginationModel) {
|
||||
this.userPreference.paginationSize = event.maxItems;
|
||||
}
|
||||
@@ -95,6 +103,7 @@ export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
onFilterChange(filter: ServiceTaskFilterCloudModel) {
|
||||
this.appName = filter.appName;
|
||||
this.editedFilter = Object.assign({}, filter);
|
||||
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
|
||||
}
|
||||
|
@@ -236,7 +236,7 @@ export class ServiceTaskFilterCloudService {
|
||||
* @returns String of task filters preference key
|
||||
*/
|
||||
private prepareKey(appName: string): string {
|
||||
return `task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`;
|
||||
return `service-task-filters-${appName}-${this.identityUserService.getCurrentUserInfo().username}`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,7 +262,7 @@ export class ServiceTaskFilterCloudService {
|
||||
key: 'my-service-tasks',
|
||||
icon: 'inbox',
|
||||
appName,
|
||||
status: 'ALL',
|
||||
status: '',
|
||||
sort: 'startedDate',
|
||||
order: 'DESC'
|
||||
} as ServiceTaskFilterCloudModel,
|
||||
|
@@ -248,7 +248,7 @@ export abstract class BaseTaskListCloudComponent extends DataTableSchema impleme
|
||||
}
|
||||
|
||||
isValidSorting(sorting: TaskListCloudSortingModel[]) {
|
||||
return sorting.length && sorting[0].orderBy && sorting[0].direction;
|
||||
return sorting && sorting.length && sorting[0].orderBy && sorting[0].direction;
|
||||
}
|
||||
|
||||
abstract load(requestNode);
|
||||
|
@@ -34,7 +34,7 @@ export class ServiceTaskListCloudComponent extends BaseTaskListCloudComponent {
|
||||
static PRESET_KEY = 'adf-cloud-service-task-list.presets';
|
||||
|
||||
@Input()
|
||||
queryParams: { [key: string]: string } = {};
|
||||
queryParams: { [key: string]: any } = {};
|
||||
|
||||
constructor(private taskListCloudService: TaskListCloudService,
|
||||
appConfigService: AppConfigService,
|
||||
@@ -57,13 +57,27 @@ export class ServiceTaskListCloudComponent extends BaseTaskListCloudComponent {
|
||||
}
|
||||
|
||||
createRequestNode(): ServiceTaskQueryCloudRequestModel {
|
||||
const requestNode = {
|
||||
...this.queryParams,
|
||||
const requestNode: ServiceTaskQueryCloudRequestModel = {
|
||||
appName: this.appName,
|
||||
maxItems: this.size,
|
||||
skipCount: this.skipCount,
|
||||
sorting: this.sorting
|
||||
};
|
||||
return <ServiceTaskQueryCloudRequestModel> requestNode;
|
||||
sorting: this.sorting,
|
||||
id: this.queryParams.serviceTaskId,
|
||||
activityName: this.queryParams.activityName,
|
||||
activityType: this.queryParams.activityType,
|
||||
completedDate: this.queryParams.completedDate,
|
||||
elementId: this.queryParams.elementId,
|
||||
executionId: this.queryParams.executionId,
|
||||
processDefinitionId: this.queryParams.processDefinitionId,
|
||||
processDefinitionKey: this.queryParams.processDefinitionKey,
|
||||
processDefinitionVersion: this.queryParams.processDefinitionVersion,
|
||||
processInstanceId: this.queryParams.processInstanceId,
|
||||
serviceFullName: this.queryParams.serviceFullName,
|
||||
serviceName: this.queryParams.serviceName,
|
||||
serviceVersion: this.queryParams.serviceVersion,
|
||||
startedDate: this.queryParams.startedDate,
|
||||
status: this.queryParams.status
|
||||
} as ServiceTaskQueryCloudRequestModel;
|
||||
return requestNode;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user