mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-25144 Process variables filters (#10405)
* AAE-25144 Implements process variables filters * update * fix lint
This commit is contained in:
@@ -16,3 +16,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './interface/index';
|
export * from './interface/index';
|
||||||
|
export * from './date-range-filter/date-range-filter.service';
|
||||||
|
@@ -21,6 +21,16 @@ import { DateCloudFilterType } from '../../../models/date-cloud-filter.model';
|
|||||||
import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service';
|
import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service';
|
||||||
import { ComponentSelectionMode } from '../../../types';
|
import { ComponentSelectionMode } from '../../../types';
|
||||||
|
|
||||||
|
export type ProcessFilterOperators = 'eq' | 'like' | 'gt' | 'gte' | 'lt' | 'lte';
|
||||||
|
|
||||||
|
export interface ProcessVariableFilterModel {
|
||||||
|
processDefinitionKey: string;
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
value: string | number;
|
||||||
|
operator: ProcessFilterOperators;
|
||||||
|
}
|
||||||
|
|
||||||
export class ProcessFilterCloudModel {
|
export class ProcessFilterCloudModel {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -53,6 +63,8 @@ export class ProcessFilterCloudModel {
|
|||||||
appVersions: string[] | null;
|
appVersions: string[] | null;
|
||||||
statuses: string[] | null;
|
statuses: string[] | null;
|
||||||
|
|
||||||
|
processVariableFilters?: ProcessVariableFilterModel[]
|
||||||
|
|
||||||
private dateRangeFilterService = new DateRangeFilterService();
|
private dateRangeFilterService = new DateRangeFilterService();
|
||||||
private _completedFrom: string;
|
private _completedFrom: string;
|
||||||
private _completedTo: string;
|
private _completedTo: string;
|
||||||
@@ -104,6 +116,7 @@ export class ProcessFilterCloudModel {
|
|||||||
this.initiators = obj.initiators || null;
|
this.initiators = obj.initiators || null;
|
||||||
this.appVersions = obj.appVersions || null;
|
this.appVersions = obj.appVersions || null;
|
||||||
this.statuses = obj.statuses || null;
|
this.statuses = obj.statuses || null;
|
||||||
|
this.processVariableFilters = obj.processVariableFilters ?? [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,6 +63,7 @@ import {
|
|||||||
} from '../../../models/data-column-custom-data';
|
} from '../../../models/data-column-custom-data';
|
||||||
import { VariableMapperService } from '../../../services/variable-mapper.sevice';
|
import { VariableMapperService } from '../../../services/variable-mapper.sevice';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
import { ProcessVariableFilterModel } from '../../process-filters/models/process-filter-cloud.model';
|
||||||
|
|
||||||
const PRESET_KEY = 'adf-cloud-process-list.presets';
|
const PRESET_KEY = 'adf-cloud-process-list.presets';
|
||||||
|
|
||||||
@@ -235,6 +236,13 @@ export class ProcessListCloudComponent
|
|||||||
@Input()
|
@Input()
|
||||||
statuses: string[] = [];
|
statuses: string[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the processes. Display only processes with specific process variables.
|
||||||
|
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
processVariables: ProcessVariableFilterModel[]
|
||||||
|
|
||||||
/** Emitted when a row in the process list is clicked. */
|
/** Emitted when a row in the process list is clicked. */
|
||||||
@Output()
|
@Output()
|
||||||
rowClick: EventEmitter<string> = new EventEmitter<string>();
|
rowClick: EventEmitter<string> = new EventEmitter<string>();
|
||||||
@@ -540,7 +548,8 @@ export class ProcessListCloudComponent
|
|||||||
completedTo: this.completedTo,
|
completedTo: this.completedTo,
|
||||||
suspendedFrom: this.suspendedFrom,
|
suspendedFrom: this.suspendedFrom,
|
||||||
suspendedTo: this.suspendedTo,
|
suspendedTo: this.suspendedTo,
|
||||||
processVariableKeys: this.getVariableDefinitionsRequestModel()
|
processVariableKeys: this.getVariableDefinitionsRequestModel(),
|
||||||
|
processVariableFilters: this.processVariables
|
||||||
};
|
};
|
||||||
|
|
||||||
return new ProcessListRequestModel(requestNode);
|
return new ProcessListRequestModel(requestNode);
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { Pagination } from '@alfresco/js-api';
|
import { Pagination } from '@alfresco/js-api';
|
||||||
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from './process-list-sorting.model';
|
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from './process-list-sorting.model';
|
||||||
import { ProcessFilterCloudModel } from '../../process-filters/models/process-filter-cloud.model';
|
import { ProcessFilterCloudModel, ProcessVariableFilterModel } from '../../process-filters/models/process-filter-cloud.model';
|
||||||
|
|
||||||
export class ProcessQueryCloudRequestModel {
|
export class ProcessQueryCloudRequestModel {
|
||||||
appName: string;
|
appName: string;
|
||||||
@@ -79,14 +79,6 @@ export class ProcessQueryCloudRequestModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProcessListRequestProcessVariableFilter {
|
|
||||||
processDefinitionKey?: string;
|
|
||||||
name?: string;
|
|
||||||
type?: string;
|
|
||||||
value?: string;
|
|
||||||
operator?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ProcessListRequestModel {
|
export class ProcessListRequestModel {
|
||||||
appName: string;
|
appName: string;
|
||||||
pagination?: Pagination;
|
pagination?: Pagination;
|
||||||
@@ -105,7 +97,7 @@ export class ProcessListRequestModel {
|
|||||||
suspendedFrom?: string;
|
suspendedFrom?: string;
|
||||||
suspendedTo?: string;
|
suspendedTo?: string;
|
||||||
|
|
||||||
processVariableFilters?: ProcessListRequestProcessVariableFilter[];
|
processVariableFilters?: ProcessVariableFilterModel[];
|
||||||
processVariableKeys?: string[];
|
processVariableKeys?: string[];
|
||||||
|
|
||||||
constructor(obj: Partial<ProcessListRequestModel>) {
|
constructor(obj: Partial<ProcessListRequestModel>) {
|
||||||
@@ -130,6 +122,7 @@ export class ProcessListRequestModel {
|
|||||||
this.suspendedFrom = obj.suspendedFrom;
|
this.suspendedFrom = obj.suspendedFrom;
|
||||||
this.suspendedTo = obj.suspendedTo;
|
this.suspendedTo = obj.suspendedTo;
|
||||||
this.processVariableKeys = obj.processVariableKeys;
|
this.processVariableKeys = obj.processVariableKeys;
|
||||||
|
this.processVariableFilters = obj.processVariableFilters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +141,7 @@ export class ProcessFilterCloudAdapter extends ProcessListRequestModel {
|
|||||||
initiator: filter.initiators,
|
initiator: filter.initiators,
|
||||||
appVersion: filter.appVersions,
|
appVersion: filter.appVersions,
|
||||||
status: filter.statuses,
|
status: filter.statuses,
|
||||||
|
processVariableFilters: filter.processVariableFilters,
|
||||||
lastModifiedFrom: filter.lastModifiedFrom?.toISOString(),
|
lastModifiedFrom: filter.lastModifiedFrom?.toISOString(),
|
||||||
lasModifiedTo: filter.lastModifiedTo?.toISOString(),
|
lasModifiedTo: filter.lastModifiedTo?.toISOString(),
|
||||||
startFrom: filter.startFrom,
|
startFrom: filter.startFrom,
|
||||||
|
@@ -114,7 +114,8 @@ export class ProcessListCloudService extends BaseCloudService {
|
|||||||
completedTo: requestNode.completedTo,
|
completedTo: requestNode.completedTo,
|
||||||
suspendedFrom: requestNode.suspendedFrom,
|
suspendedFrom: requestNode.suspendedFrom,
|
||||||
suspendedTo: requestNode.suspendedTo,
|
suspendedTo: requestNode.suspendedTo,
|
||||||
processVariableKeys: requestNode.processVariableKeys
|
processVariableKeys: requestNode.processVariableKeys,
|
||||||
|
processVariableFilters: requestNode.processVariableFilters
|
||||||
};
|
};
|
||||||
|
|
||||||
if (requestNode.sorting) {
|
if (requestNode.sorting) {
|
||||||
|
Reference in New Issue
Block a user