mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3672] - added server order for document -list (#5899)
* [ACA-3672] - added sorting server side for document-list * [ACA-3672] - added and fixed unit tests for backend order * [ACA-3672] - fixed failing test * [ACA-3672] - regenerated doc and renamed variable Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local>
This commit is contained in:
@@ -279,7 +279,7 @@ describe('DataTable', () => {
|
||||
});
|
||||
|
||||
it('should emit "sorting-changed" DOM event', (done) => {
|
||||
const column = new ObjectDataColumn({ key: 'name', sortable: true, direction: 'asc' });
|
||||
const column = new ObjectDataColumn({ key: 'name', sortable: true, direction: 'asc', sortingKey: 'displayName' });
|
||||
dataTable.data = new ObjectDataTableAdapter(
|
||||
[
|
||||
{ name: '1' },
|
||||
@@ -290,7 +290,7 @@ describe('DataTable', () => {
|
||||
dataTable.data.setSorting(new DataSorting('name', 'desc'));
|
||||
|
||||
fixture.nativeElement.addEventListener('sorting-changed', (event: CustomEvent) => {
|
||||
expect(event.detail.key).toBe('name');
|
||||
expect(event.detail.key).toBe('displayName');
|
||||
expect(event.detail.direction).toBe('asc');
|
||||
done();
|
||||
});
|
||||
|
@@ -547,7 +547,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
}
|
||||
this.sorting = [column.key, newDirection];
|
||||
this.data.setSorting(new DataSorting(column.key, newDirection));
|
||||
this.emitSortingChangedEvent(column.key, newDirection);
|
||||
this.emitSortingChangedEvent(column.sortingKey, newDirection);
|
||||
}
|
||||
|
||||
this.keyManager.updateActiveItem(0);
|
||||
|
@@ -42,4 +42,5 @@ export interface DataColumn {
|
||||
copyContent?: boolean;
|
||||
editable?: boolean;
|
||||
focus?: boolean;
|
||||
sortingKey?: string;
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ export class ObjectDataColumn implements DataColumn {
|
||||
template?: TemplateRef<any>;
|
||||
copyContent?: boolean;
|
||||
focus?: boolean;
|
||||
sortingKey?: string;
|
||||
|
||||
constructor(input: any) {
|
||||
this.key = input.key;
|
||||
@@ -43,5 +44,6 @@ export class ObjectDataColumn implements DataColumn {
|
||||
this.template = input.template;
|
||||
this.copyContent = input.copyContent;
|
||||
this.focus = input.focus;
|
||||
this.sortingKey = input.sortingKey;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user