profile page added

production
Sultan Khan 7 years ago
parent 823bd01d53
commit c63489d935

@ -8,7 +8,8 @@ const routes: Routes = [
data: { preload: true, delay: 1000 } data: { preload: true, delay: 1000 }
}, },
{ path: 'home', loadChildren: './home/home.module#HomePageModule' }, { path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' } { path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' }, { path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }
]; ];

@ -28,7 +28,7 @@
</button> --> </button> -->
</ion-item> </ion-item>
<ion-item> <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/username.png" item-left > <img width="30" src="../assets/imgs/username.png" item-left >
</ion-thumbnail> </ion-thumbnail>

@ -102,12 +102,13 @@ export class AppComponent implements OnInit, AfterViewInit {
}); });
} }
logout() { logout() {
// let req:any={};
// this.menuService.disableSession(req).subscribe((result: any) => {
// });
this.cs.sharedService.clearAll(); this.cs.sharedService.clearAll();
this.menu.toggle(); this.menu.toggle();
this.cs.openLogin(); this.cs.openLogin();
} }
profile() {
this.cs.openProfile();
this.menu.toggle();
}
} }

@ -1,7 +1,2 @@
.header-toolbar{
--background: linear-gradient(45deg, #3ac1f1 0%, #19a163 36%, #19a163 59%, #1a586d 100%);
}
.btnBack{
background: transparent;
}

@ -248,7 +248,7 @@ export class CommonService {
public userNeedToReLogin() { public userNeedToReLogin() {
this.presentConfirmDialog(this.ts.trPK("general", "relogin"), () => { this.presentConfirmDialog(this.ts.trPK("general", "relogin"), () => {
//this.openUserLogin(); this.openLogin();
}); });
} }
@ -892,6 +892,9 @@ export class CommonService {
public openForgotPassword() { public openForgotPassword() {
this.nav.navigateForward(["/authentication/forgot"]); this.nav.navigateForward(["/authentication/forgot"]);
} }
public openProfile() {
this.nav.navigateForward(["/profile/home"]);
}
public reload(url: string, from: string) { public reload(url: string, from: string) {
console.log("force reload called from:" + from); console.log("force reload called from:" + from);

@ -121,7 +121,7 @@ export class ConnectorService {
if (!this.cs.validResponse(result)) { if (!this.cs.validResponse(result)) {
// not authorized // not authorized
if (result.ErrorType === 2) { if (result.ErrorType === 2) {
// this.cs.userNeedToReLogin(); this.cs.userNeedToReLogin();
} else { } else {
this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage); this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage);
} }

@ -19,7 +19,7 @@
<div> <div>
<div> <div>
<p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}, {{userData.EMPLOYEE_DISPLAY_NAME}}</p> <p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}</p>
</div> </div>
<div> <div>
<ion-grid class="cus-grid"> <ion-grid class="cus-grid">

@ -34,7 +34,7 @@ export class HomePage implements OnInit {
this.menu.toggle(); this.menu.toggle();
} }
private getUserDetails() { private getUserDetails() {
const user = this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {

@ -0,0 +1,111 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<ion-title color="light" > {{ts.trPK('userProfile','title')}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card *ngIf="personalInfo">
<ion-card-header class="boxHdr">
<div class="hrTitle">{{personalInfo.EMPLOYEE_NAME}}</div>
</ion-card-header>
<ion-card-content>
<div>
<div class="centerDiv profileDiv">
<!-- <p class="TxtPlace boldTxt">{{User_name_Emp}}</p> -->
<ion-img class="profileImg" [src]="imageSrc"></ion-img>
</div>
<ion-grid class="profile-grid">
<div>
<ion-row>
<ion-col class="colBold" size="5">
<label> {{ts.trPK('userProfile','empNo')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.EMPLOYEE_NUMBER}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','busG')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.BUSINESS_GROUP_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','job')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.JOB_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','locName')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.LOCATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','payrol')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.PAYROLL_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','orgEmail')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.EMPLOYEE_EMAIL_ADDRESS}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','orgName')}} </label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.ORGANIZATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','position')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.POSITION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','grade')}} </label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.GRADE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="colBold" size="5">
<label>{{ts.trPK('userProfile','category')}}</label>
</ion-col>
<ion-col size="7">
<label>{{personalInfo.EMPLOYMENT_CATEGORY_MEANING}}</label>
</ion-col>
</ion-row>
</div>
</ion-grid>
</div>
</ion-card-content>
</ion-card>
</ion-content>

