mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[MNT-25501]: APS - Process instance pagination failure in ADF due to conflicting parameters sent from ADF to APS API (#11615)
* [MNT-25501]: removes start param from the processes request * [MNT-25501]: minor fixes
This commit is contained in:
+25
@@ -40,6 +40,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
|||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||||
|
import { ProcessInstanceQueryRepresentation } from '@alfresco/js-api';
|
||||||
|
|
||||||
describe('ProcessInstanceListComponent', () => {
|
describe('ProcessInstanceListComponent', () => {
|
||||||
let fixture: ComponentFixture<ProcessInstanceListComponent>;
|
let fixture: ComponentFixture<ProcessInstanceListComponent>;
|
||||||
@@ -314,6 +315,30 @@ describe('ProcessInstanceListComponent', () => {
|
|||||||
expect(customColumn[1].nativeElement.innerText).toEqual('initiator - fake-user-2');
|
expect(customColumn[1].nativeElement.innerText).toEqual('initiator - fake-user-2');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should create proper request node once reload called', () => {
|
||||||
|
component.appId = 1;
|
||||||
|
component.processDefinitionId = 'simple-process';
|
||||||
|
component.processInstanceId = '123';
|
||||||
|
component.sort = 'created-desc';
|
||||||
|
component.state = 'all';
|
||||||
|
component.page = 0;
|
||||||
|
component.size = 25;
|
||||||
|
|
||||||
|
const expectedRequestNode: ProcessInstanceQueryRepresentation = {
|
||||||
|
appDefinitionId: 1,
|
||||||
|
processDefinitionId: 'simple-process',
|
||||||
|
processInstanceId: '123',
|
||||||
|
state: 'all',
|
||||||
|
sort: 'created-desc',
|
||||||
|
page: 0,
|
||||||
|
size: 25
|
||||||
|
};
|
||||||
|
|
||||||
|
component.reload();
|
||||||
|
expect(component.requestNode).toEqual(expectedRequestNode);
|
||||||
|
expect(Object.keys(component.requestNode)).not.toContain('start');
|
||||||
|
});
|
||||||
|
|
||||||
describe('component changes', () => {
|
describe('component changes', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.data = new ObjectDataTableAdapter([], [{ type: 'text', key: 'fake-id', title: 'Name' }]);
|
component.data = new ObjectDataTableAdapter([], [{ type: 'text', key: 'fake-id', title: 'Name' }]);
|
||||||
|
|||||||
+6
-3
@@ -192,7 +192,11 @@ export class ProcessInstanceListComponent extends DataTableSchema implements OnC
|
|||||||
sorting: any[] = ['created', 'desc'];
|
sorting: any[] = ['created', 'desc'];
|
||||||
pagination: BehaviorSubject<PaginationModel>;
|
pagination: BehaviorSubject<PaginationModel>;
|
||||||
|
|
||||||
constructor(private processService: ProcessService, private userPreferences: UserPreferencesService, appConfig: AppConfigService) {
|
constructor(
|
||||||
|
private readonly processService: ProcessService,
|
||||||
|
private readonly userPreferences: UserPreferencesService,
|
||||||
|
appConfig: AppConfigService
|
||||||
|
) {
|
||||||
super(appConfig, PRESET_KEY, processPresetsDefaultModel);
|
super(appConfig, PRESET_KEY, processPresetsDefaultModel);
|
||||||
this.size = this.userPreferences.paginationSize;
|
this.size = this.userPreferences.paginationSize;
|
||||||
|
|
||||||
@@ -324,8 +328,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements OnC
|
|||||||
state: this.state,
|
state: this.state,
|
||||||
sort: this.sort,
|
sort: this.sort,
|
||||||
page: this.page,
|
page: this.page,
|
||||||
size: this.size,
|
size: this.size
|
||||||
start: 0
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user