mohemm q2 changes

MOHEMM-Q2-DEV
umasoodch 4 years ago
parent f997ac8812
commit 6b02bc1a76

@ -22,50 +22,68 @@
<!-- colorBG -->
<div class="contentEit" style="background: #f3f1f1;">
<div class="header-div">
<!-- <ion-buttons slot="end">
<button class="headerBtn" (click)="AccrualBalances()">
<img class="headerImg" src="../assets/imgs/accubalance.png">
</button>
</ion-buttons> -->
<!-- <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<p class="Title">{{ts.trPK('absenceList','absenceList')}}</p> -->
</div>
<div class="">
<div >
<div>
<ion-grid class="headerGrid">
<div >
<ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY"
placeholder="DD MMMM YYYY" cancelText="{{ts.trPK('general','cancel')}}"
doneText="{{ts.trPK('general','done')}}" (ionChange)="getAccrualBalance()"></ion-datetime>
<ion-icon class="iconCalendar" ios="ios-calendar" md="md-calendar"></ion-icon>
</div>
<div style="position: relative;">
<!-- <div [ngClass]=" direction == 'ltr' ? 'subTitle' : 'subTitle-ar'" >{{ts.trPK('absenceList','AccrualUsed')}} </div> -->
<div class="label-container">
<ion-row [ngClass]=" direction == 'ltr' ? 'green-label-container' : 'green-label-container-ar'" >
<label class="current-label"> </label>
<span [ngClass]=" direction == 'ltr' ? 'span-one' : 'span-one-ar'" >{{ts.trPK('absenceList','currentBalance')}}</span>
<span class="span-two">{{accrualNet}}</span>
</ion-row>
<!-- <div [ngClass]=" direction == 'ltr' ? 'yearLabel' : 'yearLabel-ar'">2021</div> -->
</div>
<!-- <div class="label-container">
<ion-row [ngClass]=" direction == 'ltr' ? 'black-label-container' : 'black-label-container-ar'" >
<label class="current-label-container"> </label>
<span [ngClass]=" direction == 'ltr' ? 'black-span1' : 'black-span1-ar'" >{{ts.trPK('absenceList','currentBalance')}}</span>
<span class="black-span2">{{accrualNet}}</span>
</ion-row>
<div [ngClass]=" direction == 'ltr' ? 'yearLabel' : 'yearLabel-ar'" > {{ts.trPK('absenceList','PreviousYears')}}</div>
</div> -->
<div class="label-container">
<ion-row [ngClass]=" direction == 'ltr' ? 'black-label-container' : 'black-label-container-ar'" >
<label class="used-label-container"> </label>
<span [ngClass]=" direction == 'ltr' ? 'red-span1' : 'red-span1-ar'" >{{ts.trPK('absenceList','usedBalance')}}</span>
<span class="red-span2">{{accrualUsed}}</span>
</ion-row>
</div>
<div class="graph-container">
<p-chart [ngClass]=" direction == 'ltr' ? 'today-graph' : 'today-graph-ar'" type="doughnut" [data]="data" [options]="options" ></p-chart>
</div>
</div>
</ion-grid>
<ion-grid class="headerGrid">
<!-- <ion-grid class="headerGrid">
<div style="color: black;">
<div class="result-graph">
<div >
<!-- <ion-item> -->
<!-- <ion-label class="datelabel">{{request.P_EFFECTIVE_DATE}}</ion-label> -->
<ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY"
placeholder="DD MMMM YYYY" cancelText="{{ts.trPK('general','cancel')}}"
doneText="{{ts.trPK('general','done')}}" (ionChange)="getAccrualBalance()"></ion-datetime>
<!-- <ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY"
placeholder="DD MMMM YYYY" (ionChange)="getAccrualBalance()"></ion-datetime> -->
<ion-icon class="iconCalendar" ios="ios-calendar" md="md-calendar"></ion-icon>
<!-- </ion-item> -->
</div>
<div style=" border-bottom: 1px solid #a7a4a4; margin-bottom: 12px;
margin-top: -10px; margin-right: -9px;"></div>
<div class="result-text-container">
<!-- <h2>{{totalnumber}}</h2> -->
<!-- <h2>{{accrualNet + accrualUsed + accrualYearly}}</h2> -->
<!-- <span>{{ts.trPK('absenceList','totalNumber')}}</span> -->
</div>
@ -94,38 +112,10 @@
</ion-row>
</ion-col>
</div>
<!-- <div [ngClass]=" direction == 'ltr' ? 'div-orng' : 'div-orng-ar'">
<ion-col>
<ion-row>
<label class="orng-label">{{ts.trPK('absenceList','annualBalance')}}</label>
</ion-row>
<ion-row>
<label class="orng-amount" for="">{{accrualYearly}}</label>
</ion-row>
</ion-col>
</div> -->
<!-- <div style="position: relative;
left: 59%;
bottom: 73px;
color: black;
background-color: #269DB8;
width: 16%;
height: 6px;">
<ion-col>
<ion-row>
<label class="blue-label">text</label>
</ion-row>
<ion-row> -->
<!-- <label class="blue-amount" for="">{{getleaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT}}</label> -->
<!-- </ion-row>
</ion-col>
</div> -->
</div>
</ion-grid>
</div>
</ion-grid> -->
</div>

@ -56,13 +56,9 @@
.header-div {
background-color: #269DB8;
text-transform: capitalize;
height: 160px;
/* position: relative; */
/* display: block; */
margin-bottom: -28px;
height: 100px;
}
.header-toolbar-new{
@ -102,12 +98,9 @@
}
.datetime{
// text-align: center;
// font-family: WorkSans-Bold;
// margin-left: 111px;
text-align: center;
font-family: WorkSans-Bold;
margin-left: 47px;
margin-left: -120px;
margin-top: -19px;
}
@ -119,52 +112,40 @@
.iconCalendar{
// margin-left: -241px;
// margin-top: 5px;
margin-left: 30px !important;
margin-left: -12px !important;
width: 22% !important;
height: 26px !important;
margin-top: -69px !important;
margin-bottom: 20px !important;
margin-top: -50px !important;
margin-bottom: 23px !important;
}
.today-graph{
// display:block !important;
// height: 150px !important;
// width: 300 !important;
// margin-left: -70px !important;
display: block !important;
height: 196px;
width: 385px;
padding-left: 51px;
// padding-top: 29px;
margin-left: -70px !important;
}
.today-graph-ar{
// display: block !important;
// height: 196px;
// width: 385px;
// padding-left: 51px;
/* margin-left: -70px !important; */
// font-size: 14px;
// margin-left: -48px;
// margin-right: 63px;
// margin-bottom: -30px;
display: block !important;
height: 175px;
width: 320px;
padding-left: 51px;
font-size: 14px;
margin-right: 75px;
margin-bottom: -30px;
}
// .today-graph{
// display: block !important;
// height: 196px;
// width: 385px;
// padding-left: 51px;
// // padding-top: 29px;
// margin-left: -70px !important;
// }
// .today-graph-ar{
// display: block !important;
// height: 175px;
// width: 320px;
// padding-left: 51px;
// font-size: 14px;
// margin-right: 75px;
// margin-bottom: -30px;
// }
.headerGrid{
background-color: white !important;
border: 1px solid #cac8c8 !important;
border-radius: 20px !important;
padding-top: 28px;
padding-bottom: 14px;
padding-bottom: 26px;
margin-left: 13px;
margin-right: 13px;
margin-top: -136px;
margin-top: -93px;
margin-bottom: 10px;
}
@ -310,3 +291,217 @@ margin-top: -13px;
height: 6px;
right: 16px;
}
.subTitle{
margin-top: -10px;
margin-left: 10px;
font-family: WorkSans-Bold;
font-size: 16px;
}
.subTitle-ar{
margin-top: -10px;
margin-right: 10px;
font-family: WorkSans-Bold;
font-size: 16px;
}
.today-graph {
display: block;
height: 102px;
width: 211px;
margin-top: 20px;
margin-left: -39px;
max-height: 4cm;
}
.today-graph-ar {
display: block;
height: 102px;
width: 211px;
margin-top: 20px;
/* margin-right: -39px; */
max-height: 4cm;
margin-right: 105px;
}
.graph-container{
margin-left: 160px;
position: relative;
margin-top: -98px;
}
// .label-container{
// position: absolute;
// // width: 20%;
// // right: 30px;
// top: 50%;
// margin-top: -27px;
// left: 20px;
// }
.green-label-container{
margin-top: 20px; margin-left: 12px;
}
.green-label-container-ar{
margin-top: 20px; margin-right: 12px;
}
.black-label-container{
margin-left: 12px;
}
.black-label-container-ar{
margin-right: 12px;
}
.used-label-container{
// border-top: 5px solid #292F42;
// padding: 1px 0px;
// margin: 15px 0px
width: 12px;
height: 12px;
padding-right: -10px;
border-radius: 100%;
background-color: #b60c0c;
margin-top: 30px;
}
.current-label-container{
width: 12px;
height: 12px;
padding-right: -10px;
border-radius: 100%;
background-color: black;
margin-top: 21px;
}
.current-label{
width: 12px;
height: 12px;
padding-right: -10px;
border-radius: 100%;
background-color: #269DB8;
// margin-top: 30px;
}
.span-one{
// display: block;
// font-size: 12px;
// color: black;
display: block;
font-size: 12px;
color: #269DB8;
margin-left: 6px;
margin-top: -2px;
font-weight: bold;
}
.span-one-ar{
display: block;
font-size: 12px;
color: #269DB8;
margin-right: 6px;
margin-top: -2px;
font-weight: bold;
}
.span-two{
// display: block;
// font-size: 22px;
display: block;
font-size: 12px;
color: #269DB8;
margin-left: 6px;
margin-top: -2px;
font-weight: bold;
font-family: WorkSans-Bold;
}
.black-span1{
// display: block;
// font-size: 12px;
// color: black;
display: block;
font-size: 12px;
color: black;
margin-left: 6px;
margin-top: 20px;
font-weight: bold;
}
.black-span1-ar{
// display: block;
// font-size: 12px;
// color: black;
display: block;
font-size: 12px;
color: black;
margin-right: 6px;
margin-top: 20px;
font-weight: bold;
}
.black-span2{
// display: block;
// font-size: 22px;
display: block;
font-size: 12px;
color: black;
margin-left: 6px;
margin-top: 20px;
font-weight: bold;
font-family: WorkSans-Bold;
}
.red-span1{
// display: block;
// font-size: 12px;
// color: black;
display: block;
font-size: 12px;
color: #b60c0c;
margin-left: 6px;
margin-top: 28px;
font-weight: bold;
}
.red-span1-ar{
// display: block;
// font-size: 12px;
// color: black;
display: block;
font-size: 12px;
color: #b60c0c;
margin-right: 6px;
margin-top: 28px;
font-weight: bold;
}
.red-span2{
// display: block;
// font-size: 22px;
display: block;
font-size: 12px;
color: #b60c0c;
margin-left: 6px;
margin-top: 28px;
font-weight: bold;
font-family: WorkSans-Bold;
}
.yearLabel{
font-size: 13px;
color: gray;
font-family: WorkSans-Bold;
margin-left: 29px;
margin-top: 5px;
}
.yearLabel-ar{
font-size: 13px;
color: gray;
font-family: WorkSans-Bold;
margin-right: 29px;
margin-top: 5px;
}

@ -37,17 +37,18 @@ export class HomeComponent implements OnInit {
balance: any;
ACCRUAL_NET_ENTITLEMENT: any;
ACCRUAL_USED_ENTITLEMENT: any;
ACCRUAL_YEARLY_ENTITLEMENT: any;
totalnumber: any;
public direction: string;
ACCRUAL_YEARLY_ENTITLEMENT: any;
totalnumber: any;
public direction: string;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }};
gaugeType = "full";
// gaugeValue = 11.200;
// gaugeLabel = "";
legend: { display: false }
};
gaugeType = "full";
// gaugeValue = 11.200;
// gaugeLabel = "";
constructor(
public common: CommonService,
@ -58,22 +59,23 @@ export class HomeComponent implements OnInit {
public authService: AuthenticationService
) {
this.direction = TranslatorService.getCurrentDirection();
// this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
// this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
}
ngOnInit() {
this.Sdate = new Date().toISOString();
this.getUserDetails();
this.getAccrualBalance();
}
private getUserDetails(){
private getUserDetails() {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
// this.emp_no=user.EMPLOYEE_NUMBER;
// this.getAccrualBalance();
}
});
if (user) {
// this.emp_no=user.EMPLOYEE_NUMBER;
// this.getAccrualBalance();
}
});
@ -101,34 +103,36 @@ export class HomeComponent implements OnInit {
this.accrualNet = this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.leaveAccrualBalance.ACCRUAL_USED_ENTITLEMENT;
this.accrualYearly = this.leaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT;
this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber= this.totalnumber.toFixed(3);
this.totalnumber = this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber = this.totalnumber.toFixed(3);
this.request = this.common.sharedService.getSharedData('leaveAccrualBalanceDate', false);
console.log("this.request" + this.request.P_EFFECTIVE_DATE);
this.effectiveDate = this.request.P_EFFECTIVE_DATE;
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
// { data: [this.accrualNet,this.accrualYearly,this.accrualUsed],
{
data: [this.accrualNet,this.accrualUsed],
backgroundColor: [
'#1FA269',
'#CB3232',],
borderWidth: 2
}
]
};
// { data: [this.accrualNet,this.accrualYearly,this.accrualUsed],
{
data: [this.accrualNet, this.accrualUsed],
backgroundColor: [
// '#1FA269',
// '#CB3232',],
'#269DB8',
'#b60c0c',],
borderWidth: 1
}
]
};
this.getAbsenceTransaction();
}
AccrualBalances() {
AccrualBalances() {
this.common.openAccuralPage();
}
AttachmentDocuments(id) {
AttachmentDocuments(id) {
const request = {
P_ABSENCE_ATTENDANCE_ID: id
};
@ -156,7 +160,7 @@ AttachmentDocuments(id) {
//this.GetAbsenceTransactionList =result.GetAbsenceTransactionList;
}
}
getAbsenceTransaction() {
getAbsenceTransaction() {
this.IsReachEnd = false;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
@ -170,7 +174,7 @@ getAbsenceTransaction() {
});
}
handleAbsListResult(result) {
handleAbsListResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetAbsenceTransactionList)) {
this.GetAbsenceTransactionList = result.GetAbsenceTransactionList;
@ -187,7 +191,7 @@ getAbsenceTransaction() {
}
}
}
doInfinite(event: any) {
doInfinite(event: any) {
if (!this.IsReachEnd) {
// this.P_PAGE_NUM++;
const request = {
@ -227,11 +231,11 @@ doInfinite(event: any) {
}
}
}
createAbsence() {
createAbsence() {
this.common.openSubmitAbsencePage();
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
getAccrualBalance() {
if (this.Sdate) {
let today = new Date(this.Sdate);
@ -252,31 +256,32 @@ createAbsence() {
});
}
}
handleAccrualResult(result) {
if (this.common.validResponse(result)) {
this.balance = result.GetAccrualBalancesList;
}
if(this.balance){
this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT;
// this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT;
// this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber= this.accrualNet + this.accrualUsed;
this.totalnumber= this.totalnumber.toFixed(3);
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
// { data: [this.accrualNet,this.accrualYearly,this.accrualUsed],
{ data: [this.accrualNet,this.accrualUsed],
backgroundColor: [
'#1FA269',
'#CB3232',],
borderWidth: 2
}
]
};
}
if (this.balance) {
this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT;
// this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT;
// this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber = this.accrualNet + this.accrualUsed;
this.totalnumber = this.totalnumber.toFixed(3);
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
// { data: [this.accrualNet,this.accrualYearly,this.accrualUsed],
{
data: [this.accrualNet, this.accrualUsed],
backgroundColor: [
'#269DB8',
'#b60c0c',],
borderWidth: 1
}
]
};
}
}
}
}

@ -3,15 +3,21 @@
[headerText]="'submitAbsence, submitAbsence' | translate">
</app-generic-header>
<ion-content padding>
<ion-item class='dynamicField'>
<content padding>
<div [ngClass]=" direction === 'en' ? 'custom-text-area-element Field-en' : 'custom-text-area-element Field-ar'" >
<label class="label" position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </label>
<select class="label-Select" (ionChange)="calcDay()" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required>
<option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </option>
</select>
</div>
<!-- <ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </ion-label>
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required>
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required> -->
<!-- let item of AbsenceType; let i=index; -->
<ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
<!-- <ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
</ion-select>
</ion-item>
</ion-item> -->
<ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','startDate')}} </ion-label>
@ -52,7 +58,7 @@
</ion-item>
<div id="dynamic-abs-container" >
</div>
</ion-content>
</content>
<ion-footer>
<div class="centerDiv">
<ion-button class="confirmEitOkButton" (click)="validateAbcenseTransaction()">{{ts.trPK('general','next')}}</ion-button>

@ -21,3 +21,94 @@
}
.label-Select{
color: var(--dark);
font-size: 15px;
border: none;
font-weight: 400;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
width: 80%;
padding: 1px 0px;
background-color: var(--light);
border-bottom: var(--cusgray) solid 1px;
border-radius: 0px;
// margin-left: 20px;
margin-left: 30px;
// margin-top: -10px;
// -webkit-appearance: none;
// -moz-appearance: none;
text-indent: 1px;
// text-overflow: '';
box-shadow: none;
-webkit-box-shadow:none;
-moz-box-shadow: none;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
:root[dir="ltr"]{
background-image: linear-gradient(45deg, transparent 50%, #999 50%), linear-gradient(135deg, #999 50%, transparent 50%), linear-gradient(to right, #ffffff, #ffffff);
background-position: calc(100% - 14px) calc(1em + 2px), calc(100% - 8px) calc(1em + 2px), 100% 0;
background-size: 6px 6px, 6px 6px, 2.9em 2.9em;
background-repeat: no-repeat;
padding-right: 20px;
}
:root[dir="rtl"]{
background-image: linear-gradient(-135deg, #999 50%, transparent 50%),linear-gradient(-45deg, transparent 50%, #999 50%), linear-gradient(to right, #ffffff, #ffffff);
background-position: calc(1em - 10px) calc(100% - 8px), calc(1em - 4px) calc(100% - 8px), 0 100%;
background-size: 6px 6px, 6px 6px, 2.9em 2.9em;
background-repeat: no-repeat;
padding-left: 20px;
}
}
.label{
font-size: 16px;
// margin-left: 15px;
color: #a2a5a6 !important;
display: block;
overflow: hidden;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
/* font-size: inherit; */
// text-overflow: ellipsis;
// white-space: nowrap;
white-space: normal;
// padding-top: 10px;
padding: 5px 0px;
padding-left: 10px !important;
margin: 10px auto;
:root[dir="ltr"]{
font-family: var(--fontFamilySemiBoldEN) !important;
}
:root[dir="rtl"]{
font-family: var(--fontFamilyIOSAR) !important;
font-weight: bold;
}
}
.Field-en{
border-radius: 30px;
border: 1px solid #a2a5a6!important;
margin-bottom: 20px;
padding-left: 20px !important;
padding-top: 6px !important;
color: #999999 !important;
}
.Field-ar{
border-radius: 30px;
border: 1px solid #a2a5a6!important;
margin-bottom: 20px;
padding-right: 20px !important;
padding-top: 6px !important;
color: #999999 !important;
}

@ -1,33 +1,42 @@
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'},
{ 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' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' }, { path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' }
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }
const routes: Routes = [
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
{
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'
},
{ 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' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' },
{ path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' },
{ path: 'itemforsale', loadChildren: './itemforsale/itemforsale.module#ItemforsalePageModule' },
{ path: 'offersdiscount', loadChildren: './offersdiscount/offersdiscount.module#OffersdiscountPageModule' },
{ path: 'mowadhafi', loadChildren: './mowadhafi/mowadhafi.module#MowadhafiPageModule' },
{ path: 'erm-channel', loadChildren: './erm-channel/erm-channel.module#ErmChannelPageModule' },
{ path: 'backend-integrations', loadChildren: './backend-integrations/backend-integrations.module#BackendIntegrationsPageModule' }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }

@ -45,6 +45,15 @@
</ion-label>
</ion-item>
<ion-item (click)="openMyRequestPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','HR-Request')}}
</ion-label>
</ion-item>
<!-- <ion-item (click)="openChangePassword()"> -->
<ion-item (click)="openChangePassword()">
@ -122,6 +131,14 @@
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<ion-item (click)="openMyRequestPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','HR-Request')}}
</ion-label>
</ion-item>
<ion-item (click)="openChangePassword()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/lock_icon.png" item-left>
@ -147,7 +164,6 @@
<ion-badge class="start-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
</ion-label>
</ion-item>
<!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
@ -171,7 +187,7 @@
</ion-list>
<div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg">
<img src="{{companyUrl}}" class="CompanyImg" [ngClass]="TeamFlag!='true'? 'logoImg':'logoImgWithMyTeam'">
<!-- <p class="companyTxt">{{companyDesc}}</p> -->
</div>
<div class="menuFooter">

@ -304,7 +304,7 @@ button.menu-item.item.item-block.item-ios {
}
.menuFooter {
position: fixed;
// position: fixed;
bottom: 0px;
text-align: center;
margin: auto;
@ -336,10 +336,17 @@ button.menu-item.item.item-block.item-ios {
// position: relative;
// }
.logoImgWithMyTeam{
width: 77px;
// position: relative;
margin-top: -1px;
margin-bottom: 70px;
}
.logoImg{
width: 77px;
position: relative;
// position: relative;
margin-top: -1px;
margin-bottom: 180px;
}
.companyTxt {
font-size: 12px;

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Platform, Events, MenuController, ModalController } from '@ionic/angular';
import { Platform, Events, MenuController, ModalController, NavController } from '@ionic/angular';
import { TranslatorService } from './hmg-common/services/translator/translator.service';
import { CommonService } from './hmg-common/services/common/common.service';
import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
@ -9,8 +9,10 @@ import { PushService } from '../../src/app/hmg-common/services/push/push.service
import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-loading.service';
import { DomSanitizer } from '@angular/platform-browser';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { Router } from '@angular/router';
import { Router, NavigationEnd } from '@angular/router';
import { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
import { checkAndUpdatePureExpressionInline } from '@angular/core/src/view/pure_expression';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Component({
selector: 'app-root',
@ -53,7 +55,9 @@ export class AppComponent implements OnInit {
public pushService: PushService,
private splashScreen: SplashScreen,
public router: Router,
public modalController: ModalController
public modalController: ModalController,
public nav: NavController,
public firebasex: FirebaseX
) {
this.events.subscribe('img-change', displayImg => {
console.log('app compont: ' + displayImg);
@ -67,9 +71,9 @@ export class AppComponent implements OnInit {
private hideSplashScreen() {
setTimeout(() => {
this.splashScreen.hide();
this.splashScreen.hide();
}, 1000);
}
}
public initializeApp() {
this.cs.startLoading();
@ -81,6 +85,7 @@ export class AppComponent implements OnInit {
this.ts.loadResources(() => {
this.isIOS = this.platform.is('ios') ? true : false;
this.initializeDirection();
this.monitorAnalytics();
this.start = true;
if (this.isIOS) {
this.monitUrlChange();
@ -103,39 +108,110 @@ export class AppComponent implements OnInit {
});
}
public monitorAnalytics() {
this.router.events.subscribe((val) => {
if (val instanceof NavigationEnd) {
const lastIndex = val.urlAfterRedirects.lastIndexOf('/');
const currentPageName = val.urlAfterRedirects.substr(lastIndex + 1);
this.setScreenNameAnalytics(currentPageName);
}
});
}
public setScreenNameAnalytics(currentPageName: string) {
try {
this.firebasex.setScreenName(currentPageName).then((result)=>{
console.log(result);
});
} catch (Error) { }
}
private startReceivingPushService() {
this.pushService.startReceiving();
setTimeout(() => {
console.log(' in setTimeout startReceiving');
this.getLastLoginInfo();
}, 4000);
console.log(' in setTimeout startReceiving');
this.getLastLoginInfo();
}, 4000);
}
public subscribeEvents() {
this.platform.backButton.subscribe(() => {
if (this.router.isActive('/authentication/login', true)) {
navigator['app'].exitApp();
} else if (this.router.isActive('/home', true)) {
this.nav.navigateRoot('/home');
}
});
this.events.subscribe('setMenu', () => {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
console.log(user);
localStorage.setItem("digitalIDUser", JSON.stringify(user));
this.digitalIDUser = user//JSON.stringify(user);
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {
this.user_image = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : '../assets/imgs/profile.png';
if (user) {
console.log(user);
localStorage.setItem("digitalIDUser", JSON.stringify(user));
this.digitalIDUser = user//JSON.stringify(user);
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: "After Service Submission", //After Service Submission
ItgServiceName: "Login"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;
this.cs.sharedService.setSharedData(
result,
AuthenticationService.SERVEY_DATA
)
if (!CommonService.SKIP && result) {
if (result.notificationType == 'Survey') {
this.cs.navigateForward('/erm-channel/survey');
} else {
this.authService.adsDetails({
"ItgNotificationMasterId": result['notificationMasterId']
},
() => { }, this.ts.trPK('general', 'ok')
).subscribe((result) => {
var data = result.Mohemm_ITG_ResponseItem;
if (data) {
this.cs.sharedService.setSharedData(
JSON.parse(data),
AuthenticationService.ADS_DATA
);
this.cs.navigateForward('/erm-channel/home');
}
})
}
}
this.User_Job_name = user.JOB_NAME;
});
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {
console.log(user);
this.user_image = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : '../assets/imgs/profile.png';
}
});
// this.User_Job_name = user.JOB_NAME;
let jobTitle = user.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.User_Job_name = jobTitle[0] + " " + jobTitle[1];
}
//erm channel
// if (!CommonService.SKIP)
// this.cs.navigateForward('/erm-channel/survey');
} else {
console.log(user);
}
});
});
this.events.subscribe('getNotCount', badge => { this.notBadge = badge; });
this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; });
@ -178,8 +254,13 @@ export class AppComponent implements OnInit {
this.cs.openMyTeamPage();
}
public openMyRequestPage() {
this.menu.toggle();
this.cs.openMyRequestPage();
}
public profile() {
this.cs.openEditProfile();
this.cs.openProfile('sideMenu');
this.menu.toggle();
}
@ -195,14 +276,14 @@ export class AppComponent implements OnInit {
async openDigitalId() {
const modal = await this.modalController.create({
component: DigitalIdComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo':this.digitalIDUser//JSON.parse(this.digitalIDUser)
}
component: DigitalIdComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.digitalIDUser//JSON.parse(this.digitalIDUser)
}
});
return await modal.present();
}
}
private changeImage() {
this.cs.openChangeImagePage();
@ -214,40 +295,40 @@ export class AppComponent implements OnInit {
}
public getLastLoginInfo() {
this.deviceToken = this.cs.getDeviceToken();
this.deviceToken = this.cs.getDeviceToken();
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
console.log('login enabled first time: ' + this.deviceToken);
} else {
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
this.deviceToken = localStorage.getItem('deviceToken');
}, 1000);
}
this.requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: this.deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: this.deviceToken
};
this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
this.authService.getLoginInfo(this.requestGetLoginInfo, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
this.user = true;
this.events.publish('user', this.user);
if (this.logoutFlage) {
this.cs.openLogin();
}
} else {
this.user = false;
this.events.publish('user', this.user);
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
this.user = true;
this.events.publish('user', this.user);
if (this.logoutFlage) {
this.cs.openLogin();
}
}
} else {}
if (this.logoutFlage) {
this.cs.openLogin();
}
} else {
this.user = false;
this.events.publish('user', this.user);
if (this.logoutFlage) {
this.cs.openLogin();
}
}
} else { }
});
}
}