@ -0,0 +1,3 @@
ion-col.colBold, ion-col.colBold > label{
font-weight:bold;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,38 @@
import { Component, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
@Component({
selector: "app-home",
templateUrl: "./home.component.html",
styleUrls: ["./home.component.scss"]
})
export class HomeComponent implements OnInit {
personalInfo: any;
imageSrc: string = "../assets/imgs/profile.png";
constructor(
public ts: TranslatorService,
public cs: CommonService,
public authService: AuthenticationService
) {}
ngOnInit() {
this.getProfile();
}
getProfile() {
this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
this.personalInfo = user;
this.imageSrc = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: this.imageSrc;
console.log(user);
} else {
console.log(user);
}
});
}
}

@ -0,0 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { ProfilePage } from './profile.page';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{
path: '',
component: ProfilePage,
children: [
{
path: 'home',
component: HomeComponent
}
],
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [ProfilePage , HomeComponent]
})
export class ProfilePageModule {}

@ -0,0 +1,6 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ProfilePage } from './profile.page';
describe('ProfilePage', () => {
let component: ProfilePage;
let fixture: ComponentFixture<ProfilePage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ProfilePage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ProfilePage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-profile',
templateUrl: './profile.page.html',
styleUrls: ['./profile.page.scss'],
})
export class ProfilePage implements OnInit {
constructor() { }
ngOnInit() {
}
}

@ -766,31 +766,31 @@
}, },
"confirmPassword": { "confirmPassword": {
"en":"Confirm Password", "en":"Confirm Password",
"ar":"" "ar":"تأكيد كلمة المرور"
}, },
"newPassword": { "newPassword": {
"en":"New Password", "en":"New Password",
"ar":"" "ar":"كلمة المرور الجديدة"
}, },
"changePassword": { "changePassword": {
"en":"Change Password", "en":"Change Password",
"ar":"" "ar":"تغيير كلمة المرور"
}, },
"codeNumber": { "codeNumber": {
"en":"verification code", "en":"verification code",
"ar":"" "ar": "رقم الرمز"
}, },
"emptyNewPassword": { "emptyNewPassword": {
"en":"Please fill New Password field", "en":"Please fill New Password field",
"ar":"" "ar":"الرجاء ملء حقل كلمة المرور الجديدة"
}, },
"emptyOldPassword": { "emptyOldPassword": {
"en":"Please fill Old Password field", "en":"Please fill Old Password field",
"ar":"" "ar":"الرجاء ملء حقل كلمة المرور الحالية"
}, },
"emptyConfirmPassword": { "emptyConfirmPassword": {
"en":"Please fill Confirm Password field", "en":"Please fill Confirm Password field",
"ar":"" "ar":"الرجاء ملء حقل تأكيد كلمة المرور"
} }
}, },
"attendance": "attendance":

@ -57,24 +57,18 @@ ion-label{
} }
.loaderGif{ .loading-gif{
background: transparent !important; background: transparent !important;
width:100px; width:100px;
height: 100px; height: 100px;
} }
.loading-md .loading-wrapper, #custom-progress-loader .container{
.loading-ios .loading-wrapper{
background: transparent !important; background: transparent !important;
box-shadow: none; box-shadow: none;
-webkit-box-shadow:none; -webkit-box-shadow:none;
-moz-box-shadow: none; -moz-box-shadow: none;
width: 150px; width: 150px;
} }
.loading-md ,.loading-ios {
ion-backdrop{
background-color: #8c8c8c !important;
}
}
/***********change header color***************/ /***********change header color***************/
.headerBtn{ .headerBtn{
@ -83,7 +77,12 @@ ion-label{
.headerImg{ .headerImg{
width: 36px; width: 36px;
} }
.header-toolbar{
--background: linear-gradient(45deg, #3ac1f1 0%, #19a163 36%, #19a163 59%, #1a586d 100%);
}
.btnBack{
background: transparent !important;
}
/***************/ /***************/
.attachImg{ .attachImg{
max-width: 30px; max-width: 30px;

Loading…
Cancel
Save