Skip to content

Commit

Permalink
Load only first values of the subject facet in the home page. (#553)
Browse files Browse the repository at this point in the history
* Load only first values of the `subject` facet in the home page.

* Fetch facets from `homepage` configuration in the home page.
  • Loading branch information
milanmajchrak committed Jun 19, 2024
1 parent d62adea commit 8aaa01e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/home-page/home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class HomePageComponent implements OnInit {
* @private
*/
private loadSubject() {
const facetName = 'subject';
const facetName = 'subjectFirstValue';
this.getFastSearchLinks(facetName, this.subjects$);
}

Expand All @@ -210,7 +210,7 @@ export class HomePageComponent implements OnInit {
*/
async getFastSearchLinks(facetName, behaviorSubject: BehaviorSubject<any>) {
await this.assignBaseUrl();
const authorFilter: SearchFilterConfig = Object.assign(new SearchFilterConfig(), {
const searchFilter: SearchFilterConfig = Object.assign(new SearchFilterConfig(), {
name: facetName,
filterType: FilterType.text,
hasFacets: false,
Expand All @@ -222,8 +222,8 @@ export class HomePageComponent implements OnInit {
},
},
});
const authorFilterOptions: SearchOptions = new SearchOptions({configuration: 'default'});
this.searchService.getFacetValuesFor(authorFilter, 1, authorFilterOptions)
const searchOptions: SearchOptions = new SearchOptions({configuration: 'homepage'});
this.searchService.getFacetValuesFor(searchFilter, 1, searchOptions)
.pipe(getFirstSucceededRemoteDataPayload())
.subscribe(authorStats => {
authorStats.page.forEach((facetValue: FacetValue) => {
Expand Down

0 comments on commit 8aaa01e

Please sign in to comment.