@ -12,7 +12,7 @@
.alert-tappable.sc-ion-alert-md,
.alert-tappable.sc-ion-alert-ios {
height: 70px;
height: 50px;
}
.main-badge{
position: absolute;
@ -30,4 +30,9 @@
}
.start-badge{
right:16px;
}
.my-custom-modal-css .modal-wrapper {
width: 95%;
height: 60%;
}

@ -1,6 +1,6 @@
<ion-content *ngIf="userInfo.CompanyMainCompany == 'CS'" dir="ltr">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%; height: 30%;" src="../assets/imgs/IDTOP.png">
<img *ngIf="userInfo.PAYROLL_CODE !== 'CS' " style="width: 100%; max-width: 100%;" src="../assets/imgs/IDTOP_HMG.png.png">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%; height: 30%;" src="../../../assets/imgs/IDTOP.png">
<img *ngIf="userInfo.PAYROLL_CODE !== 'CS' " style="width: 100%; max-width: 100%;" src="../../../assets/imgs/IDTOP_HMG.png.png">
<ion-grid>
<ion-row>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE != null">
@ -9,7 +9,7 @@
</ion-col>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE == null">
<img style="width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;"
src="../assets/imgs/profilePic.png">
src="../../../assets/imgs/profilePic.png">
</ion-col>
<ion-col size="6">
<p><b style="font-size: 25px !important; font-family: sans-serif;">{{userInfo.ASSIGNMENT_NUMBER}}</b></p>
@ -18,7 +18,7 @@
<ion-row>
<ion-col>
<p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p>
<p style="font-size: 15px !important;">{{userInfo.JOB_NAME}}</p>
<p style="font-size: 15px !important;">{{userJobName}}</p>
</ion-col>
</ion-row>
<ion-row>
@ -35,7 +35,7 @@
<ion-col size="3"></ion-col>
<ion-col size="9" *ngIf="userInfo.EMPLOYEE_IMAGE != null" padding>
<img *ngIf="userInfo.EMPLOYEE_IMAGE != null" [src]="'data:image/png;base64,'+userInfo.EMPLOYEE_IMAGE" style="width: 60%; height: 100%; border: 3px solid black;">
<img *ngIf="userInfo.EMPLOYEE_IMAGE == null" src="../assets/imgs/profilePic.png" style="width: 60%; height: 100%; border: 3px solid black;">
<img *ngIf="userInfo.EMPLOYEE_IMAGE == null" src="../../../assets/imgs/profilePic.png" style="width: 60%; height: 100%; border: 3px solid black;">
</ion-col>
</ion-row>
<ion-row style="padding: 0%;">
@ -50,13 +50,13 @@
</ion-row>
<ion-row style="padding: 0%;">
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;">
<p style="font-size: 15px; padding: 0%;">{{userInfo.JOB_NAME}}</p>
<p style="font-size: 15px; padding: 0%;">{{userJobName}}</p>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<img *ngIf="userInfo.CompanyImageURL" style="width: 90%; max-width: 100%; margin-left: 6%;" [src]="userInfo.CompanyBadge">
<img *ngIf="!userInfo.CompanyImageURL" style="width: 50%; max-width: 100%; margin-left: 16%;" src="../assets/imgs/HMG_LOGO.png">
<img *ngIf="!userInfo.CompanyImageURL" style="width: 50%; max-width: 100%; margin-left: 16%;" src="../../../assets/imgs/HMG_LOGO.png">
</ion-col>
</ion-row>
<ion-row>

@ -9,6 +9,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class DigitalIdComponent implements OnInit {
@Input() userInfo: any;
public userJobName: any;
constructor(
public modalCtrl: ModalController,
@ -20,6 +21,12 @@ export class DigitalIdComponent implements OnInit {
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
}
console.log(this.userInfo);
if (this.userInfo) {
let jobTitle = this.userInfo.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.userJobName = jobTitle[0] + " " + jobTitle[1];
}
}
}

