Unverified Commit 3df2bf69 authored by Rajeev's avatar Rajeev Committed by GitHub
Browse files

Merge pull request #8353 from princegupta1131/ED-211

Ed 211
No related merge requests found
Showing with 16 additions and 1 deletion
+16 -1
...@@ -453,6 +453,14 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -453,6 +453,14 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
request.channelId = this.selectedFilters['channel']; request.channelId = this.selectedFilters['channel'];
} }
const option = this.searchService.getSearchRequest(request, get(filters, 'primaryCategory')); const option = this.searchService.getSearchRequest(request, get(filters, 'primaryCategory'));
const params = _.get(this.activatedRoute, 'snapshot.queryParams');
_.filter(Object.keys(params),filterValue => {
if(((_.get(currentPageData , 'metaData.filters').indexOf(filterValue) !== -1)))
{
option.filters[filterValue] = (typeof(params[filterValue]) === "string" ) ? params[filterValue].split(',') : params[filterValue];
}
});
if (this.userService.loggedIn) { if (this.userService.loggedIn) {
option.filters['visibility'] = option.filters['channel'] = []; option.filters['visibility'] = option.filters['channel'] = [];
} }
...@@ -464,7 +472,7 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit { ...@@ -464,7 +472,7 @@ export class ExplorePageComponent implements OnInit, OnDestroy, AfterViewInit {
this.utilService.processCourseFacetData(_.get(response, 'result'), _.get(request, 'facets')) : {}); this.utilService.processCourseFacetData(_.get(response, 'result'), _.get(request, 'facets')) : {});
this.searchResponse = get(response, 'result.content'); this.searchResponse = get(response, 'result.content');
if (_.has(response, 'result.QuestionSet')) { if (_.has(response, 'result.QuestionSet')) {
this.searchResponse = _.merge(this.searchResponse, _.get(response, 'result.QuestionSet')); this.searchResponse = _.merge(this.searchResponse, _.get(response, 'result.QuestionSet'));
} }
const filteredContents = omit(groupBy(this.searchResponse, content => { const filteredContents = omit(groupBy(this.searchResponse, content => {
return content[groupByKey] || content['subject'] || 'Others'; return content[groupByKey] || content['subject'] || 'Others';
......
...@@ -241,6 +241,13 @@ export class ExploreContentComponent implements OnInit, OnDestroy, AfterViewInit ...@@ -241,6 +241,13 @@ export class ExploreContentComponent implements OnInit, OnDestroy, AfterViewInit
facets: this.globalSearchFacets, facets: this.globalSearchFacets,
params: this.configService.appConfig.ExplorePage.contentApiQueryParams || {} params: this.configService.appConfig.ExplorePage.contentApiQueryParams || {}
}; };
_.filter(Object.keys(this.queryParams),filterValue => {
if(((_.get(this.allTabData , 'search.facets').indexOf(filterValue) !== -1)))
{
option.filters[filterValue] = (typeof(this.queryParams[filterValue]) === "string" ) ? this.queryParams[filterValue].split(',') : this.queryParams[filterValue];
}
});
if (this.queryParams.softConstraints) { if (this.queryParams.softConstraints) {
try { try {
option.softConstraints = JSON.parse(this.queryParams.softConstraints); option.softConstraints = JSON.parse(this.queryParams.softConstraints);
......
Supports Markdown
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