mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3883] Improve edit-process-filter-cloud by adding inputs to control filters, sort and actions (#4127)
* [ADF-3883] Improve edit-process-filter-cloud by adding inputs to control filters, sort and actions * Fixed translate keys * * Added more properties to the editProcessModel * Fix FIlterOption model * Fix import model name * * After rebase* Cherry pick * Updated doc * Revert commit * Revert changes * * Removed obervalu from model* Added edit process/task filter to the demo shell* Refacotred edit task/process filter * Updated test to the recent changes * * Fixed failing e2e tests * Added data-automation-id * * After rebase * * Modified ProcessFilterActionType model* Added condition to get the currect filter after save as* Changed column to sort in the en.json, removed unused keys* Improved onSave editProcessfilter method * imported missing groupModule in the process-service-cloud module * * Fixed e2e test
This commit is contained in:
committed by
Maurizio Vitale
parent
618929cefb
commit
ea733fc996
@@ -539,6 +539,16 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"edit-task-filter": {
|
||||
"properties": [
|
||||
"state", "assignment", "sort", "order"
|
||||
]
|
||||
},
|
||||
"edit-process-filter": {
|
||||
"properties": [
|
||||
"state", "sort", "order", "processName"
|
||||
]
|
||||
},
|
||||
"content-metadata": {
|
||||
"presets": {
|
||||
"default": {
|
||||
|
@@ -49,7 +49,7 @@ export class CloudFiltersDemoComponent implements OnInit {
|
||||
this.currentTaskFilter$ = this.cloudLayoutService.getCurrentTaskFilterParam();
|
||||
this.currentProcessFilter$ = this.cloudLayoutService.getCurrentProcessFilterParam();
|
||||
let root = '';
|
||||
if ( this.route.snapshot && this.route.snapshot.firstChild) {
|
||||
if (this.route.snapshot && this.route.snapshot.firstChild) {
|
||||
root = this.route.snapshot.firstChild.url[0].path;
|
||||
if (root === 'tasks') {
|
||||
this.expandTaskFilter = true;
|
||||
|
@@ -35,14 +35,23 @@ export class CloudLayoutComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
let root: string = '';
|
||||
this.route.params.subscribe((params) => {
|
||||
this.applicationName = params.applicationName;
|
||||
});
|
||||
|
||||
if (this.route.snapshot && this.route.snapshot.firstChild) {
|
||||
root = this.route.snapshot.firstChild.url[0].path;
|
||||
}
|
||||
|
||||
this.route.queryParams.subscribe((params) => {
|
||||
if (params.id) {
|
||||
if (root === 'tasks' && params.id) {
|
||||
this.cloudLayoutService.setCurrentTaskFilterParam({ id: params.id });
|
||||
}
|
||||
|
||||
if (root === 'processes' && params.id) {
|
||||
this.cloudLayoutService.setCurrentProcessFilterParam({ id: params.id });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
<adf-cloud-edit-process-filter
|
||||
[appName]="applicationName"
|
||||
[id]="filterId"
|
||||
[filterProperties]="processFilterProperties"
|
||||
(filterChange)="onFilterChange($event)"
|
||||
(action)="onProcessFilterAction($event)">
|
||||
</adf-cloud-edit-process-filter>
|
||||
@@ -9,6 +10,7 @@
|
||||
<adf-cloud-process-list fxFlex class="adf-cloud-layout-overflow"
|
||||
[applicationName]="editedFilter.appName"
|
||||
[status]="editedFilter.state"
|
||||
[name]="editedFilter.processName"
|
||||
[sorting]="sortArray"
|
||||
(rowClick)="onRowClick($event)"
|
||||
#processCloud>
|
||||
|
@@ -23,8 +23,8 @@ import {
|
||||
ProcessFiltersCloudComponent
|
||||
} from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { UserPreferencesService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
||||
@Component({
|
||||
@@ -33,6 +33,9 @@ import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
})
|
||||
export class ProcessesCloudDemoComponent implements OnInit {
|
||||
|
||||
public static ACTION_SAVE_AS = 'SAVE_AS';
|
||||
static PROCESS_FILTER_PROPERTY_KEYS = 'edit-process-filter.properties';
|
||||
|
||||
@ViewChild('processCloud')
|
||||
processCloud: ProcessListCloudComponent;
|
||||
|
||||
@@ -45,13 +48,20 @@ export class ProcessesCloudDemoComponent implements OnInit {
|
||||
filterId: string = '';
|
||||
sortArray: any = [];
|
||||
selectedRow: any;
|
||||
processFilterProperties: any[] = [];
|
||||
|
||||
editedFilter: ProcessFilterCloudModel;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private cloudLayoutService: CloudLayoutService,
|
||||
private userPreference: UserPreferencesService) {
|
||||
private userPreference: UserPreferencesService,
|
||||
private appConfig: AppConfigService) {
|
||||
const properties = this.appConfig.get<Array<any>>(ProcessesCloudDemoComponent.PROCESS_FILTER_PROPERTY_KEYS);
|
||||
if (properties) {
|
||||
this.processFilterProperties = properties;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -80,7 +90,10 @@ export class ProcessesCloudDemoComponent implements OnInit {
|
||||
this.sortArray = [new ProcessListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
|
||||
}
|
||||
|
||||
onProcessFilterAction(filter: any) {
|
||||
this.cloudLayoutService.setCurrentProcessFilterParam({id: filter.id});
|
||||
onProcessFilterAction(filterAction: any) {
|
||||
this.cloudLayoutService.setCurrentProcessFilterParam({id: filterAction.filter.id});
|
||||
if (filterAction.actionType === ProcessesCloudDemoComponent.ACTION_SAVE_AS) {
|
||||
this.router.navigate([`/cloud/${this.applicationName}/processes/`], { queryParams: filterAction.filter });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
<adf-cloud-edit-task-filter
|
||||
[appName]="applicationName"
|
||||
[id]="filterId"
|
||||
[filterProperties]="taskFilterProperties"
|
||||
(action)="onTaskFilterAction($event)"
|
||||
(filterChange)="onFilterChange($event)">
|
||||
</adf-cloud-edit-task-filter>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
import { TaskListCloudComponent, TaskListCloudSortingModel, TaskFilterCloudModel } from '@alfresco/adf-process-services-cloud';
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { UserPreferencesService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
||||
@@ -28,6 +28,7 @@ import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
export class TasksCloudDemoComponent implements OnInit {
|
||||
|
||||
public static ACTION_SAVE_AS = 'SAVE_AS';
|
||||
static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter.properties';
|
||||
|
||||
@ViewChild('taskCloud')
|
||||
taskCloud: TaskListCloudComponent;
|
||||
@@ -40,6 +41,7 @@ export class TasksCloudDemoComponent implements OnInit {
|
||||
|
||||
sortArray: TaskListCloudSortingModel[];
|
||||
editedFilter: TaskFilterCloudModel;
|
||||
taskFilterProperties: any[] = [];
|
||||
|
||||
filterId;
|
||||
|
||||
@@ -47,7 +49,13 @@ export class TasksCloudDemoComponent implements OnInit {
|
||||
private cloudLayoutService: CloudLayoutService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private userPreference: UserPreferencesService) {
|
||||
private userPreference: UserPreferencesService,
|
||||
private appConfig: AppConfigService) {
|
||||
|
||||
const properties = this.appConfig.get<Array<any>>(TasksCloudDemoComponent.TASK_FILTER_PROPERTY_KEYS);
|
||||
if (properties) {
|
||||
this.taskFilterProperties = properties;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -48,6 +48,20 @@
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item (click)="editProcessFilterConfClick()">
|
||||
<a matLine id="adf-edit-process-filter-conf">Edit process filter</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item (click)="editTaskFilterConfClick()">
|
||||
<a matLine id="adf-edit-task-filter-conf">Edit task filter</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
<div>
|
||||
|
@@ -112,6 +112,18 @@ export class ConfigEditorComponent {
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
editProcessFilterConfClick() {
|
||||
this.code = JSON.stringify(this.appConfig.config['edit-process-filter']);
|
||||
this.field = 'edit-process-filter';
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
editTaskFilterConfClick() {
|
||||
this.code = JSON.stringify(this.appConfig.config['edit-task-filter']);
|
||||
this.field = 'edit-task-filter';
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
indentCode() {
|
||||
setTimeout(() => {
|
||||
this.editor.getAction('editor.action.formatDocument').run();
|
||||
|
Reference in New Issue
Block a user