Skip to content

Commit

Permalink
Issue #SB-19243 merge: Merge pull request #1094 from raghav14/release…
Browse files Browse the repository at this point in the history
…-3.0.1

Issue #SB-19243 fix: UI and NCERT content
  • Loading branch information
swayangjit authored Jul 14, 2020
2 parents c0c4c55 + a7c5348 commit bc845eb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
18 changes: 14 additions & 4 deletions src/app/faq-report-issue/faq-report-issue.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
showThanksResponse: boolean;
formContext: any;
supportEmail: any;
relevantTerms: any;

constructor(
private router: Router,
Expand Down Expand Up @@ -306,9 +307,13 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
this.takeAction();
}
}
if (this.formValues && this.formValues.children && this.formValues.children.subcategory &&
this.formValues.children.subcategory.notify) {
if (this.formValues && this.formValues.children && this.formValues.children.subcategory &&
this.formValues.subcategory === 'contentavailability') {
const corRelationList: Array<CorrelationData> = this.prepareTelemetryCorrelation();
if (this.formValues && this.formValues.children && this.formValues.children.subcategory &&
this.formValues.children.subcategory.notify) {
corRelationList.push({ id: 'true', type: 'Notify' });
}
this.telemetryGeneratorService.generateInteractTelemetry(
InteractType.SUPPORT,
'', Environment.HOME,
Expand Down Expand Up @@ -352,6 +357,9 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
[this.formValues.children.subcategory.medium.name] : undefined,
geadeList: (this.formValues.children && this.formValues.children.subcategory && this.formValues.children.subcategory.grade) ?
[this.formValues.children.subcategory.grade.name] : undefined,
subjectList: (this.formValues.children && this.formValues.children.subcategory && this.formValues.children.subcategory.subject) ?
[this.formValues.children.subcategory.subject.name] : undefined,
relevantTerms: this.relevantTerms,
curLang: this.translate.currentLang
}
});
Expand Down Expand Up @@ -529,16 +537,18 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
switch (dataSrc.marker) {
case 'ACTIVE_CHANNEL.SUGGESTED_FRAMEWORK_LIST.MAPPED_TO_FRAMEWORKCATEGORIES':
templateOptions.options = this.getClosure('board');
// delete templateOptions.dataSrc;
break;
case 'FRAMEWORK_CATEGORY_TERMS':
templateOptions.options = this.getClosure(dataSrc.params.categoryCode);
// delete templateOptions.dataSrc;
break;
}
if (dataSrc && dataSrc.action) {
this.callToAction[templateOptions.value] = dataSrc.action;
}
if (dataSrc && dataSrc.params && dataSrc.params.relevantTerms) {
this.relevantTerms = dataSrc.params.relevantTerms;
}
delete templateOptions.dataSrc;
}

getClosure(type: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ContentSearchCriteria,
ContentSearchResult,
ContentService,
SearchType, TelemetryObject
SearchType, TelemetryObject, GetSuggestedFrameworksRequest, CachedItemRequestSourceFrom, FrameworkCategoryCodesGroup, FrameworkUtilService
} from 'sunbird-sdk';
import {ContentType, ExploreConstants, RouterLinks, Search} from '@app/app/app.constant';
import {Router} from '@angular/router';
Expand All @@ -21,10 +21,6 @@ import {ContentUtil} from '@app/util/content-util';
styleUrls: ['./explore-books-sort.component.scss'],
})
export class ExploreBooksSortComponent implements OnInit, OnDestroy {
@Input() boardList: string[];
@Input() mediumList: string[];
@Input() gradeList: string[];
@Input() curLang: string;
storyAndWorksheets: Array<any>;
unregisterBackButton: Subscription;
searchRequest: ContentSearchCriteria = {
Expand All @@ -33,7 +29,15 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
appName = '';
public imageSrcMap = new Map();
defaultImg: string;
boardList: string[];
mediumList: string[];
gradeList: string[];
subjectList: string[];
curLang: string;
relevantTerms: any;

constructor(
@Inject('FRAMEWORK_UTIL_SERVICE') private frameworkUtilService: FrameworkUtilService,
private platform: Platform,
public commonUtilService: CommonUtilService,
private telemetryGeneratorService: TelemetryGeneratorService,
Expand All @@ -42,10 +46,17 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
private location: Location,
@Inject('CONTENT_SERVICE') private contentService: ContentService,
private ngZone: NgZone,
private router: Router
private router: Router,
private params: NavParams
) {
this.initForm();
this.defaultImg = this.commonUtilService.convertFileSrc('assets/imgs/ic_launcher.png');
this.boardList = this.params.get('boardList');
this.mediumList = this.params.get('mediumList');
this.gradeList = this.params.get('gradeList');
this.subjectList = this.params.get('subjectList');
this.relevantTerms = this.params.get('relevantTerms');
this.curLang = this.params.get('curLang');
this.initForm();
}
async ngOnInit() {
this.handleBackButton(false);
Expand All @@ -63,10 +74,11 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
});
}

private getRelevantTextBooks() {
this.searchRequest.board = this.boardList ? this.boardList : null;
private async getRelevantTextBooks() {
this.searchRequest.board = this.relevantTerms ? this.relevantTerms : [];
this.searchRequest.medium = this.mediumList ? this.mediumList : null;
this.searchRequest.grade = this.gradeList ? this.gradeList : null;
this.searchRequest.subject = this.subjectList ? this.subjectList : null;
this.searchRequest.facets = Search.FACETS_ETB;
this.searchRequest.mode = 'hard';
this.searchRequest.contentTypes = [ContentType.TEXTBOOK];
Expand Down

0 comments on commit bc845eb

Please sign in to comment.