[AAE-3469] New Service Task Cloud Component (#6161)

* [AAE-3469] New Service Task Lisst Component

* Fix unit tests

* Add documentation

* Add public methods to Data Table Schema

* [AAE-3469] New Service Task Cloud Component

* Fix comments

* Fix comments

* Fix unit tests
This commit is contained in:
davidcanonieto
2020-09-28 10:47:18 +02:00
committed by GitHub
parent 9b5d0d2a82
commit e497b31e3e
50 changed files with 4079 additions and 1228 deletions

View File

@@ -969,6 +969,35 @@
"delete"
]
},
"adf-edit-service-task-filter": {
"filterProperties": [
"appName",
"serviceTaskId",
"activityName",
"activityType",
"completedDate",
"startedDate",
"sort",
"order",
"status",
"elementId",
"serviceName",
"processInstanceId",
"processDefinitionId",
"serviceName"
],
"sortProperties": [
"id",
"activityName",
"completedDate",
"startedDate"
],
"actions": [
"save",
"saveAs",
"delete"
]
},
"adf-edit-process-filter": {
"filterProperties": [
"status",
@@ -1066,6 +1095,44 @@
]
}
},
"adf-cloud-service-task-list": {
"presets": {
"default": [
{
"key": "entry.id",
"type": "text",
"title": "ADF_CLOUD_SERVICE_TASK_LIST.PROPERTIES.ID",
"sortable": true
},
{
"key": "entry.activityName",
"type": "text",
"title": "ADF_CLOUD_SERVICE_TASK_LIST.PROPERTIES.ACTIVITY_NAME",
"sortable": true
},
{
"key": "entry.status",
"type": "text",
"title": "ADF_CLOUD_SERVICE_TASK_LIST.PROPERTIES.STATUS",
"sortable": true
},
{
"key": "entry.startedDate",
"type": "date",
"title": "ADF_CLOUD_SERVICE_TASK_LIST.PROPERTIES.STARTED_DATE",
"sortable": true,
"format": "timeAgo"
},
{
"key": "entry.completedDate",
"type": "date",
"title": "ADF_CLOUD_SERVICE_TASK_LIST.PROPERTIES.COMPLETED_DATE",
"sortable": true,
"format": "timeAgo"
}
]
}
},
"adf-cloud-process-list": {
"presets": {
"default": [

View File

@@ -65,6 +65,7 @@ import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.com
import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component';
import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component';
import { TaskHeaderCloudDemoComponent } from './components/cloud/task-header-cloud-demo.component';
import { ServiceTaskListCloudDemoComponent } from './components/cloud/service-task-list-cloud-demo.component';
import { CloudViewerComponent } from './components/cloud/cloud-viewer.component';
import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component';
import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component';
@@ -193,7 +194,8 @@ registerLocaleData(localeSv);
ConfirmDialogExampleComponent,
CustomEditorComponent,
CustomWidgetComponent,
ProcessCloudLayoutComponent
ProcessCloudLayoutComponent,
ServiceTaskListCloudDemoComponent
],
providers: [
{

View File

@@ -54,6 +54,7 @@ import { DemoErrorComponent } from './components/error/demo-error.component';
import { TaskHeaderCloudDemoComponent } from './components/cloud/task-header-cloud-demo.component';
import { FilteredSearchComponent } from './components/files/filtered-search.component';
import { ProcessCloudLayoutComponent } from './components/cloud/process-cloud-layout.component';
import { ServiceTaskListCloudDemoComponent } from './components/cloud/service-task-list-cloud-demo.component';
export const appRoutes: Routes = [
{ path: 'login', loadChildren: () => import('./components/login/login.module').then(m => m.AppLoginModule) },
@@ -176,22 +177,31 @@ export const appRoutes: Routes = [
{
path: 'cloud',
canActivate: [AuthGuardSsoRoleService],
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
data: { roles: ['ACTIVITI_ADMIN', 'ACTIVITI_USER'], redirectUrl: '/error/403' },
children: [
{
path: '',
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
component: AppsCloudDemoComponent
},
{
path: 'people-group-cloud',
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
component: PeopleGroupCloudDemoComponent
},
{
path: 'task-header-cloud',
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
component: TaskHeaderCloudDemoComponent
},
{
path: 'service-task-list',
data: { roles: ['ACTIVITI_ADMIN'], redirectUrl: '/error/403' },
component: ServiceTaskListCloudDemoComponent
},
{
path: 'community',
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403' },
loadChildren: () => import('./components/cloud/community/community.module').then(m => m.AppCommunityModule)
},
{

View File

@@ -55,7 +55,8 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
{ href: '/cloud/community', icon: 'cloud', title: 'APP_LAYOUT.COMMUNITY' },
{ href: '/form-cloud', icon: 'poll', title: 'APP_LAYOUT.FORM' },
{ href: '/cloud/people-group-cloud', icon: 'group', title: 'APP_LAYOUT.PEOPLE_GROUPS_CLOUD' },
{ href: '/cloud/task-header-cloud', icon: 'cloud', title: 'APP_LAYOUT.TASK_HEADER_CLOUD.COMPONENT_NAME' }
{ href: '/cloud/task-header-cloud', icon: 'cloud', title: 'APP_LAYOUT.TASK_HEADER_CLOUD.COMPONENT_NAME' },
{ href: '/cloud/service-task-list', icon: 'cloud', title: 'APP_LAYOUT.SERVICE_TASK_LIST' }
]
},
{ href: '/activiti', icon: 'device_hub', title: 'APP_LAYOUT.PROCESS_SERVICES', children: [

View File

@@ -0,0 +1,29 @@
<div fxLayout="column" fxFill fxLayoutGap="2px">
<adf-cloud-edit-service-task-filter
[id]="'myFilter'"
[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">
<adf-cloud-service-task-list #taskCloud
fxFlex
[queryParams]="editedFilter"
class="app-cloud-layout-overflow"
[appName]="editedFilter.appName"
[sorting]="sortArray"
[multiselect]="multiselect"
[selectionMode]="selectionMode"
[stickyHeader]="true"
[showActions]="actionMenu"
[showContextMenu]="contextMenu">
</adf-cloud-service-task-list>
<adf-pagination
[target]="taskCloud"
(changePageSize)="onChangePageSize($event)"
(nextPage)="resetSelectedRows()"
(prevPage)="resetSelectedRows()">
</adf-pagination>
</div>
</div>

View File

@@ -0,0 +1,101 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { TaskListCloudSortingModel, ServiceTaskListCloudComponent, ServiceTaskFilterCloudModel } from '@alfresco/adf-process-services-cloud';
import { UserPreferencesService, AppConfigService, PaginationModel } from '@alfresco/adf-core';
import { CloudLayoutService, CloudServiceSettings } from './services/cloud-layout.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
templateUrl: 'service-task-list-cloud-demo.component.html'
})
export class ServiceTaskListCloudDemoComponent implements OnInit, OnDestroy {
public static ACTION_SAVE_AS = 'saveAs';
public static ACTION_DELETE = 'delete';
static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-service-task-filter';
@ViewChild('taskCloud')
taskCloud: ServiceTaskListCloudComponent;
isFilterLoaded = false;
selectedRow: any;
sortArray: TaskListCloudSortingModel[];
editedFilter: ServiceTaskFilterCloudModel;
taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
multiselect: boolean;
selectedRows: string[] = [];
actionMenu: boolean;
contextMenu: boolean;
actions: any[] = [];
selectedAction: { id: number, name: string, actionType: string};
selectedContextAction: { id: number, name: string, actionType: string};
selectionMode: string;
private onDestroy$ = new Subject<boolean>();
constructor(
private cloudLayoutService: CloudLayoutService,
private userPreference: UserPreferencesService,
private appConfig: AppConfigService) {
const properties = this.appConfig.get<Array<any>>(ServiceTaskListCloudDemoComponent.TASK_FILTER_PROPERTY_KEYS);
if (properties === this.taskFilterProperties) {
this.taskFilterProperties = properties;
}
}
ngOnInit() {
this.isFilterLoaded = false;
this.cloudLayoutService.settings$
.pipe(takeUntil(this.onDestroy$))
.subscribe(settings => this.setCurrentSettings(settings));
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
setCurrentSettings(settings: CloudServiceSettings) {
if (settings) {
this.multiselect = settings.multiselect;
this.selectionMode = settings.selectionMode;
this.actionMenu = settings.actionMenu;
this.contextMenu = settings.contextMenu;
this.actions = settings.actions;
}
}
onChangePageSize(event: PaginationModel) {
this.userPreference.paginationSize = event.maxItems;
}
resetSelectedRows() {
this.selectedRows = [];
}
onFilterChange(filter: ServiceTaskFilterCloudModel) {
this.editedFilter = Object.assign({}, filter);
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
}
}