diff --git a/Mohem/src/app/app-routing.module.ts b/Mohem/src/app/app-routing.module.ts index 4e624a59..9116fc81 100644 --- a/Mohem/src/app/app-routing.module.ts +++ b/Mohem/src/app/app-routing.module.ts @@ -1,26 +1,27 @@ -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: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, + { path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }, + { path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' }, { path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' } -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: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, - { path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }, - { path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' } - - - - -]; - -@NgModule({ - imports: [ - RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) - ], - exports: [RouterModule] -}) -export class AppRoutingModule { } + + + + +]; + +@NgModule({ + imports: [ + RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) + ], + exports: [RouterModule] +}) +export class AppRoutingModule { } 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 c3b17829..e504c38d 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -898,6 +898,13 @@ export class CommonService { public openAccuralPage() { this.nav.navigateForward(["/accrual-balances/home"]); } + + public openMyTeamPage(){ + this.nav.navigateForward(["/my-team/home"]); + } + public openMyTeamDetails(){ + this.nav.navigateForward(["/my-team/details"]); + } public reload(url: string, from: string) { console.log("force reload called from:" + from); // window.location.reload(); diff --git a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts index 85e91a8c..1c7a2e1d 100644 --- a/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts +++ b/Mohem/src/app/hmg-common/services/menu/models/menu-response.ts @@ -4,6 +4,8 @@ export class MenuResponse { public static SHARED_DATA = 'menu_response'; public static SHARED_SEL_EMP= 'sel_empolyee'; public static SHARED_SEL_RESP_ID= 'sel_resp_id'; + public userid:string; + public search:boolean; public List_Menu:ListMenu; public GetMenuEntriesList:MenuEntry; } \ No newline at end of file diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index be1c6674..1fa25d9b 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from "@angular/core"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { MenuController,Events } from "@ionic/angular"; +import { MenuController, Events } from "@ionic/angular"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user"; import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; @@ -22,7 +22,7 @@ export class HomePage implements OnInit { public authService: AuthenticationService, public menuService: MenuService, public common: CommonService, - public events:Events + public events: Events ) {} ngOnInit() { @@ -37,9 +37,11 @@ export class HomePage implements OnInit { .loadAuthenticatedUser() .subscribe((user: AuthenticatedUser) => { if (user) { - this.events.publish('setMenu'); + this.events.publish("setMenu"); this.userData = user; - this.user_image = user.EMPLOYEE_IMAGE ? "data:image/png;base64,"+user.EMPLOYEE_IMAGE : this.user_image; + this.user_image = user.EMPLOYEE_IMAGE + ? "data:image/png;base64," + user.EMPLOYEE_IMAGE + : this.user_image; console.log(user); } else { console.log(user); @@ -47,7 +49,7 @@ export class HomePage implements OnInit { }); } public Vacation_Rule() { - this.common.navigateForward('/vacation-rule/home'); + this.common.navigateForward("/vacation-rule/home"); } private getMenu() { this.menuService.getMenu().subscribe((result: MenuResponse) => { @@ -61,7 +63,22 @@ export class HomePage implements OnInit { } } } - private accrualBalance(){ + private accrualBalance() { this.common.openAccuralPage(); } + public getMeunDetails(index) { + let item = this.menuList[index]; + let selMenu: MenuResponse = new MenuResponse(); + selMenu.List_Menu = item; + selMenu.userid = this.userData.EMPLOYEE_NUMBER; + this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); + if (item.MENU_TYPE == "M") { + this.common.openMyTeamPage(); + // this.navCtrl.push("MySubordinatePage"); + } else if (item.MENU_TYPE == "S") { + //this.navCtrl.push('MySpecialistPage',{"mySpecList":item}); + } else { + //this.getMenuEntries(item); + } + } } diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html new file mode 100644 index 00000000..e13d5938 --- /dev/null +++ b/Mohem/src/app/my-team/details/details.component.html @@ -0,0 +1,158 @@ + + + + + + + + {{headerTitle}} + + + + + + +
+ + + +
{{employee.EMPLOYEE_NAME}}
+
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ {{ts.trPK('myTeam','requestFor')}} + {{employee.EMPLOYEE_NAME}} +
+
+
+ + + + + + +

{{subordinate.EMPLOYEE_NAME}}

+

{{subordinate.POSITION_NAME}}

+ {{subordinate.NUM_OF_SUBORDINATES}} +
+
+ + + + + +
+
+ \ No newline at end of file diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss new file mode 100644 index 00000000..5b22677a --- /dev/null +++ b/Mohem/src/app/my-team/details/details.component.scss @@ -0,0 +1 @@ +.search-icons{font-size:.7cm} \ No newline at end of file diff --git a/Mohem/src/app/my-team/details/details.component.spec.ts b/Mohem/src/app/my-team/details/details.component.spec.ts new file mode 100644 index 00000000..c43eadce --- /dev/null +++ b/Mohem/src/app/my-team/details/details.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DetailsComponent } from './details.component'; + +describe('DetailsComponent', () => { + let component: DetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DetailsComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts new file mode 100644 index 00000000..755e4e5d --- /dev/null +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -0,0 +1,252 @@ +import { Component, OnInit,ViewChild } from "@angular/core"; +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"] +}) + +export class DetailsComponent implements OnInit { + @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; + pageNum: number = 1; + pageLimit: number = 50; + modalFlag: any = false; + empSubordinate: any; + employee: any; + IsReachEnd: boolean = false; + searchKey: any; + public searchKeySelect: any; + infiniteRequest: any; + isSpecialist: boolean = false; + selMenu: MenuResponse = new MenuResponse(); + public headerTitle: string = ""; + constructor( + public menuService: MenuService, + public common: CommonService, + public myTeamService: MyTeamService, + public ts: TranslatorService, + public modalController: ModalController + ) { + console.log("Constuctor called"); + } + ngOnInit() { + this.pageLimit = 50; + this.pageNum = 1; + this.employee = this.common.sharedService.getSharedData( + MyTeamService.EMPLOYEE_SHARED_DATA, + false + ); + console.log(this.employee); + // this.selMenu = this.common.sharedService.getSharedData( + // MenuResponse.SHARED_DATA, + // true + // ); + // this.headerTitle = this.selMenu.List_Menu.MENU_NAME; + // this.isSpecialist = this.navParams.get("isSpecialist") + // ? this.navParams.get("isSpecialist") + // : false; + + if (this.employee) this.getEmpSubordinate(); + } + getEmpSubordinate() { + this.modalFlag = this.employee.isModal; + let selEmpNo: string = null; + this.pageNum = 1; + this.IsReachEnd = false; + let searchEmpNum = ""; + let searchEmpName = ""; + let searchEmpEmail = ""; + if (this.searchKey) { + switch (this.searchKeySelect) { + case "1": { + searchEmpName = this.searchKey; + searchEmpNum = ""; + searchEmpEmail = ""; + + break; + } + case "2": { + searchEmpNum = this.searchKey; + searchEmpName = ""; + searchEmpEmail = ""; + break; + } + case "3": { + searchEmpEmail = this.searchKey; + searchEmpNum = ""; + searchEmpName = ""; + break; + } + default: { + searchEmpNum = ""; + searchEmpName = ""; + searchEmpEmail = ""; + break; + } + } + } else { + searchEmpNum = ""; + searchEmpName = ""; + searchEmpEmail = ""; + } + selEmpNo = this.employee.EMPLOYEE_NUMBER; + const body = { + P_SELECTED_EMPLOYEE_NUMBER: selEmpNo, + P_SEARCH_EMPLOYEE_NUMBER: searchEmpNum, + P_SEARCH_EMPLOYEE_DISPLAY_NAME: searchEmpName, + P_SEARCH_EMAIL_ADDRESS: searchEmpEmail, + P_PAGE_NUM: this.pageNum, + P_PAGE_LIMIT: this.pageLimit + }; + this.infiniteRequest = body; + this.myTeamService + .getEmployeeSubordinates(body) + .subscribe((result: any) => { + this.handleEmpResult(result); + }); + } + + handleEmpResult(result) { + //let employeeSubordinate=resFlag.GetEmployeeSubordinatesList; + //this.nav.push("MyTeamPage",{empSubordinate:employeeSubordinate}); + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetEmployeeSubordinatesList)) { + this.empSubordinate = result.GetEmployeeSubordinatesList; + this.pageNum++; + let lastItemIndex = this.empSubordinate.length - 1; + if (result.GetEmployeeSubordinatesList[lastItemIndex]) { + let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } else { + this.empSubordinate = []; + } + } + } + doInfinite(infiniteScroll) { + if (!this.IsReachEnd && this.infiniteRequest) { + this.infiniteRequest.P_PAGE_NUM = this.pageNum; + this.myTeamService + .getEmployeeSubordinates(this.infiniteRequest) + .subscribe( + (result: any) => { + if (this.common.validResponse(result)) { + this.pageNum++; + if (this.common.hasData(result.GetWorkList)) { + result.GetEmployeeSubordinatesList.forEach(vr => { + 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); + }, + Error => console.log(Error), + () => this.infiniteScroll.complete() + ); + } else { + if (infiniteScroll) this.infiniteScroll.complete(); + } + } + getDetails(index) { + this.empSubordinate[index].isModal = true; + this.common.sharedService.setSharedData( + this.empSubordinate[index], + MyTeamService.EMPLOYEE_SHARED_DATA + ); + this.presentModal(); + } + async presentModal() { + //this.modalFlag = true; + const modal = await this.modalController.create({ + component: DetailsComponent, + keyboardClose: true, + animated: false + }); + let 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 nationality: string; + if (this.isSpecialist == true) { + // respID = this.sharedData.getSharedData( + // MenuResponse.SHARED_SEL_RESP_ID, + // true + // ); + menuType = "S"; + } + selEmpNo = item.EMPLOYEE_NUMBER; + nationality = item.NATIONALITY_CODE; + + const body = { + P_MENU_TYPE: menuType, //to check + P_SELECTED_EMPLOYEE_NUMBER: selEmpNo, + P_SELECTED_RESP_ID: respID, + NationalityCode: nationality + }; + //set emp and resp id + // this.sharedData.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); + // this.sharedData.setSharedData( + // body.P_SELECTED_RESP_ID, + // MenuResponse.SHARED_SEL_RESP_ID + // ); + this.menuService.getMenuEntires(body).subscribe((result: MenuResponse) => { + this.handleMenuEntiresResult(result); + }); + } + + private handleMenuEntiresResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetMenuEntriesList)) { + this.sortMenuEntires(result.GetMenuEntriesList); + } + } + } + sortMenuEntires(list) { + // let tree = this.common.list_to_tree(list); + // this.navCtrl.push("MenuEntriesPage", { menuEntries: tree }); + } + + goToSubordinate() { + 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({ + dismissed: true + }); + } +} diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html new file mode 100644 index 00000000..08c32449 --- /dev/null +++ b/Mohem/src/app/my-team/home/home.component.html @@ -0,0 +1,54 @@ + + + + + + + + {{headerTitle}} + + + + + + + + + + + {{ts.trPK('general','search')}} + + {{ts.trPK('searchForReplacment','name')}} + {{ts.trPK('searchForReplacment','userName')}} + {{ts.trPK('searchForReplacment','email')}} + + + + + + +
+ + + + + + +

{{subordinate.EMPLOYEE_NAME}}

+

{{subordinate.POSITION_NAME}}

+ {{subordinate.NUM_OF_SUBORDINATES}} +
+
+ + + +
+
+ +
+ {{ts.trPK('general','search')}} +
+
\ 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 new file mode 100644 index 00000000..d24aa6cf --- /dev/null +++ b/Mohem/src/app/my-team/home/home.component.scss @@ -0,0 +1,6 @@ +.search-icons{font-size:.7cm} +.badge{ + padding: 10px; + border-radius: 50%; + width: 50px; +} \ No newline at end of file diff --git a/Mohem/src/app/my-team/home/home.component.spec.ts b/Mohem/src/app/my-team/home/home.component.spec.ts new file mode 100644 index 00000000..5ec1377b --- /dev/null +++ b/Mohem/src/app/my-team/home/home.component.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts new file mode 100644 index 00000000..581f66b1 --- /dev/null +++ b/Mohem/src/app/my-team/home/home.component.ts @@ -0,0 +1,208 @@ +import { Component, OnInit } from "@angular/core"; +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 { ModalController } from "@ionic/angular"; +@Component({ + selector: "app-home", + templateUrl: "./home.component.html", + styleUrls: ["./home.component.scss"] +}) +export class HomeComponent implements OnInit { + pageNum: number = 1; + pageLimit: number = 50; + empSubordinate: any; + employee: any; + public headerTitle: string = ""; + IsReachEnd: boolean = false; + searchKey: any; + public isSearch: boolean = false; + public searchKeySelect: any; + infiniteRequest: any; + selMenu: any; + selEmpNo: any; + constructor( + public ts: TranslatorService, + public authService: AuthenticationService, + public common: CommonService, + public myTeamService: MyTeamService, + public modalController: ModalController + ) {} + + ngOnInit() { + this.setIntitial(); + } + getData() {} + setIntitial() { + this.selMenu = this.common.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); + this.headerTitle = this.selMenu.List_Menu.MENU_NAME; + this.selEmpNo = this.selMenu.userid; + this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch; + // this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false; + if(!this.isSearch) + this.getEmpSubordinate(); + } + getEmpSubordinate() { + this.pageNum = 1; + this.IsReachEnd = false; + let searchEmpNum = ""; + let searchEmpName = ""; + let searchEmpEmail = ""; + if (this.searchKey) { + switch (this.searchKeySelect) { + case "1": { + searchEmpName = this.searchKey; + searchEmpNum = ""; + searchEmpEmail = ""; + + break; + } + case "2": { + searchEmpNum = this.searchKey; + searchEmpName = ""; + searchEmpEmail = ""; + break; + } + case "3": { + searchEmpEmail = this.searchKey; + searchEmpNum = ""; + searchEmpName = ""; + break; + } + default: { + searchEmpNum = ""; + searchEmpName = ""; + searchEmpEmail = ""; + break; + } + } + } else { + searchEmpNum = ""; + searchEmpName = ""; + searchEmpEmail = ""; + } + if (this.isSearch) { + this.selEmpNo = null; + } + + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.selEmpNo, + P_SEARCH_EMPLOYEE_NUMBER: searchEmpNum, + P_SEARCH_EMPLOYEE_DISPLAY_NAME: searchEmpName, + P_SEARCH_EMAIL_ADDRESS: searchEmpEmail, + P_PAGE_NUM: this.pageNum, + P_PAGE_LIMIT: this.pageLimit + }; + this.infiniteRequest = body; + this.myTeamService + .getEmployeeSubordinates(body) + .subscribe((result: any) => { + this.handleEmpResult(result); + }); + } + + handleEmpResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetEmployeeSubordinatesList)) { + this.empSubordinate = result.GetEmployeeSubordinatesList; + this.pageNum++; + 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; + } + } + } else { + this.empSubordinate = []; + } + } + } + doInfinite(infiniteScroll) { + if (!this.IsReachEnd && this.infiniteRequest) { + this.infiniteRequest.P_PAGE_NUM = this.pageNum; + this.myTeamService + .getEmployeeSubordinates(this.infiniteRequest) + .subscribe( + (result: any) => { + if (this.common.validResponse(result)) { + this.pageNum++; + if (this.common.hasData(result.GetWorkList)) { + result.GetEmployeeSubordinatesList.forEach(vr => { + 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) { + infiniteScroll.complete(); + } + // console.log(resFlag); + }, + Error => console.log(Error), + () => infiniteScroll.complete() + ); + } else { + if (infiniteScroll) { + infiniteScroll.complete(); + } + } + } + getDetails(index) { + + this.common.sharedService.setSharedData( + this.empSubordinate[index], + MyTeamService.EMPLOYEE_SHARED_DATA + ); + + this.common.sharedService.setSharedData( + this.selMenu, + MenuResponse.SHARED_DATA + ); + + this.common.openMyTeamDetails(); + this.modalController.dismiss(); + //this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]}); + } + toggleSearch() { + this.isSearch = !this.isSearch; + } + goToSubordinate() { + //this.navCtrl.push("MySubordinatePage",{isSearch:true}); + //this.getEmpSubordinate(); + this.presentModal(); + } + async presentModal() { + const modal = await this.modalController.create({ + component: HomeComponent, + keyboardClose: true, + animated: false, + componentProps:{isSearch:true} + }); + let dismissed = modal.onDidDismiss(); + dismissed.then(() => { + this.isSearch = false; + }); + return await modal.present(); + } + dismiss(){ + this.modalController.dismiss({ + dismissed: true + }); + } +} diff --git a/Mohem/src/app/my-team/my-team.module.ts b/Mohem/src/app/my-team/my-team.module.ts new file mode 100644 index 00000000..60bab748 --- /dev/null +++ b/Mohem/src/app/my-team/my-team.module.ts @@ -0,0 +1,36 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { Routes, RouterModule } from '@angular/router'; +import { HomeComponent } from './home/home.component'; +import { DetailsComponent } from './details/details.component'; +import { IonicModule } from '@ionic/angular'; + +import { MyTeamPage } from './my-team.page'; + +const routes: Routes = [ + { + path: '', + component: MyTeamPage, + children:[{ + path: 'home', + component: HomeComponent + }, + { + path: 'details', + component: DetailsComponent + } + ] + } +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + RouterModule.forChild(routes) + ], + declarations: [MyTeamPage,HomeComponent,DetailsComponent] +}) +export class MyTeamPageModule {} diff --git a/Mohem/src/app/my-team/my-team.page.html b/Mohem/src/app/my-team/my-team.page.html new file mode 100644 index 00000000..e020ca2c --- /dev/null +++ b/Mohem/src/app/my-team/my-team.page.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/my-team/my-team.page.scss b/Mohem/src/app/my-team/my-team.page.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/my-team/my-team.page.spec.ts b/Mohem/src/app/my-team/my-team.page.spec.ts new file mode 100644 index 00000000..c92f6b04 --- /dev/null +++ b/Mohem/src/app/my-team/my-team.page.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MyTeamPage } from './my-team.page'; + +describe('MyTeamPage', () => { + let component: MyTeamPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MyTeamPage ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MyTeamPage); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/my-team/my-team.page.ts b/Mohem/src/app/my-team/my-team.page.ts new file mode 100644 index 00000000..6fb64335 --- /dev/null +++ b/Mohem/src/app/my-team/my-team.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-my-team', + templateUrl: './my-team.page.html', + styleUrls: ['./my-team.page.scss'], +}) +export class MyTeamPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/Mohem/src/app/my-team/service/my-team.service.spec.ts b/Mohem/src/app/my-team/service/my-team.service.spec.ts new file mode 100644 index 00000000..ccb20921 --- /dev/null +++ b/Mohem/src/app/my-team/service/my-team.service.spec.ts @@ -0,0 +1,12 @@ +import { TestBed } from '@angular/core/testing'; + +import { MyTeamService } from './my-team.service'; + +describe('MyTeamService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: MyTeamService = TestBed.get(MyTeamService); + expect(service).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/my-team/service/my-team.service.ts b/Mohem/src/app/my-team/service/my-team.service.ts new file mode 100644 index 00000000..ebda3f1d --- /dev/null +++ b/Mohem/src/app/my-team/service/my-team.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@angular/core'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; +import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; +@Injectable({ + providedIn: 'root' +}) +export class MyTeamService { + public static EMPLOYEE_SHARED_DATA = 'employee'; + public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES'; + constructor( + public con: ConnectorService, + private authService: AuthenticationService + ) { } + public getEmployeeSubordinates(absence: any, onError?: any, errorLabel?: string){ + const request = absence; + this.authService.authenticateRequest(request); + return this.con.post(MyTeamService.getMyTeam, request, onError, errorLabel); + } +} diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 3db8c7ea..fa6d8034 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -761,31 +761,31 @@ }, "confirmPassword": { "en": "Confirm Password", - "ar": "" + "ar": "تأكيد كلمة المرور" }, "newPassword": { "en": "New Password", - "ar": "" + "ar": "كلمة المرور الجديدة" }, "changePassword": { "en": "Change Password", - "ar": "" + "ar": "تغيير كلمة المرور" }, "codeNumber": { "en": "verification code", - "ar": "" + "ar": "رقم الرمز" }, "emptyNewPassword": { "en": "Please fill New Password field", - "ar": "" + "ar": "الرجاء ملء حقل كلمة المرور الجديدة" }, "emptyOldPassword": { "en": "Please fill Old Password field", - "ar": "" + "ar": "الرجاء ملء حقل كلمة المرور الجديدة" }, "emptyConfirmPassword": { "en": "Please fill Confirm Password field", - "ar": "" + "ar": "الرجاء ملء حقل تأكيد كلمة المرور" } }, "attendance": { @@ -955,5 +955,42 @@ "en":"

Enter the date for which you wish to view your accrual balances.

", "ar":"

أدخل التاريخ الذي تريد عرض الإستحقاقات له

" } + }, + "myTeam":{ + + "requestFor":{ + "en":"Request for", + "ar":"اطلب ل" + } + }, + "searchForReplacment": { + "searchForReplacment": { + "en":"Search for an Employee", + "ar":"ابحث عن موظف" + }, + "searchBy": { + "en": " Search by", + "ar": " البحث بـ" + }, + "name":{ + "en":"Name", + "ar":"الاسم" + }, + "userName": { + "en":"User Name", + "ar":"اسم المستخدم" + }, + "email": { + "en":"Email", + "ar":"البريد الإلكتروني" + }, + "search": { + "en":"Search", + "ar":"بحث" + }, + "tip":{ + "en": "You can search for an employee by Name , User Name and Email ", + "ar":"يمكنك البحث عن موظف ب الاسم , اسم المستخدم ,أو البريد الإلكتروني " + } } } \ No newline at end of file diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 9c90f0df..be64b008 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -340,13 +340,15 @@ ion-card-header{ ion-col.colBold,ion-col.colBold>label{ // font-weight: bold; color:var(--customnavy); - :root[dir="ltr"]{ - font-family: var(--fontFamilyBoldEN) !important; - } - :root[dir="rtl"]{ - font-family: var(--fontFamilyIOSAR) !important; - font-weight: bold; - } + font-weight:bold; + // :root[dir="ltr"]{ + // font-family: var(--fontFamilyBoldEN) !important; + + // } + // :root[dir="rtl"]{ + // font-family: var(--fontFamilyIOSAR) !important; + // font-weight: bold; + // } font-size: 15px; } // .boldTxt{