diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index a12852d2..3694d942 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -100,23 +100,36 @@ export class HomeComponent implements OnInit { public setMenuEntries() { let personalInformationChildren: any; let personalInfoNestedChildren: any; - for( let i = 0; i < this.menuEntries.length; i++ ) { - if (this.menuEntries[i].MENU_NAME === 'MBL_E_PROFESSIONALS_01') { - personalInformationChildren = this.menuEntries[i].children; - for( let j = 0; j < personalInformationChildren.length; j++ ) { - if (personalInformationChildren[j].MENU_NAME = 'MBL_PERINFO_SS' && personalInformationChildren[j].ENTRY_SEQUENCE === 15) { - personalInfoNestedChildren = personalInformationChildren[j].children; - for( let k = 0; k < personalInfoNestedChildren.length; k++ ) { - if (personalInfoNestedChildren[k].REQUEST_TYPE === 'BASIC_DETAILS') { - this.basicDetailsSubMenu = personalInfoNestedChildren[k]; - } - if (personalInfoNestedChildren[k].REQUEST_TYPE === 'ADDRESS') { - this.addressSubMenu = personalInfoNestedChildren[k]; + + if (this.targetValue === 'sideMenu') { + for( let i = 0; i < this.menuEntries.length; i++ ) { + if (this.menuEntries[i].MENU_NAME === 'MBL_E_PROFESSIONALS_01') { + personalInformationChildren = this.menuEntries[i].children; + for( let j = 0; j < personalInformationChildren.length; j++ ) { + if (personalInformationChildren[j].MENU_NAME = 'MBL_PERINFO_SS' && personalInformationChildren[j].ENTRY_SEQUENCE === 15) { + personalInfoNestedChildren = personalInformationChildren[j].children; + for( let k = 0; k < personalInfoNestedChildren.length; k++ ) { + if (personalInfoNestedChildren[k].REQUEST_TYPE === 'BASIC_DETAILS') { + this.basicDetailsSubMenu = personalInfoNestedChildren[k]; + } + if (personalInfoNestedChildren[k].REQUEST_TYPE === 'ADDRESS') { + this.addressSubMenu = personalInfoNestedChildren[k]; + } } } } } } + } else { + const menuEntriesLocalArray: any = this.menuEntries.children; + for( let i = 0; i < menuEntriesLocalArray.length; i++ ) { + if (menuEntriesLocalArray[i].REQUEST_TYPE === 'BASIC_DETAILS') { + this.basicDetailsSubMenu = menuEntriesLocalArray[i]; + } + if (menuEntriesLocalArray[i].REQUEST_TYPE === 'ADDRESS') { + this.addressSubMenu = menuEntriesLocalArray[i]; + } + } } console.log(this.basicDetailsSubMenu); console.log(this.addressSubMenu);