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 45bbb01e..55beb912 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1109,6 +1109,9 @@ public getMonthNameAr(value: number): string { public openMyTeamPage() { this.nav.navigateForward(['/my-team/home']); } + public openMyTeamDetailPage() { + this.nav.navigateForward(['/my-team/details']); + } public openPage(link: string) { this.nav.navigateForward([link]); diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss index 87069a59..f497860c 100644 --- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss @@ -45,10 +45,19 @@ font-size: 18px; color: black; margin: 0; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } .title{ font-size: 15px; color: #888; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + display: block; } } .image-container{ diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index 1191cf84..b7e24248 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -49,47 +49,69 @@ -
+
+ + + Attendance + + + Team Members + + + About + + +
+ +
- -

Employee

-

197400

+ +

Employee ID

+

{{employee.EMPLOYEE_NUMBER}}

Category

-

Permanent

+

{{employee.EMPLOYMENT_CATEGORY_MEANING}}

-

Category

-

Permanent

+

Address

+

{{employee.LOCATION_NAME}}

-

Category

-

Permanent

+

Phone Number

+

{{employee.EMPLOYEE_MOBILE_NUMBER}}

-

Category

-

Permanent

+

Business Group

+

{{employee.ORGANIZATION_NAME}}

-

Category

-

Permanent

+

Job

+

{{employee.JOB_NAME}}

-

Category

-

Permanent

+

Payroll

+

{{employee.PAYROLL_NAME}}

-

Category

-

Permanent

+

Organization Email Address

+

{{employee.EMPLOYEE_EMAIL_ADDRESS}}

-

Category

-

Permanent

+

Position

+

{{employee.POSITION_NAME}}

-

Category

-

Permanent

+

Grade

+

{{employee.GRADE_NAME}}

diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss index 89216018..0da377f8 100644 --- a/Mohem/src/app/my-team/details/details.component.scss +++ b/Mohem/src/app/my-team/details/details.component.scss @@ -107,8 +107,55 @@ ion-title{ } } } -.emplyee-information-indetail{ +.employee-information-indetail{ background: white; - margin-top: 50px; + margin-top: 15px; border-radius: 20px; -} \ No newline at end of file + ion-col{ + padding: 15px; + border-bottom: 1px solid #ccc; + } + h2{ + font-size: 13px; + font-family: WorkSans-Bold; + margin: 0; + } + p{ + font-size: 13px; + margin: 0; + } +} + +.segments-container { + border-radius: 100px; + overflow: hidden; + margin-top: 15px; + background: white; + color: black; +} + +.active-Segment { + font-size: 0.3cm !important; + background: #22c6b3 !important; + text-transform: none; + --color-checked: none; + border-radius: 100px; + } + .active-Segment ion-label{ + font-size: 11px; + color: white !important; + } + .normal-Segment ion-label{ + color: black !important; + font-size: 11px; + } + .normal-Segment { + font-size: 0.3cm !important; + text-transform: none; + --color-checked: none; + } + .colum-container{ + padding: 15px; + border-bottom: 1px solid #ccc; + } + diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index 60173f23..feb1196b 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -1,35 +1,36 @@ -import { Component, OnInit,ViewChild } from "@angular/core"; -import { Location } from "@angular/common"; -import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { CommonService } from "src/app/hmg-common/services/common/common.service"; -import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; -import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; -import { MyTeamService } from "../service/my-team.service"; -import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; -import { ModalController } from "@ionic/angular"; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Location } from '@angular/common'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { MyTeamService } from '../service/my-team.service'; +import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; +import { ModalController } from '@ionic/angular'; import { IonInfiniteScroll } from '@ionic/angular'; @Component({ - selector: "app-details", - templateUrl: "./details.component.html", - styleUrls: ["./details.component.scss"] + selector: 'app-details', + templateUrl: './details.component.html', + styleUrls: ['./details.component.scss'] }) export class DetailsComponent implements OnInit { - public static opendEmployeesARR='opend_employees_arr'; + public static opendEmployeesARR = 'opend_employees_arr'; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; - pageNum: number = 1; - pageLimit: number = 50; + public activeSegment = 'About'; + pageNum = 1; + pageLimit = 50; modalFlag: any = false; empSubordinate: any; employee: any; - IsReachEnd: boolean = false; + IsReachEnd = false; searchKey: any; public searchKeySelect: any; infiniteRequest: any; - isSpecialist: boolean = false; + isSpecialist = false; selMenu: MenuResponse = new MenuResponse(); - public opendEmployees :any=[]; - public headerTitle: string = ""; + public opendEmployees: any = []; + public headerTitle = ''; public userImage: any = '../assets/imgs/profile.png'; constructor( public menuService: MenuService, @@ -39,58 +40,48 @@ export class DetailsComponent implements OnInit { public modalController: ModalController, private location: Location, public authService: AuthenticationService, - ) { - console.log("Constuctor called"); - } + ) { } + ngOnInit() { - // this.intializeMemberDetail(); + this.intializeMemberDetail(); + } + + public segmentChanged(event: any) { + console.log(event); + this.activeSegment = event.detail.value; } - intializeMemberDetail(userID?){ - + intializeMemberDetail(userID?) { this.pageLimit = 50; this.pageNum = 1; - this.employee = this.common.sharedService.getSharedData( - MyTeamService.EMPLOYEE_SHARED_DATA, - false - ); - let employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false); - if( employees ){ + this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); + const employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false); + if ( employees ) { this.opendEmployees.push(this.employee); this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR); } - //this.opendEmployees = employees; - - console.log(this.employee); this.selMenu = this.common.sharedService.getSharedData( MenuResponse.SHARED_DATA, false ); - this.headerTitle = this.selMenu.List_Menu.MENU_NAME; - - - this.isSpecialist = this.common.sharedService.getSharedData( - 'isSpecialist', - false - ) ? true :false; + this.headerTitle = this.selMenu.List_Menu.MENU_NAME; - // this.isSpecialist = this.navParams.get("isSpecialist") - // ? this.navParams.get("isSpecialist") - // : false; + this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false; - if (this.employee) this.getEmpSubordinate(userID); + if (this.employee) { + this.getEmpSubordinate(userID); + } } goback() { - //this.location.back(); const user = this.authService.getAuthenticatedUser(); - if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ - this.opendEmployees=[]; + if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ + this.opendEmployees = []; this.common.openMyTeamPage(); - }else{ - for(let i=0;i { if (this.common.validResponse(result)) { - this.infiniteRequest.P_PAGE_NUM= this.pageNum++; + this.infiniteRequest.P_PAGE_NUM = this.pageNum++; if (this.common.hasData(result.GetEmployeeSubordinatesList)) { result.GetEmployeeSubordinatesList.forEach(vr => { - if (vr.ROW_NUM == vr.NO_OF_ROWS) { + if (vr.ROW_NUM === vr.NO_OF_ROWS) { this.IsReachEnd = true; } else { this.IsReachEnd = false; } this.empSubordinate.push(vr); - // this.pro.GetVacationRulesList.push(vr); }); } else { this.IsReachEnd = true; } } - //this.P_PAGE_NUM++; - if (infiniteScroll) this.infiniteScroll.complete(); - - // console.log(resFlag); + if (infiniteScroll) { this.infiniteScroll.complete(); } }, Error => console.log(Error), () => this.infiniteScroll.complete() ); } else { - if (infiniteScroll) this.infiniteScroll.complete(); + if (infiniteScroll) { this.infiniteScroll.complete(); } } } getDetails(index) { - //this.empSubordinate[index].isModal = true; this.common.sharedService.setSharedData( this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA ); this.intializeMemberDetail(); - // this.presentModal(); } async presentModal() { - //this.modalFlag = true; const modal = await this.modalController.create({ component: DetailsComponent, keyboardClose: true, animated: false }); - let dismissed = modal.onDidDismiss(); + const dismissed = modal.onDidDismiss(); dismissed.then(() => { this.modalFlag = false; }); return await modal.present(); } getMenuEntries(item) { - let selEmpNo: String = null; - let respID: any = -999; - let menuType: string = "M"; + let selEmpNo = null; + const respID: any = -999; + let menuType = 'M'; let nationality: string; - if (this.isSpecialist == true) { - // respID = this.sharedData.getSharedData( - // MenuResponse.SHARED_SEL_RESP_ID, - // true - // ); - menuType = "S"; + if (this.isSpecialist === true) { + menuType = 'S'; } selEmpNo = item.EMPLOYEE_NUMBER; nationality = item.NATIONALITY_CODE; const body = { - P_MENU_TYPE: menuType, //to check + P_MENU_TYPE: menuType, // to check P_SELECTED_EMPLOYEE_NUMBER: selEmpNo, P_SELECTED_RESP_ID: respID, NationalityCode: nationality }; - //set emp and resp id - this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); - this.common.sharedService.setSharedData( + // set emp and resp id + this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); + this.common.sharedService.setSharedData( body.P_SELECTED_RESP_ID, MenuResponse.SHARED_SEL_RESP_ID ); @@ -286,12 +263,9 @@ export class DetailsComponent implements OnInit { sortMenuEntires(list) { this.close().then(() => { }); - let tree = this.common.list_to_tree(list); - this.common.sharedService.setSharedData(tree, "menuEntries"); - // this.common.navigateForward("/eit/homepage"); + const tree = this.common.list_to_tree(list); + this.common.sharedService.setSharedData(tree, 'menuEntries'); this.common.openEITPage(); - // let tree = this.common.list_to_tree(list); - // this.navCtrl.push("MenuEntriesPage", { menuEntries: tree }); } public async close() { @@ -301,14 +275,13 @@ export class DetailsComponent implements OnInit { } } goToSubordinate() { - this.selMenu.search=true; + this.selMenu.search = true; this.common.sharedService.setSharedData( this.selMenu, MenuResponse.SHARED_DATA ); - + this.common.openMyTeamPage(); - //this.navCtrl.push("MySubordinatePage", { isSearch: true }); } dismiss() { this.modalController.dismiss({ diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html index 0fbd79b2..6e76b337 100644 --- a/Mohem/src/app/my-team/home/home.component.html +++ b/Mohem/src/app/my-team/home/home.component.html @@ -48,11 +48,20 @@ - +
+ +
+ + + Clear Search + + + +
+ checkOut="-" + (click)="getDetails(i)"> - + \ No newline at end of file diff --git a/Mohem/src/app/my-team/home/home.component.scss b/Mohem/src/app/my-team/home/home.component.scss index 2e2e8b19..650979e9 100644 --- a/Mohem/src/app/my-team/home/home.component.scss +++ b/Mohem/src/app/my-team/home/home.component.scss @@ -141,3 +141,23 @@ ion-content { border: 1px solid #ccc; margin: 0px auto 6px; } + +.search-container{ + margin-top: 15px; + ion-col{ + background: white; + border-radius: 12px; + padding-right: 10px; + flex: none; + ion-icon{ + margin-right: 3px; + font-size: 14px; + margin-left: 3px; + vertical-align: middle; + } + span{ + font-size: 12px; + vertical-align: middle; + } + } +} diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts index c07ec4e9..e0d67465 100644 --- a/Mohem/src/app/my-team/home/home.component.ts +++ b/Mohem/src/app/my-team/home/home.component.ts @@ -92,7 +92,7 @@ export class HomeComponent implements OnInit { ) {} ngOnInit() { - // this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR); + this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR); this.setIntitial(); } @@ -117,8 +117,9 @@ export class HomeComponent implements OnInit { } searchEmployee() { - // this.isSearch = true; - // this.getEmpSubordinate(); + this.isSearch = true; + this.empSubordinate = []; + this.getEmpSubordinate(); } getEmpSubordinate() { @@ -130,6 +131,8 @@ export class HomeComponent implements OnInit { if (this.isSearch) { this.selEmpNo = null; + } else { + this.selEmpNo = this.selMenu.userid; } const body = { @@ -142,51 +145,44 @@ export class HomeComponent implements OnInit { }; this.getEmployeeSubordinatesRequestObject = body; this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => { - this.handleEmpResult(result); - }); + if (this.common.validResponse(result)) { + this.handleEmpResult(result.GetEmployeeSubordinatesList); + } + }); } handleEmpResult(result) { - if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - this.empSubordinate = result.GetEmployeeSubordinatesList; + const lastItemIndex = result.length - 1; + const lastItem = result[lastItemIndex]; + if (lastItem) { + if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) { + this.isReachEnd = true; + this.infiniteScroll.complete(); + } else { + this.isReachEnd = false; + this.infiniteScroll.complete(); + } + } + if (this.common.hasData(result)) { this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++; - const lastItemIndex = this.empSubordinate.length - 1; - if (result.GetEmployeeSubordinatesList[lastItemIndex]) { - const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; - if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) { - this.isReachEnd = true; - } else { - this.isReachEnd = false; - } + if (this.empSubordinate.length === 0) { + this.empSubordinate = result; + } else { + this.empSubordinate = this.empSubordinate.concat(result); } } else { this.empSubordinate = []; } - } } doInfinite(infiniteScroll) { if (!this.isReachEnd) { this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => { if (this.common.validResponse(result)) { - this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++; - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - result.GetEmployeeSubordinatesList.forEach(element => { - if (element.ROW_NUM === element.NO_OF_ROWS) { - this.isReachEnd = true; - } else { - this.isReachEnd = false; - } - this.empSubordinate.push(element); - }); - } else { - this.isReachEnd = true; - } + this.handleEmpResult(result.GetEmployeeSubordinatesList); } this.infiniteScroll.complete(); - } - ); + }); } else { if (this.infiniteScroll) { this.infiniteScroll.complete(); @@ -194,12 +190,20 @@ export class HomeComponent implements OnInit { } } + clearSearch() { + this.isSearch = false; + this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1; + this.empSubordinate = []; + this.isReachEnd = false; + this.searchNameOrUserName = ''; + this.searchEmail = ''; + this.getEmpSubordinate(); + } + getDetails(index) { this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA); this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA); - // this.close().then(() => { - // this.common.openMyTeamDetails(); - // }); + this.common.openMyTeamDetailPage(); } goToSubordinate() { diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 1ab21604..8aff8902 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -47,7 +47,6 @@ Advanced Search -