mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-39668 Add ability to filter by unlinked processes (#11461)
This commit is contained in:
+2
@@ -48,6 +48,7 @@ export class ProcessFilterCloudModel {
|
||||
startedDateType: DateCloudFilterType | null;
|
||||
suspendedDateType: DateCloudFilterType | null;
|
||||
includeSubprocesses: boolean | null;
|
||||
includeUnlinkedProcesses: boolean | null;
|
||||
completedDate: Date | null;
|
||||
environmentId: string | null;
|
||||
showCounter: boolean;
|
||||
@@ -114,6 +115,7 @@ export class ProcessFilterCloudModel {
|
||||
this._suspendedFrom = obj._suspendedFrom || null;
|
||||
this._suspendedTo = obj._suspendedTo || null;
|
||||
this.includeSubprocesses = obj.includeSubprocesses || null;
|
||||
this.includeUnlinkedProcesses = obj.includeUnlinkedProcesses || null;
|
||||
|
||||
this.initArrayProperties(obj);
|
||||
}
|
||||
|
||||
+50
-19
@@ -677,31 +677,62 @@ describe('ProcessListCloudComponent', () => {
|
||||
expect(component.processListRequestNode.appVersion.length).toEqual(0);
|
||||
});
|
||||
|
||||
it('should set includeSubprocesses to true in request node when input is true', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = true;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
describe('includeSubprocesses', () => {
|
||||
it('should set includeSubprocesses to true in request node when input is true', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = true;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeTrue();
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeTrue();
|
||||
});
|
||||
|
||||
it('should set includeSubprocesses to false in request node when input is false', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = false;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeFalse();
|
||||
});
|
||||
|
||||
it('should omit includeSubprocesses in request node when input is null', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = null;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
it('should set includeSubprocesses to false in request node when input is false', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = false;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
describe('includeUnlinkedProcesses', () => {
|
||||
it('should set includeUnlinkedProcesses to true in request node when input is true', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeUnlinkedProcesses = true;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeFalse();
|
||||
});
|
||||
expect(component.processListRequestNode.includeUnlinkedProcesses).toBeTrue();
|
||||
});
|
||||
|
||||
it('should omit includeSubprocesses in request node when input is null', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeSubprocesses = null;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
it('should set includeUnlinkedProcesses to false in request node when input is false', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeUnlinkedProcesses = false;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeSubprocesses).toBeNull();
|
||||
expect(component.processListRequestNode.includeUnlinkedProcesses).toBeFalse();
|
||||
});
|
||||
|
||||
it('should omit includeUnlinkedProcesses in request node when input is null', () => {
|
||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||
component.includeUnlinkedProcesses = null;
|
||||
component.ngAfterContentInit();
|
||||
component.reload();
|
||||
|
||||
expect(component.processListRequestNode.includeUnlinkedProcesses).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the results if an application name is given', (done) => {
|
||||
|
||||
+5
@@ -294,6 +294,10 @@ export class ProcessListCloudComponent
|
||||
@Input()
|
||||
includeSubprocesses: boolean | null = null;
|
||||
|
||||
/** Include unlinked processes in the process list. */
|
||||
@Input()
|
||||
includeUnlinkedProcesses: boolean | null = null;
|
||||
|
||||
/** Emitted when a row in the process list is clicked. */
|
||||
@Output()
|
||||
rowClick: EventEmitter<string> = new EventEmitter<string>();
|
||||
@@ -611,6 +615,7 @@ export class ProcessListCloudComponent
|
||||
suspendedFrom: this.suspendedFrom,
|
||||
suspendedTo: this.suspendedTo,
|
||||
includeSubprocesses: this.includeSubprocesses,
|
||||
includeUnlinkedProcesses: this.includeUnlinkedProcesses,
|
||||
processVariableKeys: this.getVariableDefinitionsRequestModel(),
|
||||
processVariableFilters: this.processVariables
|
||||
};
|
||||
|
||||
+2
@@ -103,6 +103,7 @@ export class ProcessListRequestModel {
|
||||
suspendedFrom?: string;
|
||||
suspendedTo?: string;
|
||||
includeSubprocesses?: boolean;
|
||||
includeUnlinkedProcesses?: boolean;
|
||||
|
||||
processVariableFilters?: ProcessVariableFilterModel[];
|
||||
processVariableKeys?: string[];
|
||||
@@ -132,6 +133,7 @@ export class ProcessListRequestModel {
|
||||
this.suspendedFrom = obj.suspendedFrom;
|
||||
this.suspendedTo = obj.suspendedTo;
|
||||
this.includeSubprocesses = obj.includeSubprocesses;
|
||||
this.includeUnlinkedProcesses = obj.includeUnlinkedProcesses;
|
||||
|
||||
this.processVariableKeys = obj.processVariableKeys;
|
||||
this.processVariableFilters = obj.processVariableFilters;
|
||||
|
||||
+73
-29
@@ -175,44 +175,88 @@ describe('ProcessListCloudService', () => {
|
||||
expect(error).toBe('Appname not configured');
|
||||
});
|
||||
|
||||
it('should include includeSubprocesses=true in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: true
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
describe('includeSubprocesses', () => {
|
||||
it('should include includeSubprocesses=true in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: true
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({ includeSubprocesses: true });
|
||||
expect(requestBodyParams).toEqual({ includeSubprocesses: true });
|
||||
});
|
||||
|
||||
it('should include includeSubprocesses=false in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: false
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({ includeSubprocesses: false });
|
||||
});
|
||||
|
||||
it('should omit includeSubprocesses when null', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: null
|
||||
} as unknown as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({});
|
||||
expect(requestBodyParams.includeSubprocesses).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
it('should include includeSubprocesses=false in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: false
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
describe('includeUnlinkedProcesses', () => {
|
||||
it('should include includeUnlinkedProcesses=true in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeUnlinkedProcesses: true
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({ includeSubprocesses: false });
|
||||
});
|
||||
expect(requestBodyParams).toEqual({ includeUnlinkedProcesses: true });
|
||||
});
|
||||
|
||||
it('should omit includeSubprocesses when null', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeSubprocesses: null
|
||||
} as unknown as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
it('should include includeUnlinkedProcesses=false in body', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeUnlinkedProcesses: false
|
||||
} as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({});
|
||||
expect(requestBodyParams.includeSubprocesses).toBeUndefined();
|
||||
expect(requestBodyParams).toEqual({ includeUnlinkedProcesses: false });
|
||||
});
|
||||
|
||||
it('should omit includeUnlinkedProcesses when null', async () => {
|
||||
const processRequest = {
|
||||
appName: 'fakeName',
|
||||
pagination: { skipCount: 0, maxItems: 20 },
|
||||
includeUnlinkedProcesses: null
|
||||
} as unknown as ProcessListRequestModel;
|
||||
requestSpy.and.callFake(returnCallBody);
|
||||
|
||||
const requestBodyParams = await firstValueFrom(service.fetchProcessList(processRequest));
|
||||
|
||||
expect(requestBodyParams).toEqual({});
|
||||
expect(requestBodyParams.includeUnlinkedProcesses).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -119,7 +119,8 @@ export class ProcessListCloudService extends BaseCloudService {
|
||||
suspendedTo: requestNode.suspendedTo,
|
||||
processVariableKeys: requestNode.processVariableKeys,
|
||||
processVariableFilters: requestNode.processVariableFilters,
|
||||
includeSubprocesses: requestNode.includeSubprocesses
|
||||
includeSubprocesses: requestNode.includeSubprocesses,
|
||||
includeUnlinkedProcesses: requestNode.includeUnlinkedProcesses
|
||||
};
|
||||
|
||||
if (requestNode.sorting) {
|
||||
|
||||
Reference in New Issue
Block a user