mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +00:00
44024: simple search ui finished
This commit is contained in:
@@ -119,16 +119,15 @@ export function isEmpty(obj?: any): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (objectType === 'object') {
|
if (objectType === 'object') {
|
||||||
|
if (Object.keys(obj).length === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const length = obj.length;
|
const length = obj.length;
|
||||||
if (typeof length === 'number') {
|
if (typeof length === 'number') {
|
||||||
return !length;
|
return !length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(obj).length === 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
[disabled]="paginationOptions.disabled"
|
[disabled]="paginationOptions.disabled"
|
||||||
[ellipses]="paginationOptions.ellipses"
|
[ellipses]="paginationOptions.ellipses"
|
||||||
[maxSize]="(isXs)?5:paginationOptions.maxSize"
|
[maxSize]="(isXs)?5:paginationOptions.maxSize"
|
||||||
[(page)]="currentPage"
|
[page]="currentPage"
|
||||||
(pageChange)="doPageChange($event)"
|
(pageChange)="doPageChange($event)"
|
||||||
[pageSize]="pageSize"
|
[pageSize]="pageSize"
|
||||||
[rotate]="paginationOptions.rotate"
|
[rotate]="paginationOptions.rotate"
|
||||||
|
@@ -258,22 +258,22 @@ describe('Pagination component', () => {
|
|||||||
expect(testComp.pageSizeChanged).toHaveBeenCalledWith(5);
|
expect(testComp.pageSizeChanged).toHaveBeenCalledWith(5);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// it('should set correct route parameters', fakeAsync(() => {
|
it('should set correct route parameters', fakeAsync(() => {
|
||||||
// const paginationComponent: PaginationComponent = testFixture.debugElement.query(By.css('ds-pagination')).references.p;
|
const paginationComponent: PaginationComponent = testFixture.debugElement.query(By.css('ds-pagination')).references.p;
|
||||||
// routerStub = testFixture.debugElement.injector.get(Router) as any;
|
routerStub = testFixture.debugElement.injector.get(Router) as any;
|
||||||
//
|
|
||||||
// testComp.collectionSize = 60;
|
testComp.collectionSize = 60;
|
||||||
//
|
|
||||||
// changePage(testFixture, 3);
|
changePage(testFixture, 3);
|
||||||
// tick();
|
tick();
|
||||||
// expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 10, sortDirection: 0, sortField: 'name' } });
|
expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 10, sortDirection: 0, sortField: 'name' } });
|
||||||
// expect(paginationComponent.currentPage).toEqual(3);
|
expect(paginationComponent.currentPage).toEqual(3);
|
||||||
//
|
|
||||||
// changePageSize(testFixture, '20');
|
changePageSize(testFixture, '20');
|
||||||
// tick();
|
tick();
|
||||||
// expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 20, sortDirection: 0, sortField: 'name' } });
|
expect(routerStub.navigate).toHaveBeenCalledWith([], { queryParams: { pageId: 'test', page: 3, pageSize: 20, sortDirection: 0, sortField: 'name' } });
|
||||||
// expect(paginationComponent.pageSize).toEqual(20);
|
expect(paginationComponent.pageSize).toEqual(20);
|
||||||
// }));
|
}));
|
||||||
|
|
||||||
it('should get parameters from route', () => {
|
it('should get parameters from route', () => {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user