From b9e1a956015473d87c7ea9081646a16ee8d35980 Mon Sep 17 00:00:00 2001 From: "Fatimah.Alshammari" Date: Mon, 3 Feb 2020 11:57:24 +0300 Subject: [PATCH 1/2] Add new profile page & years of experience & Performance appraisal --- Mohem/package-lock.json | 8 + Mohem/package.json | 1 + Mohem/src/app/app.component.html | 4 +- Mohem/src/app/app.component.scss | 51 ++-- Mohem/src/app/app.component.ts | 8 +- Mohem/src/app/hmg-common/hmg-common.module.ts | 10 +- .../models/authenticated-user.ts | 3 + .../services/common/common.service.ts | 10 + .../performance-appraisal.response.ts | 4 +- .../edit-profile/edit-profile.component.html | 77 +++++ .../edit-profile/edit-profile.component.scss | 153 ++++++++++ .../edit-profile.component.spec.ts | 27 ++ .../edit-profile/edit-profile.component.ts | 112 ++++++++ .../src/app/profile/home/home.component.html | 267 +++++++++++------- .../src/app/profile/home/home.component.scss | 131 ++++++++- Mohem/src/app/profile/home/home.component.ts | 11 + .../performance-evaluation.component.html | 77 +++++ .../performance-evaluation.component.scss | 144 ++++++++++ .../performance-evaluation.component.spec.ts | 27 ++ .../performance-evaluation.component.ts | 88 ++++++ .../profile-image.component.scss | 2 +- Mohem/src/app/profile/profile.module.ts | 37 ++- Mohem/src/assets/localization/i18n.json | 17 ++ 23 files changed, 1119 insertions(+), 150 deletions(-) create mode 100644 Mohem/src/app/profile/edit-profile/edit-profile.component.html create mode 100644 Mohem/src/app/profile/edit-profile/edit-profile.component.scss create mode 100644 Mohem/src/app/profile/edit-profile/edit-profile.component.spec.ts create mode 100644 Mohem/src/app/profile/edit-profile/edit-profile.component.ts create mode 100644 Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html create mode 100644 Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss create mode 100644 Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.spec.ts create mode 100644 Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts diff --git a/Mohem/package-lock.json b/Mohem/package-lock.json index 7c7d2b6c..24386f83 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -9417,6 +9417,14 @@ "tslib": "^1.9.0" } }, + "ngx-gauge": { + "version": "1.0.0-beta.10", + "resolved": "https://registry.npmjs.org/ngx-gauge/-/ngx-gauge-1.0.0-beta.10.tgz", + "integrity": "sha512-j/YOntC31Pe24Et0wooi1YOmkA11Xw5YzsdBUIvYtvikvO6jwQ5tKwHimP981QAWW3S6/FQ9y94Fd/auJfyGkw==", + "requires": { + "tslib": "^1.9.0" + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", diff --git a/Mohem/package.json b/Mohem/package.json index ed651699..75851b44 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -104,6 +104,7 @@ "mx.ferreyra.callnumber": "0.0.2", "ng2-file-upload": "^1.3.0", "ng2-pdf-viewer": "^5.3.2", + "ngx-gauge": "^1.0.0-beta.10", "npm": "^6.13.1", "phonegap-plugin-barcodescanner": "^8.1.0", "phonegap-plugin-multidex": "^1.0.0", diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index f3b35531..e466e8bb 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -37,10 +37,10 @@ -
+ diff --git a/Mohem/src/app/app.component.scss b/Mohem/src/app/app.component.scss index d7c1c6e7..e2901722 100644 --- a/Mohem/src/app/app.component.scss +++ b/Mohem/src/app/app.component.scss @@ -26,19 +26,7 @@ header --background: white !important; } -// .editIcon{ -// margin-left: 174px !important; -// margin-bottom: -104px !important; -// padding: 6px -3px !important; -// // margin-top: 50px !important; -// background: transparent; -// --background: rgb(235, 232, 232) !important; -// --border-radius: 80% !important; -// // border-color: rgb(211, 208, 208) !important; -// --box-shadow: 3px 0 rgb(194, 191, 191) !important; -// z-index: 3 !important; - -// } + .menubutton{ white-space: normal; @@ -53,15 +41,7 @@ header box-shadow: 3px 0px 7px 0px #c5c2c2; border-radius: 50%; - // box-shadow: 0px 2px 7px 0px #dfe1e3 #7f8c8d; - // white-space: normal; - // color: var(--light); - // text-transform: capitalize; - // min-height: 47px; - // background: transparent; - // font-size: 2rem; - // position: absolute; - // top: 40px; + } .changeIcon{ @@ -72,13 +52,7 @@ header position: relative; color: #7f8c8d; - // background: #c1c1c1; - // width: 40px; - // height: 39px; - // border-radius: 50% !important; - // position: relative; - // left: 51px; - // top:16px; + } .changeImgBtn{ @@ -228,11 +202,7 @@ padding: 6px 24px; .sidebar-menu .header-div { - // 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%); - // color: var(--light); + text-transform: capitalize; height: 100px; position: relative; @@ -319,4 +289,17 @@ font-weight: bolder !important; color: black !important; font-weight: bolder !important; +} + +.profileImg{ + width: 160px; + height: 160px; + display: -webkit-inline-box; + display: inline-flex; + overflow: hidden; + background: transparent; + border-radius: 70% !important; + position: relative; + top: 7px; + } \ No newline at end of file diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index a1e655df..89f6dd0a 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -126,8 +126,13 @@ export class AppComponent implements OnInit, AfterViewInit { this.cs.openLogin(); } + // profile() { + // this.cs.openProfile(); + // this.menu.toggle(); + // } + profile() { - this.cs.openProfile(); + this.cs.openEditProfile(); this.menu.toggle(); } openNotification(){ @@ -150,4 +155,5 @@ export class AppComponent implements OnInit, AfterViewInit { this.menu.toggle(); } + } diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index 84e44c4f..518aacce 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -33,6 +33,7 @@ import { KeysPipe } from './pipes/keys/keys.pipe'; import { SegmentContentComponent } from './ui/segment-content/segment-content.component'; import { GraphComponent } from './ui/graph/graph.component'; import { NgxChartsModule } from '@swimlane/ngx-charts'; + import { ExpandableComponent } from './ui/expandable/expandable.component'; import { ProjectsService } from './services/projects/projects.service'; import { NationalityService } from './services/nationality/nationality.service'; @@ -100,7 +101,8 @@ import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uplode import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' -import {DashboredService} from './services/dashbored/dashbored.service' +import {DashboredService} from './services/dashbored/dashbored.service'; + import {NgxGaugeModule} from 'ngx-gauge'; @NgModule({ imports: [ CommonModule, @@ -110,7 +112,8 @@ import {DashboredService} from './services/dashbored/dashbored.service' HttpClientModule, NgxChartsModule, ListboxModule, - PdfViewerModule + PdfViewerModule, + NgxGaugeModule ], declarations: [ NumberRangeComponent, @@ -219,7 +222,8 @@ import {DashboredService} from './services/dashbored/dashbored.service' WorkListAttachViewComponent, FileUploderProfileComponent, AccordinTabCustomComponent, - AccordinCustomComponent + AccordinCustomComponent, + NgxGaugeModule ], providers: [ DashboredService, diff --git a/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts b/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts index 76d05310..2438134c 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts @@ -78,5 +78,8 @@ MobileNumber:string; LogInTokenID:string; CompanyImageDescription: string; CompanyImageURL: string; +SERVICE_DAYS:Number; +SERVICE_MONTHS:Number; +SERVICE_YEARS:Number; } diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 532e6bd4..37aba941 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -990,6 +990,9 @@ export class CommonService { public openProfile() { this.nav.navigateForward(["/profile/home"]); } + public openEditProfile() { + this.nav.navigateForward(["/profile/editprofile"]); + } public openAccuralPage() { this.nav.navigateForward(["/accrual-balances/home"]); } @@ -1080,6 +1083,13 @@ export class CommonService { public openConfirmLoginPage() { this.nav.navigateForward(["/authentication/confirmLogin"]); } + public openEditprofile() { + this.nav.navigateForward(["/profile/editProfile"]); + } + public openPerformanceevaluation() { + this.nav.navigateForward(["/profile/performanceevaluation"]); + } + public reload(url: string, from: string) { console.log("force reload called from:" + from); diff --git a/Mohem/src/app/hmg-common/services/dashbored/performance-appraisal.response.ts b/Mohem/src/app/hmg-common/services/dashbored/performance-appraisal.response.ts index 9dbe5845..65b4e686 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/performance-appraisal.response.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/performance-appraisal.response.ts @@ -5,5 +5,7 @@ import { Response } from "src/app/hmg-common/services/models/response"; import { PerformanceAppraisalList } from './PerformanceAppraisalList'; export class PerformanceAppraisalResponse extends Response{ -public GetGetPerformanceAppraisalList :PerformanceAppraisalList[]; + public GetPerformanceAppraisalList :PerformanceAppraisalList[]; + public static PERFORMANCE_DATA = "PERFORMANCE_DATA" + } \ No newline at end of file diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.html b/Mohem/src/app/profile/edit-profile/edit-profile.component.html new file mode 100644 index 00000000..9163ba2a --- /dev/null +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.html @@ -0,0 +1,77 @@ + +
+ + + +

{{ts.trPK('userProfile','title')}}

+ +
+ + +
+ + +
+ + +
+

{{User_name_Emp}}

+

{{User_Job_name}}

+
+
+ +
+ + +
+ + + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+ +
+

Years of Services

+
+ + + + + + + + {{ts.trPK('userProfile','edit-profile')}} + + + + + + + + + + + {{ts.trPK('userProfile','performance-evaluation')}} + + + + +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.scss b/Mohem/src/app/profile/edit-profile/edit-profile.component.scss new file mode 100644 index 00000000..651acf4b --- /dev/null +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.scss @@ -0,0 +1,153 @@ + + +.list-ios { + margin-left: 0; + margin-right: 0; + margin-top: 32px; + margin-bottom: 32px; + background: var(--ion-item-background,var(--ion-background-color,#fff)); +} + +.colorBG{ + --background: #f0efef; + } + .header-div{ + text-transform: capitalize; + background: #22C6B3; + display: block; + position: relative; + height: 160px; + margin-bottom: 60px; + } + + +.profileImg{ + width: 160px; + height: 160px; + display: -webkit-inline-box; + display: inline-flex; + overflow: hidden; + /* background: transparent; */ + border-radius: 78% !important; + position: relative; + top: 34px; + // background: white; + background: transparent; + margin-left: -3px; + +} + +.proTitles { + margin: 0; + padding: 0; + font-size: 16px; + text-align: center; + font-weight: bolder; + color: white; + margin-top: -33px; + } + + .Text { + margin: 0; + padding: 0; + text-align: center; + font-weight: bolder; + color: black; + font-size: 16px; + margin-top: 34px; + margin-bottom: 10px; + text-align: center; + } + + + + ion-thumbnail.menu-thumb{ + width:20px; + height:20px; + // margin-top: 5px !important; + } + + .profile{ + color: black !important; + // font-weight: bolder !important; + + } + + .gridService{ + + // background-color: #094875; + margin-top: 87px; + border-radius: 10px; + margin-bottom: -49px; + margin-left: 14px; + margin-right: 14px; + + } + .columns{ + margin: 10px; + background: #094875; + border-radius: 27px; + padding-left: 30px; + padding-right: 6px; + padding-top: 19px; + padding-bottom: 26px; + } + + + .service{ + font-size: 28px; + // font-weight: bolder; + color: white; + letter-spacing: 1px; + font-weight: bold; + } + .services{ + + font-size: 12px; + color: white; + } + + .list{ + margin-left: 14px; + margin-right: 14px; + border-radius: 10px; + background: white; + border: solid #bebbbb !important; + padding: 2px; + } + .p{ + color: black !important; + font-size: medium; + text-align: center; + border-bottom: rgb(190, 187, 187) solid 1px; + } + .itemline{ + border-bottom: rgb(190, 187, 187) solid 1px; + } + .itemlins{ + border-bottom: rgb(190, 187, 187) solid 1px; + margin-bottom: 209px; + + + } + .empName { + margin: 0; + padding: 0; + text-align: center; + font-weight: bolder; + color: black; + font-size: 16px; + margin-top: 38px; + + } + .empJob{ + + margin: 0; + padding: 0; + text-align: center; + color: black; + font-size: 16px; + margin-top: 4px; + + } + \ No newline at end of file diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.spec.ts b/Mohem/src/app/profile/edit-profile/edit-profile.component.spec.ts new file mode 100644 index 00000000..7ef1986f --- /dev/null +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditProfileComponent } from './edit-profile.component'; + +describe('EditProfileComponent', () => { + let component: EditProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EditProfileComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.ts b/Mohem/src/app/profile/edit-profile/edit-profile.component.ts new file mode 100644 index 00000000..58c888f3 --- /dev/null +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.ts @@ -0,0 +1,112 @@ +import { Component, OnInit } from '@angular/core'; +import { Platform, Events, MenuController } from "@ionic/angular"; +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"; +import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response'; +import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +// import { DomSanitizer } from '@angular/platform-browser'; + + +@Component({ + selector: 'app-edit-profile', + templateUrl: './edit-profile.component.html', + styleUrls: ['./edit-profile.component.scss'], +}) +export class EditProfileComponent implements OnInit { + + + User_name_Emp: string = ""; + User_Job_name: string; + + private menu: MenuController; + setImage:any; + // imageSrc: any = "../assets/imgs/profile.png"; + user_image: any = "../assets/imgs/profile.png"; + personalInfo: any; + appraisalArr :any =[]; + public performanceData: any=[]; + public static PERFORMANCE_DATA = 'perAppData'; + + constructor( + public ts: TranslatorService, + public cs: CommonService, + public authService: AuthenticationService, + public DS :DashboredService, + public sharedData: SharedDataService + // private events: Events, + // private sanitizer: DomSanitizer, + + ) + { + // this.events.subscribe("img-change", displayImg => { + // console.log("app compont: "+displayImg); + // this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); + + // }); + + + } + + ngOnInit() { + this.getProfile(); + } + + getProfile() { + console.log("getProfile"); + this.authService + .loadAuthenticatedUser() + .subscribe((user: AuthenticatedUser) => { + if (user) { + this.personalInfo = user; + this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME; + this.User_Job_name=this.personalInfo.JOB_NAME; + this.user_image = user.EMPLOYEE_IMAGE + ? "data:image/png;base64," + user.EMPLOYEE_IMAGE + : "../assets/imgs/profile.png"; + console.log("name: "+ this.personalInfo.EMPLOYEE_NAME); + console.log("user name: "+ user.EMPLOYEE_NAME); + console.log("name: "+ this.personalInfo.JOB_NAME); + console.log("job name: "+ user.JOB_NAME); + + + }}); +} + +openEditprofile(){ + this.cs.openProfile(); +} + +openPerormance(){ + this.showPerformanceAppraisal(); + +} + +showPerformanceAppraisal(){ + this.DS.getPerformanceAppraisal(()=>{ + this.showPerformanceAppraisal(); + }).subscribe((result: PerformanceAppraisalResponse) => { + this.handlePerformanceAppraisalResult(result); + + }); +} + +private handlePerformanceAppraisalResult(result){ + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.GetPerformanceAppraisalList)) { + this.appraisalArr =result.GetPerformanceAppraisalList; + this.performanceData=[]; + + for(let i=0;i + - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - \ No newline at end of file + + --> + + + +
+ + + +

{{ts.trPK('userProfile','title')}}

+ + +
+
+ + +
+ + +
+

{{personalInfo.EMPLOYEE_NAME}}

+
+
+ + +
+ +
+ +
+ + +
+ + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
\ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss index 60b11dbc..4be2aac3 100644 --- a/Mohem/src/app/profile/home/home.component.scss +++ b/Mohem/src/app/profile/home/home.component.scss @@ -1,3 +1,132 @@ ion-col.colBold, ion-col.colBold > label{ font-weight:bold; -} \ No newline at end of file +} + +.colorBG{ + --background: #f0efef; + } +.header-div{ + text-transform: capitalize; + background: #22C6B3; + display: block; + position: relative; + height: 160px; + margin-bottom: 60px; + } + +// .profileCont{ +// background-color: #d9d7d7 !important; + + +.menubutton{ + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 39px; + background: #f0ecec; + font-size: 2rem; + position: absolute; + width: 35px !important; + height: 19px; + box-shadow: 3px 0px 7px 0px #c5c2c2; + border-radius: 50%; + + + } + + .changeIcon{ + /* background: #c1c1c1; */ + width: 21px; + /* height: 26px; */ + border-radius: 50% !important; + position: relative; + color: #7f8c8d; + + + } + + .changeImgBtn{ + position: absolute; + top: 80%; + left: 65%; + } +.profileImg{ + width: 160px; + height: 160px; + display: -webkit-inline-box; + display: inline-flex; + overflow: hidden; + // background: transparent; + border-radius: 69% !important; + position: relative; + top: 34px; + // background: white; + background: transparent; +} + + .Text { + margin: 0; + padding: 0; + text-align: center; + font-weight: bolder; + color: black; + font-size: 16px; + margin-top: 34px; + text-align: center; + } + + .line{ + + padding-top: 0px !important; + /* margin-bottom: 0px; */ + /* margin: 0px; */ + border-right: 1px #c5c2c2 solid !important; + line-height: 10px !important; + + } + .proTitles { + margin: 0; + padding: 0; + font-size: 16px; + text-align: center; + font-weight: bolder; + color: white; + margin-top: -33px; + } + + + .profileGrid{ + border: #bebbbb solid 1px; + border-radius: 9px; + padding: 0px; + margin-top: 54px; + margin-left: 10px; + margin-right: 10px; + margin-bottom: 10px; + color: black; + // font-weight: bold; + background: white; + + } + + + + + .lebl{ + + color: black; + font-size: 14px !important; + font-weight: bold !important; + padding-top: 9px; + padding-left: 5px; + + } + .rowBolds{ + color: black !important; + font-size: 14px !important; + /* padding: 6px !important; */ + padding-bottom: 9px; + padding-left: 5px; + padding-top: 4px; + + } \ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index 52e10d4d..2e192b1f 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -14,6 +14,7 @@ export class HomeComponent implements OnInit { personalInfo: any; setImage:any; imageSrc: any = "../assets/imgs/profile.png"; + // user_image: any = "../assets/imgs/profile.png"; constructor( public ts: TranslatorService, public cs: CommonService, @@ -39,11 +40,15 @@ export class HomeComponent implements OnInit { this.getProfile(); } getProfile() { + console.log("getProfile"); this.authService .loadAuthenticatedUser() .subscribe((user: AuthenticatedUser) => { if (user) { this.personalInfo = user; + console.log("name: "+ this.personalInfo.EMPLOYEE_NAME); + console.log("user name: "+ user.EMPLOYEE_NAME); + if(this.cs.getUpdateImage().status){ // this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img); this.imageSrc = "data:image/png;base64,"+this.cs.getUpdateImage().img; @@ -60,4 +65,10 @@ export class HomeComponent implements OnInit { } }); } + + + private ChangeImage() { + this.cs.openChangeImagePage(); + } } + diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html new file mode 100644 index 00000000..6bb094f2 --- /dev/null +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html @@ -0,0 +1,77 @@ + +
+ + + +

{{ts.trPK('userProfile','performance')}}

+ +
+ +
+ + + + + +
+ +

Performance Evaluation

+ +
+ + + + + + + +
+ +
+
+ + + + + +
+
+
+ + +
+
+ + +
+ + +
+
+
+
+
+ + + +
+ +
+ + + +
\ No newline at end of file diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss new file mode 100644 index 00000000..aee2712f --- /dev/null +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.scss @@ -0,0 +1,144 @@ + + + +.colorBG{ + --background: #f0efef; + } + .header-div{ + text-transform: capitalize; + background: #22C6B3; + display: block; + position: relative; + height: 160px; + margin-bottom: 60px; + padding-top: 10px; + } + +.btnBack{ + background: var(--customnavy); + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 45px; + margin-top: -8px !important; +} + +.profilediv{ + + margin-left: 337px; +} +.profileImg{ + width: 25px; + height: 24px; + /* display: -webkit-inline-box; */ + /* display: inline-flex; */ + overflow: hidden; + background: transparent; + border-radius: 90% !important; + position: relative; + top: -22px; + // margin-left: 337px; + +} + +.proTitles { + margin: 0; + padding: 0; + font-size: 16px; + text-align: center; + font-weight: bolder; + color: white; + margin-top: -33px; + } + + .grid{ + + background-color: #f9f9f9; + margin-top: 9px; + margin-bottom: 7px !important; + border-radius: 21px; + margin-bottom: 26px; + margin-left: 14px; + margin-right: 14px; + padding-bottom: 1px; + border: solid #d7d4d4 !important; + + } + .Text { + margin: 0; + padding: 0; + text-align: center; + font-weight: bolder; + color: black; + font-size: 16px; + margin-top: 5px; + margin-bottom: 10px; + text-align: center; + margin-left: 74px; + } + + .leftgrid{ + margin-left: 10px; + background: white; + border: solid #d7d4d4; + margin: 7px; + border-radius: 24px; + width: 30% !important; + padding-bottom: 9px; + padding-top: 11px; + padding-left: 10px; +} + +.rightgrid{ + margin-left: 10px; + background: white; + border: solid #d7d4d4; + // margin: 7px; + border-radius: 24px; + width: 30% !important; + padding-bottom: 9px; + padding-top: 11px; + padding-left: 10px; + margin-right: 189px; + +} + +.performancecolor{ + border: solid #bebbbb 1px !important; + border-radius: 13px; + margin-top: 0px !important; + height: 10px; + padding-right: 8px !important; + width: 65px; + margin-bottom: -10px; + +} + +.label{ + + font-size: 13px !important; + margin-top: -7px !important; + font-weight: bold !important; +} + +.labelvalue{ + font-size: 28px !important; + font-weight: bold !important; + margin-top: 7px !important; + margin-left: 72px !important; +} + +.percentage{ + font-size: 15px !important; + margin-top: 15px !important; + +} + +.gauge{ + transform: translate(-24px, -65px); + margin-bottom: -187px; + margin-top: -20px; + +} + + diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.spec.ts b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.spec.ts new file mode 100644 index 00000000..3e546087 --- /dev/null +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PerformanceEvaluationComponent } from './performance-evaluation.component'; + +describe('PerformanceEvaluationComponent', () => { + let component: PerformanceEvaluationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PerformanceEvaluationComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PerformanceEvaluationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts new file mode 100644 index 00000000..efc55d7b --- /dev/null +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.ts @@ -0,0 +1,88 @@ +import { Component, OnInit, NgModule } from '@angular/core'; +import { Platform, Events, MenuController } from "@ionic/angular"; +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 { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response'; +// import { DomSanitizer } from '@angular/platform-browser'; +// import {NgxGaugeModule} from 'ngx-gauge'; +import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; + + + +@Component({ + selector: 'app-performance-evaluation', + templateUrl: './performance-evaluation.component.html', + styleUrls: ['./performance-evaluation.component.scss'], +}) +export class PerformanceEvaluationComponent implements OnInit { + personalInfo: any; + user_image: any = "../assets/imgs/profile.png"; + setImage:any; + view: any = [380, 450]; + public performanceData: any=[]; + public length; + + + constructor( public ts: TranslatorService, + public cs: CommonService, + public DS :DashboredService, + public authService: AuthenticationService, + // private events: Events, + // private sanitizer: DomSanitizer, + + ) { + + // this.events.subscribe("img-change", displayImg => { + // console.log("app compont: "+displayImg); + // this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); + + // }); + + + } + + + colorScheme = { + domain: ['#22C6B3', '#094875','#3CB9D5','#1FA269','#0D155E'] + }; + + ngOnInit() { + + this.getProfile(); + + this.performanceData = this.cs.sharedService.getSharedData( + PerformanceAppraisalResponse.PERFORMANCE_DATA, + true + ); + console.log(this.performanceData.length); + //i % 2 == 0 + this.length=this.performanceData.length; + + for(let i=0;i { + if (user) { + this.personalInfo = user; + this.user_image = user.EMPLOYEE_IMAGE + ? "data:image/png;base64," + user.EMPLOYEE_IMAGE + : "../assets/imgs/profile.png"; + + + }}); +} + +} diff --git a/Mohem/src/app/profile/profile-image/profile-image.component.scss b/Mohem/src/app/profile/profile-image/profile-image.component.scss index 3077b04d..c4bcb781 100644 --- a/Mohem/src/app/profile/profile-image/profile-image.component.scss +++ b/Mohem/src/app/profile/profile-image/profile-image.component.scss @@ -32,7 +32,7 @@ width: 234px; background: transparent; border-radius: 50% !important; color:#fff; - background-color: rgba(0,0,0,0.1); +// background-color: rgba(0,0,0,0.1); // box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); img{ diff --git a/Mohem/src/app/profile/profile.module.ts b/Mohem/src/app/profile/profile.module.ts index d18c2b78..c1bd6191 100644 --- a/Mohem/src/app/profile/profile.module.ts +++ b/Mohem/src/app/profile/profile.module.ts @@ -5,10 +5,17 @@ import { Routes, RouterModule } from '@angular/router'; import { HmgCommonModule } from '../hmg-common/hmg-common.module'; import { IonicModule } from '@ionic/angular'; +import { NgxChartsModule } from '@swimlane/ngx-charts'; + + import { ProfilePage } from './profile.page'; import { HomeComponent } from './home/home.component'; +import {EditProfileComponent} from './edit-profile/edit-profile.component'; import {ProfileImageComponent} from './profile-image/profile-image.component' +import {PerformanceEvaluationComponent} from './performance-evaluation/performance-evaluation.component' +import { from } from 'rxjs'; + const routes: Routes = [ { path: '', @@ -29,7 +36,31 @@ const routes: Routes = [ component: ProfileImageComponent } ], - } + + }, + + { + path: '', + component: ProfilePage, + children: [ + { + path: 'editprofile', + component: EditProfileComponent + } + ], + }, + + { + path: '', + component: ProfilePage, + children: [ + { + path: 'performanceevaluation', + component: PerformanceEvaluationComponent + } + ], + }, + ]; @NgModule({ @@ -38,8 +69,10 @@ const routes: Routes = [ FormsModule, IonicModule, HmgCommonModule, + NgxChartsModule, + RouterModule.forChild(routes) ], - declarations: [ProfilePage , HomeComponent,ProfileImageComponent] + declarations: [ProfilePage , HomeComponent,ProfileImageComponent,EditProfileComponent,PerformanceEvaluationComponent] }) export class ProfilePageModule {} diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 482258ad..847cfcc9 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -25,6 +25,7 @@ "en": "Register", "ar": "التسجيل" }, + "sign-out": { "en": "Are you sure you want to Sign Out", "ar": "هل أنت متأكد من إغلاق الحساب" @@ -877,6 +878,18 @@ "en": "My Profile", "ar": "معلوماتي" }, + "edit-profile": { + "en": "Edit Profile", + "ar": "تعديل المعلومات" + }, + "performance-evaluation": { + "en": "Performance Evaluation", + "ar": "تقييم الاداء" + }, + "performance": { + "en": "Performance", + "ar": "الاداء" + }, "changepicture":{ "en":"Change Picture", "ar":"تغيير الصوره" @@ -897,6 +910,10 @@ "en": "Location Name", "ar": "اسم الموقع" }, + "address": { + "en": "Address", + "ar": "العنوان" + }, "payrol": { "en": "Payroll", "ar": "كشف الرواتب" From 396241bc83b1c95dce8d4a2aa8b5caee9a6f75ea Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Tue, 11 Feb 2020 09:00:27 +0300 Subject: [PATCH 2/2] merge emp-profile branch --- Mohem/src/app/home/home.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 95e58003..c29c014b 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -593,7 +593,7 @@ export class HomePage implements OnInit { } openProfilePage() { - this.common.openProfile(); + this.common.openEditProfile(); } }