profile page added
parent
823bd01d53
commit
c63489d935
@ -1,21 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
||||
data: { preload: true, delay: 1000 }
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
|
||||
{
|
||||
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule',
|
||||
data: { preload: true, delay: 1000 }
|
||||
},
|
||||
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
|
||||
{ path: 'sms-page', loadChildren: './authentication/sms-page/sms-page.module#SmsPagePageModule' }
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||
],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
||||
@ -1,7 +1,2 @@
|
||||
.header-toolbar{
|
||||
--background: linear-gradient(45deg, #3ac1f1 0%, #19a163 36%, #19a163 59%, #1a586d 100%);
|
||||
}
|
||||
|
||||
.btnBack{
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
@ -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() {
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue