Skip to content

Commit

Permalink
Issue #ED-4150 merge: Merge pull request #3598 from Ajoymaity/release…
Browse files Browse the repository at this point in the history
…-7.0.0

Issue #ED-4150 fix: Fixed the changed category unselected issue on library page header
  • Loading branch information
swayangjit authored Apr 25, 2024
2 parents a44c874 + c8c5b5f commit 0a054a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app/faq-help/faq-help.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export class FaqHelpPage implements OnInit {
Environment.USER,
PageId.FAQ);

const formConfig = await this.formAndFrameworkUtilService.getFormConfig();
let formConfig = await this.formAndFrameworkUtilService.getHelpIssueFormConfig(this.appGlobalService.getCurrentUser().syllabus[0] || '*');
this.appGlobalService.formConfig = formConfig;
await this.router.navigate([RouterLinks.FAQ_REPORT_ISSUE], {
state: {
Expand Down
17 changes: 5 additions & 12 deletions src/app/faq-report-issue/faq-report-issue.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
const getSuggestedFrameworksRequest: GetSuggestedFrameworksRequest = {
from: CachedItemRequestSourceFrom.SERVER,
language: this.translate.currentLang,
requiredCategories: FrameworkCategoryCodesGroup.DEFAULT_FRAMEWORK_CATEGORIES
requiredCategories: this.appGlobalService.getRequiredCategories()
};

this.frameworkUtilService.getActiveChannelSuggestedFrameworkList(getSuggestedFrameworksRequest).toPromise()
Expand Down Expand Up @@ -550,15 +550,12 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
console.error('Telemetry Data Sync Error: ', error);
});
await that.zone.run(async () => {
if (status.error) {
await loader.dismiss();
return;
} else if (!status.syncedEventCount) {
if (status?.error || !status?.syncedEventCount) {
await loader.dismiss();
return;
}

this.generateInteractEvent(InteractType.OTHER, InteractSubtype.MANUALSYNC_SUCCESS, status.syncedFileSize, correlationlist);
this.generateInteractEvent(InteractType.OTHER, InteractSubtype.MANUALSYNC_SUCCESS, status?.syncedFileSize || '', correlationlist);
await loader.dismiss();
});
}
Expand Down Expand Up @@ -633,12 +630,8 @@ export class FaqReportIssuePage implements OnInit, OnDestroy {
switch (type) {
case 'board':
return this.frameworkCommonFormConfigBuilder.getBoardConfigOptionsBuilder(this.profile);
case 'medium':
return this.frameworkCommonFormConfigBuilder.getMediumConfigOptionsBuilder(this.profile);
case 'grade':
return this.frameworkCommonFormConfigBuilder.getGradeConfigOptionsBuilder(this.profile);
case 'subject':
return this.frameworkCommonFormConfigBuilder.getSubjectConfigOptionsBuilder(this.profile);
default:
return this.frameworkCommonFormConfigBuilder.getFrameworkConfigOptionsBuilder(type);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/resources/resources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra
selectedCategory = this.profile.serverProfile.framework[categories[2].code]
}
this.categoryGradeLevelsArray = res.map(a => (a.name));
selectedCategory = this.classSelected.length ? this.categoryGradeLevelsArray[this.classSelected[0]] : selectedCategory;
if (this.searchGroupingContents && this.searchGroupingContents.combination[this.category3Code]!) {
const indexOfselectedClass =
this.categoryGradeLevelsArray.indexOf(this.searchGroupingContents.combination[this.category3Code]!);
Expand Down Expand Up @@ -836,7 +837,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra

async mediumClickHandler(index: number, mediumName, isMediumClicked?: boolean) {
if (isMediumClicked) {
this.generateMediumInteractTelemetry(mediumName, this.getGroupByPageReq.medium[0]);
this.generateMediumInteractTelemetry(mediumName, this.getGroupByPageReq[this.category2Code][0]);
}
this.getGroupByPageReq[this.category2Code] = [mediumName];
if (this.currentMedium !== mediumName && isMediumClicked) {
Expand Down
5 changes: 3 additions & 2 deletions src/services/formandframeworkutil.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,9 @@ export class FormAndFrameworkUtilService {
});
}

async getFormConfig() {
return (await this.getFormFields(FormConstants.DYNAMIC_FORM_CONFIG).then() as any);
async getHelpIssueFormConfig(framework) {
let rootOrgId = await this.preferences.getString('defaultRootOrgId').toPromise();
return (await this.getFormFields({...FormConstants.DYNAMIC_FORM_CONFIG, framework, rootOrgId}, rootOrgId).then() as any);
}

async getStateContactList() {
Expand Down

0 comments on commit 0a054a5

Please sign in to comment.