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;
|
startedDateType: DateCloudFilterType | null;
|
||||||
suspendedDateType: DateCloudFilterType | null;
|
suspendedDateType: DateCloudFilterType | null;
|
||||||
includeSubprocesses: boolean | null;
|
includeSubprocesses: boolean | null;
|
||||||
|
includeUnlinkedProcesses: boolean | null;
|
||||||
completedDate: Date | null;
|
completedDate: Date | null;
|
||||||
environmentId: string | null;
|
environmentId: string | null;
|
||||||
showCounter: boolean;
|
showCounter: boolean;
|
||||||
@@ -114,6 +115,7 @@ export class ProcessFilterCloudModel {
|
|||||||
this._suspendedFrom = obj._suspendedFrom || null;
|
this._suspendedFrom = obj._suspendedFrom || null;
|
||||||
this._suspendedTo = obj._suspendedTo || null;
|
this._suspendedTo = obj._suspendedTo || null;
|
||||||
this.includeSubprocesses = obj.includeSubprocesses || null;
|
this.includeSubprocesses = obj.includeSubprocesses || null;
|
||||||
|
this.includeUnlinkedProcesses = obj.includeUnlinkedProcesses || null;
|
||||||
|
|
||||||
this.initArrayProperties(obj);
|
this.initArrayProperties(obj);
|
||||||
}
|
}
|
||||||
|
|||||||
+31
@@ -677,6 +677,7 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
expect(component.processListRequestNode.appVersion.length).toEqual(0);
|
expect(component.processListRequestNode.appVersion.length).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('includeSubprocesses', () => {
|
||||||
it('should set includeSubprocesses to true in request node when input is true', () => {
|
it('should set includeSubprocesses to true in request node when input is true', () => {
|
||||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||||
component.includeSubprocesses = true;
|
component.includeSubprocesses = true;
|
||||||
@@ -703,6 +704,36 @@ describe('ProcessListCloudComponent', () => {
|
|||||||
|
|
||||||
expect(component.processListRequestNode.includeSubprocesses).toBeNull();
|
expect(component.processListRequestNode.includeSubprocesses).toBeNull();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
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.includeUnlinkedProcesses).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
|
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.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) => {
|
it('should return the results if an application name is given', (done) => {
|
||||||
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
spyOn(processListCloudService, 'fetchProcessList').and.returnValue(of(fakeProcessCloudList));
|
||||||
|
|||||||
+5
@@ -294,6 +294,10 @@ export class ProcessListCloudComponent
|
|||||||
@Input()
|
@Input()
|
||||||
includeSubprocesses: boolean | null = null;
|
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. */
|
/** Emitted when a row in the process list is clicked. */
|
||||||
@Output()
|
@Output()
|
||||||
rowClick: EventEmitter<string> = new EventEmitter<string>();
|
rowClick: EventEmitter<string> = new EventEmitter<string>();
|
||||||
@@ -611,6 +615,7 @@ export class ProcessListCloudComponent
|
|||||||
suspendedFrom: this.suspendedFrom,
|
suspendedFrom: this.suspendedFrom,
|
||||||
suspendedTo: this.suspendedTo,
|
suspendedTo: this.suspendedTo,
|
||||||
includeSubprocesses: this.includeSubprocesses,
|
includeSubprocesses: this.includeSubprocesses,
|
||||||
|
includeUnlinkedProcesses: this.includeUnlinkedProcesses,
|
||||||
processVariableKeys: this.getVariableDefinitionsRequestModel(),
|
processVariableKeys: this.getVariableDefinitionsRequestModel(),
|
||||||
processVariableFilters: this.processVariables
|
processVariableFilters: this.processVariables
|
||||||
};
|
};
|
||||||
|
|||||||
+2
@@ -103,6 +103,7 @@ export class ProcessListRequestModel {
|
|||||||
suspendedFrom?: string;
|
suspendedFrom?: string;
|
||||||
suspendedTo?: string;
|
suspendedTo?: string;
|
||||||
includeSubprocesses?: boolean;
|
includeSubprocesses?: boolean;
|
||||||
|
includeUnlinkedProcesses?: boolean;
|
||||||
|
|
||||||
processVariableFilters?: ProcessVariableFilterModel[];
|
processVariableFilters?: ProcessVariableFilterModel[];
|
||||||
processVariableKeys?: string[];
|
processVariableKeys?: string[];
|
||||||
@@ -132,6 +133,7 @@ export class ProcessListRequestModel {
|
|||||||
this.suspendedFrom = obj.suspendedFrom;
|
this.suspendedFrom = obj.suspendedFrom;
|
||||||
this.suspendedTo = obj.suspendedTo;
|
this.suspendedTo = obj.suspendedTo;
|
||||||
this.includeSubprocesses = obj.includeSubprocesses;
|
this.includeSubprocesses = obj.includeSubprocesses;
|
||||||
|
this.includeUnlinkedProcesses = obj.includeUnlinkedProcesses;
|
||||||
|
|
||||||
this.processVariableKeys = obj.processVariableKeys;
|
this.processVariableKeys = obj.processVariableKeys;
|
||||||
this.processVariableFilters = obj.processVariableFilters;
|
this.processVariableFilters = obj.processVariableFilters;
|
||||||
|
|||||||
+44
@@ -175,6 +175,7 @@ describe('ProcessListCloudService', () => {
|
|||||||
expect(error).toBe('Appname not configured');
|
expect(error).toBe('Appname not configured');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('includeSubprocesses', () => {
|
||||||
it('should include includeSubprocesses=true in body', async () => {
|
it('should include includeSubprocesses=true in body', async () => {
|
||||||
const processRequest = {
|
const processRequest = {
|
||||||
appName: 'fakeName',
|
appName: 'fakeName',
|
||||||
@@ -216,6 +217,49 @@ describe('ProcessListCloudService', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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));
|
||||||
|
|
||||||
|
expect(requestBodyParams).toEqual({ includeUnlinkedProcesses: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
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));
|
||||||
|
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('getAdminProcessRequest', () => {
|
describe('getAdminProcessRequest', () => {
|
||||||
it('should append to the call all the parameters', async () => {
|
it('should append to the call all the parameters', async () => {
|
||||||
const processRequest = { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' } as ProcessQueryCloudRequestModel;
|
const processRequest = { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' } as ProcessQueryCloudRequestModel;
|
||||||
|
|||||||
+2
-1
@@ -119,7 +119,8 @@ export class ProcessListCloudService extends BaseCloudService {
|
|||||||
suspendedTo: requestNode.suspendedTo,
|
suspendedTo: requestNode.suspendedTo,
|
||||||
processVariableKeys: requestNode.processVariableKeys,
|
processVariableKeys: requestNode.processVariableKeys,
|
||||||
processVariableFilters: requestNode.processVariableFilters,
|
processVariableFilters: requestNode.processVariableFilters,
|
||||||
includeSubprocesses: requestNode.includeSubprocesses
|
includeSubprocesses: requestNode.includeSubprocesses,
|
||||||
|
includeUnlinkedProcesses: requestNode.includeUnlinkedProcesses
|
||||||
};
|
};
|
||||||
|
|
||||||
if (requestNode.sorting) {
|
if (requestNode.sorting) {
|
||||||
|
|||||||
Reference in New Issue
Block a user