@ -35,8 +35,7 @@ export class ForgotComponent implements OnInit {
) {
}
ngOnInit() {
}
ngOnInit() {}
public onForgot() {
this.sendSMSForForgotPassword();
@ -59,12 +58,18 @@ export class ForgotComponent implements OnInit {
public forgotpassword(){
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const forgetPasswordTokenResult = this.sharedData.getSharedData('checkSMSResponse', false);
let forgetPasswordTokenID = '';
if (forgetPasswordTokenResult.ForgetPasswordTokenID) {
forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID;
}
this.loginData.P_USER_NAME = this.P_USER_NAME;
let request:ForgetPassword = new ForgetPassword();
let request: any = {};
request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD;
request.P_USER_NAME = data.P_USER_NAME;
request.ForgetPasswordTokenID = forgetPasswordTokenID;
this.authService.submitForgetPassword(
request,
() => {

@ -47,7 +47,7 @@
<!-- </div> -->
<div class="centerDiv" style="margin-top: 20px !important;">
<ion-button [ngClass]="{'disable-button-opacity': isValidForm()}" class="button-login" (click)="onLogin()" [disabled]="isValidForm()">{{ts.trPK('login','login')}}</ion-button>
<ion-button [ngClass]="{'disable-button-opacity': isValidForm()}" class="button-login" (click)="onLogin()" [disabled]="isValidForm()" style="width: 100% !important;">{{ts.trPK('login','login')}}</ion-button>
<!-- digital ID button -->
<!-- <ion-button *ngIf="userInfo" class="button-digital-id" (click)="openDigitalId()">
@ -62,7 +62,7 @@
</div>
</ion-content>
<ion-footer *ngIf="!user" [ngStyle]="keyboardOpened === true ? {'display': 'none'} : {}">
<ion-footer *ngIf="!user" [ngStyle]="keyboardOpened === true ? {'display': 'none'} : {}" style="padding: 0px;">
<ion-row>
<ion-col class="colPad">
<img class="centerDiv logoFotor" src="../assets/imgs/CSLogo.png" />

@ -58,6 +58,8 @@
</ion-col>
</ion-row>
<div *ngIf="showErrorMessage"><p style="color: red; font-weight: bold; font-size: 14px; text-align: center;">{{messageValue}}</p></div>
</div>
</ion-content>

@ -50,6 +50,8 @@ export class SmsPageComponent implements OnInit {
loginType: any;
activeType: any;
public isNFCAvailable = false;
public showErrorMessage = false;
public messageValue: string;
constructor(
public navCtrl: NavController,
@ -183,6 +185,7 @@ export class SmsPageComponent implements OnInit {
}
public checkSMS() {
this.showErrorMessage = false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
@ -190,9 +193,8 @@ export class SmsPageComponent implements OnInit {
request.P_USER_NAME = data.P_USER_NAME;
request.MobileNumber = data.MobileNumber;
request.IsDeviceNFC = this.isNFCAvailable;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
@ -206,9 +208,20 @@ export class SmsPageComponent implements OnInit {
if (this.platform.is('cordova')) {
this.insertMobileLogin();
}
this.common.sharedService.setSharedData(result.MemberInformationList[0].PAYROLL_CODE, "projcet-code");
this.activeType =this.common.setActiveTypeLogin(0);
this.common.openHome();
});
} else {
let errorResult: any;
errorResult = result;
this.showErrorMessage = true;
this.messageValue = errorResult.ErrorEndUserMessage;
this.smc_code = [];
(document.activeElement as HTMLElement).blur();
setTimeout(() => {
this.showErrorMessage = false;
}, 5000);
}
});
}
@ -239,6 +252,7 @@ export class SmsPageComponent implements OnInit {
request.P_USER_NAME = data.P_USER_NAME;
this.authService.checkForgetSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
this.sharedData.setSharedData(result, 'checkSMSResponse');
if (this.isForgetPwd) {
this.common.openForgotPassword();
}

@ -0,0 +1,90 @@
<app-generic-header
showBack="true"
[headerText]="'login,announcement' | translate">
</app-generic-header>
<ion-content style="--background:#F4F4F4;">
<ion-searchbar mode='md' (ionInput)="filterList($event)" style="--background: white; margin-top: 10px; padding-bottom: 20px;"></ion-searchbar>
<ion-list style="background: #f4f4f4; margin-top: -8px !important;">
<div *ngFor="let item of announcementList; let i = index"
[ngClass]="item.Open ? 'class-dev-close': 'class-dev-open'"
style="margin: 15px; background: white; border-radius: 10px;">
<!-- <ion-card *ngIf="i === 0 && !item.isOpen" (click)="toggleAnnouncement(item)" class="main-card-style">
<img [src]="item.img" class="main-card-image">
<ion-item class="main-card-item-list-style">
<ion-label class="main-card-label-style-all">
<p class="text-style item-list-first-date">{{item.date}}</p>
<h2 class="text-style item-list-first-h" *ngIf="direction === 'en'">{{item.title_EN}}</h2>
<h2 class="text-style item-list-first-h" *ngIf="direction === 'ar'">{{item.title_AR}}</h2>
</ion-label>
</ion-item>
</ion-card>
<ion-card *ngIf="i === 0 && item.isOpen" (click)="toggleAnnouncement(item)" style="margin: 0px; background: white;">
<ion-card-header style="background: transparent;">
<ion-card-title *ngIf="direction === 'en'"><h2 class="card-style-h">{{item.title_EN}}</h2><br>
<p class="card-style-date">{{item.date}}</p>
</ion-card-title>
<ion-card-title *ngIf="direction === 'ar'" class="card-style-h">{{item.title_AR}} <br>
<p class="card-style-date">{{item.date}}</p>
</ion-card-title>
<img [src]="item.img" class="image-center">
</ion-card-header>
<ion-card-content>
<p *ngIf="direction === 'en'" class="card-style-p"><span [innerHTML]="item.body_EN"></span></p>
<p *ngIf="direction === 'ar'" class="card-style-p">{{item.body_AR}}</p>
</ion-card-content>
</ion-card> -->
<ion-item no-padding *ngIf="!item.isOpen && item.img" (click)="toggleAnnouncement(item)" lines='none' class="announcement-items">
<img [src]="item.img" [ngClass]="direction === 'en'? 'image-item-en': 'image-item-ar' ">
<ion-label style="margin: 5px; margin-top: -20px;">
<h2 class="item-list-h" *ngIf="direction === 'en'">{{item.title_EN}}</h2>
<!-- <p class="item-list-p-title" *ngIf="direction === 'en'"><span [innerHTML]="item.body_EN"></span></p> -->
<h2 class="item-list-h" *ngIf="direction === 'ar'">{{item.title_AR}}</h2>
<!-- <p class="item-list-p-title" *ngIf="direction === 'ar'">{{item.body_AR}}</p> -->
<p class="item-list-date-title">{{item.date}}</p>
</ion-label>
</ion-item>
<ion-item *ngIf="!item.isOpen && !item.img" (click)="toggleAnnouncement(item)" lines='none' class="announcement-items">
<ion-label style="margin: 10px;">
<h2 class="item-list-h" *ngIf="direction === 'en'">{{item.title_EN}}</h2>
<p class="item-list-p-title" *ngIf="direction === 'en'"><span [innerHTML]="item.body_EN"></span></p>
<h2 class="item-list-h" *ngIf="direction === 'ar'">{{item.title_AR}}</h2>
<p class="item-list-p-title" *ngIf="direction === 'ar'"><span [innerHTML]="item.body_AR"></span></p>
<p class="item-list-date-title">{{item.date}}</p>
</ion-label>
</ion-item>
<ion-card *ngIf="item.isOpen" (click)="closeAnnouncement(item)" style="margin: 0px;">
<ion-card-header style="background: transparent;">
<ion-card-title style="font-size: 20px; margin: 5px;" *ngIf="direction === 'en'">{{detialData.title_EN}} <br>
<p style="font-size: 12px; color: gray;">{{detialData.date}}</p>
</ion-card-title>
<ion-card-title style="font-size: 20px; margin: 5px;" *ngIf="direction === 'ar'">{{detialData.title_AR}} <br>
<p style="font-size: 12px; color: gray;">{{detialData.date}}</p>
</ion-card-title>
<img *ngIf='detialData.img' [src]="detialData.img" class="image-center">
<div *ngIf='!detialData.img'></div>
</ion-card-header>
<ion-card-content>
<p *ngIf="direction === 'en'"><span [innerHTML]="detialData.body_EN"></span></p>
<p *ngIf="direction === 'ar'"><span [innerHTML]="detialData.body_AR"></span></p>
</ion-card-content>
</ion-card>
</div>
</ion-list>
<ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)">
<ion-infinite-scroll-content
loadingSpinner="bubbles"
loadingText="Loading more data...">
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
<!-- <ion-footer>
<ion-button (click)="loadData($event)"><ion-label><p>more</p></ion-label></ion-button>
</ion-footer> -->

@ -0,0 +1,140 @@
.image-center {
width: 100%;
display: block;
margin-left: auto;
margin-right: auto;
height: 190px;
}
.main-card-image {
width: 100%;
display: block;
margin-left: auto;
margin-right: auto;
position: absolute;
height: 100%;
}
.text-style {
margin: 5px;
}
.class-dev-close {
// border: 1px solid lightgray;
// border-radius: 30px;
}
.class-dev-open {
}
.class-item-open {
border: 1px solid lightgray;
border-radius: 30px;
height: 100px;
}
.class-item-close {
}
.image-item-en {
padding-left: 5px;
width: 100px;
min-height: 100px;
border: 5px solid white;
border-radius: 11px;
border-left: 0px;
border-right: 0px;
object-fit: cover;
}
.image-item-ar {
padding-right: 5px;
width: 100px;
min-height: 100px;
border: 5px solid white;
border-radius: 11px;
border-left: 0px;
border-right: 0px;
}
.announcement-items {
border: 1px solid #00000029;
border-radius: 10px;
height: 100px;
box-shadow: 0px 0px 5px #00000000;
}
.item-list-h {
font: normal normal 600 14px/11px Poppins;
letter-spacing: -0.56px;
color: #2b353e;
opacity: 1;
padding-bottom: 5px;
}
.item-list-p-title {
font: normal normal medium 11px/16px Poppins;
letter-spacing: -0.44px;
color: #535353;
}
.item-list-date-title {
font: normal normal 600 10px/16px Poppins;
letter-spacing: -0.4px;
color: #7c7c7c;
}
.item-list-first-h {
font: normal normal bold 23px/24px Poppins;
letter-spacing: -0.3px;
color: #ffffff;
white-space: break-spaces;
}
.item-list-first-p {
font: normal normal normal 12px/17px Poppins;
letter-spacing: -0.12px;
color: #ffffff;
}
.item-list-first-date {
text-align: left;
font: normal normal bold 8px/23px Poppins;
letter-spacing: 0px;
color: #ffffff;
}
.card-style-h {
font: normal normal 600 20px/22px Poppins;
letter-spacing: -0.8px;
color: #2b353e;
margin-bottom: -34px;
}
.card-style-p {
font: normal normal medium 13px/18px Poppins;
letter-spacing: -0.52px;
color: #535353;
}
.card-style-date {
font: normal normal 600 12px/18px Poppins;
letter-spacing: -0.48px;
color: #7c7c7c;
}
.main-card-style {
margin: 0px;
position: relative;
min-height: 283px;
}
.main-card-item-list-style {
position: absolute;
bottom: 0px;
--background: transparent;
}
.main-card-label-stle{
margin: 0px;
padding: 0px;
width: 237px;
}
.main-card-label-style-all{
padding: 0px;
margin: 0px;
width: 200px;
}
.item-native {
padding-left: 5px !important;
}

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

@ -0,0 +1,147 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { detachEmbeddedView } from '@angular/core/src/view';
import { AnnouncementService } from 'src/app/hmg-common/services/announcement-services/announcement.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { IonInfiniteScroll } from '@ionic/angular';
@Component({
selector: 'app-announcement',
templateUrl: './announcement.component.html',
styleUrls: ['./announcement.component.scss'],
})
export class AnnouncementComponent implements OnInit {
public arr: { id: number, title_EN: string, title_AR: string, body_EN: string, body_AR: string, img?: string, date: Date, isopen: boolean }[] = [];
public arrList = [];
public listOfAnnouncement;
direction: string;
public announcementList = [];
public numberOfListLength = 10;
public announcememntCounter = this.numberOfListLength;
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
public pageSize = 1;
public pageLength = 0;
public lengthCounter = 5;
public detialData: {
id: number,
title_EN: string,
title_AR: string,
body_EN: string,
body_AR: string,
img?: string,
date: Date};
constructor(
public announcementService: AnnouncementService,
public translate: TranslatorService,
public common: CommonService
) { }
ngOnInit() {
this.common.startLoading();
this.direction = TranslatorService.getCurrentLanguageName();
this.getAnnouncementListService();
}
filterList(event) {
const val = event.target.value;
if (val === '') {
this.announcementList = this.arrList;
}
this.announcementList = this.arrList.filter((item) => {
return (item.title_EN.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
toggleAnnouncement(item) {
this.common.startLoading();
let holdData;
let data;
this.announcementList.forEach(element => {
if (element.id === item.id) {
this.announcementService.getAnnouncementListService(this.pageSize, item.id).subscribe((result: any) => {
this.common.stopLoading();
if (this.common.validResponse(result)) {
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
data = JSON.parse(holdData.result.data)[0];
console.log(data);
this.detialData = {
id: data.rowID,
title_EN: data.Title_EN,
title_AR: data.Title_AR,
body_EN: data.Body_EN,
body_AR: data.Body_AR,
date: data.created,
img: data.Banner_Image
};
element.isOpen = !element.isOpen;
// this.common.stopLoading();
}
console.log(this.detialData);
});
} else {
element.isOpen = false;
}
});
}
closeAnnouncement(item){
item.isOpen = false;
}
getAnnouncementListService() {
// this.common.startLoading();
let holdData;
this.announcementService.getAnnouncementListService(this.pageSize).subscribe((result: any) => {
this.common.stopLoading();
if (this.common.validResponse(result)) {
holdData = JSON.parse(result.Mohemm_ITG_ResponseItem);
this.listOfAnnouncement = JSON.parse(holdData.result.data);
this.pageLength = this.listOfAnnouncement[0].TotalItems;
for (let i = 0; i < this.listOfAnnouncement.length; i++) {
this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN;
this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR;
this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN;
this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR;
this.arr[i] = {
id: this.listOfAnnouncement[i].rowID,
title_EN: this.listOfAnnouncement[i].Title_EN,
title_AR: this.listOfAnnouncement[i].Title_AR,
body_EN: this.listOfAnnouncement[i].EmailBody_EN,
body_AR: this.listOfAnnouncement[i].EmailBody_AR,
date: this.listOfAnnouncement[i].created,
img: this.listOfAnnouncement[i].Banner_Image,
isopen: false
};
if ( i < this.numberOfListLength){
this.announcementList.push(this.arr[i]);
}
this.arrList.push(this.arr[i]);
}
}
// this.common.stopLoading();
});
}
loadData(event) {
// let counter = this.numberOfListLength + this.announcememntCounter;
setTimeout(() => {
event.target.complete();
// for(let i = this.announcememntCounter; i < counter; i++) {
// if(this.arrList[i]) {
// this.announcementList.push(this.arrList[i]);
// this.announcememntCounter ++;
// }
// }
this.pageSize += 1;
if (this.lengthCounter >= this.pageLength) {
event.target.disabled = true;
} else {
this.getAnnouncementListService();
}
this.lengthCounter += 5;
}, 500);
}
}

@ -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 { IonicModule } from '@ionic/angular';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { BackendIntegrationsPage } from './backend-integrations.page';
import { AnnouncementComponent } from './announcement/announcement.component';
const routes: Routes = [
{
path: '',
component: BackendIntegrationsPage,
children: [
{
path: 'announcement',
component: AnnouncementComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [BackendIntegrationsPage, AnnouncementComponent]
})
export class BackendIntegrationsPageModule {}

@ -0,0 +1,3 @@
<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 { BackendIntegrationsPage } from './backend-integrations.page';
describe('BackendIntegrationsPage', () => {
let component: BackendIntegrationsPage;
let fixture: ComponentFixture<BackendIntegrationsPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BackendIntegrationsPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BackendIntegrationsPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

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

@ -2,7 +2,7 @@
showBack="true"
[headerText]="headerTitle">
</app-generic-header>
<!-- backLink="/home" -->
<ion-content>

@ -31,6 +31,7 @@ export class HomeComponent implements OnInit {
ngOnInit() { }
openPage(page, index) {
console.log(page + "index" + index);
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
if (page.children.length === 0) {
@ -56,6 +57,10 @@ export class HomeComponent implements OnInit {
this.cs.openAbsencePage();
} else if (menuEntry.REQUEST_TYPE === 'EIT') {
this.cs.openEitListPage();
} else if (menuEntry.REQUEST_TYPE === 'BASIC_DETAILS') {
this.cs.openProfile('basicDetails');
} else if (menuEntry.REQUEST_TYPE === 'ADDRESS') {
this.cs.openProfile('address');
}
if (menuEntry.REQUEST_TYPE === 'PAYSLIP') {
this.cs.openPayslipPage();

@ -0,0 +1,15 @@
import { EitTransactionModel } from './eit.transaction.model';
export class EitAddressRequest {
public static SHARED_DATA = 'eit-request';
public P_MENU_TYPE: string;
public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_FUNCTION_NAME: string;
public P_SELECTED_RESP_ID: Number;
P_DESC_FLEX_CONTEXT_CODE: string;
EITTransactionTBL: EitTransactionModel[];
P_COUNTRY_CODE: string;
P_EFFECTIVE_DATE: string;
P_ACTION: string;
}

@ -8,4 +8,5 @@ export class EitRequest {
public P_SELECTED_RESP_ID: Number;
P_DESC_FLEX_CONTEXT_CODE: string;
EITTransactionTBL: EitTransactionModel[];
}

@ -0,0 +1,41 @@
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 { IonicRatingModule } from 'ionic4-rating';
import { ErmChannelPage } from './erm-channel.page';
import { HomeComponent } from './home/home.component';
import { SurveyComponent } from './survey/survey.component';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
const routes: Routes = [
{
path: '',
component: ErmChannelPage,
children: [
{
path: 'home',
component: HomeComponent
},
{
path: 'survey',
component: SurveyComponent
},
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
IonicRatingModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [ErmChannelPage, HomeComponent, SurveyComponent]
})
export class ErmChannelPageModule { }

@ -0,0 +1,4 @@
<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 { ErmChannelPage } from './erm-channel.page';
describe('ErmChannelPage', () => {
let component: ErmChannelPage;
let fixture: ComponentFixture<ErmChannelPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ErmChannelPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ErmChannelPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

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

@ -0,0 +1,20 @@
<div class="full-ads" >
<img [src]="advertisement.base64String" *ngIf="advertisement.contentType =='image/jpeg'"/>
<video style="width: 100%; position: absolute; bottom: 45%;" autoplay="autoplay" *ngIf="advertisement.contentType =='video/mp4'" controls>
<source type="video/mp4" [src]="advertisement.base64String">
</video>
<!-- <div class="skip-btn" (click)="skip()" *ngIf="isSkip ==true">{{ts.trPK('worklistMain','skip')}}</div> -->
<div class="info-container">
<div class="seconds" *ngIf="isSkip ==false">{{setTime}}</div>
<div *ngIf="setTime ==0">
<ion-icon name="thumbs-down" class="red" (click)="setView('Dislike')"></ion-icon>
<img src="../../../assets/imgs/light-bulb.svg" style="width: 70px; padding: 15px;" (click)="setView('Info')">
<ion-icon name="thumbs-up" class="green" (click)="setView('Like')"></ion-icon>
</div>
</div>
</div>

@ -0,0 +1,48 @@
.full-ads{
position: absolute;
height: 100%;
width: 100%;
background-size: cover;
}
.skip-btn{
position: absolute;
background: black;
color: #fff;
margin: 10px;
right: 10px;
padding: 5px;
border-radius: 5px;
}
.info-container {
width: 100%;
text-align: center;
bottom: 10%;
position: absolute;
}
.info-container ion-icon{
margin: 10px;
font-size: 32px;
padding: 10px;
border-radius: 50%;
display: inline-block;
}
.red{
background: #ff5757;
color: #fff;
}
.green{
background: #23f172;
color: #fff;
}
.white{
background: #fff;
color: #000;
}
.seconds{
font-size: 28px;
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,68 @@
import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { DomSanitizer } from '@angular/platform-browser';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
isSkip: boolean = false;
setTime: number = 5;
advertisement: any;
data: any;
constructor(public nav: NavController, public cs: CommonService, public sanitizer: DomSanitizer, public authService: AuthenticationService, public ts: TranslatorService) { }
ngOnInit() {
this.data = this.cs.sharedService.getSharedData(
AuthenticationService.ADS_DATA,
false
);
this.advertisement = this.data.result.data.advertisement.viewAttachFileColl[0];
this.setTime = this.data.result.data.advertisement.durationInSeconds;
this.setTimer();
}
skip() {
this.nav.pop();
CommonService.SKIP = true;
}
setTimer() {
setTimeout(() => {
this.setTime--;
if (this.setTime == 0) {
this.isSkip = true;
} else {
this.setTimer();
}
}, 1000);
}
setView(status) {
// var request =
// {
// "ItgSurveyId": data.serviceId, "ItgNotificationMasterId": data.notificationMasterId, "ItgComments": this.note, "ItgQuestionResponses": [
// { "questionId": 1, "optionId": null, "starRating": parseInt(this.rate) },
// { "questionId": 2, "optionId": 4, "starRating": parseInt(this.satisfied) }
// ]
// };
this.authService.setViewAds({
"ItgNotificationMasterId": this.data.result.data.notificationMasterId,
"ItgAdvertisement": {
"advertisementId": this.data.result.data.advertisementId,
"acknowledgment": status
}
}, (
) => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true;
this.cs.openHome();
})
}
}

@ -0,0 +1,72 @@
<ion-content padding class="survey-content">
<!-- <div class="skip-btn" (click)="skip()" *ngIf="isSkip ==true">{{ts.trPK('worklistMain','skip')}} </div>
<div class="seconds" *ngIf="isSkip ==false">{{setTime}}</div> -->
<ion-grid class="ion-no-padding grid-parent">
<ion-row>
<ion-text class="title-text">
{{ts.trPK('erm-channel','fedback-about-ux')}}
</ion-text>
</ion-row>
<ion-row>
<ion-col [size]="12">
<p class="subheading">1. {{ts.trPK('erm-channel','how-would-you-like')}} </p>
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="12">
<rating id="surveyRatingNew" [(ngModel)]="rate" readonly="false" size="default"></rating>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row>
<ion-col>
<p class="subheading">2. {{ts.trPK('erm-channel','how-would-you-satisfied')}} </p>
</ion-col>
</ion-row>
<ion-row class="faces-row">
<ion-col [ngClass]="{'select2' : satisfied=='1'}">
<img class="face" src="assets/icon/rate/poor.svg" (click)="select(1)">
</ion-col>
<ion-col [ngClass]="{'select2' : satisfied=='2'}">
<img class="face" src="assets/icon/rate/bad.svg" (click)="select(2)">
</ion-col>
<ion-col [ngClass]="{'select2' : satisfied=='3'}">
<img class="face" src="assets/icon/rate/normal.svg" (click)="select(3)">
</ion-col>
<ion-col [ngClass]="{'select2' : satisfied=='4'}">
<img class="face" src="assets/icon/rate/good.svg" (click)="select(4)">
</ion-col>
<ion-col [ngClass]="{'select2' : satisfied=='5'}">
<img class="face" src="assets/icon/rate/xcellent.svg" (click)="select(5)">
</ion-col>
</ion-row>
</ion-grid>
<ion-row>
<ion-col>
<p class="comments"> {{ts.trPK('erm-channel','give-comments')}} </p>
</ion-col>
</ion-row>
<ion-card class="doctor-card">
<ion-row class="input-field">
<ion-col [size]="12">
<ion-textarea rows="6" cols="20" [(ngModel)]="note" [placeholder]="ts.trPK('replacementRoll','enterNote')"></ion-textarea>
</ion-col>
</ion-row>
</ion-card>
</ion-content>
<ion-footer >
<div class="centerDiv">
<ion-button class="footer-button" ion-button (click)="saveSurvey()" [disabled]="!rate || (rate==1 && !note)">
{{'general,submit' | translate}} </ion-button>
</div>
</ion-footer>

@ -0,0 +1,55 @@
.survey-content{
--background:#f5f5f5;
}
.title-text{ font-size: 28px; font-weight: bold;text-align: center; margin-top:20%}
.survey-content{
margin-top:50px;
}
.subheading{
margin:30px 30px 0px 30px;
font-size: 20px;
font-weight: bold;}
.bottom-line{
height: 150px;
}
.doctor-card{
background: #fff;
margin: 10px 20px 10px 20px;
border-radius: 10px;
}
.comments{
margin-left: 20px;
margin-bottom: 0;
font-weight: bold;
}
.faces-row{
margin-left: 20px;
margin-right:20px;
}
.faces-row ion-col{
background: #fff;
text-align: center;
border-radius: 7px;
margin: 5px;
}
ion-footer .footer-button{
--background: #259CB8;
width: 80%;
background: #259CB8;
border-radius: 10px;
}
.skip-btn{
position: absolute;
background: black;
color: #fff;
margin: 10px;
right: 10px;
padding: 5px;
border-radius: 5px;
}
.select2{
border:1px solid #000;
}

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

@ -0,0 +1,63 @@
import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-survey',
templateUrl: './survey.component.html',
styleUrls: ['./survey.component.scss'],
})
export class SurveyComponent implements OnInit {
rate: any;
isSkip: boolean = false;
setTime: number = 5;
satisfied: any = '5';
note: any;
constructor(public ts: TranslatorService, public cs: CommonService, public nav: NavController, public authService: AuthenticationService) { }
ngOnInit() {
this.setTimer();
}
skip() {
this.nav.pop();
CommonService.SKIP = true;
}
setTimer() {
setTimeout(() => {
this.setTime--;
if (this.setTime == 0) {
this.isSkip = true;
} else {
this.setTimer();
}
}, 1000);
}
saveSurvey() {
var data = this.cs.sharedService.getSharedData(
AuthenticationService.SERVEY_DATA,
false
)
var request =
{
"ItgSurveyId": data.serviceId, "ItgNotificationMasterId": data.notificationMasterId, "ItgComments": this.note, "ItgQuestionResponses": [
{ "questionId": 1, "optionId": null, "starRating": parseInt(this.rate) },
{ "questionId": 2, "optionId": 4, "starRating": parseInt(this.satisfied) }
]
};
this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true;
this.cs.openHome();
})
}
select(rating) {
this.satisfied = rating;
}
}

@ -110,6 +110,7 @@ import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component';
@NgModule({
imports: [
@ -192,7 +193,8 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DateInfoModalComponent,
Modal,
GenericHeaderComponent,
AttendanceOptionsComponent
AttendanceOptionsComponent,
CardCalendarComponent
],
exports: [
FabButtonComponent,
@ -262,7 +264,8 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
FileUploadModule,
Modal,
GenericHeaderComponent,
AttendanceOptionsComponent
AttendanceOptionsComponent,
CardCalendarComponent
],
providers: [
AttendScanService,

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { AnnouncementService } from './announcement.service';
describe('AnnouncementService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: AnnouncementService = TestBed.get(AnnouncementService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,35 @@
import { Injectable } from '@angular/core';
import { Request } from 'src/app/hmg-common/services/models/request';
import { Observable } from 'rxjs';
import { AuthenticationService } from '../authentication/authentication.service';
import { ConnectorService } from '../connector/connector.service';
import { AnnouncementRequest } from '../models/announcement-request';
@Injectable({
providedIn: 'root'
})
export class AnnouncementService {
public static getAnnouncemntList = 'Services/COCWS.svc/REST/GetAnnouncementDiscountsConfigData';
constructor(
public authService: AuthenticationService,
public con: ConnectorService,
) { }
getAnnouncementListService(pageNumber: number, id?: number, onError ?: any , oerrorLable ?: any) {
const request = new AnnouncementRequest();
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME;
request.ItgPageNo = pageNumber;
request.ItgPageSize = 5;
request.ItgAwarenessID = 0;
request.ItgRowID = (id) ? Number(id) : 0;
return this.con.postNoLoad(
AnnouncementService.getAnnouncemntList,
request,
onError,
oerrorLable
);
}
}

@ -17,6 +17,7 @@ import { Device } from '@ionic-native/device/ngx';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { Platform } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Injectable({
@ -32,6 +33,7 @@ export class AttendScanService {
userData: any = {};
public isFakeLocationUsed = false;
public isGpsRequired = false;
public collection = 'CS';
constructor(private device: Device,
private zbar: ZBar,
@ -46,9 +48,11 @@ export class AttendScanService {
public ts: TranslatorService,
public backgroundGeolocation: BackgroundGeolocation,
public platform: Platform,
public modalController: ModalController
public modalController: ModalController,
public firebasex: FirebaseX
) {
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
console.log(this.userData);
}
getDeviceLocation() {
@ -149,8 +153,119 @@ export class AttendScanService {
});
}
public async checkFirestoreDocument(userID : string) {
try {
let result = {};
await this.firebasex.fetchDocumentInFirestoreCollection(userID, this.collection, (document: any) => {
console.log("Successfully Fetched the document with id =" + userID);
result = {
isDocumentAvailable: true,
document: document
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
}, (error: any) => {
console.log(error);
result = {
isDocumentAvailable: false,
document: null
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
})
} catch(error) {
console.log(error);
const result = {
isDocumentAvailable: false,
document: null
};
this.common.sharedService.setSharedData(result, 'firebase-document');
this.common.stopLoading();
}
}
public updateFirebaseDocument(resultObject: any) {
try {
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document', false);
let currentSwipeArray = currentFirebaseDocument.document.swipeData;
if (currentSwipeArray) {
currentSwipeArray.push(resultObject);
} else {
let swipeData = [];
swipeData.push(resultObject);
currentSwipeArray = swipeData;
}
const updatedDocument = {
swipeData: currentSwipeArray
};
console.log(updatedDocument);
this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => {
console.log("Successfully updated document with id = " + this.userData.EMPLOYEE_NUMBER);
const result = {
isDocumentAvailable: true,
document: updatedDocument
};
this.common.sharedService.setSharedData(result, 'firebase-document');
}, (error) => {
console.error("Error adding document: " + error);
});
} catch (error) {
console.log(error);
}
}
public checkDocumentAvailability(resultObject: any) {
const firestoreDocument = this.common.sharedService.getSharedData('firebase-document', false);
if (firestoreDocument) {
if (firestoreDocument.isDocumentAvailable) {
this.updateFirebaseDocument(resultObject);
} else {
this.createNewDocument(resultObject);
}
} else {
this.createNewDocument(resultObject);
}
}
public processFirebaseDocument(mode: string, result: any) {
try {
this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
const resultObject = {
modeOfAttendance: mode,
messageStatus: result.MessageStatus,
transactionID: result.SWP_AuthenticateAndSwipeUserModel.TransactionID,
userID: result.SWP_AuthenticateAndSwipeUserModel.UserID,
pointID: result.SWP_AuthenticateAndSwipeUserModel.PointID,
branchDescription: result.SWP_AuthenticateAndSwipeUserModel.BranchDescription
}
this.checkDocumentAvailability(resultObject);
} catch (error) {
console.log(error);
}
}
public createNewDocument(resultObject: any) {
let swipeData = [];
swipeData.push(resultObject);
const newDocument = {
swipeData: swipeData
};
this.firebasex.setDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, newDocument, this.collection, () => {
console.log("Successfully added document");
const result = {
isDocumentAvailable: true,
document: newDocument
};
this.common.sharedService.setSharedData(result, 'firebase-document');
}, (error) => {
console.error("Error adding document: "+error);
});
}
public swipeAttendance() {
const isPlatformValue = this.platform.is('ios') ? 'QR-IOS' : 'QR-ANDROID';
const enableFirestore = this.common.sharedService.getSharedData('enableFirestore', false);
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.PointType = 1;
request.Latitude = this.lat;
@ -167,6 +282,9 @@ export class AttendScanService {
console.log('Error inside in swipe attendance');
})
.subscribe((result: Response) => {
if (enableFirestore) {
this.processFirebaseDocument(isPlatformValue, result);
}
if (this.common.validResponse(result)) {
console.log('response');
console.log(result);
@ -175,23 +293,4 @@ export class AttendScanService {
}
});
}
// public swipeAttendanceNFC (nfcSerialCode: any) {
// const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
// request.PointType = 2;
// request.Latitude = 0;
// request.Longitude = 0;
// request.QRValue = "";
// request.NFCValue = nfcSerialCode;
// request.UID = this.device.uuid;
// request.UserName = this.userData.EMPLOYEE_NUMBER;
// this.attendance_service.attendanceSwipeScanner(request, () => {
// console.log('Error inside in swipe attendance');
// }).subscribe((result: Response) => {
// if (this.common.validResponse(result)) {
// this.modalController.dismiss();
// }
// });
// }
}

@ -38,87 +38,96 @@ import { SendActivationByType } from 'src/app/authentication/models/sendActivati
})
export class AuthenticationService {
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static login = 'Services/ERP.svc/REST/MemberLogin';
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
public static smsCheck='Services/ERP.svc/REST/CheckActivationCode';
public static smsCheckForget='Services/ERP.svc/REST/CheckPublicActivationCode';
public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode';
public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType';
public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo
public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo';
/* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration';
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration';
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS';
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser;
public static servicePrivilage : PrivilageModel[];
/*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired';
public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion';
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user';
public static LOGIN_DATA="logindata";
public static DEVICE_TOKEN = "device_token";
public static LAST_LOGIN = 'last-login';
public static IMEI_USER_DATA = "imei-user-data";
// private static user: AuthenticatedUser;
constructor(
public con: ConnectorService,
public cs: CommonService,
public ts: TranslatorService,
public nativeStorage: NativeStorage,
// public localNotifications: UserLocalNotificationService,
private events: Events,
private menu: MenuController,
public platform: Platform
) { }
public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request);
const user = this.getAuthenticatedUser();
if (user) {
request.P_SESSION_ID = user.P_SESSION_ID;
request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
request.LogInTokenID = user.LogInTokenID;
request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS;
if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog();
}
} else {
this.cs.userNeedToReLogin();
}
/*
else {
if (automaticLogin) {
this.cs.openUserLogin();
}
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static login = 'Services/ERP.svc/REST/MemberLogin';
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
public static smsCheck = 'Services/ERP.svc/REST/CheckActivationCode';
public static smsCheckForget = 'Services/ERP.svc/REST/CheckPublicActivationCode';
public static smsSendCode = 'Services/ERP.svc/REST/SendPublicActivationCode';
public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType';
public static getMobileLoginInfo = 'Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo
public static insertMobileLoginInfo = 'Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo';
/* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration';
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration';
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS';
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser;
public static servicePrivilage: PrivilageModel[];
/*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget = 'Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword = 'Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired';
public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion';
/* check survey or ads */
public static getITGPageNotification = 'Services/COCWS.svc/REST/Mohemm_ITG_GetPageNotification';
public static getITGPageNotificationDetails = 'Services/COCWS.svc/REST/Mohemm_ITG_GetPageNotificationDetails';
public static saveSurveyAds = 'Services/COCWS.svc/REST/Mohemm_ITG_Survey_Response';
public static setViewAdvertisement = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateAdvertisementAsViewed';
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user';
public static LOGIN_DATA = "logindata";
public static DEVICE_TOKEN = "device_token";
public static LAST_LOGIN = 'last-login';
public static IMEI_USER_DATA = "imei-user-data";
public static SERVEY_DATA = "survey-data";
public static ADS_DATA = "ads-data";
// private static user: AuthenticatedUser;
constructor(
public con: ConnectorService,
public cs: CommonService,
public ts: TranslatorService,
public nativeStorage: NativeStorage,
// public localNotifications: UserLocalNotificationService,
private events: Events,
private menu: MenuController,
public platform: Platform
) { }
public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request);
const user = this.getAuthenticatedUser();
if (user) {
request.P_SESSION_ID = user.P_SESSION_ID;
request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
request.LogInTokenID = user.LogInTokenID;
request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS;
if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog();
}
} else {
this.cs.userNeedToReLogin();
}
/*
else {
if (automaticLogin) {
this.cs.openUserLogin();
}
*/
}
*/
return request;
}
@ -127,17 +136,17 @@ export class AuthenticationService {
const isIOS = this.platform.is('ios');
let mobileType = '';
if (isAndroid) {
mobileType = 'android';
mobileType = 'android';
} else if (isIOS) {
mobileType = 'ios';
}else{
mobileType = 'android';
mobileType = 'ios';
} else {
mobileType = 'android';
}
request.VersionID = 2.9;
request.Channel = 33;
request.VersionID = 3.0;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;
return request;
}
public authenticateAndSetPersonalInformation(
@ -194,65 +203,65 @@ export class AuthenticationService {
public getPublicRequest(): Request {
const request = new Request();
this.setPublicFields(request);
return request;
}
public getPublicRequest(): Request {
const request = new Request();
this.setPublicFields(request);
return request;
}
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
}
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
}
public isAuthenticated(): boolean {
return AuthenticationService.user != null;
}
/**
* this fucntion load from user information if he logged in before
* and save user into memory and local storage
* disable notifications for previous user if new user logged in with different user
*
*
* info:
* 1- user stored in local storage without token
* @param result check activation code result
*/
public setAuthenticatedUser(
result: SMSCheckResponse
): Observable<boolean> {
return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user;
this.publishUserChangeEvent();
observer.next(true);
observer.complete();
});
}
);
});
}
public isAuthenticated(): boolean {
return AuthenticationService.user != null;
}
/**
* this fucntion load from user information if he logged in before
* and save user into memory and local storage
* disable notifications for previous user if new user logged in with different user
*
*
* info:
* 1- user stored in local storage without token
* @param result check activation code result
*/
public setAuthenticatedUser(
result: SMSCheckResponse
): Observable<boolean> {
return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user;
this.publishUserChangeEvent();
observer.next(true);
observer.complete();
});
}
);
});
}
public resetAuthenticatedUser(user: AuthenticatedUser) {
AuthenticationService.user = user;
AuthenticationService.requireRelogin = false;
@ -334,8 +343,8 @@ export class AuthenticationService {
user.P_SESSION_ID = result.P_SESSION_ID;
user.MobileNumber = result.EMPLOYEE_MOBILE_NUMBER;
user.TokenID = result.TokenID;
user.CompanyImageDescription=result.CompanyImageDescription;
user.CompanyImageURL=result.CompanyImageURL;
user.CompanyImageDescription = result.CompanyImageDescription;
user.CompanyImageURL = result.CompanyImageURL;
user.CompanyBadge = result.CompanyBadge;
user.CompanyMainCompany = result.CompanyMainCompany;
user.LogInTokenID = this.cs.sharedService.getSharedData(
@ -455,163 +464,163 @@ export class AuthenticationService {
return AuthenticationService.user;
}
*/
if(AuthenticationService.user){
return AuthenticationService.user;
}else{
this.cs.openLogin();
}
if (AuthenticationService.user) {
return AuthenticationService.user;
} else {
this.cs.openLogin();
}
}
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string, fromSMS = false )
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel, fromSMS);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheckForget, request, onError, errorLabel);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheckForget, request, onError, errorLabel);
}
public sendPublicSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public sendPublicSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
/*
client side:
id no , mobile no , zip code
*/
/*
client side:
id no , mobile no , zip code
*/
/*
client side:
id no , mobile no , zip code
*/
// public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
// : Observable<CheckUserAuthenticationResponse> {
// this.setPublicFields(request);
// request.TokenID = '';
// request.isRegister = false;
// return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel);
// }
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
// public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
// : Observable<CheckUserAuthenticationResponse> {
// this.setPublicFields(request);
// request.TokenID = '';
// request.isRegister = false;
// return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel);
// }
public sendForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public submitForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.changePasswordForget, request, onError, errorLabel);
}
public sendForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public submitChangePassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
this.authenticateRequest(request);
return this.con.post(AuthenticationService.changePassword, request, onError, errorLabel);
}
public submitForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.changePasswordForget, request, onError, errorLabel);
}
public submitExpiredPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.expiredPassword, request, onError, errorLabel);
}
public submitChangePassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
this.authenticateRequest(request);
return this.con.post(AuthenticationService.changePassword, request, onError, errorLabel);
}
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
//request.SearchType = 2;
//request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
}
public submitExpiredPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.expiredPassword, request, onError, errorLabel);
}
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<ForgotFileIDResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.SearchType = 2;
request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel);
}
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
//request.SearchType = 2;
//request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
}
// tslint:disable-next-line: max-line-length
public insertMobileLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string, isPostNoLoad = false): Observable<GetLoginInfoResponse> {
this.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
} else {
return this.con.post(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
}
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<ForgotFileIDResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.SearchType = 2;
request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel);
}
// tslint:disable-next-line: max-line-length
public insertMobileLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string, isPostNoLoad = false): Observable<GetLoginInfoResponse> {
this.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
} else {
return this.con.post(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
}
}
public isSAUDIIDValid(id: string): boolean {
if (!id) {
public isSAUDIIDValid(id: string): boolean {
if (!id) {
return false;
}
try {
id = id.toString();
id = id.trim();
const returnValue = Number(id);
let sum = 0;
if (returnValue > 0) {
const type = Number(id.charAt(0));
if (id.length !== 10) {
return false;
}
try {
id = id.toString();
id = id.trim();
const returnValue = Number(id);
let sum = 0;
if (returnValue > 0) {
const type = Number(id.charAt(0));
if (id.length !== 10) {
return false;
}
if (type !== 2 && type !== 1) {
return false;
}
for (let i = 0; i < 10; i++) {
if (i % 2 === 0) {
const a = id.charAt(i);
const x = Number(a) * 2;
let b = x.toString();
if (b.length === 1) {
b = "0" + b;
}
sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else {
sum += Number(id.charAt(i));
}
if (type !== 2 && type !== 1) {
return false;
}
for (let i = 0; i < 10; i++) {
if (i % 2 === 0) {
const a = id.charAt(i);
const x = Number(a) * 2;
let b = x.toString();
if (b.length === 1) {
b = "0" + b;
}
return sum % 10 === 0;
sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else {
sum += Number(id.charAt(i));
}
} catch (err) {}
return false;
}
return sum % 10 === 0;
}
} catch (err) { }
return false;
}
public checkUserHasEmailDialog(): Observable<void> {
return Observable.create(observer => {
if (this.isAuthenticatedUserHasRealEmail()) {
@ -662,26 +671,26 @@ export class AuthenticationService {
public getLastLoginInfo() {
let deviceToken = localStorage.getItem('deviceToken');
let deviceToken = localStorage.getItem('deviceToken');
const requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
};
this.getLoginInfo(requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
this.getLoginInfo(requestGetLoginInfo, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else {}
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else { }
});
}
@ -727,6 +736,34 @@ export class AuthenticationService {
);
}
}
checkAds(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.getITGPageNotification, request, onError, errorLabel);
}
adsDetails(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.getITGPageNotificationDetails, request, onError, errorLabel);
}
saveAdsStatus(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.saveSurveyAds, request, onError, errorLabel);
}
setViewAds(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.setViewAdvertisement, request, onError, errorLabel);
}
//**************************//
public sendActivationCodeByType(
@ -744,4 +781,5 @@ export class AuthenticationService {
onError,
errorLabel
);
}}
}
}

@ -21,5 +21,5 @@ export class SMSCheckResponse extends Response {
public EMPLOYEE_NAME:string;
public Mohemm_Wifi_SSID:string;
public Mohemm_Wifi_Password:string;
public ForgetPasswordTokenID: string;
}

@ -7,7 +7,7 @@ import {
Platform,
MenuController
} from '@ionic/angular';
import { Router } from '@angular/router';
import { Router, NavigationExtras } from '@angular/router';
import { TranslatorService } from '../translator/translator.service';
import { AlertControllerService } from '../../ui/alert/alert-controller.service';
//import { Response } from "../models/response";
@ -35,7 +35,7 @@ export class CommonService {
public static MOHEMM_WIFI_SSID = "";
public static MOHEMM_WIFI_PASSWORD = "";
public static SKIP = false;
public static months_en_long = [
'January',
'February',
@ -81,8 +81,8 @@ export class CommonService {
private progressLoaders: any[] = [];
private loadingProgress: any;
public updateImage:boolean=false;
public setUpdateImg:any;
public updateImage: boolean = false;
public setUpdateImg: any;
DT: any;
activeType: any;
constructor(
@ -105,7 +105,7 @@ export class CommonService {
public diagnostic: Diagnostic,
public iab: InAppBrowser,
private menu: MenuController,
) {}
) { }
public back() {
// this.nav.pop();
@ -118,61 +118,61 @@ export class CommonService {
public getMonthName(value: number): string {
switch (value) {
case 1:
return 'January';
case 2:
return 'February';
case 3:
return 'March';
case 4:
return 'April';
case 5:
return 'May';
case 6:
return 'June';
case 7:
return 'July';
case 8:
return 'August';
case 9:
return 'September';
case 10:
return 'October';
case 11:
return 'November';
case 12:
return 'December';
case 1:
return 'January';
case 2:
return 'February';
case 3:
return 'March';
case 4:
return 'April';
case 5:
return 'May';
case 6:
return 'June';
case 7:
return 'July';
case 8:
return 'August';
case 9:
return 'September';
case 10:
return 'October';
case 11:
return 'November';
case 12:
return 'December';
}
}
}
public getMonthNameAr(value: number): string {
public getMonthNameAr(value: number): string {
switch (value) {
case 1:
return 'يناير';
case 2:
return ' فبراير';
case 3:
return 'مارس';
case 4:
return 'أبريل';
case 5:
return 'مايو';
case 6:
return 'يونيو';
case 7:
return 'يوليو';
case 8:
return 'أغسطس';
case 9:
return 'سبتمبر';
case 10:
return ' اكتوبر';
case 11:
return ' نوفمبر';
case 12:
return 'ديسمبر';
case 1:
return 'يناير';
case 2:
return ' فبراير';
case 3:
return 'مارس';
case 4:
return 'أبريل';
case 5:
return 'مايو';
case 6:
return 'يونيو';
case 7:
return 'يوليو';
case 8:
return 'أغسطس';
case 9:
return 'سبتمبر';
case 10:
return ' اكتوبر';
case 11:
return ' نوفمبر';
case 12:
return 'ديسمبر';
}
}
}
public round(value: number, decimal: number): string {
const valueStr = value.toString();
@ -213,6 +213,22 @@ public getMonthNameAr(value: number): string {
toast.present();
}
public redToastPK(page: string, key: string) {
this.redToast(this.ts.trPK(page, key));
}
async redToast(message: string) {
const toast = await this.toastController.create({
message: message,
showCloseButton: true,
position: 'middle',
duration: 2000,
color: 'danger',
closeButtonText: this.ts.trPK('general', 'close')
});
toast.present();
}
private loaderIsActive = false;
async startLoadingOld() {
this.stopLoading();
@ -290,7 +306,7 @@ public getMonthNameAr(value: number): string {
public confirmNotAllowedDialog() {
this.openHome();
this.alertDialog(
() => {},
() => { },
this.ts.trPK('general', 'ok'),
this.ts.trPK('general', 'info'),
this.ts.trPK('general', 'not-allowed')
@ -436,7 +452,7 @@ public getMonthNameAr(value: number): string {
message: message,
buttons: [
{
text:this.ts.trPK('general', 'ok'),
text: this.ts.trPK('general', 'ok'),
handler: () => {
if (onAccept) {
onAccept();
@ -587,8 +603,8 @@ public getMonthNameAr(value: number): string {
public getDeviceType(): string {
if (this.platform.is('mobile')) {
// return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android");
return (this.platform.is('ios') ? 'Iphone' : 'android');
// return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android");
return (this.platform.is('ios') ? 'Iphone' : 'android');
} else {
return 'Desktop';
@ -620,7 +636,7 @@ public getMonthNameAr(value: number): string {
private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) {
const browser = window.open(url, '_blank', 'location=no');
browser.addEventListener('loadstart', () => {});
browser.addEventListener('loadstart', () => { });
browser.addEventListener('loaderror', () => {
if (onFaild) {
@ -696,7 +712,7 @@ public getMonthNameAr(value: number): string {
public openLocation(lat: number, lng: number) {
this.platform.ready().then(() => {
this.launchNavigation.navigate([lat, lng]).then(
() => {},
() => { },
err => {
// this.failedToOpenMap();
window.open('https://maps.google.com/?q=' + lat + ',' + lng);
@ -896,7 +912,7 @@ public getMonthNameAr(value: number): string {
return targetCode >= minDigit && targetCode <= maxDigit;
}
public enterPage() {}
public enterPage() { }
private smsAlertDialog = null;
public presentSMSPasswordDialog(
@ -928,7 +944,7 @@ public getMonthNameAr(value: number): string {
text: this.ts.trPK('general', 'cancel'),
role: 'cancel',
cssClass: 'cancel-button',
handler: () => {}
handler: () => { }
},
{
text: this.ts.trPK('general', 'ok'),
@ -1075,10 +1091,10 @@ public getMonthNameAr(value: number): string {
/*
open calls
*/
public openAttenTrackingpage(){
public openAttenTrackingpage() {
this.nav.navigateForward(['/attendance-tracking/home']);
}
public openAttendanceOptionsComponent(){
public openAttendanceOptionsComponent() {
this.nav.navigateForward(['/home/attendance-option']);
}
public openEitListPage() {
@ -1090,6 +1106,9 @@ public getMonthNameAr(value: number): string {
public openConfirmEitPage() {
this.nav.navigateForward(['/eit/confirm-add-eit']);
}
public openConfirmBasicDetailsPage() {
this.nav.navigateForward(['/profile/confirm-basic']);
}
public openHome() {
this.nav.navigateRoot(['/home']);
}
@ -1099,12 +1118,31 @@ public getMonthNameAr(value: number): string {
public openChangePassword() {
this.nav.navigateForward(['/authentication/changepassowrd']);
}
public openProfile() {
this.nav.navigateForward(['/profile/home']);
// public openProfile() {
// this.nav.navigateForward(['/profile/home']);
// }
public openProfile(target: any) {
const navigationExtras: NavigationExtras = {
queryParams: {
targetValue: target
}
};
this.nav.navigateForward(['/profile/home'], navigationExtras);
}
public openEditProfile() {
this.nav.navigateForward(['/profile/editprofile']);
}
public openAddBasicDetails(target: string) {
const navigationExtras: NavigationExtras = {
queryParams: {
targetValue: target
}
};
this.nav.navigateForward(['/profile/addBasicDetails'], navigationExtras);
}
public openAccuralPage() {
this.nav.navigateForward(['/accrual-balances/home']);
}
@ -1118,14 +1156,28 @@ public getMonthNameAr(value: number): string {
public openMyTeamDetailPage() {
this.nav.navigateForward(['/my-team/details']);
}
public openMyRequestPage() {
this.nav.navigateForward(['/mowadhafi/my-request']);
}
public openHRRequestPage() {
this.nav.navigateForward(['/mowadhafi/hr-request']);
}
public openHRRequestFormPage() {
this.nav.navigateForward(['/mowadhafi/hr-request-form']);
}
public openRequestDetailsPage() {
this.nav.navigateForward(['/mowadhafi/request-details']);
}
public openPage(link: string) {
this.nav.navigateForward([link]);
}
public static myTeamDetailUrl =['/my-team/details','/my-team/details-2']
public static myTeamDetailUrl = ['/my-team/details', '/my-team/details-2']
public openMyTeamDetails() {
this.alternateNavigate(CommonService.myTeamDetailUrl,'teamDetail-open',true);
// this.nav.navigateForward(["/my-team/details"]);
this.alternateNavigate(CommonService.myTeamDetailUrl, 'teamDetail-open', true);
// this.nav.navigateForward(["/my-team/details"]);
}
public openAbsencePage() {
this.nav.navigateForward(['/absence/home']);
@ -1176,9 +1228,8 @@ public getMonthNameAr(value: number): string {
this.nav.navigateForward(['/notification/item-history-PO']);
}
public openMOItemHistoryPage(){
public openMOItemHistoryPage() {
this.nav.navigateForward(['/notification/item-history-MO']);
}
public openQutationAnalysisPage() {
this.nav.navigateForward(['/notification/qutation-analysis-PO']);
@ -1186,6 +1237,9 @@ public getMonthNameAr(value: number): string {
public openWorklistMainMRPage() {
this.nav.navigateForward(['/notification/worklist-main-MR']);
}
public openWorklistMainICPage() {
this.nav.navigateForward(['/notification/item-creation-IC']);
}
public openWorklistITGPage() {
this.nav.navigateForward(['/notification/worklist-main-ITG']);
}
@ -1217,15 +1271,24 @@ public getMonthNameAr(value: number): string {
public openEditprofile() {
this.nav.navigateForward(['/profile/editProfile']);
}
public openAddAddress() {
this.nav.navigateForward(['/profile/add-address']);
}
public openConfirmAddAddress() {
this.nav.navigateForward(['/profile/confirm-add-address']);
}
public openPerformanceevaluation() {
this.nav.navigateForward(['/profile/performanceevaluation']);
}
public eitUpdate() {
this.nav.navigateForward(['/eit/eit-update-list']);
}
public openAnnouncement() {
this.nav.navigateForward(['/backend-integrations/announcement']);
}
public navigatePage(path) {
this.nav.navigateForward([path]);
}
@ -1252,7 +1315,7 @@ public getMonthNameAr(value: number): string {
this.nav.navigateBack([url]);
}
private alternateNavigate(paths: string[], key: string, root = false) {
let url: string;
if (localStorage.getItem(key) === 'yes') {
@ -1373,7 +1436,7 @@ public getMonthNameAr(value: number): string {
public formatDate(date) {
let FormatedDate;
console.log(date);
if (date) {
date = date.slice(0, 10);
FormatedDate = date.replace(/-/g, '/');
@ -1398,34 +1461,34 @@ public getMonthNameAr(value: number): string {
return FormatedDate;
}
public setUpdateImage (image,status?){
public setUpdateImage(image, status?) {
console.log('setUpdateImage');
this.setUpdateImg=image;
this.updateImage=status;
this.setUpdateImg = image;
this.updateImage = status;
}
public getUpdateImage(){
public getUpdateImage() {
console.log('getUpdateImage');
const objImg={
img: this.setUpdateImg,
const objImg = {
img: this.setUpdateImg,
status: this.updateImage
}
return objImg;
}
setDeviceToken(deviceToken) {
this.DT = deviceToken;
}
setDeviceToken(deviceToken){
this.DT=deviceToken;
}
getDeviceToken(){
return this.DT;
}
getDeviceToken() {
return this.DT;
}
setActiveTypeLogin(activeType){
this.activeType=activeType;
}
setActiveTypeLogin(activeType) {
this.activeType = activeType;
}
getActiveTypeLogin(){
return this.activeType;
}
getActiveTypeLogin() {
return this.activeType;
}
}

@ -27,19 +27,20 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
// public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,
private events: Events,
public ts: TranslatorService) {}
public cs: CommonService,
private events: Events,
public ts: TranslatorService) { }
public post(
service: string,
data: any,
onError: any,
errorLabel?: string
errorLabel?: string,
fromSMS = false
): Observable<any> {
this.cs.startLoading();
return this.httpClient
@ -52,7 +53,7 @@ export class ConnectorService {
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap(
res => this.handleResponse(res, onError, errorLabel),
res => this.handleResponse(res, onError, errorLabel, false, fromSMS),
error => this.handleError(error, onError, errorLabel)
)
);
@ -98,18 +99,18 @@ export class ConnectorService {
public postNoLoad(service: string, data: any, onError: any, errorLabel?: string): Observable<any> {
return this.httpClient
.post<any>(
.post<any>(
ConnectorService.host + service,
data,
ConnectorService.httpOptions)
.pipe(
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap((res) => {
this.handleResponse(res, onError, errorLabel, true);
}, (error) => {
this.handleError(error, onError, errorLabel, true);
}));
.pipe(
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap((res) => {
this.handleResponse(res, onError, errorLabel, true);
}, (error) => {
this.handleError(error, onError, errorLabel, true);
}));
}
// absolute url connection
@ -198,27 +199,28 @@ export class ConnectorService {
let deviceToken = localStorage.getItem('deviceToken');
const requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
};
this.getLoginInfo(requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
this.getLoginInfo(requestGetLoginInfo, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], 'imei-user-data');
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else {}
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], 'imei-user-data');
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else { }
});
}
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false, fromSMS = false) {
console.log('fromSMSValue ' + fromSMS)
if (!isPostNoLoad) {
this.cs.stopLoading();
}
@ -236,11 +238,16 @@ export class ConnectorService {
this.cs.stopLoading();
} else {
this.cs.stopLoading();
this.cs.showErrorMessageDialog(
onError,
errorLabel,
result.ErrorEndUserMessage
);
if (!fromSMS) {
this.cs.showErrorMessageDialog(
onError,
errorLabel,
result.ErrorEndUserMessage
);
} else {
console.log('its an error from sms')
}
//add flag if user not auth
}
@ -257,7 +264,7 @@ export class ConnectorService {
this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
console.log("presentAcceptDialog");
this.cs.sharedService.clearAll();
this.cs.sharedService.clearAll();
// this.cs.openLogin();
this.getLastLoginInfo();
});

@ -4,7 +4,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
import { Observable } from 'rxjs';
import { SubjectSubscriber } from 'rxjs/internal/Subject';
import { TranslatorService } from '../translator/translator.service';
import { promise } from 'protractor';
import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
@ -42,17 +42,17 @@ export class DevicePermissionsService {
private requestCamera(observer: any) {
this.hasCameraPermission().then((isAvailable) => {
if (isAvailable) {
// this.requestMicophonePermission(observer);
this.observerDone(observer, true);
// this.requestMicophonePermission(observer);
this.observerDone(observer, true);
} else {
this.diagnostic.requestCameraAuthorization(true).then((value) => {
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
// this.requestMicophonePermission(observer);
this.observerDone(observer, true);
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
// this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
// this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
} else {
this.observerDone(observer, false);
@ -84,7 +84,7 @@ export class DevicePermissionsService {
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
this.observerDone(observer, true);
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
@ -113,15 +113,15 @@ export class DevicePermissionsService {
observer.complete();
}
public async hasCameraPermission(): Promise<boolean> {
public async hasCameraPermission(): Promise<boolean> {
return this.diagnostic.isCameraAuthorized(true);
}
public async hasCameraAndMicPermissions(): Promise<boolean> {
public async hasCameraAndMicPermissions(): Promise<boolean> {
const camera = await this.hasCameraPermission();
// let mic = await this.diagnostic.isMicrophoneAuthorized();
if (camera) {
// await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false);
// await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false);
return true;
} else {
return false;
@ -218,8 +218,8 @@ export class DevicePermissionsService {
// }
// } else {
if (await this.permissionRequestDialog(message)) {
return this.requestCameraPermission().toPromise();
}
return this.requestCameraPermission().toPromise();
}
// }
return false;
}
@ -229,7 +229,7 @@ export class DevicePermissionsService {
/* geolocation permission */
public async requestLocationAutherization() {
if ( await this.isLocationEnabled()) {
if (await this.isLocationEnabled()) {
if (await this.hasLocationPermissions()) {
return true;
} else {
@ -240,8 +240,8 @@ export class DevicePermissionsService {
// }
// } else {
if (await this.permissionRequestDialog(message)) {
return this.requestLocationPermission();
}
return this.requestLocationPermission();
}
// }
return false;
}
@ -259,7 +259,7 @@ export class DevicePermissionsService {
return isAvailable;
}
public async hasLocationPermissions(): Promise<boolean> {
public async hasLocationPermissions(): Promise<boolean> {
const location = await this.diagnostic.isLocationAvailable();
if (location) {
await this.setAlwaysDenied(DevicePermissionsService.LOCATION, false);
@ -289,7 +289,7 @@ export class DevicePermissionsService {
// tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
return true;
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.LOCATION, true);
}

@ -0,0 +1,12 @@
import { Request } from 'src/app/hmg-common/services/models/request';
export class AnnouncementRequest extends Request {
public TokenID: string;
public EmployeeNumber: string;
public ItgPageNo: number;
public ItgPageSize: number;
public ItgAwarenessID: number;
public ItgRowID: number;
}

@ -38,7 +38,7 @@
margin-right: 6%;
width: 88%;
text-align: center;
font-size: 0.38cm;
font-size: 0.3cm;
color: var(--ion-color-secondary);
}

@ -0,0 +1,6 @@
<div class="main-container" [ngStyle]="active === true ? {'color': color} : {}">
<div class="main-container-radius" [ngStyle]="active === true ? {'color': '#ffffff'} : {'color': color}"></div>
<span class="text-span" [ngStyle]="active === true ? {'color': '#269DB8'} : {}">{{text}}</span>
</div>

@ -0,0 +1,21 @@
.main-container{
width: 47px;
position: relative;
margin-left: 9px;
}
.main-container-radius{
position: absolute;
width: 30px;
}
.number-span{
display: block;
}
.text-span{
font-size: 13px;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}

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

@ -0,0 +1,18 @@
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-card-calendar',
templateUrl: './card-calendar.component.html',
styleUrls: ['./card-calendar.component.scss'],
})
export class CardCalendarComponent implements OnInit {
@Input() text: string;
@Input() active: boolean;
@Input() color: string;
constructor() { }
ngOnInit() {}
}

@ -9,12 +9,13 @@
</ion-col>
<ion-col [size]="9" style="padding: 8px 5px 0px;margin-top: 14px;">
<div>
<span class="employee-name" (click)="getDetails()">
<span [ngClass]=" direction == 'en'? 'employee-name' : 'employee-name-ar'" (click)="getDetails()">
<h2 class="name">{{name}}</h2>
<span class="title">{{title}}</span>
</span>
<a [ngClass]="employeePhoneNumber == '' ? 'disable-phone image-container' : 'image-container'" href="tel:{{employeePhoneNumber}}">
<img src="../assets/imgs/green_call_icon.png" >
<!-- <img src="../assets/imgs/green_call_icon.png" > -->
<img src="../assets/imgs/call.svg" >
</a>
</div>
<!-- <div class="swipe-information">

@ -1,16 +1,26 @@
.team-member-container{
// background: white;
// border-radius: 100px 20px 20px 100px;
// margin-top: 15px;
// font-family: WorkSans-Regular;
// border: 1px solid #ccc;
// border-radius: 15px;
// padding-bottom: 8px;
background: white;
border-radius: 100px 20px 20px 100px;
margin-top: 15px;
/* margin-top: 2px; */
font-family: WorkSans-Regular;
border: 1px solid #ccc;
border-radius: 15px;
padding-bottom: 8px;
margin-bottom: 7px;
}
.user-image-container{
position: relative;
width: 70px;
height: 70px;
display: block;
margin: 0 auto;
// .user-image-container{
// position: relative;
// width: 70px;
// height: 70px;
// display: block;
// margin: 0 auto;
// &:before{
// position: absolute;
// content: "";
@ -26,19 +36,24 @@
// &.present:before{
// background-color: green !important;
// }
}
// }
.user-image{
overflow: hidden;
position: relative;
display: block;
width: 100%;
height: 100%;
border-radius: 80px;
border: 1px solid #ccc;
margin: 0px auto 6px;
// overflow: hidden;
// position: relative;
// display: block;
// width: 100%;
// height: 100%;
// border-radius: 80px;
// border: 1px solid #ccc;
// margin: 0px auto 6px;
img {
width: 100%;
max-height: 100%;
// width: 100%;
// max-height: 100%;
width: 74%;
max-height: 74%;
margin-top: 4px;
margin-left: 6px;
}
}
@ -46,22 +61,109 @@
display: inline-block;
width: 80%;
.name{
font-size: 16px;
color: black;
margin: 0;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
// font-size: 16px;
// color: black;
// // margin: 0;
// width: 100%;
// text-overflow: ellipsis;
// white-space: nowrap;
// overflow: hidden;
// margin-left: -10px;
// margin-top: -5px;
// font-family: 'WorkSans-Bold';
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-left: -10px;
margin-top: -5px;
text-align: left;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 25px;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
}
.title{
// font-size: 13px;
// color: #888;
// width: 100%;
// text-overflow: ellipsis;
// white-space: nowrap;
// overflow: hidden;
// display: block;
// margin-left: -10px;
// margin-top: -6px;
// color: black;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 12px;
letter-spacing: -0.56px;
color: #575757;
opacity: 1;
font-size: 14px;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: block;
margin-left: -10px;
margin-top: -10px;
}
}
.employee-name-ar{
display: inline-block;
width: 80%;
.name{
// font-size: 16px;
// color: black;
// // margin: 0;
// width: 100%;
// text-overflow: ellipsis;
// white-space: nowrap;
// overflow: hidden;
// margin-left: -10px;
// margin-top: -5px;
// font-family: 'WorkSans-Bold';
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-left: -10px;
margin-top: -5px;
text-align: right;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 25px;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
}
.title{
font-size: 13px;
color: #888;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: block;
// font-size: 13px;
// color: #888;
// width: 100%;
// text-overflow: ellipsis;
// white-space: nowrap;
// overflow: hidden;
// display: block;
// margin-left: -10px;
// margin-top: -6px;
// color: black;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 12px;
letter-spacing: -0.56px;
color: #575757;
opacity: 1;
font-size: 14px;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: block;
margin-left: -10px;
margin-top: -10px;
}
}
.image-container{

@ -1,12 +1,13 @@
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-employee-information',
templateUrl: './employee-information.component.html',
styleUrls: ['./employee-information.component.scss'],
})
export class EmployeeInformationComponent implements OnInit {
public direction: string;
public userImage: any = '../assets/imgs/profile.png';
@Input() name: string;
@Input() title: string;
@ -15,9 +16,19 @@ export class EmployeeInformationComponent implements OnInit {
// tslint:disable-next-line: no-output-on-prefix
@Output() onGetDetails = new EventEmitter();
constructor() { }
constructor(
public ts: TranslatorService,
) {
this.direction = TranslatorService.getCurrentLanguageName();
}
ngOnInit() {}
ngOnInit() {
console.log(this.title);
let jobTitle = this.title.split('.');
if (jobTitle && jobTitle.length > 1) {
this.title = jobTitle[0] + " " + jobTitle[1];
}
}
getDetails() {
this.onGetDetails.emit();

@ -28,7 +28,7 @@ export class GenericHeaderComponent implements OnInit {
}
openProfilePage() {
this.common.openEditProfile();
this.common.openProfile('sideMenu');
}
closeModal() {

@ -33,9 +33,9 @@ export class NavButtonsComponent implements OnInit {
this.isIOS = this.platform.is('ios');
this.direction = TranslatorService.getCurrentDirection();
this.platform.backButton.subscribeWithPriority(0 , () => {
this.backButtonClicked({});
});
// this.platform.backButton.subscribeWithPriority(0 , () => {
// this.backButtonClicked({});
// });
});
}

@ -1,10 +1,15 @@
<div feedback class="custom-button">
<div class="iconBox">
<img *ngIf="title != 'My Team' && title != 'Vacation Rule' && title != 'فريقي' && title != 'الإنابة بالإجازات' " [src]="'data:image/png;base64,'+icon" class="icon">
<img *ngIf="title !='Announcement' && title !='اعلان' && title !='Items For Sale' && title !='بضاعه للبع' && title !='العروض والخصومات' && title !='Offers & Discount' && title != 'My Team' && title != 'Vacation Rule' && title != 'فريقي' && title != 'الإنابة بالإجازات' " [src]="'data:image/png;base64,'+icon" class="icon">
<!-- <img *ngIf="title == 'My Team' || title == 'Vacation Rule'" [src]="icon" class="icon"> -->
<img *ngIf="title == 'My Team' || title == 'فريقي' " [src]="myTeamIcon" class="icon">
<img *ngIf="title == 'Vacation Rule' || title == 'الإنابة بالإجازات'" [src]="vacationRuleIcon" class="icon">
<img *ngIf="title == 'Vacation Rule' || title == 'الإنابة بالإجازات'" [src]="vacationRuleIcon" class="icon">
<img *ngIf="title =='Items For Sale' || title=='بضاعه للبع'" src="/assets/icon/home/item_for_sale.png" class="icon" style="height:40px" />
<img *ngIf="title =='Offers & Discount' || title =='العروض والخصومات'" src="/assets/icon/home/offers_discount.png" class="icon" style="height:40px" />
<img *ngIf="title =='Announcement' || title =='اعلان'" src="/assets/icon/home/announcementIntegration.png" class="icon" style="height:40px" />
</div>
<div class="titleBox">
<p class="pClass">{{title}}</p>

@ -26,7 +26,7 @@
}
.pClass {
font-size: 12PX;
font-size: 9px;
text-align: center;
margin-top: 10px;
color: black;

@ -3,7 +3,7 @@
margin-bottom: 0px;
border: 1px solid #ccc;
border-radius: 20px;
width: 100%;
width: 200px;
max-width: 105px;
height: 160px;
padding: 10px;
@ -29,7 +29,7 @@
.titleBox {
display: block;
span {
font-size: 30px;
font-size: 25px;
font-weight: bold;
color: black;
text-align: left;
@ -44,6 +44,7 @@
font-weight: bold;
text-align: left;
display: block;
font-size: 14px !important;
}
.iconFab{

@ -18,6 +18,7 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { DevicePermissionsService } from 'src/app/hmg-common/services/device-permissions/device-permissions.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Component({
@ -36,12 +37,17 @@ export class AttendanceOptionsComponent implements OnInit {
public enableLocationQR = false;
public enableLocationNFC = false;
public enableLocationWIFI = false;
public enableFirestore = false;
public deviceNFC = false;
public nfcIOSSuccess = false;
public lat = 0;
public longt = 0;
public isFakeLocationUsed = false;
public deviceID: string;
public firebasex: FirebaseX
public isDocumentAvailable = false;
public document: any;
constructor(
private nfc: NFC,
@ -61,6 +67,7 @@ export class AttendanceOptionsComponent implements OnInit {
) {}
ngOnInit() {
this.common.startLoading();
this.direction = TranslatorService.getCurrentLanguageName();
this.userData = this.common.sharedService.getSharedData(
AuthenticatedUser.SHARED_DATA,
@ -71,6 +78,11 @@ export class AttendanceOptionsComponent implements OnInit {
this.checkNFCStatus("one");
}
public checkFirebaseDocument() {
const id = this.userData.EMPLOYEE_NUMBER;
this.attendScanService.checkFirestoreDocument(id);
}
async checkNFCStatus(checkValue: string) {
try {
let nfcStatus = await this.nfc.enabled();
@ -100,43 +112,40 @@ export class AttendanceOptionsComponent implements OnInit {
}
public setServicesPrivilage() {
for (const servicePrivilage of AuthenticationService.servicePrivilage) {
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableNFC"
) {
this.serviceEnableNFC = true;
}
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableQR"
) {
this.serviceEnableQR = true;
}
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableWIFI"
) {
this.serviceEnableWifi = true;
}
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableLocationQR"
) {
this.enableLocationQR = true;
}
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableLocationNFC"
) {
this.enableLocationNFC = true;
}
if (
servicePrivilage.Previlege &&
servicePrivilage.ServiceName === "enableLocationWIFI"
) {
this.enableLocationWIFI = true;
try {
for (const servicePrivilage of AuthenticationService.servicePrivilage) {
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableNFC") {
this.serviceEnableNFC = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableQR") {
this.serviceEnableQR = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableWIFI") {
this.serviceEnableWifi = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableLocationQR") {
this.enableLocationQR = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableLocationNFC") {
this.enableLocationNFC = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableLocationWIFI") {
this.enableLocationWIFI = true;
}
if (servicePrivilage.Previlege && servicePrivilage.ServiceName === "enableFirestore") {
this.enableFirestore = true;
this.common.sharedService.setSharedData(true, 'enableFirestore');
this.checkFirebaseDocument();
} else {
this.enableFirestore = false;
this.common.sharedService.setSharedData(false, 'enableFirestore');
this.common.stopLoading();
}
}
} catch (error) {
console.log(error);
this.common.stopLoading();
}
}
@ -178,6 +187,9 @@ export class AttendanceOptionsComponent implements OnInit {
console.log("Error inside in swipe attendance");
})
.subscribe((result: Response) => {
if (this.enableFirestore) {
this.attendScanService.processFirebaseDocument('NFC-IOS', result);
}
if (this.common.validResponse(result)) {
this.ngZone.run(() => {
this.nfcIOSSuccess = true;
@ -228,6 +240,17 @@ export class AttendanceOptionsComponent implements OnInit {
const isAndroid = this.platform.is("android");
const isIOS = this.platform.is("ios");
const isWifiEnabled = await this.wifiWizard2.isWifiEnabled();
const versionType = this.device.version;
const versionTypeInt = parseInt(versionType);
console.log('version type: ' + versionType);
console.log('version Type: ' + versionTypeInt);
if(isAndroid && versionTypeInt > 10) {
if(!isWifiEnabled){
this.showWifiNotEnabled();
return;
}
}
if (isIOS) {
if(!isWifiEnabled){
@ -248,17 +271,16 @@ export class AttendanceOptionsComponent implements OnInit {
});
return;
}
// opening wifi dailog if all above conditions are passed (isWifiEnabled == true)
let modal = await this.modalController.create({
component: WifiModalComponent,
showBackdrop: true,
backdropDismiss: false,
componentProps:{ enableLocationWIFI: this.enableLocationWIFI, lat: this.lat, longt: this.longt},
});
modal.cssClass = "wifi-modal";
await modal.present();
}
// opening wifi dailog if all above conditions are passed (isWifiEnabled == true)
let modal = await this.modalController.create({
component: WifiModalComponent,
showBackdrop: true,
backdropDismiss: false,
componentProps:{ enableLocationWIFI: this.enableLocationWIFI, lat: this.lat, longt: this.longt},
});
modal.cssClass = "wifi-modal";
await modal.present();
}

@ -7,7 +7,7 @@
<ion-content class="main-dashboard-container">
<ion-grid class="main-container contentBg">
<ion-row class="slideFullWidth">
<ion-row *ngIf="showStaticServices" class="slideFullWidth">
<ion-slides [options]="slideOptsOne" class="padding-slide slide">
<ion-slide *ngFor="let button of statsButtons; let i=index;">
<app-stats-button
@ -56,7 +56,32 @@
<img src="assets/icon/new-design/attendance_button_icon.png"/>
</ion-col>
</ion-row>
</ion-row>
<ion-row *ngIf="showStaticServices">
<ion-col size="12">
<ion-label> {{'general,other-services' | translate}} </ion-label>
</ion-col>
<ion-slides [options]="slideOptsTwo" >
<ion-slide style="pointer-events: none; opacity: .3">
<app-services-button (click)="itemForSale()" [title]="'general,items-sales' | translate" >
</app-services-button>
</ion-slide>
<ion-slide>
<app-services-button (click)="offersDiscount()" [title]="'general,offers-discount' | translate" >
</app-services-button>
</ion-slide>
<ion-slide>
<app-services-button (click)="openAnnouncement()" [title]="'login,announcement' | translate" >
</app-services-button>
</ion-slide>
</ion-slides>
</ion-row>
</ion-grid>
</ion-content>

@ -37,8 +37,9 @@ import { WorklistMainService } from '../notification/service/work-list.main.serv
import { isThisISOWeek } from 'date-fns';
import { Router } from '@angular/router';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { NFC, Ndef} from "@ionic-native/nfc/ngx"
import { NFC, Ndef } from "@ionic-native/nfc/ngx"
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Component({
selector: 'app-home',
@ -73,28 +74,28 @@ export class HomePage implements OnInit {
show: true
},
{
title: this.ts.trPK('home','worklist'),
title: this.ts.trPK('home', 'worklist'),
statsValue: 0,
icon: 'assets/icon/new-design/work_list.png',
link: '1',
show: true
},
{
title: this.ts.trPK('home','missing-swipes'),
title: this.ts.trPK('home', 'missing-swipes'),
statsValue: 0,
icon: 'assets/icon/new-design/missing_swipe.png',
link: '2',
show:true
show: true
},
{
title: this.ts.trPK('home','leave-balance'),
title: this.ts.trPK('home', 'leave-balance'),
statsValue: 0,
icon: 'assets/icon/new-design/leave_balance.png',
link: '3',
show: this.isShow,
},
{
title: this.ts.trPK('absenceList','tickets-balance'),
title: this.ts.trPK('absenceList', 'tickets-balance'),
statsValue: 0,
icon: 'assets/icon/new-design/ticket_balance.png',
link: '4',
@ -102,14 +103,9 @@ export class HomePage implements OnInit {
}
];
public slideOptsOne = {
slidesPerView: 3.5,
spaceBetween: 10
};
public slideOptsTwo = {
slidesPerView: 3.2,
spaceBetween: 10
};
public slideOptsOne = {};
public slideOptsTwo = {};
public runTimer = false;
public hasStarted = false;
public hasFinished = false;
@ -132,6 +128,7 @@ export class HomePage implements OnInit {
public vacationRuleIcon: string;
direction: string;
public isPostNoLoad = true;
public showStaticServices = false;
constructor(
public ts: TranslatorService,
@ -158,7 +155,8 @@ export class HomePage implements OnInit {
private platform: Platform,
public backgroundGeolocation: BackgroundGeolocation,
public modalController: ModalController,
private nfc: NFC
private nfc: NFC,
public firebasex: FirebaseX
) {
this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl(
@ -169,11 +167,6 @@ export class HomePage implements OnInit {
ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
this.platform.backButton.subscribeWithPriority(9999, () => {
if (this.router.isActive('/home', true)) {
this.common.openHome();
}
});
this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');
@ -182,14 +175,27 @@ export class HomePage implements OnInit {
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
if(openDigitalIDCard === true){
if (openDigitalIDCard === true) {
console.log("DONE");
this.openDigitalId();
}
}
public slideSettingsTwo() {
const width = this.platform.width();
this.slideOptsOne = {
slidesPerView: width > 320 ? 3.5 : 3,
spaceBetween: 10
};
this.slideOptsTwo = {
slidesPerView: width > 320 ? 3.2 : 2.5,
spaceBetween: width > 320 ? 10 : 5
};
this.showStaticServices = true;
}
ionViewWillEnter() {
this.common.startLoading();
this.slideSettingsTwo();
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.remainingTime = 0;
this.displayTime = '00:00:00';
@ -269,11 +275,11 @@ export class HomePage implements OnInit {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
}, (error) => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
} else {
this.geolocation.getCurrentPosition({maximumAge: 3000, timeout: 10000, enableHighAccuracy: true}).then(resp => {
if(resp && resp.coords.latitude && resp.coords.longitude) {
this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }).then(resp => {
if (resp && resp.coords.latitude && resp.coords.longitude) {
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
@ -283,7 +289,7 @@ export class HomePage implements OnInit {
}).catch(error => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
}
}
} else {
return false;
}
@ -293,11 +299,11 @@ export class HomePage implements OnInit {
setServicesPrivilage() {
for (const servicePrivilage of AuthenticationService.servicePrivilage) {
if (servicePrivilage.Previlege === false) {
if(servicePrivilage.ServiceName === 'accrualBalance'){
if (servicePrivilage.ServiceName === 'accrualBalance') {
this.statsButtons[3].show = false;
this.statsButtons[4].show = false;
}
if(servicePrivilage.ServiceName === 'vacationRule'){
if (servicePrivilage.ServiceName === 'vacationRule') {
this.showVcationRule = false;
}
// document
@ -305,7 +311,7 @@ export class HomePage implements OnInit {
// .setAttribute('disabled', 'disabled');
// document.getElementById(servicePrivilage.ServiceName).style.filter =
// 'grayscale(1)';
}else{
} else {
this.statsButtons[3].show = true;
this.statsButtons[4].show = true;
this.showVcationRule = true;
@ -344,11 +350,11 @@ export class HomePage implements OnInit {
);
if (this.common.getUpdateImage().status) {
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.common.getUpdateImage().img);
} else {
this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
}
} else {
this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
}
this.callDashboardServices();
} else {
console.log(user);
@ -403,12 +409,12 @@ export class HomePage implements OnInit {
for (let i = 0; i < this.menuList.length; i++) {
if (this.menuList[i].MENU_TYPE === 'M') {
this.events.publish('myTeamFlag', 'true');
// this.common.sharedService.setSharedData('true', "myTeamFlag");
// this.common.sharedService.setSharedData('true', "myTeamFlag");
}
}
// if (item.MENU_TYPE === 'M') {
// this.common.openMyTeamPage();
// this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage");
// } else if (item.MENU_TYPE === 'S') {
// this.common.sharedService.setSharedData(item, 'mySpecList');
@ -480,15 +486,15 @@ export class HomePage implements OnInit {
for (let i = 0; i < result.GetMenuEntriesList.length; i++) {
// tslint:disable-next-line: triple-equals
if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HMG_TKT_NEW_EIT_SS') {
this.ticketRequestObject = result.GetMenuEntriesList[i];
// tslint:disable-next-line: triple-equals
this.ticketRequestObject = result.GetMenuEntriesList[i];
// tslint:disable-next-line: triple-equals
} else if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HR_LOA_SS') {
this.leaveRequestObject = result.GetMenuEntriesList[i];
// tslint:disable-next-line: triple-equals
} else if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HMG_OTL_MISSING_SWIPE_EIT_SS') {
this.missingSwipeRequestObject = result.GetMenuEntriesList[i];
}
}
// tslint:disable-next-line: triple-equals
} else if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HMG_OTL_MISSING_SWIPE_EIT_SS') {
this.missingSwipeRequestObject = result.GetMenuEntriesList[i];
}
}
this.sortMenuEntires(result.GetMenuEntriesList);
}
}
@ -541,12 +547,12 @@ export class HomePage implements OnInit {
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.EmployeeID = this.userData.EMPLOYEE_NUMBER;
this.attendanceService.fakeAttendanceSwipeScanner(request, () => {console.log('Error inside in swipe attendance');})
this.attendanceService.fakeAttendanceSwipeScanner(request, () => { console.log('Error inside in swipe attendance'); })
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK('home', 'fake-location'));
this.common.presentAlert(this.ts.trPK('home', 'fake-location'));
}
});
});
}
swipeAttendance() {
@ -569,13 +575,13 @@ export class HomePage implements OnInit {
}
openPersonalInfo() {
this.common.openProfile();
this.common.openProfile('sideMenu');
}
// Dashboard Services
showOrganizationSalaries() {
this.DS.getOrganizationSalaries().subscribe(
(result: OrganizationSalariesResponse) => {}
(result: OrganizationSalariesResponse) => { }
);
}
@ -592,7 +598,7 @@ export class HomePage implements OnInit {
showPerformanceAppraisal() {
this.DS.getPerformanceAppraisal().subscribe(
(result: PerformanceAppraisalResponse) => {}
(result: PerformanceAppraisalResponse) => { }
);
}
@ -604,7 +610,7 @@ export class HomePage implements OnInit {
return seconds;
}
convertAndAssignTime(data) {
convertAndAssignTime(data) {
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
@ -614,22 +620,22 @@ convertAndAssignTime(data) {
} else if (this.isCheckedIn && this.remainingTime === 0) {
this.percent = 100;
}
}
}
showAttendanceTracking() {
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
};
this.DS.getAttendanceTracking(request, '', '', this.isPostNoLoad).subscribe((result: AttendanceTrackingResponse) => {
showAttendanceTracking() {
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
};
this.DS.getAttendanceTracking(request, '', '', this.isPostNoLoad).subscribe((result: AttendanceTrackingResponse) => {
if (this.common.validResponse(result)) {
clearTimeout(this.intervalCountdown);
const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]);
}
});
}
}
openPeriodDateDashbored() {
openPeriodDateDashbored() {
this.DS.getOpenPeriodDates(() => { console.log('Error '); }).subscribe((result: OpenPeriodDatesResponse) => {
if (this.common.validResponse(result)) {
console.log('response');
@ -638,7 +644,7 @@ openPeriodDateDashbored() {
}
openNotificationsDashbored() {
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
this.DS.getOpenNotifications('', '', false).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
const key = 'P_OPEN_NTF_NUMBER';
this.countAllNotification = result[key];
@ -654,7 +660,7 @@ openPeriodDateDashbored() {
ITGCountAllNotification() {
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
this.statsButtons[1].statsValue =
Math.floor(this.countAllNotification + result.TotalCount);
Math.floor(this.countAllNotification + result.TotalCount);
this.common.stopLoading();
});
}
@ -673,7 +679,7 @@ openPeriodDateDashbored() {
});
}
getSubordinatesAttStatus() {
getSubordinatesAttStatus() {
const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM = '/Date(1578603600000+0300)/'; // test
request.P_SCHEDULE_DATE_TO = '/Date(1576011600000+0300)/'; // test
@ -731,8 +737,7 @@ getSubordinatesAttStatus() {
this.accrualBalancesList = result.GetAccrualBalancesList;
for (const accrualBalance of result.GetAccrualBalancesList) {
if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') {
this.statsButtons[3].statsValue =
Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT);
this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT === null ? 0 : Number(accrualBalance.ACCRUAL_NET_ENTITLEMENT.toFixed(2));
this.common.sharedService.setSharedData(accrualBalance, 'leaveAccrualBalance');
this.common.sharedService.setSharedData(request, 'leaveAccrualBalanceDate');
this.common.sharedService.setSharedData(this.accrualBalancesList, 'tickitsbalance');
@ -740,18 +745,18 @@ getSubordinatesAttStatus() {
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
this.statsButtons[4].statsValue = Math.floor(totalTicketsLeft);
this.statsButtons[4].statsValue = Number(totalTicketsLeft.toFixed(2));
}
});
}
openattentracking() {
openattentracking() {
this.common.openAttenTrackingpage();
}
}
public showAttendanceOptions() {
this.common.openAttendanceOptionsComponent();
}
public showAttendanceOptions() {
this.common.openAttendanceOptionsComponent();
}
openStatsButton(link: any) {
// tslint:disable-next-line: triple-equals
@ -759,19 +764,19 @@ public showAttendanceOptions() {
this.isFakeLocationUsed = false;
// this.getDeviceLocation();
this.showAttendanceOptions();
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (link == '1') {
this.common.startLoading();
this.common.openNotificationPage();
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (link == '2') {
this.openPage(this.missingSwipeRequestObject);
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (link == '3') {
this.openPage(this.leaveRequestObject);
// tslint:disable-next-line: triple-equals
// tslint:disable-next-line: triple-equals
} else if (link == '4') {
this.openPage(this.ticketRequestObject);
this.openPage(this.ticketRequestObject);
}
}
@ -782,4 +787,13 @@ public showAttendanceOptions() {
});
return await modal.present();
}
itemForSale() {
this.common.navigateForward('/itemforsale/items');
}
offersDiscount() {
this.common.navigateForward('/offersdiscount/home');
}
openAnnouncement() {
this.common.openAnnouncement();
}
}

@ -58,6 +58,7 @@ export class NfcModalComponent implements OnInit {
public swipeAttendanceNFC (nfcSerialCode: any) {
this.nfcReader.unsubscribe();
const enableFirestore = this.common.sharedService.getSharedData('enableFirestore', false);
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.PointType = 2;
request.Latitude = this.lat;
@ -71,6 +72,9 @@ export class NfcModalComponent implements OnInit {
console.log('Error inside in swipe attendance');
this.modalController.dismiss();
}).subscribe((result: Response) => {
if (enableFirestore) {
this.attendScanService.processFirebaseDocument('NFC-ANDROID', result);
}
if (this.common.validResponse(result)) {
this.ngZone.run(() => {
this.gifStatus = true;

@ -10,6 +10,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
import { Platform } from "@ionic/angular";
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AttendScanService } from "../../hmg-common/services/attend-services/attend-scan.service";
@Component({
selector: 'app-wifi-modal',
@ -36,6 +37,7 @@ export class WifiModalComponent implements OnInit {
private wifiWizard2: WifiWizard2,
private openNativeSettings: OpenNativeSettings,
private platform: Platform,
public attendScanService: AttendScanService
) { }
ngOnInit() {
@ -134,7 +136,10 @@ export class WifiModalComponent implements OnInit {
}
}
async swipeAttendanceWifi(code:any) {
async swipeAttendanceWifi(code:any) {
const isPlatformValue = this.platform.is('ios') ? 'WIFI-IOS' : 'WIFI-ANDROID';
const enableFirestore = this.common.sharedService.getSharedData('enableFirestore', false);
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.PointType = 3;
request.Latitude = this.lat;
@ -153,6 +158,9 @@ export class WifiModalComponent implements OnInit {
this.disconnectWifi();
})
.subscribe((result: Response) => {
if (enableFirestore) {
this.attendScanService.processFirebaseDocument(isPlatformValue, result);
}
this.disconnectWifi();
if (this.common.validResponse(result)) {
this.ngZone.run(() => {

@ -0,0 +1,273 @@
<ion-content>
<div class="head-title">
<!-- <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('itemforsale','title')}}</ion-title>
</ion-toolbar> -->
<app-generic-header
showImage="false"
showBack="true"
[headerText]="'itemforsale,title' | translate">
</app-generic-header>
</div>
<div class="header"></div>
<div class="bottom"></div>
<div class="md-stepper-horizontal ">
<ion-row>
<ion-col size="4"> <div class="md-step active " [ngClass]="step >1 ? 'green' : 'orange'">
<div class="md-step-circle"><span style="content: url(/assets/imgs/check-white.svg)"></span></div>
<div class="md-step-title">{{ts.trPK('itemforsale','select-category')}}</div>
<div class="md-step-optional">{{ts.trPK('itemforsale','completed')}}</div>
<div class="md-step-bar-left"></div>
<!-- <div class="md-step-bar-right" [ngClass]="step ==1 ? 'orange-border' : 'green-border'"></div> -->
</div>
</ion-col>
<ion-col size="4"> <div class="md-step" [ngClass]="step >2 ? 'green' : step ==2 ? 'orange' : 'grey'">
<div class="md-step-circle"><span *ngIf="step==1" style="content: url(/assets/imgs/check.svg)"></span>
<span *ngIf="step>2 || step==2" style="content: url(/assets/imgs/check-white.svg)">
</span>
</div>
<div class="md-step-title">{{ts.trPK('itemforsale','add-details')}}</div>
<div class="md-step-optional">{{step >2 ? "Completed" : "Locked"}}</div>
<div class="md-step-bar-left"></div>
</div></ion-col>
<ion-col size="4"><div class="md-step" [ngClass]="step >3 ? 'green' : step ==3 ? 'orange' : 'grey'">
<div class="md-step-circle"><span *ngIf="step==1 || step==2" style="content: url(/assets/imgs/check.svg)"></span>
<span *ngIf="step>=3" style="content: url(/assets/imgs/check-white.svg)"></span></div>
<div class="md-step-title">{{ts.trPK('itemforsale','review-sell')}}</div>
<div class="md-step-optional">{{step >3 ? "Completed" : "Locked"}}</div>
<div class="md-step-bar-left"></div>
</div></ion-col>
</ion-row>
</div>
<div class="content">
<div class="offering" *ngIf="step==1">
<h2>What are you offering?</h2>
</div>
<ion-grid *ngIf="step==1">
<ion-row>
<ion-col size="4">
<div class="sale-icon" (click)="nextStep()">
<div class="top">
<img src="/assets/imgs/itemsforsale/mobile.svg">
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon" (click)="openItem()">
<div class="top">
<img src="/assets/imgs/itemsforsale/cars.svg">
</div>
<div class="bottom-icon">
<p>Cars & Vehicles</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/electronic_appliances.svg">
</div>
<div class="bottom-icon">
<p>Electronic Applicance</p>
</div>
</div>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/furniture.svg">
</div>
<div class="bottom-icon">
<p>Furniture & Home Decor</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/fashion.svg">
</div>
<div class="bottom-icon">
<p>Fashion & beauty</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/book and sports.svg">
</div>
<div class="bottom-icon">
<p>Books, Sports & Hobbies</p>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
<div class="offering" *ngIf="step==2">
<h2>Add Details</h2>
</div>
<div class="add-details" *ngIf="step==2">
<ion-grid>
<ion-row>
<p>Item Info</p>
<ion-col size="12">
<ion-item lines="none">
<ion-input placeholder="Item Info"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
<ion-item lines="none">
<ion-textarea rows="6" cols="20" placeholder="Description"></ion-textarea>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<p>Item Condition</p>
<ion-radio-group value="new">
<ion-col>
<ion-radio value="new"></ion-radio>
<ion-label>New</ion-label>
</ion-col>
<ion-col>
<ion-radio value="used"></ion-radio>
<ion-label>Used</ion-label>
</ion-col>
</ion-radio-group>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
<p>Item Price</p>
<ion-item lines="none">
<ion-input placeholder="Item Price"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<p>Item Photos</p>
</ion-row>
<ion-row>
<ion-col lines="none" size="3">
<div class="image-container">
<div class="uploaded">
<div class="closed">X</div>
<img src="assets/imgs/itemsforsale/fashion.svg" />
</div>
</div>
</ion-col>
<ion-col lines="none" size="3">
<div class="image-container">
<div class="uploaded">
<div class="closed">X</div>
<img src="assets/imgs/itemsforsale/fashion.svg" />
</div>
</div>
</ion-col>
<ion-col lines="none" size="3">
<div class="image-container uploader-box">
<div class="uploaded">
<ion-icon name="camera" class="camera-icon"></ion-icon>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div class="offering" *ngIf="step==3">
<h2>Review & Sell</h2>
</div>
<div class="add-details" *ngIf="step==3">
<h2 class="review-title">Furniture Table</h2>
<p>
Consectetur adipiscing elit. Donec blandit diam nulla, non euismod eros efficitur imperdiet. Fusce erat enim, volutpat at enim in, venenatis iaculis risus.
</p>
<div class="description-details">
<p class="orange">Used</p>
<img src="assets/imgs/itemsforsale/fashion.svg" />
<img src="assets/imgs/itemsforsale/fashion.svg" />
<div class="selling">
<strong>Selling for </strong> <h2>500 SAR</h2>
</div>
<div class="waring">
<img src="/assets/imgs/itemsforsale/alert.svg"> <label>This ad will be valid for 2 week after approval</label>
</div>
</div>
</div>
</div>
<ion-footer *ngIf="step==1">
<div class="centerDiv">
<ion-button class="footer-button red-button" ion-button>
cancel </ion-button>
</div>
</ion-footer>
<ion-footer *ngIf="step>1">
<div class="centerDiv">
<ion-button class="footer-button red-button small-btn" ion-button (click)="step =3" *ngIf="step ==2 || step ==3">
cancel </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="step =3" *ngIf="step ==2">
{{ts.trPK('general','next')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="openItem()" *ngIf="step ==3">
Confirm </ion-button>
</div>
</ion-footer>
</ion-content>

@ -0,0 +1,343 @@
.md-stepper-horizontal {
width: 95%;
margin: 0 auto;
background-color: #FFFFFF;
box-shadow: 0 3px 8px -6px #DDDDDD;
margin: auto;
position: relative;
border-radius: 25px;
}
.md-stepper-horizontal .md-step {
display: table-cell;
position: relative;
padding: 20px 10px;
text-align: left;
}
.md-stepper-horizontal .md-step:hover,
.md-stepper-horizontal .md-step:active {
background-color:rgba(0,0,0,0.04);
}
.md-stepper-horizontal .md-step:active {
border-radius: 15% / 75%;
}
.md-stepper-horizontal .md-step:first-child:active {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.md-stepper-horizontal .md-step:last-child:active {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.md-stepper-horizontal .md-step:hover .md-step-circle {
background-color:#757575;
}
.md-stepper-horizontal ion-col:last-child .md-step-bar-left {
display:none;
}
.md-stepper-horizontal .md-step .md-step-circle {
width: 30px;
height: 30px;
border-radius: 50%;
text-align: center;
line-height: 30px;
font-size: 16px;
font-weight: 600;
color: #FFFFFF;
z-index: 3;
}
.md-stepper-horizontal .md-step:last-child .md-step-circle {
margin-left:0px
}
.md-stepper-horizontal.green .md-step.active .md-step-circle {
background-color:#00AE4D;
}
.md-stepper-horizontal.orange .md-step.active .md-step-circle {
background-color:#CC9B14;
}
.md-stepper-horizontal .md-step.active .md-step-circle {
background-color: rgb(33,150,243);
}
.md-stepper-horizontal .md-step.done .md-step-circle:before {
font-family:'FontAwesome';
font-weight:100;
content: "\f00c";
}
.md-stepper-horizontal .md-step.done .md-step-circle *,
.md-stepper-horizontal .md-step.editable .md-step-circle * {
display:none;
}
.md-stepper-horizontal .md-step.editable .md-step-circle {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
}
.md-stepper-horizontal .md-step.editable .md-step-circle:before {
font-family:'FontAwesome';
font-weight:100;
content: "\f040";
}
.md-stepper-horizontal .md-step .md-step-title {
margin-top: 5px;
font-size: 10px;
font-weight:bold;
}
.md-stepper-horizontal .md-step .md-step-title,
.md-stepper-horizontal .md-step .md-step-optional {
text-align: center;
color:rgba(0,0,0,.26);
margin-left:0 ;
}
.md-stepper-horizontal .md-step.orange .md-step-title, .md-stepper-horizontal .md-step.green .md-step-title {
font-weight: 600;
color:black;
}
.md-stepper-horizontal .md-step.active.done .md-step-title,
.md-stepper-horizontal .md-step.active.editable .md-step-title {
font-weight:600;
}
.md-stepper-horizontal .md-step .md-step-optional {
font-size:10px;
}
.md-stepper-horizontal .md-step .md-step-bar-left,
.md-stepper-horizontal .md-step .md-step-bar-right {
position: absolute;
top: 36px;
height: 2px;
background: #DDDDDD;
width: 120px;
z-index: 0;
left: 25px;
}
.md-stepper-horizontal .md-step .md-step-bar-left {
margin-right: 0px;
left: 40%;
}
.orange .md-step-bar-left {
background:#CC9B14 !important;
font-weight: bold;
}
.green .md-step-bar-left {
background:#1FA169 !important;
font-weight: bold;
}
.header{
height: 15%;
width: 100%;
position: absolute;
background: #259CB8;
top: 0;
}
.header-toolbar{
--background: #259CB8 !important;
}
.bottom{
height: 85%;
width: 100%;
position: absolute;
background: #F5F5F5;
top: 15%;
}
.md-step-optional{
font-size: 12px;
background: #cccccc;
color: #ffffff !important;
padding: 2px 5px 2px 5px;
border-radius: 5px;
margin: 5px;
}
.orange .md-step-optional{
font-size: 12px;
background: #CC9B14;
color: #ffffff !important;
padding:2px 5px 2px 5px;
border-radius: 5px;
margin-left:0 ;
}
.green .md-step-optional{
font-size: 12px;
background-color:#00AE4D;
color: #ffffff !important;
padding: 2px 5px 2px 5px;
border-radius: 5px;
}
.green .md-step-circle{
background-color:#00AE4D !important;
}
.orange .md-step-circle{
background: #CC9B14 !important;
}
.grey .md-step-circle{
background: #E3E3E3 !important;
}
.content{
position: relative;
margin-bottom: 70px;
}
.offering{
font-weight: bold;
margin: 20px 20px 0px;
position: relative;
}
.offering h2{
font-weight: bold;
font-size: 20px;
margin-bottom: 0;
}
.sale-icon{
box-shadow: 1px 1px 5px 1px #cccc;
padding: 10px;
margin: 2px;
border-radius: 15px;
background: #fff;
height: 115px;
position: relative;
}
.sale-icon ion-icon{
font-size: 35px;
}
.sale-icon p{
margin-bottom: 0;
font-size: 12px;
font-weight: bold;
position: absolute;
bottom: 10px;
text-align: left;
padding: 5px;
}
.add-details{
background: #fff;
margin: 15px;
padding: 10px;
box-shadow: 3px 4px 3px -1px #ccc;
border-radius: 20px;
}
.add-details ion-item{
border-radius: 25px;
border: 1px solid #cdcd;
padding: 5px;
}
.add-details p{
font-weight: normal;
font-size: 12px;
}
.add-details ion-label{
margin: 10px;
position: relative;
bottom: 3px;
}
.add-details ion-radio {
--color-checked: #009688;
}
.image-container{
position: relative;
height: 70px;
}
.image-container .uploaded{
position: relative;
}
.image-container .uploaded .closed{
position: absolute;
right: 0;
font-size: 14px;
color: #fff;
top: -15px;
right: -10px;
font-weight: bolder;
background: red;
padding: 6px;
border-radius: 50%;
text-align: center;
line-height: .7;
}
.image-container .uploaded img{
width: 70px;
}
.footer-button{
background: var(--newgreen)!important;border-radius: 10px; --background: transparent;
width: 80%;
}
.description-details .orange{
color: #CC9B14;
font-weight: bold;
font-size: 14px;
}
.description-details img{
margin:10px;
}
.waring{
color: #CA3332;
padding: 10px;
font-size: 10px;
}
.waring label{
font-size: 11px;
padding: 0px 10px;
display: inline-block;
position: relative;
position: absolute;
}
.waring img{
margin: 0px;
}
.selling h2{
display: inline-block;
font-weight: bolder;
font-size: 25px;
}
.selling strong{
font-size: 14px;
}
.flaot-button{float:right;margin:30px}
.orange-border{
border-top:2px solid #CC9B14;
}
.green-border{
border-top:2px solid #00AE4D;
}
.md-step span{
position: relative;
z-index: 2;
}
.red-button{
--background:#CA3332;
}
ion-footer{
bottom: 0;
position: fixed;
}
.small-btn{
width: 40%;
}
.uploader-box{
border-width: 2px;
border-color: #259CB8;
border-style: dotted;
border-radius: 10px;
left: 10px;
}
.review-title{
font-size: 14px;
font-weight: bold;
}
.camera-icon{
font-size: 35px;
position: absolute;
margin: auto;
left: 0;
right: 0;
top: 60px;
bottom: 0;
color: #259CB8;
}
.top img{
position: absolute;
top: 15px;
}

@ -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,27 @@
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';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
step: any = 1;
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
openItem() {
this.cs.navigateForward('/itemforsale/items');
}
nextStep() {
this.step = 2;
}
openMyAds() {
this.cs.navigateForward('/itemforsale/my-ads');
}
}

@ -0,0 +1,63 @@
<ion-content>
<div class="head-title">
<app-generic-header
showImage="false"
showBack="true"
[headerText]="'itemforsale,title' | translate">
</app-generic-header>
</div>
<div class="header"></div>
<div class="bottom"></div>
<div>
<ion-card>
<ion-card-header>
<img src="https://ii1.pepperfry.com/media/catalog/product/r/o/568x625/royal-wing-chair-in-blue-color-by-dreamzz-furniture-royal-wing-chair-in-blue-color-by-dreamzz-furnit-6hcjya.jpg" />
<ion-card-title>Furniture Table</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break clear away, once in awhile,
and climb a mountain or spend a week in the woods. Wash your spirit clean.
<div class="content-bottom">
<p class="green">New</p>
<h1>500 SAR</h1>
</div>
<div class="profile">
<ion-item lines="none" >
<ion-avatar slot="start">
<img class="profile-img" src="/assets/imgs/S.png">
</ion-avatar>
<ion-label>
<p class="profile-title">Mohammed Imran</p>
<p>Posted on 22 April 2020</p>
<p><a href="">View Profile</a></p>
</ion-label>
</ion-item>
</div>
</ion-card-content>
</ion-card>
</div>
<ion-footer >
<div class="centerDiv details-button" >
<ion-button class="footer-button" ion-button>
<img class="icon-footer" src="/assets/imgs/itemsforsale/sms.svg">
{{ts.trPK('sms','title')}} </ion-button>
<ion-button class="footer-button" ion-button>
<img class="icon-footer" src="/assets/imgs/itemsforsale/call.svg">
{{ts.trPK('vacation-rule','call')}} </ion-button>
</div>
</ion-footer>
</ion-content>

@ -0,0 +1,79 @@
.header{
height: 150px;
width: 100%;
position: absolute;
background: #259CB8;
top: 0;
}
.header-toolbar{
--background: #259CB8 !important;
}
.bottom{
height: 88%;
width: 100%;
position: absolute;
background: #F5F5F5;
top: 20%;
}
ion-card-header{
background-color: #fff;
padding: 10px 10px 5px !important;
}
ion-card-header img{
height: 320px;
}
ion-card-title{
margin: 15px 10px 0px;
}
ion-card-content{
padding-top: 0px;
padding-bottom: 0px;
}
.content-bottom{
padding-top: 15px;
}
.green{
color:#1FA169;
font-weight: bold;
}
.content-bottom h1{
font-size: 22px;
font-weight: bold;
}
.details-button ion-button{
--background: #565656;
width: 150px;
border-radius: 8px;
}
.profile-title{
color:#000;
font-weight: bold;
}
.profile-img{
height: 50px;
width: 50px;
border-radius: 50%;
}
ion-avatar{
height: 50px;
width: 50px;
text-align: center;
}
ion-avatar p{
color:#000;
}
ion-avatar a{
color:#259CB8;
text-decoration: underline;
}
ion-footer{
position: fixed;
bottom: 0;
}
.icon-footer{
margin: 0px;
position: relative;
left: -10px;
}

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

@ -0,0 +1,15 @@
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';
@Component({
selector: 'app-item-details',
templateUrl: './item-details.component.html',
styleUrls: ['./item-details.component.scss'],
})
export class ItemDetailsComponent implements OnInit {
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
}

@ -0,0 +1,50 @@
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 { ItemforsalePage } from './itemforsale.page';
import { HomeComponent } from './home/home.component';
import { ItemsComponent } from './items/items.component';
import { ItemDetailsComponent } from './item-details/item-details.component';
import { MyAdsComponent } from './my-ads/my-ads.component';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
const routes: Routes = [
{
path: '',
component: ItemforsalePage,
children: [
{
path: 'home',
component: HomeComponent
},
{
path: 'items',
component: ItemsComponent
},
{
path: 'items-details',
component: ItemDetailsComponent
},
{
path: 'my-ads',
component: MyAdsComponent
}
],
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent]
})
export class ItemforsalePageModule { }

@ -0,0 +1,4 @@
<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 { ItemforsalePage } from './itemforsale.page';
describe('ItemforsalePage', () => {
let component: ItemforsalePage;
let fixture: ComponentFixture<ItemforsalePage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ItemforsalePage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ItemforsalePage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

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

@ -0,0 +1,186 @@
<ion-content>
<div class="head-title">
<app-generic-header
showImage="false"
showBack="true"
[headerText]="'itemforsale,title' | translate">
</app-generic-header>
</div>
<div class="segments-container">
<ion-segment (ionChange)="segmentChanged($event)" value="1" class="item-for-sale-indicator">
<ion-segment-button value="1" >
<ion-label>{{ts.trPK('itemforsale','title')}} </ion-label>
</ion-segment-button>
<ion-segment-button value="2">
<ion-label>{{ts.trPK('itemforsale','my-posted-ad')}}</ion-label>
</ion-segment-button>
</ion-segment>
</div>
<div class="header"></div>
<div class="bottom"></div>
<div class="sales-items" *ngIf="segment =='1'">
<div class="fab-button">
<ion-fab-button class="flaot-button" (click)="openSale()"><img src="assets/imgs/itemsforsale/add.svg"></ion-fab-button>
</div>
<ion-grid>
<ion-row>
<ion-col size="12">
<ion-item lines="none" class="SearchtextBox">
<ion-input [placeholder]="'itemforsale,search-items'| translate"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="10">
<p class="filterText"> {{ts.trPK('itemforsale','browse-categories')}} </p>
</ion-col>
<ion-col size="2">
<img class="filter-icon" src="assets/imgs/itemsforsale/filter.svg">
</ion-col>
</ion-row>
</ion-grid>
<div class="container-icon">
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<img src="assets/imgs/itemsforsale/mobile.svg">
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<img src="assets/imgs/itemsforsale/cars.svg">
</div>
<div class="bottom-icon">
<p>Cars & Vehicle</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<img src="assets/imgs/itemsforsale/electronic_appliances.svg">
</div>
<div class="bottom-icon">
<p>Electronic Appliance</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<img src="assets/imgs/itemsforsale/fashion.svg">
</div>
<div class="bottom-icon">
<p>Fashion & Beauty</p>
</div>
</div>
</div>
</div>
<div class="grid-row">
<ion-row >
<ion-col size="6" (click)="openDetails()">
<ion-card>
<ion-card-header>
<img src="https://ii1.pepperfry.com/media/catalog/product/r/o/568x625/royal-wing-chair-in-blue-color-by-dreamzz-furniture-royal-wing-chair-in-blue-color-by-dreamzz-furnit-6hcjya.jpg" />
<ion-card-title>Furniture Table</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break
<p class="orange">
Used
</p>
<ion-row>
<ion-col size="10">
<strong>
500 SAR
</strong>
</ion-col>
<ion-col size="2">
<img src="assets/imgs/itemsforsale/arrow.svg">
</ion-col>
</ion-row>
</ion-card-content>
</ion-card>
</ion-col>
<ion-col size="6" (click)="openDetails()">
<ion-card>
<ion-card-header>
<img src="https://ii1.pepperfry.com/media/catalog/product/r/o/568x625/royal-wing-chair-in-blue-color-by-dreamzz-furniture-royal-wing-chair-in-blue-color-by-dreamzz-furnit-6hcjya.jpg" />
<ion-card-title>Furniture Table</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break
<p class="green">
New
</p>
<ion-row>
<ion-col size="10">
<strong>
500 SAR
</strong>
</ion-col>
<ion-col size="2">
<img src="assets/imgs/itemsforsale/arrow.svg">
</ion-col>
</ion-row>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</div>
</div>
<div class="my-ads" *ngIf="segment =='2'">
<ion-row>
<ion-item button detail="false">
<ion-thumbnail slot="start">
<img src="https://ii1.pepperfry.com/media/catalog/product/r/o/568x625/royal-wing-chair-in-blue-color-by-dreamzz-furniture-royal-wing-chair-in-blue-color-by-dreamzz-furnit-6hcjya.jpg" />
</ion-thumbnail>
<ion-label class="label-thumb">
<h3>Furniture Table</h3>
<p class="posted-on">
Posted on 24 April 2021
</p>
<p class="details-text">good condition only 6th month used </p>
<ion-row>
<ion-col size="8">
<p class="yellow">Pending Review</p>
</ion-col>
<ion-col>
<img class="icon" src="assets/imgs/itemsforsale/delete.svg" />
<img class="icon edit" src="assets/imgs/itemsforsale/edit.svg" />
</ion-col>
</ion-row>
</ion-label>
</ion-item>
</ion-row>
</div>
<ion-footer *ngIf="segment=='2'" >
<div class="centerDiv">
<ion-button class="footer-button" ion-button (click)="openSale()">
{{ts.trPK('itemforsale','create-new-ad')}} </ion-button>
</div>
</ion-footer>
</ion-content>

@ -0,0 +1,222 @@
.header{
width: 100%;
position: absolute;
background: #259CB8;
top: 0;
}
.header-toolbar{
--background: #259CB8 !important;
}
.bottom{
height: 100%;
width: 100%;
position: absolute;
background: #F5F5F5;
}
.filterText{
margin: 5px 15px 15px;
font-size: 18px;
font-weight: bold;
}
.container-icon{
padding: 0 10px 20px;
position: relative;
white-space:nowrap;
overflow-x:auto;
}
.box-icon{
width: 100px;
height: 100px;
margin: 0px;
display: inline-block;
}
.sale-icon{
box-shadow: 1px 1px 5px 1px #cccc;
padding: 5px;
margin: 5px;
border-radius: 10px;
background: #fff;
}
.sale-icon ion-icon{
font-size: 25px;
}
.sale-icon p{
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
font-size: 14px;
}
.bottom-icon{
text-overflow: clip;
white-space: normal;
}
ion-card-header{
background: #fff;
}
ion-card-header img{
margin:15px auto;
border-radius: 6px;
height: 170px;
}
ion-card-title{
font-weight: bold;
font-size: 14px;
padding: 5px
}
.orange{
color: #CC9B14;
font-weight: bold;
}
.green{
color:#1FA169;
font-weight: bold;
}
ion-card-content p{
margin-left: 0;
margin-right: 0;
margin-top: 15px;
margin-bottom: 0px;
font-size: 12px;
font-weight: bold;
}
.my-ads ion-item{
margin: 10px;
--border-radius: 10px;
padding: 15px 10px 0px 10px;
width: 100%;
}
.my-ads ion-thumbnail img{
position: relative;
top: -10px;
border-radius: 6px;
}
.my-ads .details-text{
font-size: 11px;
margin: 0;
}
.my-ads .yellow, .my-ads .green{
font-size: 11px;
}
ion-segment-button{
--background-checked: #000;
--indicator-color : transparent!important;
border: none;
}
ion-segment-button ion-label{
padding: 0;
font-size: 16px;
white-space: normal;
font-weight: bold;
}
.segment-button-checked ion-label{
color: #fff !important;
}
.segment-button-checked{
background: rgb(46, 46, 46);
}
ion-item.SearchtextBox{
--background: #fff;
margin: 10px;
--border-radius: 100px;
padding: 5px;
}
ion-item h3{
color: #000;
font-weight: bold;
font-size: 14px;
}
.yellow{
color:#CC9B14;
font-weight: bold;
}
ion-item .icon{
margin: 5px 0px;
}
.edit{
position: absolute;
right: 0px;
}
.fab-button{
position: fixed;
bottom: 5%;
z-index: 2;
right: 10%;
}
.fab-button ion-fab-button{
--background: #259CB8;
}
ion-footer{
position: absolute;
bottom: 0;
}
ion-footer .footer-button{
--background: #259CB8;
width: 80%;
background: #259CB8;
border-radius: 10px;
}
ion-segment{
height:55px
}
ion-card{
margin: 0px;
--background: #fff;
--border-radius: 53px;
border-radius: 10px;
}
.filter-icon{
margin-left: 15px;
}
.top img{
width: 25px;
height: 30px;
margin: 5px 5px 0px 5px;
}
.forward-arrow{
color:#259CB8;
font-size: 26px;
}
ion-card-content{
padding: 0 15px 10px 15px;
font-size: 11px;
}
.label-thumb h2{
font-size: 14px;
font-weight: bold;
}
.posted-on{
color: #969696;
float: right;
position: absolute;
top: 0;
right: 0;
font-size: 10px;
margin: 5px;
padding: 0px 5px;
}
.details-text{
white-space: normal;
}
ion-card-content ion-icon{
font-size: 25px;
}
ion-card-content strong{
margin-left: -5px;
font-size: 16px;
}
ion-fab-button{
height: 60px;
width: 60px;
}
.grid-row{
margin:10px;
}

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

@ -0,0 +1,25 @@
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';
@Component({
selector: 'app-items',
templateUrl: './items.component.html',
styleUrls: ['./items.component.scss'],
})
export class ItemsComponent implements OnInit {
segment: any = '1';
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
openDetails() {
this.cs.navigateForward('/itemforsale/items-details');
}
segmentChanged(value) {
this.segment = value.detail.value;
}
openSale() {
this.cs.navigateForward('/itemforsale/home');
}
}

@ -0,0 +1,11 @@
<ion-content>
<div class="head-title">
<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('itemforsale','title')}}</ion-title>
</ion-toolbar>
</div>
</ion-content>

@ -0,0 +1,11 @@
.header{
height: 150px;
width: 100%;
position: absolute;
background: #259CB8;
top: 0;
}
.header-toolbar{
--background: #259CB8 !important;
}

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

@ -0,0 +1,15 @@
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';
@Component({
selector: 'app-my-ads',
templateUrl: './my-ads.component.html',
styleUrls: ['./my-ads.component.scss'],
})
export class MyAdsComponent implements OnInit {
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
}

@ -0,0 +1,127 @@
<app-generic-header
showBack="true"
[headerText]="'userProfile, createHR-Request' | translate">
</app-generic-header>
<ion-content>
<!-- <form [formGroup] = "form" (ngSubmit) = "submitRequest(form.value)"> -->
<div >
<ion-card class="result-serviceType">
<ion-card-content>
<div class="request-heading">
<span>{{ts.trPK('userProfile','ServiceType')}}</span>
</div>
<div>
<ion-row class="custom-radio">
<ion-radio-group [(ngModel)]="SelectedServiceType" class="radio-list" required style="display: flex;">
<!--
<ion-radio value="HRServices" [color]="myColor">{{HR}}</ion-radio>
<ion-label class="text-label" >{{HR}}</ion-label>
<ion-radio value="Complaints" [color]="myColor" >{{complaints}}</ion-radio>
<ion-label class="text-label">{{complaints}}</ion-label>
<ion-radio value="Inquiry" [color]="myColor" >{{inquiry}}</ion-radio>
<ion-label class="text-label">{{inquiry}}</ion-label> -->
<div style="display: inline-block !important;" *ngFor="let ticket of ticketType">
<ion-item lines='none' class="ion-no-padding">
<ion-radio mode="md" [value]="ticket.ticketTypeId" [color]="myColor" ></ion-radio>
<ion-label class="text-label">{{ticket.typeName}}</ion-label>
</ion-item>
</div>
</ion-radio-group>
</ion-row>
</div>
<!-- /////////////////////////////////////////// -->
<div>
<div>
<ion-list >
<label class="labels">{{ts.trPK('userProfile','DeptName')}}</label>
<ion-item lines="none" class="filed-container">
<select [(ngModel)]="depType" (change)="onSelectChange($event,1)" class="filed1" id="firstLabel"
placeholder="Select Department" type="text" required >
<option value="" selected hidden selected>{{ts.trPK('userProfile','selectDep')}}</option>
<option [value]="x.projectDepartmentId" *ngFor="let x of departTypeList"> {{x.departmentName}} </option>
<!-- <option [value]="x.departmentId" *ngFor="let x of departTypeList"> {{x.departmentName}} </option> -->
</select>
</ion-item>
<label class="labels">{{ts.trPK('userProfile','RelatedSection')}}</label>
<ion-item lines="none" class="filed-container">
<select [(ngModel)]="secType" (change)="onSelectChange($event,2)" class="filed1"
selected="selected" placeholder="Select Sectiont" type="text" required>
<option value="" hidden selected>{{ts.trPK('userProfile','selectSec')}}</option>
<option [value]="x.departmentSectionId"
*ngFor="let x of sectionTypeList">
{{x.sectionName}} </option>
</select>
</ion-item>
<label class="labels">{{ts.trPK('userProfile','RelatedTopic')}}</label>
<ion-item lines="none" class="filed-container">
<select [(ngModel)]="topicType" (change)="onSelectChange($event, 3)" class="filed1"
placeholder="Select Topic" type="text" required>
<option value="" hidden selected>{{ts.trPK('userProfile','selectTopic')}}</option>
<option [value]="x.sectionTopicId" *ngFor="let x of topicTypeList"> {{x.topicName}} </option>
</select>
</ion-item>
</ion-list>
</div>
<div class="request-heading">
<span>{{ts.trPK('userProfile','SupportingDocument')}}</span>
</div>
<div>
<div class="fileUpload btn btn-primary">
<img slot="start" style=" height: 55px;"src="../assets/imgs/add-photo.svg">
<input end class="upload" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
</div>
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-col class="rowAH" *ngFor="let item of uploader.queue">
<ion-col style=" background: #dad8d8;" size="4">
<label for="">{{ item?.file?.name }}</label>
</ion-col>
<ion-col style=" background: #dad8d8;" size="2">
<button class="iconButton" ion-button (click)="removeFile(item)">
<ion-icon style="color: red;" name="close"></ion-icon>
</button>
</ion-col>
</ion-col>
</ion-grid>
</ion-slide>
</ion-slides>
</div>
<div class="request-heading">
<span>{{ts.trPK('userProfile','Description')}}</span>
</div>
<ion-col size="12">
<ion-item style="margin-left: -20px;margin-right: -13px;margin-top: -24px;" lines="none">
<ion-input [(ngModel)]="Description" [ngClass]="direction == 'en' ? 'filedDesc':'filedDesc-ar' " placeholder="{{ts.trPK('userProfile','Description')}}" type="text"></ion-input>
</ion-item>
</ion-col>
</div>
</ion-card-content>
</ion-card>
</div>
<!-- </form> -->
</ion-content>
<ion-footer >
<div class="centerDiv" >
<ion-button class="gridCancelBtn main-button" ion-button (click)="cancelRequest()">{{ts.trPK('general','cancel')}}</ion-button>
<ion-button [disabled]="isValidForm()" class="gridSubmitBtn main-button" ion-button (click)="CreateTicket()">{{ts.trPK('general','submit')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,529 @@
.header-toolbar-new{
--background: #269DB8;
}
.contentBg{
padding: 0px 20px;
}
.contentBg:before {
position: absolute;
content: "";
background: #269DB8;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
@media screen and (min-width: 1px) and (max-width:767px){
.result-graph {
position: relative;
background: white;
// margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
margin-top: 56px;
border-radius: 20px;
border: 1px solid #ccc;
padding-top: 12px;
}}
@media screen and (min-width: 768px) and (max-width:1024px){
.result-graph {
position: relative;
background: white;
// margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
margin-top: 89px;
border-radius: 20px;
border: 1px solid #ccc;
padding-top: 114px !important;
}}
.user-info{
text-align: center;
margin-bottom: 3px;
.user-image-container{
position: relative;
width: 100%;
height: 24px;
justify-content: space-between;
display: flex;
margin: 0 auto;
align-items: center;
}}
.Boldtext{
font-size: 13px;
font-family: WorkSans-Bold;
color: black !important;
display: block !important;
// line-height: 0px !important;
}
.Nametext{
font-size: 15px;
font-family: WorkSans-Bold;
color: black !important;
display: block !important;
// line-height: 0px !important;
}
.employee-information-indetail{
background: white;
margin-top: 15px;
border-radius: 20px;
margin-bottom: 15px;
border-radius: 20px;
border: 1px solid #ccc;
ion-col{
padding: 15px;
// border-bottom: 1px solid #ccc;
}
h2{
font-size: 13px;
// font-family: WorkSans-Bold;
margin: 0;
font-weight: bold;
color: rgb(128, 124, 124);
}
p{
font-size: 13px;
margin: 0;
font-family: WorkSans-Bold;
// margin-bottom: 10px;
}
}
@media screen and (min-width: 1px) and (max-width:767px){
.user-image{
position: relative;
display: block;
width: 95%;
height: 100%;
border-radius: 80px;
/* border: 1px solid #ccc; */
margin-top: -125px;
}}
@media screen and (min-width: 768px) and (max-width:1024px){
.user-image{
position: relative;
display: block;
width: 95%;
height: 100%;
border-radius: 80px;
margin-bottom: 371px;
}}
.img{
width: 100px;
height: 100px;
display: inline-flex;
overflow: hidden;
background: transparent;
border-radius: 70% !important;
position: relative;
top: 3px;
}
.sendCodeBtn{
--background: #269DB8;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin-left: 5px !important;
margin-top: 15px !important;
margin-bottom: 20px !important;
/* border-radius: 4px; */
height: 26px;
/* padding: 6px 24px; */
font-size: 15px;
width: 322px;
}
.verify-code{
position: relative;
background: white;
border-radius: 20px;
z-index: 1;
border-radius: 20px;
border: 1px solid #ccc;
padding: 21px 3px 34px 14px;
margin: 25px 22px 2px 22px;
}
// .sms_code{
// margin: 0px;
// text-align: center;
// }
ion-input {
margin: 0 5px;
text-align: center;
line-height: 0;
font-size: 32px;
//border: solid 1px #ccc;
border: 1px solid #ccc !important;
//box-shadow: 0 0 5px #ccc inset;
outline: none;
width: 20%;
transition: all .2s ease-in-out;
border-radius: 3px;
display: inline-block;
&:focus {
border-color:var(--ion-color-secondary) !important;
box-shadow: 0 0 5px var(--ion-color-secondary) !important;
}
&::selection {
background: transparent;
}
}
.sendVerifyBtn{
--background: #269DB8;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin-top: 15px !important;
margin-bottom: 20px !important;
/* border-radius: 4px; */
height: 26px;
font-size: 15px;
width: 322px;
margin-left: 22px;
}
@media screen and (min-width: 1px) and (max-width:320px){
.custom-radio .radio-icon {
margin: 0px;
border-radius: 50%;
border-width: var(--border-width);
border-style: var(--border-style);
border-color: #dcdcdc;
margin-top: 6px !important;
border-color: #d8d4d4 !important;
margin-bottom: 18px;}
.text-label{
color: black !important;
font-size: 9px;
margin-left: 2px;
margin-right: 2px;
font-family: 'WorkSans-Bold';
} }
@media screen and (min-width: 325px){
.custom-radio .radio-icon {
margin: 0px;
border-radius: 50%;
border-width: var(--border-width);
border-style: var(--border-style);
border-color: #dcdcdc;
margin-top: 6px !important;
border-color: #d8d4d4 !important;
margin-bottom: 18px;}
.text-label{
color: black !important;
font-size: 10px;
margin-left: 15px;
margin-right: 13px;
font-family: 'WorkSans-Bold';
} }
// .radio-list{
// background: white;
// margin-left: 18px;
// /* margin-right: 10px; */
// margin-top: 12px;
// }
.result-serviceType{
position: relative;
background: white;
border-radius: 20px;
z-index: 1;
border-radius: 25px;
border: 1px solid #ccc;
margin: 15px;
}
.request-heading {
span {
display: block;
margin-bottom: 15px;
// padding-top: 8px;
padding-left: 3px;
/* font-weight: bold; */
font-size: 14px;
font-family: 'WorkSans-Bold';
}
}
.filed1{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
margin: 10px;
padding-left: 10px !important;
padding-top: 10px !important;
color: #636161;
padding-bottom: 10px;
width: 130% !important;
}
.filedDesc{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
// margin: 10px;
padding-left: 20px !important;
padding-top: 6px !important;
color: #636161;
--padding-bottom: 90px;
font-size: 13px;
text-align: start;
}
.filedDesc-ar{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
// margin: 10px;
padding-right: 20px !important;
padding-top: 6px !important;
color: #636161;
--padding-bottom: 90px;
font-size: 13px;
text-align: start;
}
.labelDesc{
display: block;
padding-top: 8px;
padding-left: 15px;
font-size: 14px;
font-weight: bold;
color: #adabab;
}
.selectLabel{
display: block;
padding-top: 8px;
padding-left: 15px;
font-size: 14px;
/* font-family: 'WorkSans-Bold'; */
font-weight: bold;
color: black;
}
// .cancelRequest{
// padding: 10px 7px 10px 0px;
// ion-button{
// border-radius: 7px;
// padding: 12px 30px 12px 30px;
// background: #d00a0a;
// --background: transparent;
// --box-shadow: none !important;
// height: auto;
// min-height: inherit;
// font-size: 16px;
// font-weight: bold;
// margin-top: -5px;
// }}
// .submitRequest{
// padding: 10px 7px 10px 0px;
// ion-button{
// border-radius: 7px;
// padding: 12px 30px 12px 30px;
// background: #19a163;
// --background: transparent;
// --box-shadow: none !important;
// height: auto;
// min-height: inherit;
// font-size: 16px;
// font-weight: bold;
// margin-top: -5px;
// }}
.gridDiv{
width: 100%;
height: 40px;
margin-top: 18px;
font-size: 14px;
}
.gridCancelBtn{
min-width: auto;
// margin: 0px;
padding: 10px;
border: 1px solid var(--cusgray);
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
width: 45%;
height: 100%;
border-radius: 8px;
background: #d00a0a;
color: white;
margin-left: 15px;
margin-right: 5px;
font-family: 'WorkSans-bold';
font-size: 16px;
min-height: 1.0cm;
--background: #d00a0a !important;
}
.main-button{
--box-shadow:none;
}
.gridSubmitBtn{
min-width: auto;
// margin: 0px;
padding: 10px;
border: 1px solid var(--cusgray);
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
width: 45%;
height: 100%;
border-radius: 8px;
background: #19a163;
color: white;
// margin-left: 15px;
// margin-right: 5px;
font-family: 'WorkSans-bold';
font-size: 16px;
min-height: 1.0cm;
--background: #19a163 !important;}
.filed-container{
margin-right: -17px;
margin-left: -25px;
}
.labels{
display: block;
margin-top: 15px;
padding-top: 8px;
padding-left: 3px;
font-size: 14px;
font-family: 'WorkSans-Bold';
}
.CreateBtn{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 7px !important;
border-radius: 7px !important;
--min-height: 1.6cm !important;
width: 315px;
}
.footer{
padding: 15px 0px 0px 0px;
background-color: var(--light) !important;
border: 0px !important;
box-shadow: none !important;
-webkit-box-shadow: none;
}
.Btn{
margin: auto; text-align: center; display: block;
}
.footer2{
padding: 15px 0px 0px 24px;
background-color: var(--light) !important;
border: 0px !important;
box-shadow: none !important;
-webkit-box-shadow: none;
}
ion-footer .footer-button{
--background: #259CB8;
width: 80%;
}
@media screen and (min-width: 325px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
margin-left: -233px;
}}
@media screen and (min-width: 1px) and (max-width:320px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
margin-left: -158px;
}}
.fileUpload input.upload {
position: absolute;
top: 0;
right: 0;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
}
.iconButton .imgSize{
width: 10px !important;
height: 10px;
}
button.iconButton.button.button-ios.button-default.button-default-ios,
button.iconButton.button.button-md.button-default.button-default-md {
padding: 0px;
}
select option[data-default] {
color: #888;
}
.Field-en{
border-radius: 30px;
border: 1px solid #a2a5a6!important;
margin-bottom: 20px;
padding-left: 20px !important;
padding-top: 6px !important;
color: #999999 !important;
}
.Field-ar{
border-radius: 30px;
border: 1px solid #a2a5a6!important;
margin-bottom: 20px;
padding-right: 20px !important;
padding-top: 6px !important;
color: #999999 !important;
}
.button-native {
box-shadow: none!important;
}

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

@ -0,0 +1,420 @@
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 { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { MowadhafiService } from '../mowadhafi.service';
import { Location } from '@angular/common';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { LoginModel } from 'src/app/authentication/models/LoginModel';
import { SendActivationByType } from 'src/app/authentication/models/sendActivationByType';
import { FileUploader } from 'ng2-file-upload';
@Component({
selector: 'app-hr-request-form',
templateUrl: './hr-request-form.component.html',
styleUrls: ['./hr-request-form.component.scss'],
})
export class HrRequestFormComponent implements OnInit {
public EmpName: string;
public EmpNum: string;
public EmpGroup: string;
public EmpMobile: string;
public EmpJob: string;
public EmpOrgName: string;
public EmpPayrol: string;
public EmpPosition: string;
public EmpEmail: string;
public EmpCatMeaning: string;
public EmpGRADENAME: string;
public EmpLocation: string;
public EmpImg: string;
public userImage: any = '../assets/imgs/profile.png';
public loginData = new LoginModel();
public searchKeySelect = 'Complaints';
myColor: string = 'secondary';
public showRequestDetails = false;
public proID = "CS"
public inquiry: string;
public HR: string;
public complaints: string;
public Projectresult: any;
public EmpRelations: any;
public Hr: any;
public Payroll: any;
public GovRelation: any;
public projName: any;
public topicName: any;
public departTypeList: any;
public topicTypeList: any;
public sectionTypeList: any;
public projectDetial: any;
public projectDep: any;
public sectionDep: any;
public projectCode;
public SelectedServiceType: any;
public depType: any ="";
public secType: any ="";
public topicType: any ="";
indexLastObj: any;
addAttachRequest: any = [];
TransactionID: any;
public teckitDetial: any;
public teckitInfo: any;
public Description: any;
public selectedFile: any;
filterAllowedType: any = [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
];
projctid:any;
employeeNumber:any;
ticketType: any =[];
public direction: string;
HRServices = '';
Complaints='';
Inquiry='';
input = document.getElementById ("firstLabel");
constructor(
public ts: TranslatorService,
public cs: CommonService,
public authService: AuthenticationService,
public sharedData: SharedDataService,
public events: Events,
public MowadhafiService: MowadhafiService,
private location: Location,
private menu: MenuController,
) {
this.direction = TranslatorService.getCurrentLanguageName();
}
ngOnInit() {
this.projectCode = this.cs.sharedService.getSharedData("projcet-code",false);
this.getTicketTypes();
this.getProject();
}
public isValidForm(): boolean {
if (this.depType && this.SelectedServiceType && this.secType && this.topicType) {
return false;
}
return true;
}
onSelectChange(event, type) {
const value = event.target.value;
console.log(value);
// this.topicTypeList =[];
// this.sectionTypeList =[];
if(type==1){
this.depType = value;
this.sectionTypeList =[];
this.topicTypeList =[];
this.getDepartmentSections(value);
}else if(type==2){
this.getSectionTopics(value);
this.topicTypeList =[];
}
}
onFileSelectedclick(event){
event.target.value = '';
}
goback() {
this.location.back();
}
showSelectedField() { }
getTicketTypes() {
const request = {
EmployeeNumber: "",
};
this.MowadhafiService.getTicketTypes(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetTicketTypesResult(result);
})
}
handlegetTicketTypesResult(result) {
this.ticketType =result.Mohemm_Itg_TicketTypesList;
}
/////////////////////////////////////////////////
getProject() {
const request = {
EmployeeNumber: "",
ItgProjectCode: this.projectCode
};
this.MowadhafiService.getProject(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetProjectResult(result);
})
}
handlegetProjectResult(result) {
this.Projectresult = result.Mohemm_Itg_ProjectsList;
this.projctid=this.Projectresult[0].projectId;
this.getProjectDepartments();
}
////////////////////////////////////////////////////
getProjectDepartments() {
const request = {
EmployeeNumber: "",
ItgProjectId: this.Projectresult[0].projectId,
};
this.MowadhafiService.getProjectDepartments(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetProjectDepartmentsResult(result);
})
}
handlegetProjectDepartmentsResult(result) {
this.departTypeList = result.Mohemm_ITG_ProjectDepartmentsList;
// this.getDepartmentSections();
}
//////////////////////////////////////////////////////
getDepartmentSections(value) {
const request = {
EmployeeNumber: "",
ItgProjectDepartmentId: value ?value : this.departTypeList.projectDepartmentId,
};
this.MowadhafiService.getDepartmentSections(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetDepartmentSectionsResult(result);
})
}
handlegetDepartmentSectionsResult(result) {
this.sectionTypeList = result.Mohemm_ITG_DepartmentSectionsList;
// this.getSectionTopics();
}
getSectionTopics(value=null) {
const request = {
EmployeeNumber: "",
// ItgDepartmentSectionId: this.sectionTypeList.departmentSectionId,
ItgDepartmentSectionId: value ?value : this.sectionTypeList.departmentSectionId,
};
this.MowadhafiService.getSectionTopics(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetSectionTopicsResult(result);
})
}
handlegetSectionTopicsResult(result) {
// this.topicName=result.Mohemm_ITG_SectionTopicsList[0].topicName
this.topicTypeList = result.Mohemm_ITG_SectionTopicsList;
}
/*******************Create Ticket Function*************/
CreateTicket() {
var authUser =this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('ticketTypeId', this.SelectedServiceType);
request.append('projectId', this.projctid);
request.append('departmentId', this.depType);
request.append('sectionId', this.secType);
request.append('sectionTopicId', this.topicType);
request.append('description', this.Description);
console.log("TEST:______")
console.log(this.selectedFile);
if(this.selectedFile && this.selectedFile !== undefined){
request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
}
request.append('employeeNumber', authUser.P_USER_NAME);
request.append('ticketStatus', 'new');
request.append('channelId', '3');
request.append('Channel', authUser.Channel.toString());
request.append('LogInToken', authUser.LogInTokenID);
request.append('Token', authUser.TokenID);
request.append('EmployeeNumber', authUser.P_USER_NAME);
request.append('MobileNo', authUser.MobileNumber);
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.cs.stopLoading();
this.handlegetCreateTicketResult(result);
this.checkERM('After Service Submission');
//hear you have to redirect page
this.cs.openMyRequestPage();
})
}
handlegetCreateTicketResult(result) {
}
public cancelRequest() {
this.cs.openMyRequestPage();
// this.menu.toggle();
}
/*******************Add attchement Functions*************/
public uploader: FileUploader = new FileUploader({
allowedMimeType: [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.cs.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
this.selectedFile = input.target.files;
this.getBase64(file).then(data =>
this.pushObject(data, file.name, file.type)
);
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
this.indexLastObj++;
try {
let array = name.split(".");
let attachType: string = array[array.length - 1];
this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
});
} catch (e) { }
}
removeFile(objectitem) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
this.uploader.queue.splice(objIndex1, 1);
let objIndex = this.addAttachRequest.findIndex(
item => item.AttachmentID == objectitem.AttachmentID
);
this.addAttachRequest.splice(objIndex, 1);
}
submitRequest() {
}
checkERM(status) {
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: status, //After Service Submission
ItgServiceName: "Ticket"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;
this.cs.sharedService.setSharedData(
result,
AuthenticationService.SERVEY_DATA
)
if (!CommonService.SKIP && result) {
if (result.notificationType == 'Survey') {
this.cs.navigateForward('/erm-channel/survey');
} else {
this.authService.adsDetails({
"ItgNotificationMasterId": result['notificationMasterId']
},
() => { }, this.ts.trPK('general', 'ok')
).subscribe((result) => {
var data = result.Mohemm_ITG_ResponseItem;
if (data) {
this.cs.sharedService.setSharedData(
JSON.parse(data),
AuthenticationService.ADS_DATA
);
this.cs.navigateForward('/erm-channel/home');
}
})
}
}
})
}
}

@ -0,0 +1,132 @@
<app-generic-header
showBack="true"
[headerText]="'userProfile, createHR-Request' | translate">
</app-generic-header>
<ion-content>
<div class="contentBg">
<div class="result-graph" >
<div class="user-info">
<div class="user-image-container">
<div class="user-image">
<img class="img" [src]="EmpImg ? 'data:image/png;base64,'+ EmpImg : '../assets/imgs/profile.png'" alt="Team Member Image"/>
</div>
</div>
<div style="margin-top: 25px;">
<span class="Nametext">{{EmpName}}</span>
<p class="p1">{{EmpEmail}}</p>
</div>
<div >
<ion-row>
<ion-col style="border-right: 1px solid rgb(221 221 221);">
<p class="p">{{ts.trPK('userProfile','role')}}</p>
<span class="Boldtext">{{EmpPosition}}</span>
</ion-col>
<ion-col>
<p class="p" style="line-height: 12px !important;">{{ts.trPK('userProfile','empNo')}}</p>
<span class="Boldtext">{{EmpNum}}</span>
</ion-col>
</ion-row>
</div>
</div>
</div>
<div [ngClass]="direction == 'en' ? 'employee-information-indetail':'employee-information-indetail-ar' ">
<ion-row style="padding-left: 13px;">
<ion-col>
<div [ngClass]="direction == 'en' ? 'title':'title-ar' " >{{ts.trPK('userProfile','profile-details')}}</div>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','category')}}</h2>
<p>{{EmpCatMeaning}}</p>
</ion-col >
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','address')}}</h2>
<p class="hL">{{EmpLocation}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','phone-no')}}</h2>
<p>{{EmpMobile}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','busG')}}</h2>
<p>{{EmpOrgName}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','job')}}</h2>
<p>{{EmpPosition}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','payrol')}}</h2>
<p>{{EmpPayrol}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','position')}}</h2>
<p class="hL">{{EmpPosition}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12" style="border-bottom: none;">
<h2>{{ts.trPK('userProfile','grade')}}</h2>
<p>{{EmpGRADENAME}}</p>
</ion-col>
</ion-row>
</div>
</div>
<!-- ///////////////////////////////////////////////////////////////////next page -->
<!-- <div>
<div class="verify-code">
<ion-row style=" margin-left: 9px; margin-bottom: 13px;">
<ion-col style="font-size: 12px; color: rgb(128, 124, 124);">{{ts.trPK('userProfile','code-sent')}}</ion-col>
<ion-col class="Boldtext"> {{EmpMobile}}</ion-col>
</ion-row>
<ion-row dir="ltr">
<ion-col [size]="12">
<ion-input type="tel" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()" #ref autofocus="true">
</ion-input>
<ion-input type="tel" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
<ion-input type="tel" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
<ion-input type="tel" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
</ion-col>
</ion-row>
</div>
<div>
<ion-button class="sendVerifyBtn" (click)="VerifyCode()" >{{ts.trPK('userProfile','verify-code')}}</ion-button>
</div>
</div> -->
<!-- ///////////////////////////////////////////////////////////////////next page -->
</ion-content>
<ion-footer class="footer">
<div class="Btn">
<ion-button class="CreateBtn" (click)="createRequest()" >{{ts.trPK('userProfile','createHR-Request')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,616 @@
.header-toolbar-new{
--background: #269DB8;
}
ion-content {
--ion-background-color: whitesmoke;
}
.contentBg{
padding: 0px 20px;
}
.contentBg:before {
position: absolute;
content: "";
background: #269DB8;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
@media screen and (min-width: 1px) and (max-width:767px){
.result-graph {
position: relative;
background: white;
// margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
margin-top: 56px;
border-radius: 20px;
border: 1px solid #ccc;
padding-top: 12px;
}}
@media screen and (min-width: 768px) and (max-width:1024px){
.result-graph {
position: relative;
background: white;
// margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
margin-top: 89px;
border-radius: 20px;
border: 1px solid #ccc;
padding-top: 114px !important;
}}
.user-info{
text-align: center;
margin-bottom: 3px;
.user-image-container{
position: relative;
width: 100%;
height: 24px;
justify-content: space-between;
display: flex;
margin: 0 auto;
align-items: center;
}}
.Boldtext{
// font-size: 13px;
// font-family: WorkSans-Bold;
// color: black !important;
// display: block !important;
text-align: center;
// font: normal normal 600 16px/19px Poppins;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
font-size: 16px;
line-height: 19px;
}
.p{
text-align: center;
// font: normal normal 600 13px/0px Poppins;
letter-spacing: -0.52px;
color: #A2A2A2;
opacity: 1;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
font-size: 13px;
line-height: 0px;
}
.p1{
text-align: center;
// font: normal normal 600 13px/6px Poppins;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
font-size: 13px;
line-height: 6px;
letter-spacing: -0.52px;
color: #A2A2A2;
opacity: 1;
}
.Nametext{
// font-size: 15px;
// font-family: WorkSans-Bold;
// color: black !important;
// display: block !important;
text-align: center;
/* font: normal normal 600 21px/31px Poppins; */
letter-spacing: -0.84px;
color: #2B353E;
opacity: 1;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 21px;
font-size: 21px;
}
.title{
text-align: left;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 20px;
font-size: 20px;
letter-spacing: -0.8px;
color: #2B353E;
opacity: 1;
margin-top: 12px;
margin-bottom: -22px;
}
.title-ar{
text-align: right;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 20px;
font-size: 20px;
letter-spacing: -0.8px;
color: #2B353E;
opacity: 1;
margin-top: 12px;
margin-bottom: -22px;
}
.employee-information-indetail{
background: white;
// margin-top: 15px;
border-radius: 20px;
// margin-bottom: 15px;
border-radius: 20px;
border: 1px solid #ccc;
ion-col{
padding: 15px;
// border-bottom: 1px solid #ccc;
}
h2{
// font-size: 13px;
// margin: 0;
// font-weight: bold;
// color: rgb(128, 124, 124);
text-align: left;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 0px;
font-size: 13px;
letter-spacing: -0.52px;
color: #A2A2A2;
opacity: 1;
}
p{
// font-size: 13px;
// margin: 0;
// font-family: WorkSans-Bold;
text-align: left;
// font: normal normal 600 16px/5px Poppins;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 5px;
font-size: 16px;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
}
}
.employee-information-indetail-ar{
background: white;
// margin-top: 15px;
border-radius: 20px;
// margin-bottom: 15px;
border-radius: 20px;
border: 1px solid #ccc;
ion-col{
padding: 15px;
// border-bottom: 1px solid #ccc;
}
h2{
// font-size: 13px;
// margin: 0;
// font-weight: bold;
// color: rgb(128, 124, 124);
text-align: right;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 0px;
font-size: 13px;
letter-spacing: -0.52px;
color: #A2A2A2;
opacity: 1;
}
p{
// font-size: 13px;
// margin: 0;
// font-family: WorkSans-Bold;
text-align: right;
// font: normal normal 600 16px/5px Poppins;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
line-height: 5px;
font-size: 16px;
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
}
}
@media screen and (min-width: 1px) and (max-width:767px){
.user-image{
position: relative;
display: block;
width: 95%;
height: 100%;
border-radius: 80px;
/* border: 1px solid #ccc; */
margin-top: -125px;
}}
@media screen and (min-width: 768px) and (max-width:1024px){
.user-image{
position: relative;
display: block;
width: 95%;
height: 100%;
border-radius: 80px;
margin-bottom: 371px;
}}
.img{
width: 100px;
height: 100px;
display: inline-flex;
overflow: hidden;
background: transparent;
border-radius: 70% !important;
position: relative;
top: 3px;
}
.sendCodeBtn{
--background: #269DB8;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin-left: 5px !important;
margin-top: 15px !important;
margin-bottom: 20px !important;
/* border-radius: 4px; */
height: 26px;
/* padding: 6px 24px; */
font-size: 15px;
width: 322px;
}
.verify-code{
position: relative;
background: white;
border-radius: 20px;
z-index: 1;
border-radius: 20px;
border: 1px solid #ccc;
padding: 21px 3px 34px 14px;
margin: 25px 22px 2px 22px;
}
// .sms_code{
// margin: 0px;
// text-align: center;
// }
ion-input {
margin: 0 5px;
text-align: center;
line-height: 0;
font-size: 32px;
//border: solid 1px #ccc;
border: 1px solid #ccc !important;
//box-shadow: 0 0 5px #ccc inset;
outline: none;
width: 20%;
transition: all .2s ease-in-out;
border-radius: 3px;
display: inline-block;
&:focus {
border-color:var(--ion-color-secondary) !important;
box-shadow: 0 0 5px var(--ion-color-secondary) !important;
}
&::selection {
background: transparent;
}
}
.sendVerifyBtn{
--background: #269DB8;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
margin-top: 15px !important;
margin-bottom: 20px !important;
/* border-radius: 4px; */
height: 26px;
font-size: 15px;
width: 322px;
margin-left: 22px;
}
.custom-radio .radio-icon {
margin: 0px;
border-radius: 50%;
border-width: var(--border-width);
border-style: var(--border-style);
border-color: #dcdcdc;
margin-top: 6px !important;
border-color: #d8d4d4 !important;
margin-bottom: 18px;}
.text-label{
color: black !important;
font-size: 10px;
margin-left: 15px;
margin-right: 18px;
font-family: 'WorkSans-Bold';
}
// .radio-list{
// background: white;
// margin-left: 18px;
// /* margin-right: 10px; */
// margin-top: 12px;
// }
.result-serviceType{
position: relative;
background: white;
border-radius: 20px;
z-index: 1;
border-radius: 25px;
border: 1px solid #ccc;
margin: 15px;
}
.request-heading {
span {
display: block;
margin-bottom: 15px;
// padding-top: 8px;
// padding-left: 15px;
/* font-weight: bold; */
font-size: 14px;
font-family: 'WorkSans-Bold';
}
}
.filed1{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
margin: 10px;
padding-left: 11px !important;
padding-top: 6px !important;
color: #636161;
padding-bottom: 15px;
// padding-right: 252px;
padding-right: 115px;
}
.filed2{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
margin: 10px;
padding-left: 11px !important;
padding-top: 6px !important;
color: #636161;
padding-bottom: 15px;
// padding-right: 252px;
padding-right: 153px;
}
.filed3{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
margin: 10px;
padding-left: 11px !important;
padding-top: 6px !important;
color: #636161;
padding-bottom: 15px;
// padding-right: 252px;
padding-right: 61px;
}
.filedDesc{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
// margin: 10px;
padding-left: 20px !important;
padding-top: 6px !important;
color: #636161;
--padding-bottom: 90px;
font-size: 13px;
text-align: start;
}
.filedDesc-ar{
border-radius: 30px;
border: 1px solid #d3d5d5 !important;
// margin: 10px;
padding-right: 20px !important;
padding-top: 6px !important;
color: #636161;
--padding-bottom: 90px;
font-size: 13px;
text-align: start;
}
.labelDesc{
display: block;
padding-top: 8px;
padding-left: 15px;
font-size: 14px;
font-weight: bold;
color: #adabab;
}
.selectLabel{
display: block;
padding-top: 8px;
padding-left: 15px;
font-size: 14px;
/* font-family: 'WorkSans-Bold'; */
font-weight: bold;
color: black;
}
// .cancelRequest{
// padding: 10px 7px 10px 0px;
// ion-button{
// border-radius: 7px;
// padding: 12px 30px 12px 30px;
// background: #d00a0a;
// --background: transparent;
// --box-shadow: none !important;
// height: auto;
// min-height: inherit;
// font-size: 16px;
// font-weight: bold;
// margin-top: -5px;
// }}
// .submitRequest{
// padding: 10px 7px 10px 0px;
// ion-button{
// border-radius: 7px;
// padding: 12px 30px 12px 30px;
// background: #19a163;
// --background: transparent;
// --box-shadow: none !important;
// height: auto;
// min-height: inherit;
// font-size: 16px;
// font-weight: bold;
// margin-top: -5px;
// }}
.gridDiv{
width: 100%;
height: 40px;
margin-top: 18px;
font-size: 14px;
}
.gridCancelBtn{
min-width: auto;
// margin: 0px;
padding: 10px;
border: 1px solid var(--cusgray);
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
width: 45%;
height: 100%;
border-radius: 8px;
background: #d00a0a;
color: white;
margin-left: 15px;
margin-right: 5px;
font-family: 'WorkSans-bold';
}
.gridSubmitBtn{
min-width: auto;
// margin: 0px;
padding: 10px;
border: 1px solid var(--cusgray);
box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
width: 45%;
height: 100%;
border-radius: 8px;
background: #19a163;
color: white;
// margin-left: 15px;
// margin-right: 5px;
font-family: 'WorkSans-bold';}
.filed-container{
margin-right: -17px;
margin-left: -25px;
}
.labels{
display: block;
margin-top: 15px;
padding-top: 8px;
padding-left: 15px;
font-size: 14px;
font-family: 'WorkSans-Bold';
}
@media screen and (min-width: 325px) { .CreateBtn{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 7px !important;
border-radius: 7px !important;
--min-height: 1.6cm !important;
width: 315px;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}}
@media screen and (min-width: 1px) and (max-width:320px) {
.CreateBtn{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 7px !important;
border-radius: 7px !important;
--min-height: 1.6cm !important;
width: 231px;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}}
.footer{
padding: 15px 0px 0px 0px;
background-color: var(--light) !important;
border: 0px !important;
box-shadow: none !important;
-webkit-box-shadow: none;
}
.Btn{
margin: auto; text-align: center; display: block;
}
.footer2{
padding: 15px 0px 0px 24px;
background-color: var(--light) !important;
border: 0px !important;
box-shadow: none !important;
-webkit-box-shadow: none;
}
ion-footer .footer-button{
--background: #259CB8;
width: 80%;
}
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
margin-left: -233px;
}
.fileUpload input.upload {
position: absolute;
top: 0;
right: 0;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
}
.hL{
line-height: 19px !important;
}

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

@ -0,0 +1,153 @@
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 { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { MowadhafiService } from '../mowadhafi.service';
import { Location } from '@angular/common';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { LoginModel } from 'src/app/authentication/models/LoginModel';
import { SendActivationByType } from 'src/app/authentication/models/sendActivationByType';
import { FileUploader } from 'ng2-file-upload';
@Component({
selector: 'app-hr-request',
templateUrl: './hr-request.component.html',
styleUrls: ['./hr-request.component.scss'],
})
export class HRRequestComponent implements OnInit {
public EmpName: string;
public EmpNum: string;
public EmpGroup: string;
public EmpMobile: string;
public EmpJob: string;
public EmpOrgName: string;
public EmpPayrol: string;
public EmpPosition: string;
public EmpEmail: string;
public EmpCatMeaning: string;
public EmpGRADENAME: string;
public EmpLocation: string;
public EmpImg: string;
public userImage: any = '../assets/imgs/profile.png';
public loginData = new LoginModel();
public direction: string;
constructor(
public ts: TranslatorService,
public cs: CommonService,
public authService: AuthenticationService,
public sharedData: SharedDataService,
public events: Events,
public MowadhafiService: MowadhafiService,
private location: Location,
private menu: MenuController,
) {
this.direction = TranslatorService.getCurrentLanguageName();
}
ngOnInit() {
this.getUserInformation();
this.checkERM('Before Service Initiation');
}
goback() {
this.location.back();
}
getUserInformation() {
const request = {
// P_SELECTED_EMPLOYEE_NUMBER:"121816",
P_SELECTED_RESP_ID: -999,
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1
};
this.MowadhafiService.getUserInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handleUserInfoResult(result);
})
}
handleUserInfoResult(result) {
this.EmpName = result.MemberInformationList[0].EMPLOYEE_NAME;
console.log("____________" + this.EmpName);
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER;
// this.EmpJob = result.MemberInformationList[0].JOB_NAME;
this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME;
// this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
let jobTitle = result.MemberInformationList[0].POSITION_NAME
jobTitle = jobTitle.split('.');
if (jobTitle && jobTitle.length > 1) {
this.EmpPosition = jobTitle[0] + " " + jobTitle[1];
} else {
this.EmpPosition = '';
}
this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME;
this.EmpLocation = result.MemberInformationList[0].LOCATION_NAME;
this.EmpImg = result.MemberInformationList[0].EMPLOYEE_IMAGE
// console.log("total no "+this.EmpTotal)
}
public createRequest() {
this.cs.openHRRequestFormPage();
// this.menu.toggle();
}
checkERM(status) {
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: status, //After Service Submission
ItgServiceName: "Ticket"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
var result = JSON.parse(res.Mohemm_ITG_ResponseItem).result.data;
this.cs.sharedService.setSharedData(
result,
AuthenticationService.SERVEY_DATA
)
if (!CommonService.SKIP && result) {
if (result.notificationType == 'Survey') {
this.cs.navigateForward('/erm-channel/survey');
} else {
this.authService.adsDetails({
"ItgNotificationMasterId": result['notificationMasterId']
},
() => { }, this.ts.trPK('general', 'ok')
).subscribe((result) => {
var data = result.Mohemm_ITG_ResponseItem;
if (data) {
this.cs.sharedService.setSharedData(
JSON.parse(data),
AuthenticationService.ADS_DATA
);
this.cs.navigateForward('/erm-channel/home');
}
})
}
}
})
}
}

@ -0,0 +1,52 @@
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 { MowadhafiPage } from './mowadhafi.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import {MyRequestComponent} from './my-request/my-request.component';
import {HRRequestComponent} from './hr-request/hr-request.component';
import {RequestDetailsComponent} from'./request-details/request-details.component';
import {HrRequestFormComponent} from './hr-request-form/hr-request-form.component';
const routes: Routes = [
{
path: '',
component: MowadhafiPage,
children:[{
path: 'my-request',
component: MyRequestComponent
},
{
path: 'hr-request',
component: HRRequestComponent
},
{
path: 'request-details',
component: RequestDetailsComponent
},
{
path: 'hr-request-form',
component: HrRequestFormComponent
}
]
}
];
@NgModule({
imports: [
HmgCommonModule,
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [MowadhafiPage,MyRequestComponent,HRRequestComponent
,RequestDetailsComponent,HrRequestFormComponent]
})
export class MowadhafiPageModule {}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save