diff --git a/src/app/profile/framework-selection/framework-selection.page.ts b/src/app/profile/framework-selection/framework-selection.page.ts index 4d23157ec3..43f2511b3e 100644 --- a/src/app/profile/framework-selection/framework-selection.page.ts +++ b/src/app/profile/framework-selection/framework-selection.page.ts @@ -125,7 +125,7 @@ export class FrameworkSelectionPage implements OnInit, OnDestroy { getClosure(type: string, enableOtherOption?: boolean): FieldConfigOptionsBuilder { if (enableOtherOption) { - return this.frameworkCommonFormConfigBuilder.getFrameworkConfigOptionsBuilder(null, null, enableOtherOption) + return this.frameworkCommonFormConfigBuilder.getFrameworkConfigOptionsBuilder(type, null, enableOtherOption) } else { switch (type) { case 'framework': diff --git a/src/app/resources/resources.component.ts b/src/app/resources/resources.component.ts index 9f34fbdf9e..6baa9f0e70 100644 --- a/src/app/resources/resources.component.ts +++ b/src/app/resources/resources.component.ts @@ -729,12 +729,12 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra } } this.categoryMediumNamesArray = categoryMediumsParam; - if (this.searchGroupingContents && this.searchGroupingContents.combination.medium) { - const indexOfSelectedmediums = this.categoryMediumNamesArray.indexOf(this.searchGroupingContents.combination.medium); + if (this.searchGroupingContents && this.searchGroupingContents.combination?.medium!) { + const indexOfSelectedmediums = this.categoryMediumNamesArray.indexOf(this.searchGroupingContents.combination?.medium!); await this.mediumClickHandler(indexOfSelectedmediums, this.categoryMediumNamesArray[indexOfSelectedmediums]); } else { for (let i = 0, len = this.categoryMediumNamesArray.length; i < len; i++) { - if ((selectedCategory[0].toLowerCase().trim()) === this.categoryMediumNamesArray[i].toLowerCase().trim()) { + if ((selectedCategory[0].toLowerCase().replace(/\s/g, '')) === this.categoryMediumNamesArray[i].toLowerCase().replace(/\s/g, '')) { await this.mediumClickHandler(i, this.categoryMediumNamesArray[i]); } } @@ -759,13 +759,13 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy, Fra selectedCategory = this.profile.serverProfile.framework[categories[2].code] } this.categoryGradeLevelsArray = res.map(a => (a.name)); - if (this.searchGroupingContents && this.searchGroupingContents.combination.gradeLevel) { + if (this.searchGroupingContents && this.searchGroupingContents.combination?.gradeLevel!) { const indexOfselectedClass = - this.categoryGradeLevelsArray.indexOf(this.searchGroupingContents.combination.gradeLevel); + this.categoryGradeLevelsArray.indexOf(this.searchGroupingContents.combination?.gradeLevel!); await this.classClickHandler(indexOfselectedClass); } else { for (let i = 0, len = this.categoryGradeLevelsArray.length; i < len; i++) { - if (selectedCategory[0] === this.categoryGradeLevelsArray[i]) { + if (selectedCategory[0].toLowerCase().replace(/\s/g, '') === this.categoryGradeLevelsArray[i].toLowerCase().replace(/\s/g, '')) { await this.classClickHandler(i); } }