Skip to content
Snippets Groups Projects
Commit 491d40c0 authored by Jonas Van Goolen's avatar Jonas Van Goolen
Browse files

#150 Intermediate commit

parent c5bfbeaa
Branches
Tags
No related merge requests found
......@@ -57,14 +57,6 @@ export class SearchPageComponent implements OnInit, OnDestroy {
pagination.currentPage = 1;
pagination.pageSize = 10;
// TODO Update to accommodate view switcher
this.route.queryParams.map((params) => {
if (isNotEmpty(params.view) && params.view == ViewMode.Grid) {
pagination.pageSize = 12;
}
});
const sort: SortOptions = new SortOptions();
this.sortConfig=sort;
this.searchOptions = this.service.searchOptions;
......@@ -80,6 +72,8 @@ export class SearchPageComponent implements OnInit, OnDestroy {
this.scope = params.scope;
const page = +params.page || this.searchOptions.pagination.currentPage;
const pageSize = +params.pageSize || this.searchOptions.pagination.pageSize;
const sortDirection = +params.sortDirection || this.searchOptions.sort.direction;
const pagination = Object.assign({},
this.searchOptions.pagination,
......
......@@ -28,7 +28,7 @@ export class ObjectCollectionComponent implements OnChanges, OnInit {
@Input() config?: PaginationComponentOptions;
@Input() sortConfig: SortOptions;
pageInfo: Observable<PageInfo>;
private sub;
/**
* An event fired when the page is changed.
* Event's payload equals to the newly selected page.
......@@ -67,6 +67,14 @@ export class ObjectCollectionComponent implements OnChanges, OnInit {
ngOnInit(): void {
this.pageInfo = this.objects.pageInfo;
this.sub = this.route
.queryParams
.subscribe((params) => {
if(isNotEmpty(params.view)){
this.currentMode = params.view;
}
});
}
/**
......
......@@ -70,7 +70,6 @@ export class ObjectGridComponent implements OnChanges, OnInit {
ngOnInit(): void {
this.pageInfo = this.objects.pageInfo;
this.config.pageSize = 4;
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment