Revert "AAE-40254 Remove excludeByProcessCategoryName input (#11392)" (#11395)

This reverts commit 3d07d7e942.
This commit is contained in:
Wiktor Danielewski
2025-11-27 11:34:34 +01:00
committed by GitHub
parent 81658d0588
commit 533bf89b18
8 changed files with 48 additions and 5 deletions
@@ -65,4 +65,14 @@ describe('ProcessFilterCloudModel', () => {
expect(model.startFrom).toEqual(startOfDay(date).toISOString());
expect(model.startTo).toEqual(endOfDay(date).toISOString());
});
it('should assign value to the excludeByProcessCategoryName if provided', () => {
const model = new ProcessFilterCloudModel({ excludeByProcessCategoryName: 'test' });
expect(model.excludeByProcessCategoryName).toBe('test');
});
it('should assign null to the excludeByProcessCategoryName if value not provided', () => {
const model = new ProcessFilterCloudModel({});
expect(model.excludeByProcessCategoryName).toBeNull();
});
});
@@ -58,6 +58,7 @@ export class ProcessFilterCloudModel {
initiators: string[] | null;
appVersions: string[] | null;
statuses: string[] | null;
excludeByProcessCategoryName: string | null;
processVariableFilters?: ProcessVariableFilterModel[];
@@ -110,6 +111,7 @@ export class ProcessFilterCloudModel {
this.completedFrom = obj._completedFrom || null;
this.completedTo = obj._completedTo || null;
this.completedDate = obj.completedDate || null;
this.excludeByProcessCategoryName = obj.excludeByProcessCategoryName || null;
this._suspendedFrom = obj._suspendedFrom || null;
this._suspendedTo = obj._suspendedTo || null;
@@ -846,6 +846,28 @@ describe('ProcessListCloudComponent', () => {
expect(fetchProcessListSpy).toHaveBeenCalled();
});
it('should reload process list when excludeByProcessCategoryName changes', () => {
const fetchProcessListSpy = spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
fixture.componentRef.setInput('excludeByProcessCategoryName', 'mock-category');
fixture.detectChanges();
fixture.componentRef.setInput('excludeByProcessCategoryName', 'mock-category-2');
fixture.detectChanges();
expect(fetchProcessListSpy).toHaveBeenCalledTimes(2);
expect(fetchProcessListSpy).toHaveBeenCalledWith(
jasmine.objectContaining({
excludeByProcessCategoryName: 'mock-category'
})
);
expect(fetchProcessListSpy).toHaveBeenCalledWith(
jasmine.objectContaining({
excludeByProcessCategoryName: 'mock-category-2'
})
);
});
it('should reload process list when sorting on a column changes', () => {
const fetchProcessListSpy = spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
component.onSortingChanged(
@@ -290,6 +290,8 @@ export class ProcessListCloudComponent
@Input()
processVariables: ProcessVariableFilterModel[];
@Input() excludeByProcessCategoryName: string = '';
/** Emitted when a row in the process list is clicked. */
@Output()
rowClick: EventEmitter<string> = new EventEmitter<string>();
@@ -607,7 +609,8 @@ export class ProcessListCloudComponent
suspendedFrom: this.suspendedFrom,
suspendedTo: this.suspendedTo,
processVariableKeys: this.getVariableDefinitionsRequestModel(),
processVariableFilters: this.processVariables
processVariableFilters: this.processVariables,
excludeByProcessCategoryName: this.excludeByProcessCategoryName
};
return new ProcessListRequestModel(requestNode);
@@ -102,6 +102,7 @@ export class ProcessListRequestModel {
completedTo?: string;
suspendedFrom?: string;
suspendedTo?: string;
excludeByProcessCategoryName?: string;
processVariableFilters?: ProcessVariableFilterModel[];
processVariableKeys?: string[];
@@ -132,6 +133,7 @@ export class ProcessListRequestModel {
this.suspendedTo = obj.suspendedTo;
this.processVariableKeys = obj.processVariableKeys;
this.processVariableFilters = obj.processVariableFilters;
this.excludeByProcessCategoryName = obj.excludeByProcessCategoryName;
}
}
@@ -119,7 +119,8 @@ describe('ProcessListCloudService', () => {
const processRequest = {
appName: 'fakeName',
pagination: { skipCount: 0, maxItems: 20 },
parentId: ['fakeParentId']
parentId: ['fakeParentId'],
excludeByProcessCategoryName: 'fakeCategory'
} as ProcessListRequestModel;
requestSpy.and.callFake(returnCallQueryParameters);
@@ -132,13 +133,14 @@ describe('ProcessListCloudService', () => {
const processRequest = {
appName: 'fakeName',
pagination: { skipCount: 0, maxItems: 20 },
parentId: ['fakeParentId']
parentId: ['fakeParentId'],
excludeByProcessCategoryName: 'fakeCategory'
} as ProcessListRequestModel;
requestSpy.and.callFake(returnCallBody);
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
expect(requestBodyParams).toEqual({ parentId: ['fakeParentId'] });
expect(requestBodyParams).toEqual({ excludeByProcessCategoryName: 'fakeCategory', parentId: ['fakeParentId'] });
});
it('should concat the app name to the request url', async () => {
@@ -118,7 +118,8 @@ export class ProcessListCloudService extends BaseCloudService {
suspendedFrom: requestNode.suspendedFrom,
suspendedTo: requestNode.suspendedTo,
processVariableKeys: requestNode.processVariableKeys,
processVariableFilters: requestNode.processVariableFilters
processVariableFilters: requestNode.processVariableFilters,
excludeByProcessCategoryName: requestNode.excludeByProcessCategoryName
};
if (requestNode.sorting) {
@@ -26,6 +26,7 @@ import { TaskVariableCloud } from '../../../form/models/task-variable-cloud.mode
export interface QueryParams {
include: string;
excludedCategory?: string;
}
@Injectable({