diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 97f8ceb3..edf5dc1b 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -12,7 +12,7 @@ - +
-

{{"home.dashboard" | translate}}

+

{{"userData.dashboard" | translate}}

diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 361f0ead..fcd61833 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -1,46 +1,59 @@ -import { Component, OnInit } from '@angular/core'; -import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { MenuController } from '@ionic/angular'; +import { Component, OnInit } from "@angular/core"; +import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; +import { MenuController } from "@ionic/angular"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; -import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; +import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; +import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; +import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; +import { CommonService } from "src/app/hmg-common/services/common/common.service"; @Component({ - selector: 'app-home', - templateUrl: './home.page.html', - styleUrls: ['./home.page.scss'], + selector: "app-home", + templateUrl: "./home.page.html", + styleUrls: ["./home.page.scss"] }) export class HomePage implements OnInit { - userData: any ={}; - user_image : any = "../assets/imgs/profile.png"; - constructor(public ts: TranslatorService, public menu: MenuController, public authService: AuthenticationService ) { } + userData: any = {}; + user_image: any = "../assets/imgs/profile.png"; + menuList: any = []; + constructor( + public ts: TranslatorService, + public menu: MenuController, + public authService: AuthenticationService, + public menuService: MenuService, + public common: CommonService + ) {} ngOnInit() { this.getUserDetails(); + this.getMenu(); } - private openMenu(){ + + private openMenu() { this.menu.toggle(); } - private getUserDetails(){ - const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { + private getUserDetails() { + const user = this.authService + .loadAuthenticatedUser() + .subscribe((user: AuthenticatedUser) => { if (user) { - this.userData=user; + this.userData = user; console.log(user); - }else{ + } else { console.log(user); } - }) - + }); + } + private getMenu() { + this.menuService.getMenu().subscribe((result: MenuResponse) => { + this.handleMenuResult(result); + }); + } + private handleMenuResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.List_Menu)) { + this.menuList = result.List_Menu; + } + } } -// private getMenu(){ -// this.menuService.getMenu(). -// subscribe((result: MenuResponse) => { -// this.handleMenuResult(result); -// }); -// } -// private handleMenuResult(result){ -// if (this.common.validResponse(result)) { -// if (this.common.hasData(result.List_Menu)) { -// this.menuList = result.List_Menu; -// } -// } } diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 307a507a..7b52e4e6 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -139,10 +139,10 @@ ion-header ion-icon.icon.icon-ios.ion-ios-add{ color: (--darkgray); } .toolbar-background { - background: (--primary); - background: -moz-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); - background: -webkit-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); - background: linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%); + background: var(--primary); + background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='var(--primary)', endColorstr='--var(customnavy)',GradientType=1 ); } /***************button bckground***************/