Skip to content

Commit

Permalink
Merge branch 'develop' into uniform-deployment-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jekabs-karklins authored Feb 8, 2023
2 parents 7d6daf9 + d2fe3c9 commit 8c9c4f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ export class DashboardComponent {
{ name: "creator", icon: "group", sort: true, inList: true },
{ name: "doi", icon: "label", sort: true, inList: true },
];
itemFields = {thumbnail: false};

params: any = this.datasourceService.queryParams(
this.itemsPerPage,
this.currentPage,
this.sortColumn,
this.sortDirection
this.sortDirection,
this.itemFields,
);
publications$: Observable<
PublishedData[]
Expand All @@ -72,7 +74,8 @@ export class DashboardComponent {
this.itemsPerPage,
this.currentPage,
this.sortColumn,
this.sortDirection
this.sortDirection,
this.itemFields,
);
this.publications$ = this.datasourceService.getPublications(this.params);
}
Expand All @@ -85,7 +88,8 @@ export class DashboardComponent {
this.itemsPerPage,
this.currentPage,
this.sortColumn,
this.sortDirection
this.sortDirection,
this.itemFields,
);
this.publications$ = this.datasourceService.getPublications(this.params);
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/datasource.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ export class DatasourceService {
itemsPerPage: number,
currentPage: number,
sortColumn: string,
sortDirection: string
sortDirection: string,
itemFields: Partial<{[key in keyof PublishedData]: boolean}>
): string {
return this.appConfig.directMongoAccess
? JSON.stringify({
order: sortColumn + " " + sortDirection,
skip: itemsPerPage * currentPage,
limit: itemsPerPage,
fields: itemFields,
})
: "(" +
"skip=" +
Expand All @@ -53,6 +55,8 @@ export class DatasourceService {
sortColumn +
",sortDirection=" +
sortDirection +
",excludeFields=" +
Object.keys(itemFields).filter(k => !itemFields[k]).join("|") +
")";
}
}

0 comments on commit 8c9c4f3

Please sign in to comment.