Merge branch 'MOHEMM-Q3-DEV-LATEST' into MOHEMM-PHASE-2-SFH

# Conflicts:
#	Mohem/resources/android/icon/drawable-hdpi-icon.png
#	Mohem/resources/android/icon/drawable-ldpi-icon.png
#	Mohem/resources/android/icon/drawable-mdpi-icon.png
#	Mohem/resources/android/icon/drawable-xhdpi-icon.png
#	Mohem/resources/android/icon/drawable-xxhdpi-icon.png
#	Mohem/resources/android/icon/drawable-xxxhdpi-icon.png
#	Mohem/resources/android/splash/drawable-land-hdpi-screen.png
#	Mohem/resources/android/splash/drawable-land-ldpi-screen.png
#	Mohem/resources/android/splash/drawable-land-mdpi-screen.png
#	Mohem/resources/android/splash/drawable-land-xhdpi-screen.png
#	Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png
#	Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png
#	Mohem/resources/android/splash/drawable-port-hdpi-screen.png
#	Mohem/resources/android/splash/drawable-port-ldpi-screen.png
#	Mohem/resources/android/splash/drawable-port-mdpi-screen.png
#	Mohem/resources/android/splash/drawable-port-xhdpi-screen.png
#	Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png
#	Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png
#	Mohem/src/app/app-routing.module.ts
#	Mohem/src/app/app.component.html
#	Mohem/src/app/app.component.ts
#	Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
#	Mohem/src/app/hmg-common/services/common/common.service.ts
#	Mohem/src/app/hmg-common/ui/generic-header/generic-header.component.scss
#	Mohem/src/app/home/home.page.ts
#	Mohem/src/app/my-team/details/details.component.ts
#	Mohem/src/app/notification/home/home.component.html
#	Mohem/src/app/notification/home/home.component.ts
#	Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss
#	Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss
#	Mohem/src/app/notification/worklist-main/worklist-main.component.html
#	Mohem/src/app/notification/worklist-main/worklist-main.component.ts
#	Mohem/src/app/profile/home/home.component.ts
#	Mohem/src/app/time-card/time-card-details/time-card-details.component.ts
NEW-SFH-2022
umasoodch 4 years ago
commit 42ec226d45

@ -0,0 +1,17 @@
{
"name": "com.huawei.cordovahmsgmscheckplugin",
"version": "1.0.0",
"description": "Account Check Kit 4.0",
"cordova": {
"id": "com.huawei.cordovahmsgmscheckplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
],
"author": "",
"license": "ISC"
}

@ -0,0 +1,17 @@
{
"name": "com.huawei.cordovahmslocationplugin",
"version": "1.0.0",
"description": "Location Service",
"cordova": {
"id": "com.huawei.cordovahmslocationplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
],
"author": "",
"license": "ISC"
}

@ -0,0 +1,21 @@
{
"name": "cordovahmspushplugin",
"version": "1.0.0",
"description": "For Hms Push",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "test",
"license": "ISC",
"cordova": {
"id": "com.huawei.cordovahmspushplugin",
"platforms": [
"android"
]
},
"keywords": [
"ecosystem:cordova",
"cordova-android"
]
}

@ -35,7 +35,10 @@
"@ionic-native/device": "^5.18.0",
"@ionic-native/diagnostic": "^5.18.0",
"@ionic-native/file": "^5.18.0",
"@ionic-native/file-chooser": "^5.36.0",
"@ionic-native/file-opener": "^5.36.0",
"@ionic-native/file-path": "^5.18.0",
"@ionic-native/file-picker": "^5.36.0",
"@ionic-native/fingerprint-aio": "^5.18.0",
"@ionic-native/firebase-x": "^5.34.0",
"@ionic-native/geolocation": "^5.10.0",
@ -48,6 +51,7 @@
"@ionic-native/native-storage": "^5.17.0",
"@ionic-native/nfc": "^5.30.0",
"@ionic-native/open-native-settings": "^5.14.0",
"@ionic-native/sms-retriever": "^5.36.0",
"@ionic-native/social-sharing": "^5.34.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.18.0",
@ -80,7 +84,10 @@
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-filechooser": "^1.2.0",
"cordova-plugin-filepath": "^1.5.6",
"cordova-plugin-filepicker": "^1.1.6",
"cordova-plugin-fingerprint-aio": "^3.0.0",
"cordova-plugin-firebasex": "^13.0.0",
"cordova-plugin-geolocation": "^4.0.2",
@ -90,6 +97,7 @@
"cordova-plugin-ionic-webview": "^4.1.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-sms-retriever-manager": "^1.0.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-themeablebrowser": "^0.2.18",
@ -231,7 +239,15 @@
},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
}
},
"cordova-plugin-sms-retriever-manager": {
"PLAY_SERVICES_VERSION": "15.0.1"
},
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-filepicker": {},
"cordova-plugin-filechooser": {}
},
"platforms": [
"android",

@ -32,7 +32,7 @@ export class AbsenceReplacementListComponent implements OnInit {
P_PAGE_NUM: number;
P_PAGE_LIMIT: number;
ReplacementList: any = [];
searchBy: string = "";
searchBy: string = "2";
IsReachEnd: boolean = false;
ReplacmentListRes: WorKListReplacmentEmployeeResponse;
private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest();

@ -3,7 +3,7 @@ import { CommonService } from "src/app/hmg-common/services/common/common.service
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { ModalController ,IonSelectOption ,IonSelect } from "@ionic/angular";
import { ModalController, IonSelectOption, IonSelect } from "@ionic/angular";
import { SubmitAbsenceService } from "../service/submit.absence.service";
import { AbsenceAttahcmentResponse } from "../models/abs.attach.response";
import { AbsenceListService } from "../service/service.service";
@ -23,8 +23,8 @@ import { DatePicker } from "@ionic-native/date-picker/ngx";
import { Request } from '../../hmg-common/services/models/request';
// import { Request } from "../models/request";
import * as moment from "moment";
import {ReplacementListComponent} from "../../vacation-rule/replacement-list/replacement-list.component";
import {ReplacmentResponse} from "../models/replacment-response";
import { ReplacementListComponent } from "../../vacation-rule/replacement-list/replacement-list.component";
import { ReplacmentResponse } from "../models/replacment-response";
import { AbsenceResponse } from '../models/absence.response';
import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component';
import { AbsenceNotificatonBodyResponse } from 'src/app/notification/models/AbsenceNotificationBodyRes';
@ -99,8 +99,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.direction = TranslatorService.getCurrentLanguageName();
////*new add*/////
/**********resubmit************ */
this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
this.getPassdirfromNotifiPage = this.common.sharedService.getSharedData('dirfromNotificationPage');
//this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true);
// this.getPassdirfromNotifiPage = this.navParams.get('dirfromNotificationPage');
if (this.getPassdirfromNotifiPage) {
@ -110,8 +110,8 @@ export class SubmitAbsenceComponent implements OnInit {
this.notificationId = this.getPassNotificationDetails.NOTIFICATION_ID;
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.respID = -999;
this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
console.log()
this.submitAbsObjList = this.common.sharedService.getSharedData('submitAbsObjList');
console.log()
} else {
this.action = "CREATE";
this.selEmp = this.common.sharedService.getSharedData(
@ -185,7 +185,7 @@ export class SubmitAbsenceComponent implements OnInit {
}
}
calcDay() {
console.log("calcDay" );
console.log("calcDay");
let msg: string = "";
if (
this.startDate == undefined ||
@ -233,7 +233,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.totalDays = result.CalculateAbsenceDuration.P_ABSENCE_DAYS;
}
}
async openSearch(){
async openSearch() {
const modal = await this.modalCtrl.create({
component: ReplacementListComponent,
keyboardClose: true,
@ -259,7 +259,7 @@ export class SubmitAbsenceComponent implements OnInit {
console.log(data)
console.log(user);
if (data) {
this.employeeName = user.EMPLOYEE_DISPLAY_NAME;
this.employeeName = user.EMPLOYEE_DISPLAY_NAME;
this.employeeID = user.USER_NAME;
this.employeeSel = this.employeeName + "," + this.employeeID;
}
@ -278,12 +278,12 @@ export class SubmitAbsenceComponent implements OnInit {
}
public onTypeAbsenceChange() {
if (this.absenceType) {
let obj: any = this.absenceTypeList.find(
s => s.ABSENCE_ATTENDANCE_TYPE_ID == this.absenceType
);
if (obj) this.absenceTypeName = obj.DESC_FLEX_CONTEXT_CODE;
else this.absenceTypeName = null;
@ -443,7 +443,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.textInput = new TextInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
defaultVal,
defaultVal,
containerId,
defaultValText,
feildsList[i].MOBILE_ENABLED,
@ -492,9 +492,9 @@ export class SubmitAbsenceComponent implements OnInit {
this.fillAbsStructure();
}
}
bindHtmlElemEvents(id, obj) {
const elem = document.getElementById(id);
elem.addEventListener("change", e => {
elem.classList.remove("requiredClassElm");
@ -1039,20 +1039,20 @@ export class SubmitAbsenceComponent implements OnInit {
let elem = document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement;
let elemVal="";
let elemVal = "";
if (elem.classList.contains('onic-date')) {
elemVal = (document.getElementById(
elemVal = (document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
if(elemVal){
if (elemVal) {
elemVal = moment(elemVal).format("YYYY/MM/DD hh:mm:ss");
}
}else{
elemVal = (document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
}
} else {
elemVal = (document.getElementById(
this.absenceDffresponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
}
textValue = elemVal;
if (
@ -1060,7 +1060,7 @@ export class SubmitAbsenceComponent implements OnInit {
this.absenceDffresponse[i].DISPLAY_FLAG != "N"
) {
//date
elemVal = this.common.formatDate(elemVal);
elemVal = this.common.formatDate(elemVal);
} else if (
this.absenceDffresponse[i].FORMAT_TYPE == "Y" &&
this.absenceDffresponse[i].DISPLAY_FLAG != "N"
@ -1323,6 +1323,7 @@ export class SubmitAbsenceComponent implements OnInit {
}
return isSt;
}
validateAbcenseTransaction() {
(this.elementRef.nativeElement.querySelectorAll(
"ion-item"
@ -1447,9 +1448,9 @@ export class SubmitAbsenceComponent implements OnInit {
private handleSubmitAbsence(result) {
if (this.common.validResponse(result)) {
if (this.getPassdirfromNotifiPage) {
this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.common.openConfirmAbsece();
// this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true });
this.common.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.common.openConfirmAbsece();
// this.navCtrl.push("SubmitAbsenceConfirmPage", { isResubmit: true });
} else {
this.common.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.common.openConfirmAbsece();

@ -1,43 +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' },
{ 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' }, { path: 'sit', loadChildren: './sit/sit.module#SitPageModule' }
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' },
{ path: 'sit', loadChildren: './sit/sit.module#SitPageModule' },
{ path: 'reports', loadChildren: './reports/reports.module#ReportsPageModule' },
{ path: 'termination', loadChildren: './termination/termination.module#TerminationPageModule' },
{ path: 'pending-transaction', loadChildren: './pending-transaction/pending-transaction.module#PendingTransactionPageModule' }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }

@ -47,13 +47,33 @@
<!-- <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>
<img style= "height: 20px !important;" src="../assets/imgs/hr-request.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','HR-Request')}}
</ion-label>
</ion-item> -->
<!-- </ion-item> -->
<div *ngFor="let menu of menuList">
<ion-item (click)="oepnMyRequest(menu)" *ngIf="menu.REQUEST_GROUP_NAME =='MBL_RG_01' && menu.MENU_TYPE =='E'">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 20px !important;" src="../assets/imgs/my-request.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{menu.MENU_NAME}}
</ion-label>
</ion-item>
</div>
<ion-item (click)="oepnTransaction()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 20px !important;" src="../assets/imgs/pending-transaction.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('general','pending-transaction')}}
</ion-label>
</ion-item>
<!-- <ion-item (click)="openChangePassword()"> -->
<ion-item (click)="openChangePassword()">
@ -149,6 +169,27 @@
{{ts.trPK('userProfile','HR-Request')}}
</ion-label>
</ion-item> -->
<!-- </ion-item> -->
<div *ngFor="let menu of menuList">
<ion-item (click)="oepnMyRequest(menu)" *ngIf="menu.REQUEST_GROUP_NAME =='MBL_RG_01' && menu.MENU_TYPE =='E'">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 20px !important;" src="../assets/imgs/my-request.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{menu.MENU_NAME}}
</ion-label>
</ion-item>
</div>
<ion-item (click)="oepnTransaction()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 20px !important;" src="../assets/imgs/pending-transaction.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('general','pending-transaction')}}
</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>

@ -14,6 +14,7 @@ import { DigitalIdComponent } from './authentication/digital-id/digital-id.compo
import { checkAndUpdatePureExpressionInline } from '@angular/core/src/view/pure_expression';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from './authentication/business-card/business-card.component';
import { MenuResponse } from './hmg-common/services/menu/models/menu-response';
@Component({
selector: 'app-root',
@ -122,7 +123,7 @@ export class AppComponent implements OnInit {
public setScreenNameAnalytics(currentPageName: string) {
try {
this.firebasex.setScreenName(currentPageName).then((result)=>{
this.firebasex.setScreenName(currentPageName).then((result) => {
console.log(result);
});
} catch (Error) { }
@ -217,7 +218,10 @@ export class AppComponent implements OnInit {
});
});
this.events.subscribe('getNotCount', badge => { this.notBadge = badge; });
this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; });
this.events.subscribe('myTeamFlag', myTeamFlag => {
this.TeamFlag = myTeamFlag;
this.menuList = this.cs.sharedService.getSharedData(MenuResponse.MENU_LIST, false);
});
}
private initializeDirection() {
@ -266,7 +270,10 @@ export class AppComponent implements OnInit {
this.cs.openProfile('sideMenu');
this.menu.toggle();
}
public performanceEvaluation() {
this.cs.openPerformanceevaluation();
this.menu.toggle();
}
public openNotification() {
this.cs.openNotificationPage();
this.menu.toggle();
@ -347,4 +354,13 @@ export class AppComponent implements OnInit {
} else { }
});
}
oepnMyRequest(menu) {
this.cs.sharedService.setSharedData(menu, MenuResponse.SELECTED_MENU);
this.cs.openConcurrentReport();
this.menu.toggle();
}
oepnTransaction() {
this.cs.openTransactions();
this.menu.toggle();
}
}

@ -35,4 +35,7 @@
.my-custom-modal-css .modal-wrapper {
width: 95%;
height: 60%;
}
.dependent-title .ion-title{
font-size:0.4cm !important;
}

@ -14,14 +14,15 @@ import { Device } from '@ionic-native/device/ngx';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { SearchableOptionsModule } from '../hmg-common/ui/searchable-select/searchable-options.module';
import { MobileNumberModule } from 'src/app/hmg-common/ui/mobile-number/mobile-number.module';
import { MobileNumberModule } from 'src/app/hmg-common/ui/mobile-number/mobile-number.module';
import { SmsdialogPageModule } from 'src/app/hmg-common/ui/smsdialog/smsdialog.module';
import { SmsPageModule } from 'src/app/hmg-common/ui/sms/sms.module';
import { SmsPageComponent } from './sms-page/sms-page.page';
import { CheckUserComponent } from './check-user/check-user.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
import {WelcomeComponent} from '../authentication/welcome/welcome.component'
import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-login.component'
import { WelcomeComponent } from '../authentication/welcome/welcome.component'
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
const routes: Routes = [
{
@ -84,11 +85,12 @@ const routes: Routes = [
// ConfirmLoginComponent,
WelcomeComponent,
],
providers:[
providers: [
FingerprintAIO,
Device,
SplashScreen
SplashScreen,
SmsRetriever
],
entryComponents:[]
entryComponents: []
})
export class AuthenticationPageModule { }

@ -49,12 +49,13 @@
</ion-col>
</ion-row>
</ion-grid> -->
<div style="height: 300px; width: 300px; transform: rotate(90deg) !important;">
<div style="height: 320px; width: 320px; transform: rotate(90deg) !important;">
<img style="width: 100px; margin-left: 20px; margin-top: 26px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
<h1 class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_en}}</h1>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{userInfo.job_en}}</h5>
<h1 *ngIf="direction === 'en'" class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_en}}</h1>
<h1 *ngIf="direction === 'ar'" class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_ar}}</h1>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{jobName}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; font-size: 18px; margin-bottom: 0px;">{{userInfo.mobile}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 5px; font-size: 12px; margin-bottom: 5px;">{{userInfo.email}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 5px; font-size: 12px; margin-bottom: 5px; white-space: nowrap;">{{userInfo.email}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px;">{{userInfo.company_url}}</h5>
</div>
@ -114,7 +115,7 @@
<img style="width: 300px; margin-left: 185px; margin-top: 26px;" [alt]='userInfo.company_logo' src="../assets/icon/HMG_LOGO.png"/>
<div style="margin-top: 30px;">
<h1 class='font-text-style' style="font-size: 25px !important; margin-left: 20px; margin-top: 5px; margin-bottom: 0px;">{{userInfo.name_en}}</h1>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{userInfo.job_en}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px; ">{{jobName}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; font-size: 18px; margin-bottom: 0px;">{{userInfo.mobile}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 5px; font-size: 12px; margin-bottom: 5px;">{{userInfo.email}}</h5>
<h5 class='font-text-style' style="margin-left: 20px; margin-top: 0px;">{{userInfo.company_url}}</h5>
@ -124,4 +125,4 @@
<div style="height: 150px; width: 300px;">
<img style="width: 140px; margin-left: 10px; margin-top: 50px;" [src]="userInfo.qr"/>
</div>
</ion-content>
</ion-content>

@ -2,6 +2,8 @@ import { Component, OnInit, Input } from '@angular/core';
import { ModalController } 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';
@Component({
selector: 'app-business-card',
@ -12,15 +14,30 @@ export class BusinessCardComponent implements OnInit {
public userInfo: any;
public userJobName: any;
public jobName: any;
direction: string;
constructor(
public modalCtrl: ModalController,
public ts: TranslatorService,
public common: CommonService
public common: CommonService,
public authService: AuthenticationService,
) { }
ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
this.direction = TranslatorService.getCurrentLanguageName();
console.log(this.userInfo);
this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
let jobTitle = user.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.jobName = jobTitle[0] + " " + jobTitle[1];
}
}
});
}
@ -30,4 +47,4 @@ export class BusinessCardComponent implements OnInit {
});
}
}
}

@ -1,64 +1,106 @@
<app-generic-header
showBack="true"
[headerText]="'changePassword,changePassword' | translate">
<app-generic-header showBack="true" [headerText]="'changePassword,changePassword' | translate">
</app-generic-header>
<ion-content padding>
<ion-grid>
<ion-row >
<ion-col [size]="4">
<img [src]="logo" class="logoHeader" />
</ion-col>
</ion-row>
<br/>
<br/>
<p class="headerTxt" color="light" > {{'changePassword,changePassword' | translate}}</p>
<ion-grid>
<ion-row>
<ion-col [size]="4">
<img [src]="logo" class="logoHeader" />
</ion-col>
</ion-row>
<ion-item class="item-input-login" >
<p class="headerTxt" color="light"> {{'changePassword,changePassword' | translate}}</p>
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required type="password"
placeholder="{{ts.trPK('changePassword','currentPassword')}}"
[(ngModel)]="P_OLD_PASSWORD"
minLength="8" min="8"
(ionChange)="onChangeOP()"
></ion-input>
</ion-item>
<p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required [type]="currentPasswordIcon"
placeholder="{{ts.trPK('changePassword','currentPassword')}}" [(ngModel)]="P_OLD_PASSWORD" minLength="8"
min="8" (ionChange)="onChangeOP()"></ion-input>
<ion-icon *ngIf='currentPasswordIcon === "text"' name="ios-eye" (click)="showPassword(3)"></ion-icon>
<ion-icon *ngIf='currentPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(3)"></ion-icon>
</ion-item>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD" minLength="8" min="8" >
</ion-input>
</ion-item>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeCNP()" class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD" minLength="8" min="8">
</ion-input>
</ion-item>
<p class="headerTxt" color="light"> {{'changePassword,newPassword' | translate}}</p>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeNP()" class="login-input" required [type]="newPasswordIcon"
placeholder="{{ts.trPK('changePassword','newPassword')}}" [(ngModel)]="P_NEW_PASSWORD" minLength="8"
min="8">
</ion-input>
<ion-icon *ngIf='newPasswordIcon === "text"' name="ios-eye" (click)="showPassword(1)"></ion-icon>
<ion-icon *ngIf='newPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(1)"></ion-icon>
</ion-item>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input (ionChange)="onChangeCNP()" class="login-input" required [type]="confirmPasswordIcon"
placeholder="{{ts.trPK('changePassword','confirmPassword')}}" [(ngModel)]="P_Confirm_NEW_PASSWORD"
minLength="8" min="8">
</ion-input>
<ion-icon *ngIf='confirmPasswordIcon === "text"' name="ios-eye" (click)="showPassword(2)"></ion-icon>
<ion-icon *ngIf='confirmPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(2)"></ion-icon>
</ion-item>
<ion-item lines='none'>
<img class="item-icon " src="../assets/imgs/req info.svg" item-start />
<ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label>
</ion-item>
<!-- <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLowerCase.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(2)" item-start />
<ion-label><p>{{isUpperCase.text}}</p></ion-label>
</ion-item> -->
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isLetterCase.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(3)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isHasDigit.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(4)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isMinLength.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(5)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isRepeatedLetter.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(6)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isContainSpecialChar.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(7)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{confirmMatchNew.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(8)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{userNameMatchNew.text}}</p></ion-label>
</ion-item>
</ion-grid>
<page-trailer [small]="true"></page-trailer>
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
</ion-grid>
<page-trailer [small]="true"></page-trailer>
<!-- [disabled]="NEW_PASSWORD && Confirm_NEW_PASSWORD" [disabled]="true"-->
</ion-content>
<ion-footer>
<div class="centerDiv">
<button [disabled]="!(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD)" [ngClass]=" !(NEW_PASSWORD && Confirm_NEW_PASSWORD && OLD_PASSWORD) ? 'disabledButton' : '' " class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
<button [disabled]="disabledSubmitBtn()"
[ngClass]=" disabledSubmitBtn() ? 'disabledButton' : '' "
class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</button>
</div>
</ion-footer>

@ -33,3 +33,7 @@
opacity:.5;
}
.info{
color: #000;
font-weight: bold;
}

@ -9,7 +9,7 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser
import { ForgetPassword } from '../models/forget.password';
import { LoginModel } from '../models/LoginModel';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import {LoginComponent} from "src/app/authentication/login/login.component";
import { LoginComponent } from "src/app/authentication/login/login.component";
import { Password } from '../models/password';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
//import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@ -22,17 +22,89 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
export class ChangePasswordComponent implements OnInit {
private loginData = new LoginModel();
public P_NEW_PASSWORD: string = "";
public P_Confirm_NEW_PASSWORD : string = "";
public P_OLD_PASSWORD : string = "";
public P_USER_NAME : string;
public P_Confirm_NEW_PASSWORD: string = "";
public P_OLD_PASSWORD: string = "";
public P_USER_NAME: string;
public logo = "assets/icon/login/lock.png";
public testy = 'a123';
userData: any = {};
public isExpiredPwd: boolean = false;
public NEW_PASSWORD: boolean = false;
public Confirm_NEW_PASSWORD: boolean = false;
public OLD_PASSWORD: boolean = false;
//public profile_form: FormGroup;
public currentPasswordIcon = 'password';
public newPasswordIcon = 'password';
public confirmPasswordIcon = 'password';
public recentPasswordNote = {
yellowImg: '../assets/imgs/mohemm-action/info.png',
text: this.ts.trPK('login', 'current-password-validation')
};
public isLowerCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false
};
public isUpperCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false
};
public isLetterCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false
};
public isHasDigit = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false
};
public isMinLength = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false
};
public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false
};
public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false
};
public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false
};
public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false
};
public userId: string;
constructor(
public cs: CommonService,
@ -43,24 +115,24 @@ export class ChangePasswordComponent implements OnInit {
public smsService: SmsReaderService,
public changeDetector: ChangeDetectorRef,
public sharedData: SharedDataService,
// public formBuilder: FormBuilder,
) {
console.log("change password constructor");
}
// public formBuilder: FormBuilder,
) {
console.log("change password constructor");
}
ngOnInit() {
console.log("change password oninit");
this.isExpiredPwd =
this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
this.P_USER_NAME =data.P_USER_NAME;
this.P_USER_NAME = data.P_USER_NAME;
console.log(this.isExpiredPwd);
console.log(this.P_USER_NAME);
// this.profile_form = this.formBuilder.group({
// password: ['', Validators.compose([Validators.minLength(8)])]
// });
// this.profile_form = this.formBuilder.group({
// password: ['', Validators.compose([Validators.minLength(8)])]
// });
// this.authService
// .loadAuthenticatedUser()
// .subscribe((user: AuthenticatedUser) => {
@ -78,97 +150,224 @@ export class ChangePasswordComponent implements OnInit {
private checkUserResult: CheckUserAuthenticationResponse;
submit(){
submit() {
console.log(this.isExpiredPwd);
if(this.isExpiredPwd){
if (this.isExpiredPwd) {
this.expiredPassword();
}else{
} else {
this.changePassword();
}
}
public expiredPassword(){
public expiredPassword() {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
//this.loginData.P_USER_NAME = this.P_USER_NAME;
let request:Password = new Password();
request.P_OLD_PASSWORD=this.P_OLD_PASSWORD;
request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD;
let request: Password = new Password();
request.P_OLD_PASSWORD = this.P_OLD_PASSWORD;
request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD;
request.P_USER_NAME = this.P_USER_NAME;
this.authService.submitExpiredPassword(
request,
() => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log(result);
this.cs.toastPK("changePassword","successChange");
this.sharedData.setSharedData(false,Password.IS_EXPIRED_PSW);
this.cs.openLogin();
}
});
request,
() => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log(result);
this.cs.toastPK("changePassword", "successChange");
this.sharedData.setSharedData(false, Password.IS_EXPIRED_PSW);
this.cs.openLogin();
}
});
}
public changePassword(){
public changePassword() {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
//this.loginData.P_USER_NAME = this.P_USER_NAME;
let request:Password = new Password();
request.P_OLD_PASSWORD=this.P_OLD_PASSWORD;
request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD;
let request: Password = new Password();
request.P_OLD_PASSWORD = this.P_OLD_PASSWORD;
request.P_Confirm_NEW_PASSWORD = this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD = this.P_Confirm_NEW_PASSWORD;
request.P_USER_NAME = this.P_USER_NAME;
this.authService.submitChangePassword(
request,
() => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log(result);
this.cs.toastPK("changePassword","successChange");
this.cs.openHome();
}
});
request,
() => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log(result);
this.cs.toastPK("changePassword", "successChange");
this.cs.openHome();
}
});
}
onChangeCNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
onChangeCNP() {
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_Confirm_NEW_PASSWORD.length >= 3) {
this.Confirm_NEW_PASSWORD=true;
this.Confirm_NEW_PASSWORD = true;
} else {
this.Confirm_NEW_PASSWORD = false;
}
}else{
this.Confirm_NEW_PASSWORD=false;
}
}
onChangeNP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_NEW_PASSWORD.length >= 3) {
this.NEW_PASSWORD=true;
}else{
this.NEW_PASSWORD=false;
onChangeNP() {
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_NEW_PASSWORD.length >= 3) {
this.NEW_PASSWORD = true;
}
} else {
this.NEW_PASSWORD = false;
}
onChangeOP(){
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_OLD_PASSWORD.length >= 3) {
this.OLD_PASSWORD=true;
}else{
this.OLD_PASSWORD=false;
}
}
}
onChangeOP() {
// in UAT Alow to the length of password less than 8
// so if we ready to go life change it to >= 8
if (this.P_OLD_PASSWORD.length >= 3) {
this.OLD_PASSWORD = true;
}
} else {
this.OLD_PASSWORD = false;
}
}
checkerFuncation(val) {
if (this.P_NEW_PASSWORD === '') {
switch (val) {
case 1:
return this.isLetterCase.blankImg;
case 3:
return this.isHasDigit.blankImg;
case 4:
return this.isMinLength.blankImg;
case 5:
return this.isRepeatedLetter.blankImg;
case 6:
return this.isContainSpecialChar.blankImg;
case 7:
return this.confirmMatchNew.blankImg;
case 8:
return this.userNameMatchNew.blankImg;
}
} else {
switch (val) {
// case 1:
// if (/[a-z]/.test(this.P_NEW_PASSWORD)) {
// this.isLowerCase.isMatch = true;
// return this.isLowerCase.greenImg;
// } else {
// this.isLowerCase.isMatch = false;
// return this.isLowerCase.redImg;
// }
// case 2:
// if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
// this.isUpperCase.isMatch = true;
// return this.isUpperCase.greenImg;
// } else {
// this.isUpperCase.isMatch = false;
// return this.isUpperCase.redImg;
// }
case 1:
if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
this.isLetterCase.isMatch = true;
return this.isLetterCase.greenImg;
} else {
this.isLetterCase.isMatch = false;
return this.isLetterCase.redImg;
}
case 3:
if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
this.isHasDigit.isMatch = true;
return this.isHasDigit.greenImg;
} else {
this.isHasDigit.isMatch = false;
return this.isHasDigit.redImg;
}
case 4:
if (this.P_NEW_PASSWORD.length >= 8) {
this.isMinLength.isMatch = true;
return this.isMinLength.greenImg;
} else {
this.isMinLength.isMatch = false;
return this.isMinLength.redImg;
}
case 5:
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
this.isRepeatedLetter.isMatch = false;
return this.isRepeatedLetter.redImg;
} else {
this.isRepeatedLetter.isMatch = true;
return this.isRepeatedLetter.greenImg;
}
case 6:
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
this.isContainSpecialChar.isMatch = true;
return this.isContainSpecialChar.greenImg;
} else {
this.isContainSpecialChar.isMatch = false;
return this.isContainSpecialChar.redImg;
}
case 7:
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
this.confirmMatchNew.isMatch = false;
return this.confirmMatchNew.redImg;
} else {
this.confirmMatchNew.isMatch = true;
return this.confirmMatchNew.greenImg;
}
case 8:
if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) {
this.userNameMatchNew.isMatch = true;
return this.userNameMatchNew.greenImg;
} else {
this.userNameMatchNew.isMatch = false;
return this.userNameMatchNew.redImg;
}
}
}
}
disabledSubmitBtn() {
if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.NEW_PASSWORD
&& this.Confirm_NEW_PASSWORD && this.OLD_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) {
return false;
} else { return true; }
}
showPassword(val) {
if (val === 1)
this.newPasswordIcon = 'password';
else if (val === 2) {
this.confirmPasswordIcon = 'password'
}
else {
this.currentPasswordIcon = 'password';
}
}
hidePassword(val) {
if (val === 1)
this.newPasswordIcon = 'text';
else if (val === 2) {
this.confirmPasswordIcon = 'text'
}
else {
this.currentPasswordIcon = 'text';
}
}
}

@ -32,6 +32,6 @@
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button [ngClass]="{'disable-button-opacity': isValidForm()}" class="button-login" ion-button (click)=" userCheck()" [disabled]="isValidForm()">{{ts.trPK('login','changepassword')}}</ion-button>
<ion-button [ngClass]="{'disable-button-opacity': isValidForm()}" class="button-login" ion-button (click)=" sendSMSForForgotPassword()" [disabled]="isValidForm()">{{ts.trPK('login','changepassword')}}</ion-button>
</div>
</ion-footer>

@ -46,32 +46,27 @@ export class CheckUserComponent implements OnInit {
return true;
}
public userCheck()
{
public userCheck() {
this.cs.startLoading();
const request = new CheckUserAuthenticationRequest();
request.P_USER_NAME = this.P_USER_NAME;
this.authService.checkUserAuthentication(
request,
() => {
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
this.cs.stopLoading();
this.sendSMSForForgotPassword();
}
});
this.authService.checkUserAuthentication(request, () => {}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
this.cs.stopLoading();
this.sendSMSForForgotPassword();
}
});
}
private checkUserResult: CheckUserAuthenticationResponse;
private sendSMSForForgotPassword() {
public sendSMSForForgotPassword() {
this.cs.startLoading();
let changePwdObj= new LoginRequest();
changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
// changePwdObj.MobileNumber= this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
changePwdObj.P_USER_NAME=this.P_USER_NAME;
changePwdObj.P_MOBILE_NUMBER=this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
// changePwdObj.P_MOBILE_NUMBER=this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
this.authService.sendPublicSMS(
changePwdObj,

@ -12,7 +12,7 @@ import { GetLoginInfoResponse } from '../../hmg-common/services/authentication/m
import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request';
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { PushService } from 'src/app/hmg-common/services/push/push.service';
import { ModalController, Platform } from '@ionic/angular';
import { ModalController, Platform, AlertController } from '@ionic/angular';
import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response';
import { LoginModel } from '../models/LoginModel';
import * as moment from 'moment';
@ -20,6 +20,9 @@ import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authenticat
import { NFC } from "@ionic-native/nfc/ngx";
import { DigitalIdComponent } from '../digital-id/digital-id.component';
import { AppUpdateComponent } from '../app-update/app-update.component';
import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
@Component({
selector: 'app-confirm-login',
@ -53,7 +56,9 @@ export class ConfirmLoginComponent implements OnInit {
public isNFCAvailable = false;
direction: string;
userInfo: any;
public businessInfo: object;
private checkUserResult: CheckUserAuthenticationResponse;
private signature: string;
constructor(
public ts: TranslatorService,
public cs: CommonService,
@ -63,7 +68,9 @@ export class ConfirmLoginComponent implements OnInit {
public pushService: PushService,
public platform: Platform,
public modalController: ModalController,
private nfc: NFC
public alertController: AlertController,
private nfc: NFC,
private smsRetriever: SmsRetriever
) {
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
@ -83,6 +90,7 @@ export class ConfirmLoginComponent implements OnInit {
this.direction = TranslatorService.getCurrentLanguageName();
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.checkNFCStatus();
this.generateSMSsignature();
// **checkIfAvailable FAIO **//
this.checkIfAvailable();
// **getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **//
@ -224,13 +232,18 @@ export class ConfirmLoginComponent implements OnInit {
}
public generateSMSsignature() {
this.smsRetriever.getAppHash()
.then((res: any) => this.signature = res)
.catch((error: any) => console.error(error));
}
public sendActivationCode(type: number) {
console.log(this.signature);
const request = new SendActivationByType();
this.authService.setPublicFields(request);
request.OTP_SendType = type;
request.MobileNumber = this.loginData.MobileNumber;
request.smsSignature = this.signature;
request.IsMobileFingerPrint = 0;
request.P_USER_NAME = this.loginData.P_USER_NAME;
@ -294,7 +307,7 @@ export class ConfirmLoginComponent implements OnInit {
private presentBiometricDialog() {
this.faio.show({
title: 'Biometric Authetnciation', // (Android Only) | optional | Default: "<APP_NAME> Biometric Sign On"
subtitle: 'Coolest Plugin ever', // (Android Only) | optional | Default: null
subtitle: 'Mohemm', // (Android Only) | optional | Default: null
description: this.ts.trPK('general', 'auth-please'), // optional | Default: null
fallbackButtonTitle: this.ts.trPK('general', 'use-pin'), // optional | When disableBackup is false defaults to "Use Pin".
disableBackup: true, // optional | default: false
@ -367,10 +380,24 @@ export class ConfirmLoginComponent implements OnInit {
this.authService.checkSMS(request, () => { }, this.ts.trPK('general', 'ok'))
.subscribe((result: SMSCheckResponse) => {
if (this.cs.validResponse(result)) {
this.businessInfo = {
show_business: result.BusinessCardPrivilege,
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
job_en: result.MemberInformationList[0].JOB_NAME_En,
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
qr: result.MemberInformationList[0].BusinessCardQR,
company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL,
company_url: result.BC_Domain,
company_type: result.CompanyMainCompany,
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
}
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
@ -431,13 +458,77 @@ export class ConfirmLoginComponent implements OnInit {
this.confirm(this.loginType);
} else {
if (result.IsPasswordExpired) {
// alert("dont forget to handelpresentPasswordExpiredDialog() ");
// this.presentPasswordExpiredDialog(); *****
this.presentPasswordExpiredDialog();
}
}
});
}
async presentPasswordExpiredDialog() {
const alert = await this.alertController.create({
header: this.ts.trPK('general', 'confirm'),
message: this.ts.trPK('login', 'password-expired'),
buttons: [
{
text: this.ts.trPK('general', 'ok'),
handler: () => {
console.log('Confirm Okay');
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
this.userCheck();
}
}
]
});
await alert.present();
}
public userCheck() {
this.cs.startLoading();
const request = new CheckUserAuthenticationRequest();
request.P_USER_NAME = this.username;
this.authService.checkUserAuthentication(
request,
() => {
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
this.cs.stopLoading();
this.sendSMSForForgotPassword();
}
});
}
private sendSMSForForgotPassword() {
this.cs.startLoading();
const changePwdObj = new LoginRequest();
changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
changePwdObj.P_USER_NAME = this.username;
changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
this.authService.sendPublicSMS(
changePwdObj,
() => {
// this.sendSMSForForgotPassword();
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log('2');
console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username;
// this.loginData.EmployeeName =result.MemberLoginList[0].EMPLOYEE_NAME;
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.sharedData.setSharedData(true, Password.IS_FORGET_PSW);
this.cs.stopLoading();
this.cs.openSMSPage();
}
});
}
private handleAppUpdate(result) {
this.iosLink = result.IOSLink;
this.androidLink = result.AndroidLink;
@ -463,14 +554,14 @@ export class ConfirmLoginComponent implements OnInit {
});
}
async appUpdate(msg, result) {
async appUpdate(msg, result) {
const modal = await this.modalController.create({
component: AppUpdateComponent,
cssClass: 'app-update-modal-css',
componentProps: {'msg':msg}
componentProps: { 'msg': msg }
});
modal.onDidDismiss().then((data) => {
this.handleAppUpdate(result);
this.handleAppUpdate(result);
});
return await modal.present();
}
@ -502,9 +593,9 @@ export class ConfirmLoginComponent implements OnInit {
let buttonSelected;
this.buttons.forEach(element => {
element.forEach(elementValue => {
if(typeNumber === elementValue.value){
if (typeNumber === elementValue.value) {
buttonSelected = elementValue;
}else{
} else {
elementValue.visible = false;
}
});

@ -24,18 +24,65 @@
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-label>{{'changePassword,newPassword' | translate}}</ion-label>
<ion-input class="login-input" required type="password"
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required [type]="newPasswordIcon"
placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD">
</ion-input>
<ion-icon *ngIf='newPasswordIcon === "text"' name="ios-eye" (click)="showPassword(1)"></ion-icon>
<ion-icon *ngIf='newPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(1)"></ion-icon>
</ion-item>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label>
<ion-input class="login-input" required type="password"
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input class="login-input" required [type]="confirmPasswordIcon"
placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD">
</ion-input>
<ion-icon *ngIf='confirmPasswordIcon === "text"' name="ios-eye" (click)="showPassword(2)"></ion-icon>
<ion-icon *ngIf='confirmPasswordIcon === "password"' name="ios-eye-off" (click)="hidePassword(2)"></ion-icon>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" src="../assets/imgs/req info.svg" item-start />
<ion-label><p class="info">{{recentPasswordNote.text}}</p></ion-label>
</ion-item>
<!-- <ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLowerCase.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(2)" item-start />
<ion-label><p>{{isUpperCase.text}}</p></ion-label>
</ion-item> -->
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(1)" item-start />
<ion-label><p>{{isLetterCase.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(3)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isHasDigit.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(4)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isMinLength.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(5)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isRepeatedLetter.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(6)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{isContainSpecialChar.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(7)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{confirmMatchNew.text}}</p></ion-label>
</ion-item>
<ion-item lines='none'>
<img class="item-icon" [src]="checkerFuncation(8)" item-start />
<ion-label><p style="white-space: pre-wrap;">{{userNameMatchNew.text}}</p></ion-label>
</ion-item>
</ion-grid>
<page-trailer [small]="true"></page-trailer>
@ -45,6 +92,8 @@
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="button-login" ion-button (click)=" forgotpassword()">{{ts.trPK('login','changepassword')}}</ion-button>
<button [disabled]="disabledSubmitBtn()"
[ngClass]="disabledSubmitBtn() ? 'disabledButton' : 'enable' "
class="button-login" ion-button (click)="forgotpassword()">{{ts.trPK('login','changepassword')}}</button>
</div>
</ion-footer>

@ -1,2 +1,8 @@
.disabledButton{
opacity:.5;
}
.info{
color: #000;
font-weight: bold;
}

@ -9,7 +9,6 @@ import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.ser
import { ForgetPassword } from '../models/forget.password';
import { LoginModel } from '../models/LoginModel';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import {LoginComponent} from "src/app/authentication/login/login.component";
@Component({
selector: 'app-forgot',
templateUrl: './forgot.component.html',
@ -18,10 +17,81 @@ import {LoginComponent} from "src/app/authentication/login/login.component";
export class ForgotComponent implements OnInit {
private loginData = new LoginModel();
public P_NEW_PASSWORD: string;
public P_Confirm_NEW_PASSWORD : string;
public P_USER_NAME : string;
public logo = "assets/icon/login/lock.png";
public P_NEW_PASSWORD = '';
// tslint:disable-next-line: variable-name
public P_Confirm_NEW_PASSWORD = '';
public P_USER_NAME: string;
public logo = 'assets/icon/login/lock.png';
public newPasswordIcon = "password";
public confirmPasswordIcon = "password";
public recentPasswordNote = {
yellowImg: '../assets/imgs/mohemm-action/info.png',
text: this.ts.trPK('login', 'current-password-validation')
};
public isLowerCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'lowercase-password-validation'),
isMatch: false
};
public isUpperCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'uppercase-password-validation'),
isMatch: false
};
public isLetterCase = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'letter-password-validation'),
isMatch: false
};
public isHasDigit = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'numerica-password-validation'),
isMatch: false
};
public isMinLength = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'min-password-validation'),
isMatch: false
};
public isRepeatedLetter = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'repeating-password-validation'),
isMatch: false
};
public isContainSpecialChar = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'special-character-password-validation'),
isMatch: false
};
public confirmMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'not-match-password-validation'),
isMatch: false
};
public userNameMatchNew = {
blankImg: '../assets/icon/blank.svg',
greenImg: '../assets/icon/green.svg',
redImg: '../assets/imgs/close.svg',
text: this.ts.trPK('login', 'contain-username-password-validation'),
isMatch: false
};
public userId: string;
constructor(
public cs: CommonService,
@ -35,16 +105,22 @@ export class ForgotComponent implements OnInit {
) {
}
ngOnInit() {}
ngOnInit() {
console.log('ENAD >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
this.userId = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false).P_USER_NAME;
console.log(this.userId);
}
public onForgot() {
this.sendSMSForForgotPassword();
}
// tslint:disable-next-line: member-ordering
private checkUserResult: CheckUserAuthenticationResponse;
private sendSMSForForgotPassword() {
const request = new ForgetPassword();
console.log(request);
this.authService.sendForgetPassword(
request,
() => {
@ -56,7 +132,7 @@ export class ForgotComponent implements OnInit {
});
}
public forgotpassword(){
public forgotpassword() {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const forgetPasswordTokenResult = this.sharedData.getSharedData('checkSMSResponse', false);
let forgetPasswordTokenID = '';
@ -64,24 +140,148 @@ export class ForgotComponent implements OnInit {
forgetPasswordTokenID = forgetPasswordTokenResult.ForgetPasswordTokenID;
}
this.loginData.P_USER_NAME = this.P_USER_NAME;
let request: any = {};
request.P_Confirm_NEW_PASSWORD=this.P_NEW_PASSWORD;
request.P_NEW_PASSWORD=this.P_Confirm_NEW_PASSWORD;
const 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;
request.ForgetPasswordTokenID = forgetPasswordTokenID;
this.authService.submitForgetPassword(
request,
() => {
//this.sendSMSForForgotPassword();
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log(result);
this.cs.toastPK("changePassword","successChange");
this.cs.toastPK('changePassword', 'successChange');
this.cs.openLogin();
}
});
}
checkerFuncation(val) {
if (this.P_NEW_PASSWORD === '') {
switch (val) {
// case 1:
// return this.isLowerCase.blankImg;
// case 2:
// return this.isUpperCase.blankImg;
case 1:
return this.isLetterCase.blankImg;
case 3:
return this.isHasDigit.blankImg;
case 4:
return this.isMinLength.blankImg;
case 5:
return this.isRepeatedLetter.blankImg;
case 6:
return this.isContainSpecialChar.blankImg;
case 7:
return this.confirmMatchNew.blankImg;
case 8:
return this.userNameMatchNew.blankImg;
}
} else {
switch (val) {
// case 1:
// if (/[a-z]/.test(this.P_NEW_PASSWORD)) {
// this.isLowerCase.isMatch = true;
// return this.isLowerCase.greenImg;
// } else {
// this.isLowerCase.isMatch = false;
// return this.isLowerCase.redImg;
// }
// case 2:
// if (/[A-Z]/.test(this.P_NEW_PASSWORD)) {
// this.isUpperCase.isMatch = true;
// return this.isUpperCase.greenImg;
// } else {
// this.isUpperCase.isMatch = false;
// return this.isUpperCase.redImg;
// }
case 1:
if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
this.isLetterCase.isMatch = true;
return this.isLetterCase.greenImg;
} else {
this.isLetterCase.isMatch = false;
return this.isLetterCase.redImg;
}
case 3:
if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
this.isHasDigit.isMatch = true;
return this.isHasDigit.greenImg;
} else {
this.isHasDigit.isMatch = false;
return this.isHasDigit.redImg;
}
case 4:
if (this.P_NEW_PASSWORD.length >= 8) {
this.isMinLength.isMatch = true;
return this.isMinLength.greenImg;
} else {
this.isMinLength.isMatch = false;
return this.isMinLength.redImg;
}
case 5:
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
this.isRepeatedLetter.isMatch = false;
return this.isRepeatedLetter.redImg;
} else {
this.isRepeatedLetter.isMatch = true;
return this.isRepeatedLetter.greenImg;
}
case 6:
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
this.isContainSpecialChar.isMatch = true;
return this.isContainSpecialChar.greenImg;
} else {
this.isContainSpecialChar.isMatch = false;
return this.isContainSpecialChar.redImg;
}
case 7:
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
this.confirmMatchNew.isMatch = false;
return this.confirmMatchNew.redImg;
} else {
this.confirmMatchNew.isMatch = true;
return this.confirmMatchNew.greenImg;
}
case 8:
if (!this.P_NEW_PASSWORD.includes(this.userId)) {
this.userNameMatchNew.isMatch = true;
return this.userNameMatchNew.greenImg;
} else {
this.userNameMatchNew.isMatch = false;
return this.userNameMatchNew.redImg;
}
}
}
}
disabledSubmitBtn() {
if (this.isLetterCase.isMatch && this.isHasDigit.isMatch && this.isMinLength.isMatch
&& this.isRepeatedLetter.isMatch && this.P_NEW_PASSWORD !== '' && this.P_NEW_PASSWORD
&& this.P_Confirm_NEW_PASSWORD && this.isContainSpecialChar.isMatch && this.confirmMatchNew.isMatch) {
return false;
} else { return true; }
}
showPassword(val) {
if (val == 1)
this.newPasswordIcon = 'password';
else {
this.confirmPasswordIcon = 'password'
}
}
hidePassword(val) {
if (val == 1)
this.newPasswordIcon = 'text';
else {
this.confirmPasswordIcon = 'text'
}
}
}

@ -2,30 +2,31 @@ import { Request } from 'src/app/hmg-common/services/models/request';
export class SendActivationByType extends Request {
P_USER_NAME: string; // id
UserName:string;
UserName: string;
MobileNumber: string; // phone number
ZipCode: string;
LogInTokenID: string;
OTP_SendType:number;
IsMobileFingerPrint:number;
P_LEGISLATION_CODE:string;
OTP_SendType: number;
IsMobileFingerPrint: number;
P_LEGISLATION_CODE: string;
smsSignature: string;
// VersionID:string;
// Test
//{
// "Channel":31,
// "LanguageID":2,
// "LogInTokenID":"Wfm9uDlWhEi3vFsQMqUz3w==",
// "MobileNumber":"0508079569",
// "P_USER_NAME":"191817",
// "UserName":"191817",
// "VersionID":2.0,
// "P_LEGISLATION_CODE":"SA",
// "IsMobileFingerPrint":0,
// "OTP_SendType":1
// }
// Test
//{
// "Channel":31,
// "LanguageID":2,
// "LogInTokenID":"Wfm9uDlWhEi3vFsQMqUz3w==",
// "MobileNumber":"0508079569",
// "P_USER_NAME":"191817",
// "UserName":"191817",
// "VersionID":2.0,
// "P_LEGISLATION_CODE":"SA",
// "IsMobileFingerPrint":0,
// "OTP_SendType":1
// }

@ -1,70 +1,142 @@
<app-generic-header
showBack="true"
[headerText]="'verificationcode,verificationcode' | translate">
showBack="true"
[headerText]="'verificationcode,verificationcode' | translate">
</app-generic-header>
<ion-content padding>
<ion-grid>
<!-- <ion-row>
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row> -->
<br/>
<br/>
<ion-row>
<ion-col>
<p class="headerTxt" > {{'verificationcode,verificationcode' | translate}}</p>
<br/>
<p class="leftDiv">{{'verificationcode,title' | translate}}
<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span>
{{'verificationcode,by' | translate}}
<span *ngIf="loginType == 1 || activeType == 1" class="boldTxtNav">{{'verificationcode , sms' | translate}}, </span>
<span *ngIf="loginType == 4 || activeType == 4" class="boldTxtNav">{{'verificationcode , whatsapp' | translate}}, </span>
{{'verificationcode,instruct' | translate}}
<span class="boldTxtNav">{{'general,submit' | translate}}</span
></p>
<!-- <p class="leftDiv">{{'verificationcode,title' | translate}}<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span> {{'verificationcode,by' | translate}}<span class="boldTxtNav">{{'verificationcode,sms' | translate}}</span>{{'verificationcode,instruct' | translate}}<span class="boldTxtNav">{{'general,submit' | translate}}</span></p> -->
</ion-col>
</ion-row>
</ion-grid>
<br/><br/>
<!-- <p style="color: #c0c0c0; margin-left: 32%">{{'verificationcode.verificationcode' | translate}}</p> -->
<div>
<h1 text-center>{{displayTime}}</h1>
<br/><br/>
<!-- <ion-item>
//<ion-label>{{'verificationcode,verificationcode' | translate}}</ion-label>
// <img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input required type="tel" maxlength="4" (keyup)="checkOTPLength()" placeholder="{{translate.trPK('verificationcode','verificationcode')}}" [(ngModel)]="activationCode"></ion-input>
</ion-item> -->
<ion-row class="sms_code" dir="ltr">
<ion-col [size]="12">
<ion-input type="tel" [(ngModel)]="smc_code[0]" 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" [(ngModel)]="smc_code[1]" 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" [(ngModel)]="smc_code[2]" 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" [(ngModel)]="smc_code[3]" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
<ion-grid>
<!-- <ion-row>
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row> -->
<br/>
<br/>
<ion-row>
<ion-col>
<p class="headerTxt" > {{'verificationcode,verificationcode' | translate}}</p>
<br/>
<p class="leftDiv">{{'verificationcode,title' | translate}}
<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span>
{{'verificationcode,by' | translate}}
<span *ngIf="loginType == 1 || activeType == 1" class="boldTxtNav">{{'verificationcode , sms' | translate}}, </span>
<span *ngIf="loginType == 4 || activeType == 4" class="boldTxtNav">{{'verificationcode , whatsapp' | translate}}, </span>
{{'verificationcode,instruct' | translate}}
<span class="boldTxtNav">{{'general,submit' | translate}}</span
></p>
<!-- <p class="leftDiv">{{'verificationcode,title' | translate}}<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span> {{'verificationcode,by' | translate}}<span class="boldTxtNav">{{'verificationcode,sms' | translate}}</span>{{'verificationcode,instruct' | translate}}<span class="boldTxtNav">{{'general,submit' | translate}}</span></p> -->
</ion-col>
</ion-row>
</ion-grid>
<br/><br/>
<!-- <p style="color: #c0c0c0; margin-left: 32%">{{'verificationcode.verificationcode' | translate}}</p> -->
<div>
<h1 text-center>{{displayTime}}</h1>
<br/><br/>
<!-- <ion-item>
//<ion-label>{{'verificationcode,verificationcode' | translate}}</ion-label>
// <img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input required type="tel" maxlength="4" (keyup)="checkOTPLength()" placeholder="{{translate.trPK('verificationcode','verificationcode')}}" [(ngModel)]="activationCode"></ion-input>
</ion-item> -->
<ion-row class="sms_code" dir="ltr">
<ion-col [size]="12">
<ion-input type="tel" [(ngModel)]="smc_code[0]" maxLength="4" size="4" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()" #ref autofocus="true">
</ion-input>
<ion-input type="tel" [(ngModel)]="smc_code[1]" 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" [(ngModel)]="smc_code[2]" 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" [(ngModel)]="smc_code[3]" 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 *ngIf="showErrorMessage"><p style="color: red; font-weight: bold; font-size: 14px; text-align: center;">{{messageValue}}</p></div>
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="button-login" ion-button (click)="checkVerificationCode()">{{'general,submit' | translate}}</ion-button>
</div>
</ion-footer>
<div class="centerDiv">
<ion-button class="button-login" ion-button (click)="checkVerificationCode()">{{'general,submit' | translate}}</ion-button>
</div>
</ion-footer>

@ -1,325 +1,682 @@
import { Component, OnInit } from '@angular/core';
import { ElementRef } from '@angular/core';
import { NavController, Platform } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request';
import { LoginModel } from '../models/LoginModel';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { Password } from '../models/password';
import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request';
import * as moment from 'moment';
import { NFC } from "@ionic-native/nfc/ngx";
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
@Component({
selector: 'app-sms-page',
templateUrl: './sms-page.page.html',
styleUrls: ['./sms-page.page.scss']
})
export class SmsPageComponent implements OnInit {
public static LOGIN_DATA = 'LOGIN_DATA';
Channel = 0;
activationCode: string;
P_SESSION_ID: number;
P_USER_NAME: string;
timeInSeconds: any;
time: any;
runTimer: any;
hasStarted: any;
hasFinished: any;
remainingTime: any;
displayTime: any;
loginTokenID: string;
public isForgetPwd = false;
public isExpiredPwd = false;
public count = 0;
private loginData = new LoginModel();
public deviceToken: any;
public loginTypeData: any;
public logo = 'assets/icon/login/password.png';
// tslint:disable-next-line: variable-name
public smc_code: any = [];
code: any;
// tslint:disable-next-line: variable-name
user_name: string;
public isPostNoLoad = true;
loginType: any;
activeType: any;
public isNFCAvailable = false;
public showErrorMessage = false;
public messageValue: string;
public businessInfo: object;
public isAutoRead: boolean = false;
constructor(
public navCtrl: NavController,
public translate: TranslatorService,
public common: CommonService,
private elementRef: ElementRef,
public authService: AuthenticationService,
public sharedData: SharedDataService,
public platform: Platform,
private nfc: NFC
) {}
private nfc: NFC,
private smsRetriever: SmsRetriever
) { }
ngOnInit() {
this.checkNFCStatus();
this.activeType=this.common.getActiveTypeLogin();
console.log("active "+ this.common.sharedService.getSharedData('active-type',true));
console.log("activeType :"+this.activeType);
this.activeType = this.common.getActiveTypeLogin();
console.log("active " + this.common.sharedService.getSharedData('active-type', true));
console.log("activeType :" + this.activeType);
this.count = 0;
this.initTimer();
this.startTimer();
this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
this.isExpiredPwd = this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
this.deviceToken = this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// tslint:disable-next-line: triple-equals
if (this.deviceToken == undefined) {
this.deviceToken = localStorage.getItem('deviceToken');
}
console.log('deviceToken :' + this.deviceToken);
this.loginTypeData = this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false);
if( this.loginTypeData){
this.loginType=this.loginTypeData.loginType;
console.log("loginType :"+this.loginTypeData.loginType);
}else{
this.loginType=1;
}
if (this.loginTypeData) {
this.loginType = this.loginTypeData.loginType;
console.log("loginType :" + this.loginTypeData.loginType);
} else {
this.loginType = 1;
}
this.smsRetriever.startWatching()
.then((res: any) => this.checkActivation(res, true))
.catch((error: any) => console.error(error));
}
checkActivation(res, isAndroid) {
this.isAutoRead = true;
var pattern = /\d+/g;
if (isAndroid)
var code = res.Message.match(pattern)[0];
else
var code = res;
this.activationCode = code
this.smc_code = code.split('');
this.checkVerificationCode();
}
initTimer() {
if (!this.timeInSeconds) {
this.timeInSeconds = 600;
this.timeInSeconds = 120;
}
this.time = this.timeInSeconds;
this.runTimer = false;
this.hasStarted = false;
this.hasFinished = false;
this.remainingTime = this.timeInSeconds;
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
}
startTimer() {
this.runTimer = true;
this.hasStarted = true;
this.timerTick();
}
pauseTimer() {
this.runTimer = false;
}
resumeTimer() {
this.startTimer();
}
timerTick() {
setTimeout(() => {
if (!this.runTimer) {
return;
}
this.remainingTime--;
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
if (this.remainingTime > 0) {
this.timerTick();
} else {
this.hasFinished = true;
this.pauseTimer();
this.navCtrl.pop();
}
}, 1000);
}
ionViewWillLeave() {
this.pauseTimer();
}
checkOTPLength() {
// tslint:disable-next-line: triple-equals
if (this.activationCode.length == 4) {
this.checkVerificationCode();
}
}
checkVerificationCode() {
this.code = this.smc_code.join('');
if (this.count < 3) {
// tslint:disable-next-line: triple-equals
if (this.code == undefined || this.code == null || this.code == '') {
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
} else {
this.count = this.count + 1;
if (this.isForgetPwd || this.isExpiredPwd) {
this.checkForgetPwdSMS();
} else {
this.checkSMS();
}
}
} else {
const msg: string = this.translate.trPK('general', 'noOfTriesLogin');
this.common.JustAlertDialog(this.translate.trPK('general', 'ok'), msg);
}
}
async checkNFCStatus() {
try {
let nfcStatus = await this.nfc.enabled();
console.log("nfc status >>>>>>>>>>" + nfcStatus);
this.isNFCAvailable = true;
} catch (err) {
console.log("Error reading tag", err);
if (err === "NO_NFC") {
this.isNFCAvailable = false;
} else if (err === "NFC_DISABLED") {
this.isNFCAvailable = true;
this.isNFCAvailable = true;
} else {
this.isNFCAvailable = false;
}
}
}
public checkSMS() {
this.showErrorMessage = false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.code; // code;this.activationCode;
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'), true).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
//save business card info
this.businessInfo = {
show_business: result.BusinessCardPrivilege,
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
job_en: result.MemberInformationList[0].JOB_NAME_En,
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
qr: result.MemberInformationList[0].BusinessCardQR,
company_logo: result.BC_Logo ? result.BC_Logo: result.CompanyImageURL,
company_url: result.BC_Domain,
company_type: result.CompanyMainCompany,
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
}
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME;
const currDateTime = moment().format('MMM DD , YYYY HH:mm');
localStorage.setItem('login-at', currDateTime);
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);
this.showErrorMessage = false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.code; // code;this.activationCode;
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'), true).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
//save business card info
this.businessInfo = {
show_business: result.BusinessCardPrivilege,
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
job_en: result.MemberInformationList[0].JOB_NAME_En,
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
qr: result.MemberInformationList[0].BusinessCardQR,
company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL,
company_url: result.BC_Domain,
company_type: result.CompanyMainCompany,
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
}
});
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME;
const currDateTime = moment().format('MMM DD , YYYY HH:mm');
localStorage.setItem('login-at', currDateTime);
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);
}
});
}
public insertMobileLogin() {
const request = new GetLoginInfoRequest();
this.authService.setPublicFields(request);
request.MobileNumber = this.loginData.MobileNumber;
request.P_USER_NAME = this.loginData.P_USER_NAME;
request.UserName = this.loginData.P_USER_NAME;
request.LogInTokenID = this.loginData.LogInTokenID;
request.CompanyID = 1; // CompanyID
request.DeviceType = this.common.getDeviceType();
request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
request.LoginType = this.loginTypeData.loginType;
request.EmployeeName = this.user_name;
this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad)
.subscribe((result: any) => {
console.log('successful insertMobileLogin' );
});
const request = new GetLoginInfoRequest();
this.authService.setPublicFields(request);
request.MobileNumber = this.loginData.MobileNumber;
request.P_USER_NAME = this.loginData.P_USER_NAME;
request.UserName = this.loginData.P_USER_NAME;
request.LogInTokenID = this.loginData.LogInTokenID;
request.CompanyID = 1; // CompanyID
request.DeviceType = this.common.getDeviceType();
request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
request.LoginType = this.loginTypeData.loginType;
request.EmployeeName = this.user_name;
this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad)
.subscribe((result: any) => {
console.log('successful insertMobileLogin');
});
}
public checkForgetPwdSMS() {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.code; // this.activationCode;
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();
}
if (this.isExpiredPwd) {
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
this.common.openChangePassword();
}
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();
}
});
if (this.isExpiredPwd) {
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
this.common.openChangePassword();
}
}
});
}
onChange() {
// tslint:disable-next-line: only-arrow-functions
const filtered = this.smc_code.filter(function(el) {
const filtered = this.smc_code.filter(function (el) {
if (el) {
return el;
}
});
if (filtered.length === 4) {
if (filtered.length === 4 && !this.isAutoRead) {
this.checkVerificationCode();
}
}
goToNextInput(e) {
const key = e.which;
const t = e.target;
const sib = t.nextElementSibling;
const sibPre = t.previousElementSibling;
if (key === undefined && (this.platform.is('ios') && !this.platform.is('mobileweb'))) {
this.checkActivation(e.target.value, false);
}
if (key !== 9 && (key < 48 || key > 57)) {
if (key === 8 || key === 46) {
return true;
} else {
e.preventDefault();
return false;
}
}
if (key === 9) {
return true;
}
if (sib) {
if (e.target.value === '') {
sibPre.setFocus();
} else {
sib.setFocus();
}
}
}
}

@ -0,0 +1,24 @@
<app-generic-header
showBack="!getPassdirfromNotifiPage"
[updateDirection]="getPassdirfromNotifiPage"
[headerText]="headerTitle"
(trigger)="closeModal()"
>
</app-generic-header>
<ion-content padding>
<ion-item class="country dynamicField" lines="none" *ngIf="showEffectiveDate">
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-label>{{showEffectiveDate}}</ion-label>
</ion-item>
<div #containerDiv id="containerDiv">
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="submitChildEducationTransaction()">
{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,45 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
ion-label {
color: var(--customnavy) !important;
}
.daynamicForm-Label {
font-size: 16px;
color: #a2a5a6 !important;
display: block;
overflow: hidden;
-webkit-flex: 1;
flex: 1;
font-size: inherit;
white-space: normal;
padding: 5px 0px;
margin: 10px auto;
padding-left: 10px;
}
.header-toolbar-new{
--background: #269DB8;
}
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.country{
margin-top: 10px;
padding: 10px;
}

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

File diff suppressed because it is too large Load Diff

@ -0,0 +1,69 @@
<app-generic-header
showImage="false"
showBack="true"
[headerText]="'eit,cei' | translate">
</app-generic-header>
<ion-content style="--background: #f5f5f5;">
<!-- <div class="head-title">
</div> -->
<div padding>
<ion-radio-group [(ngModel)]="selectedServiceType">
<ion-item *ngFor="let user of familyMemberData" lines='none'
style="padding-bottom: 10px; border-radius: 10px 10px 25px 25px;">
<ion-grid>
<ion-row>
<ion-col size='6'>
<h2 style="font-weight: bold; font-size: 15px;">{{user.CONTACT_NAME}}</h2>
</ion-col>
<ion-col size='6'>
<div class='family-member-button'>
<ion-label>
<p style="white-space: pre-line; font-size: 11px;">{{ts.trPK('eit','relationship-start-date')}}</p>
</ion-label>
<ion-label>
<p style="color: black;">12/31/2022</p>
</ion-label>
</div>
</ion-col>
</ion-row>
<ion-row>
<ion-col size='6'>
<ion-label>
<p style="font-weight: bold; font-size: 14px; white-space:pre-wrap">{{user.RELATIONSHIP}}</p>
</ion-label>
</ion-col>
<ion-col size='6'>
<div class='family-member-button'>
<ion-label>
<p style="white-space: pre-line; font-size: 11px;">{{ts.trPK('eit','relationship-end-date')}}</p>
</ion-label>
<ion-label>
<p style="color: black;">12/31/2022</p>
</ion-label>
</div>
</ion-col>
</ion-row>
</ion-grid>
<ion-radio mode="md" slot="start" [value]="user" [color]="myColor" (click)='selectedUser(user)'></ion-radio>
</ion-item>
</ion-radio-group>
</div>
</ion-content>
<ion-footer class="footer">
<div class="Btn">
<ion-button class="CreateBtn" (click)="gotoTransactionsPage()" >{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
</ion-footer>
<!-- <ion-footer style="background: #f5f5f5 !important;">
<div class="centerDiv" (click)="gotoTransactionsPage()">
<ion-button ion-button style="background: #269db8 !important; --background: #269db8">
{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
</ion-footer> -->

@ -0,0 +1,40 @@
@media screen and (min-width: 300px){
.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:290px) {
.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: 257px;
font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}}
.footer{
padding: 15px 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;
}

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

@ -0,0 +1,51 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { EitService } from '../services/eit.service';
@Component({
selector: 'app-cei-homepage',
templateUrl: './cei-homepage.component.html',
styleUrls: ['./cei-homepage.component.scss'],
})
export class CeiHomepageComponent implements OnInit {
public familyMemberData;
public selectedServiceType;
public direction: string;
myColor: string = 'secondary';
constructor(
private eitService: EitService,
public ts: TranslatorService,
public cs: CommonService
) {}
ngOnInit() {
this.getContactInfo();
}
public getContactInfo () {
this.eitService.getContactInfo({
P_MENU_TYPE: 'E',
P_SELECTED_RESP_ID: -999
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
if (this.cs.validResponse(response)) {
this.familyMemberData = response['GetEmployeeContactsList'];
this.selectedServiceType = this.familyMemberData[0];
console.log(this.familyMemberData);
}
});
}
public gotoTransactionsPage() {
console.log(this.selectedServiceType);
this.cs.sharedService.setSharedData(this.selectedServiceType, 'selectedContactFORChildEducation');
this.cs.openCEIListPage();
}
public selectedUser(user){
this.selectedServiceType = user;
}
}

@ -0,0 +1,42 @@
<app-generic-header
showBack="true"
[headerText]="headerTitle">
</app-generic-header>
<ion-content>
<div>
<div class="no-dataDiv"
*ngIf="!getResCEITransactionList || getResCEITransactionList[0]?.Collection_Transaction.length <= 0">
<ion-row>
<img class="empty-data" src="../assets/imgs/box.png" />
</ion-row>
<h4> {{'general, noData' | translate}}</h4>
</div>
<div *ngIf="getResCEITransactionList && getResCEITransactionList[0]?.Collection_Transaction.length > 0 ">
<div *ngFor="let EITTransactionList of getResCEITransactionList; let i=index ">
<ion-grid>
<div>
</div>
<ion-grid class="grids">
<div *ngFor="let item of EITTransactionList.Collection_Transaction">
<ion-row *ngIf="item.DISPLAY_FLAG != 'N' " class="">
<ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''">
<label style="color:#269DB8;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label>
<br>
<label class="label" style="color:black;" for="">{{item.SEGMENT_VALUE_DSP}} </label>
<br>
<hr style="background-color: grey;height: 1px">
</ion-col>
</ion-row>
</div>
</ion-grid>
</ion-grid>
</div>
<div>
</div>
</div>
</div>
</ion-content>
<ion-icon class="addClass" name="add" (click)="addCEIRrq()"></ion-icon>

@ -0,0 +1,330 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
.datetime{
text-align: center;
font-family: WorkSans-Bold;
margin-left: 47px;
margin-top: -19px;
}
.iconCalendar{
margin-left: 30px !important;
width: 22% !important;
height: 26px !important;
margin-top: -69px !important;
margin-bottom: 20px !important;
}
h4 {
font-size: 2.2rem;
text-align: center;
color: #000000;
}
.grids{
border-radius: 20px !important;
background: white;
padding-left: 1px;
padding-right: 1px;
margin: 13px;
padding-top: 0px;
padding-bottom: 3px;
padding-left: 13px;
padding-right: 13px;
border: 1px solid #cac8c8;
}
.bgcolor {
color: white;
border-top-right-radius: 19px;
border-top-left-radius: 15px;
padding-top: 1;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
/* border-radius: 12px !important; */
background: #269DB8;
border-bottom: 1px solid #a7a4a4;
border-top: 1px solid #cac8c8;
margin-left: -13px;
margin-right: -13px;
}
.colEit{
border-right: 1px solid #cac8c8;
border-bottom-left-radius: -10px !important;
padding-top: 8px;
padding-bottom: 8px;
margin-left: 18px;
font-size: 12px !important;
}
.header-div {
background-color: #269DB8;
text-transform: capitalize;
height: 160px;
// position: relative;
display: block;
margin-bottom: -28px;
}
.header-toolbar-new{
--background: #269DB8;
}
.addClass{
background-color: #269DB8;
width: 80px;
height: 80px;
right: 8%;
position: fixed;
color: white;
bottom: 5%;
border-radius: 50%;
z-index: 999;
-webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
-moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
}
.contentEit:before {
position: absolute;
content: "";
// background: #269DB8;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
.hrClass{
border-width: 0;
box-sizing: content-box;
border-bottom: 1px solid #e6e6e6;
background: #fff !important;
height: 1px;
}
////////////////////////////////
.content:before {
position: absolute;
content: "";
background: #269DB8;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
.colorBG{
--background: #f0efef;
}
.Title{
text-align: center;
color: white;
margin-top: -33px;
font-size: 17px;
}
.title{
text-align: center;
color: black;
margin-top: 5px;
font-size: 17px;
}
.today-graph{
display: block !important;
height: 196px;
width: 365px;
/* padding-left: 51px; */
margin-left: 28px !important;
}
.headerGrid{
background-color: white !important;
border: 1px solid #cac8c8 !important;
padding-bottom: 53px;
padding-top: -30px;
margin-left: 13px;
margin-right: 13px;
margin-bottom: 10px;
position: relative;
z-index: 1;
border-radius: 20px;
margin-top: 17px;
}
.result-graph{
font-size: 14px;
margin-left: -48px;
margin-right: 3px;
margin-bottom: -30px;
}
.green-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: 42px;
}
.green-label-ar{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: 15px;
}
.blue-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: 13px;
}
.light-label{
font-size: 15px !important;
margin-left: 7px !important;
margin-right: -26px;
}
.light-label-ar{
font-size: 15px !important;
margin-right: 7px !important;
margin-left: -26px;
}
.light-dote{
background-color: #3CB9D5;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
}
.blue-dote{
background-color: #269DB8;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
}
.green-dote{
background-color: #1FA269;
width: 12px;
height: 12px;
border-radius: 50% !important;
display: inline-block;
margin-right: -1px;
}
.col{
text-align: right;
}
.gridService{
/* margin-top: 87px; */
border-radius: 10px;
/* margin-bottom: -49px; */
margin-left: 14px;
margin-right: 14px;
}
.columns{
margin: 3px;
margin-bottom: 13px;
background: white;
border-radius: 27px;
padding-left: 30px;
padding-right: 6px;
padding-top: 19px;
padding-bottom: 8px;
border: 1px solid #cac8c8 !important;
}
.service{
font-size: 22px;
color: black;
letter-spacing: 1px;
font-weight: bold;
}
.services{
font-size: 12px;
color: black;
}
.adult-dote{
background-color: #3CB9D5;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
}
.adult-dote-ar{
background-color: #3CB9D5;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-right: 0px;
margin-left: 5px;
}
.child-dote{
background-color: #269DB8;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
}
.child-dote-ar{
background-color: #269DB8;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-right: 1px;
margin-left: 5px;
}
.infants-dote{
background-color: #1FA269;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-left: -17px;
margin-right: 5px;
// margin-bottom: 6px;
}
.infants-dote-ar{
background-color: #1FA269;
width: 15px;
height: 15px;
border-radius: 50% !important;
display: inline-block;
margin-right: 1px;
margin-left: 5px;
}
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}

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

@ -0,0 +1,127 @@
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { EITTransactionsRequest } from './../models/EITTransactionsReq';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { Component, OnInit } from '@angular/core';
import { EitService } from '../services/eit.service';
import { EIT_ACTION } from '../models/submit.eit.action';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
@Component({
selector: 'app-cei-list',
templateUrl: './cei-list.component.html',
styleUrls: ['./cei-list.component.scss'],
})
export class CeiListComponent implements OnInit {
Sdate: any;
emp_no: any;
balance:any;
P_PAGE_NUM: number;
P_PAGE_LIMIT: number;
IsReachEnd = false;
userName: any;
isDelete = false;
getResCEITransactionList: any = [];
eitAddedList: any = [];
getPassMnuEntryObj: any;
selMenu: MenuResponse = new MenuResponse();
CEITransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest();
selEmp: string;
respID: number;
transactionNo = 0;
menuType = '';
public functionName = '';
private pAction = 0;
public headerTitle = '';
data: any;
accrualNetInfants: any;
accrualUNetChild: any;
accrualNetAdult: any;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }};
gaugeType = 'full';
accrualBalancesList: any;
common: any;
direction: string;
constructor(
private cs: CommonService,
private EITService: EitService,
public ts: TranslatorService,
public authService:AuthenticationService,) {
this.direction = TranslatorService.getCurrentLanguageName();
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList;
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.transactionNo = 0;
this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 100;
}
ngOnInit() {
this.getCEITransactions();
}
public getCEITransactions() {
this.IsReachEnd = false;
this.CEITransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.CEITransactionsListObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
this.CEITransactionsListObj.P_SELECTED_RESP_ID = this.respID;
this.CEITransactionsListObj.P_MENU_TYPE = this.selMenu.List_Menu.MENU_TYPE;
this.CEITransactionsListObj.P_FUNCTION_NAME = this.getPassMnuEntryObj.FUNCTION_NAME;
this.EITService.getCEITransactionsList(this.CEITransactionsListObj).
subscribe((result: any) => {
this.handleCEITransactionsResult(result);
});
}
public handleCEITransactionsResult(result) {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.GetEITTransactionList)) {
this.getResCEITransactionList = result.GetEITTransactionList;
this.P_PAGE_NUM++;
this.CEITransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
const lastItemIndex = this.getResCEITransactionList.length - 1;
if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) {
const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
// tslint:disable-next-line: triple-equals
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
}
}
}
}
public addCEIRrq(i?) {
this.pAction = EIT_ACTION.ADD;
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
this.openCEINew(i);
}
openCEINew(index) {
let item: any = [];
if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResCEITransactionList[index].Collection_Transaction;
}
this.transactionNo++;
// tslint:disable-next-line: max-line-length
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddCEIPage();
}
}

@ -0,0 +1,127 @@
<ion-header>
<ion-toolbar class="header-toolbar-new">
<nav-buttons></nav-buttons>
<ion-title [ngClass]=" direction === 'en' ? 'title' : 'title-ar'" color="light">{{headerTitle}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<!-------------------------------Start New design ---------------------------------------->
<ion-grid>
<ion-row style="margin-top: 20px;margin-left: 12px;">
<ion-col>
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'" >{{'general, addAttach' | translate}}</div>
</ion-col>
<ion-col style="padding-left: 7%;" size="2">
<div class="fileDiv">
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
<label end for="file" class="attachLable">
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
</label></div>
</ion-col>
</ion-row>
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
</ion-item>
</ion-grid>
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col size="1">
<ion-label style="color: black !important;">
{{attachList.AttachmentID +1 }} .
</ion-label>
</ion-col>
<ion-col style="text-align: left;" size="10">
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
{{attachList.P_FILE_NAME }}
</ion-label>
</ion-col>
<ion-col size="1">
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
(click)="removeFile(attachList)">
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
</button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col col-8>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid class="">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
<ion-item class="submitNote" lines="none">
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
</ion-item>
</ion-grid>
<ion-grid class="approvalList">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
<div class="noDataDiv" *ngIf="approversList?.length == 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
<div class="timeline-item" slot="start">
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
{{employee.APPROVER}}
</ion-label>
<ion-label style="color:black !important ;padding-top: 4%;">
{{employee.POSITION_TITLE}}
</ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
</ion-grid>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="confirmEitOkButton" color="customnavy" ion-button (click)="openSubmitModal()">
{{ (isDelete ? 'general, delete' : 'general, submit') | translate }}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,263 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
.imgSize {
width: 22px;
height: 22px;
}
.Header {
font-weight: bold;
color: #1a586d !important;
font-size: 10px;
}
.tbData {
font-size: 10px;
}
.btnBack {
background: transparent;
float: right;
}
.attachmentDiv{
background: #ffffff;
height: auto;
text-align: center;
padding-top: 1px;
margin: 10px;
border-radius: 15px;
border: 1px solid grey;
}
.noDataDiv{
background: #ffffff;
height: 11%;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
border-radius: 5px;
}
.submitNote{
background: #ffffff;
height: 80px;
padding-top: 1px;
margin: 10px;
border-radius: 15px;
border: 1px solid grey;
}
.approvalList{
--background: #f0efef;
height: auto;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
border-radius: 5px;
}
/************************New Design**********************************/
.notification-list{
background: none;
background: none;
border-radius: 32px;
ion-item{
// margin-top: 5px;
// margin-bottom: 5px;
background-color: transparent;
.item-date{
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: start;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 12%;
}
ion-label , [item-end]{
white-space: normal;
font-size: 14px;
padding-top: 15%;
// :root[dir="ltr"]{
// margin-left: 10px;
// }
// :root[dir="rtl"]{
// margin-right: 10px;
// }
}
}
}
.timeline {
position: relative;
margin: 15px 0 0 0;
// border-bottom: solid 1px var(--cusgray);
}
.timeline:before {
content: '';
position: inherit !important;
top: 0;
bottom: 0;
width: 4px;
// background: #e4e4e4;
z-index: 1;
left: 35px;
/* margin-left: -10px; */
/* z-index: 1; */
}
.timeline .timeline-thumb {
border-radius: 500px;
width: 70px !important;
z-index: 2;
position: absolute;
left: 0px;
// :root[dir="ltr"]{
// left: 37px;
// }
// :root[dir="rtl"]{
// right: 37px;
// }
float: right;
top: 9px;
}
.timeline .timeline-thumb.timeline-icon {
height: 70px;
// text-align: center;
// color: white;
// border: 5px solid #CBD0D3;
// transform: scale(0.2);
}
.timeline .timeline-item {
width: 40px;
}
.timeline .timeline-stats {
position: relative;
font-size: 12px;
color: var(--darkgray);
}
.empImge{
border-radius: 50%;
width:100%;
height: 100%;
border: #dedede solid 1px;
}
.empImgeRep {
border-radius: 50% !important;
width: 80px;
height: 80px;
border: #dedede solid 1px;
}
.line{
padding-bottom:87px;
}
.attachLable{
position: absolute;
top: 0px;
z-index: 0;
background: #30b8c6;
color: #fff;
border-radius: 50%;
border: 0px;
width: 24px;
height: 24px;
text-align: center;
font-size: 5px;
}
.removeLable{
top: 0px;
z-index: 0;
background: #d8252d;
color: #fff;
border-radius: 50%;
border: 0px;
width: 20px;
height: 20px;
text-align: center;
font-size: 5px;
}
.note-modal {
// width: 90%;
// height: 50%;
// top: 20%;
// left: 5%;
// right: 5%;
// bottom: 5%;
background: rgba(0, 0, 0, 0.5) !important;
padding: 30% 10% !important;
--height: 12cm !important;
// --width: 80% !important;
--border-radius:20px;
}
.header-toolbar-new{
--background: #269DB8;
}
.title{
margin-top: -37px;
margin-left: 85px;
}
.title-ar{
margin-top: -37px;
margin-right: 101px;
}
.confirmEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.approvalTitle-ar{
font-weight: bold;
font-size: 16px;
text-align: right;
}
.approvalTitle{
font-weight: bold;
font-size: 16px;
text-align: left;
}

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

@ -0,0 +1,444 @@
import { WorkListAttachViewComponent } from './../../notification/work-list-attach-view/work-list-attach-view.component';
import { AddAttachComponent } from './../add-attach/add-attach.component';
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
import { EITNotificatonBodyResponse } from './../models/EITNotificationBodyRes';
import { WorkListButtonRequest } from './../models/NotificationButtonReq';
import { ApproversList } from './../../absence/models/approvers';
import { CeiRequest } from './../models/cei.request';
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { ModalController } 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 { EitService } from '../services/eit.service';
import { AddCeiResponse } from '../models/add.cei.response';
import { FileUploader } from 'ng2-file-upload';
import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component';
@Component({
selector: 'app-confirm-add-cei',
templateUrl: './confirm-add-cei.component.html',
styleUrls: ['./confirm-add-cei.component.scss'],
})
export class ConfirmAddCeiComponent implements OnInit {
private P_TransactionID: number;
private ceiRequest: CeiRequest;
approversList = [];
addrespList: any;
eitComments: string = "";
menuType: string = "";
selEmp: string = "";
respID: number;
selMenu: MenuResponse;
getAttachList: any;
attachListDisplay: any = [];
headerTitle: string = "";
isTrue: any = 0;
attachItems: any;
public isResubmitEIT: boolean = false;
private itemKey: string = "";
private pActionMode: string = "SUBMIT";
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
attachmentRes: any;
objIndex1: any;
attachListOver: any = [];
index: any = 0;
getPassNotificationDetails: any;
isSubmitBtnClicked: boolean;
isDelete: boolean = false;
isUpload: boolean = false;
inQueue: boolean = false;
addAttachmentListReq: any;
attachmentID: number = 0;
addAttachRequest: any = [];
fileData: any;
fileType: any;
dirPage: any;
TransactionID: any;
indexLastObj: any = 0;
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
direction: string;
constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) {
this.direction = TranslatorService.getCurrentLanguageName()
this.isSubmitBtnClicked = false;
this.ceiRequest = new CeiRequest();
}
ngOnInit() {
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.ceiRequest = this.cs.sharedService.getSharedData(CeiRequest.SHARED_DATA, false);
// this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING **
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
this.pActionMode = "RESUBMIT";
this.menuType = "E";
this.respID = -999;
this.selEmp = this.ceiRequest.P_SELECTED_EMPLOYEE_NUMBER;
this.getApproversList();
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "update-title");
this.headerTitle = msg;
} else {
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.addrespList = this.cs.sharedService.getSharedData(AddCeiResponse.SHARED_DATA);
this.itemKey = this.addrespList.SubmitCEITransactionList.P_ITEM_KEY;
this.P_TransactionID = this.addrespList.SubmitCEITransactionList.P_TRANSACTION_ID;
// this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
this.getApproversList();
}
}
getApproversList() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: "SSHRMS",
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000
}
this.eitService.getApproversList(
body).
subscribe((result: any) => {
this.handleApproversResult(result);
});
}
handleApproversResult(result) {
if (this.cs.validResponse(result)) {
this.approversList = result.GetApprovesList;
}
}
startCeiApproval() {
if (this.attachListOver) {
let request = {
AddAttachmentList: this.attachListOver
}
this.eitService.addAttachment(
request).
subscribe((result: any) => {
this.handleAddAttachmentResults(result);
});
} else {
this.startCeiApprovalProcess();
}
}
handleAddAttachmentResults(result) {
if (this.cs.validResponse(result)) {
//this.isUpload=true;
this.isTrue = 0;
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
if (!result.AddAttSuccessList[i].AddSuccess) {
this.attachListOver[i].isSuccess = false;
// if false display cancel button with waring icon or design
}// end if
else {
// if true remove cancel and set isSuccess = true
this.attachListOver[i].isSuccess = true;
this.isTrue = this.isTrue + 1; //count flag of attach status
} // end else
} // end for
if (this.isTrue == result.AddAttSuccessList.length) {
this.startCeiApprovalProcess();
}
else {
//stope
let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
this.attachListOver = filtered;
let msg: string = "";
msg = this.ts.trPK("eit", "attach-errorMsg");
this.cs.presentAlert(msg);
}
}
}
startCeiApprovalProcess() {
let request: any = {};
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
request.P_MENU_TYPE = this.menuType;
request.P_SELECTED_RESP_ID = this.respID;
request.P_TRANSACTION_ID = this.P_TransactionID;
request.P_ITEM_KEY = this.itemKey;
request.P_ACTION_MODE = this.pActionMode;
request.P_COMMENTS = this.eitComments;
this.eitService.startCeiApprovalProcess(
request).
subscribe((result: any) => {
this.handleResults(result);
});
}
cancelEitProcess() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID
}
this.eitService.cancelHRTransaction(
body).
subscribe((result: any) => {
this.handleCancelResults(result);
});
}
handleCancelResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = false;
}
}
handleResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = true;
let msg: string = this.ts.trPK("eit", "approval-message-success");
this.cs.presentAlert(msg);
this.cs.openNotificationPage();
}
}
async addAttachment(str: boolean, attachItems: any) {
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID');
this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj');
const modal = await this.modalController.create({
component: AddAttachComponent
});
modal.onDidDismiss()
.then((data) => {
if (data == "cancel" || data == "undefined") {
return;
} else {
if (!str) {
this.updateFile(data, attachDocID);
} else {
console.log(data);
this.attachListDisplay = data.data;
this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el);
o.isSuccess = false;
return o;
});
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
}
}
});
return await modal.present();
}
/*****submit modal********/
async openSubmitModal() {
this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList');
this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
const modal = await this.modalController.create({
component: SubmitEitModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
this.startCeiApproval();
}
});
return await modal.present();
}
removeFile(objectitem) {
if (this.attachListOver) {
let index2 = this.attachListOver.findIndex(item => item == objectitem);
if (index2 > -1) {
this.attachListOver.splice(index2, 1);
}
}
if (this.attachmentRes) {
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
if (index3 > -1) {
this.attachmentRes.splice(index3, 1);
}
}
}
getAttachment(NotificationID) {
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
this.eitService.getAttach(this.attachReqObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
});
}
handleWorkListAttachResult(result) {
if (this.cs.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
async OpenAttachFiles(value, Type) {
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
const modal = await this.modalController.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss()
.then((data) => {
});
return await modal.present();
}
delelteFile(attach) {
this.cs.confirmAlertDialog((data) => {
if (data == true) {
this.continueDelete(attach);
}
}, this.ts.trPK('general', 'ok'), () => {
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
}
continueDelete(attach) {
let req = {
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
}
this.eitService.deleteAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "deleteAttach");
this.cs.presentAlert(msg);
}
}
});
}
updateFile(attachList, attachDocID) {
let req = {
P_ATTACHED_DOCUMENT_ID: attachDocID,
P_FILE_DATA: attachList[0].P_FILE_DATA,
P_FILE_NAME: attachList[0].P_FILE_NAME,
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
}
this.eitService.updateAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
let msg: string = "";
msg = this.ts.trPK("eit", "attachUpdate");
this.cs.presentAlert(msg);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
}
} // val
});
}
ionViewWillLeave() {
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
this.cancelEitProcess();
}
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()
});
});
}
});
onFileSelectedclick(event){
event.target.value = '';
}
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "notSupport");
this.cs.presentAlert(msg);
return
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
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) {
try {
let array = name.split('.');
let attachType: string = array[array.length - 1];
this.attachListOver.push(
{
AttachmentID: this.attachListOver.length,
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
P_FILE_DATA: fileData.split(',')[1],
P_FILE_NAME: name,//.split('.')[0],
P_TRANSACTION_ID: this.P_TransactionID
})
} catch (e) {
}
}
}

@ -14,7 +14,10 @@ import { DatePicker } from '@ionic-native/date-picker/ngx';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import { EitUpdateListComponent } from './eit-update-list/eit-update-list.component';
import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component';
import { CeiHomepageComponent } from './cei-homepage/cei-homepage.component';
import { CeiListComponent } from './cei-list/cei-list.component';
import { AddCeiComponent } from './add-cei/add-cei.component';
import { ConfirmAddCeiComponent } from './confirm-add-cei/confirm-add-cei.component';
const routes: Routes = [
{
@ -48,7 +51,23 @@ const routes: Routes = [
{
path: 'eit-submit-modal',
component: SubmitEitModalComponent
}
},
{
path: 'cei-homepage',
component: CeiHomepageComponent
},
{
path: 'cei-list',
component: CeiListComponent
},
{
path: 'add-cei',
component: AddCeiComponent
},
{
path: 'confirm-cei',
component: ConfirmAddCeiComponent
},
]
}
];
@ -69,7 +88,11 @@ const routes: Routes = [
ConfirmAddEitComponent,
AddAttachComponent,
EitUpdateListComponent,
SubmitEitModalComponent
SubmitEitModalComponent,
CeiHomepageComponent,
CeiListComponent,
AddCeiComponent,
ConfirmAddCeiComponent
],
entryComponents: [
WorkListAttachViewComponent

@ -2,6 +2,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { TerminationServiceService } from 'src/app/termination/service/termination-service.service';
@Component({
selector: 'app-home',
@ -19,7 +20,7 @@ export class HomeComponent implements OnInit {
direction: string;
pageType: string;
constructor(private cs: CommonService, private ts: TranslatorService) {
constructor(private cs: CommonService, private ts: TranslatorService, public terminationService: TerminationServiceService) {
this.direction = TranslatorService.getCurrentLanguageName();
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false);
@ -45,6 +46,11 @@ export class HomeComponent implements OnInit {
this.selectedMenu = index;
}
}
if (page['FUNCTION_NAME'] == 'HR_TERM_SS' || page['FUNCTION_NAME'] == 'HR_TERM_EMP_SS') {
this.cs.sharedService.setSharedData(page, TerminationServiceService.TERMINATION_PAGE);
this.cs.openTermination();
}
console.log('selected>>>>>>>' + this.selectedMenu);
}
@ -59,8 +65,10 @@ export class HomeComponent implements OnInit {
this.cs.openEitListPage();
} else if (menuEntry.REQUEST_TYPE === 'BASIC_DETAILS') {
this.cs.openProfile('basicDetails');
} else if (menuEntry.REQUEST_TYPE === 'ADDRESS') {
this.cs.openProfile('address');
} else if (menuEntry.REQUEST_TYPE === 'ADDRESS' || menuEntry.REQUEST_TYPE === 'PHONE_NUMBERS') {
this.cs.openProfile('contact');
} else if (menuEntry.REQUEST_TYPE === 'CONTACT') {
this.cs.openProfile('family');
}
if (menuEntry.REQUEST_TYPE === 'PAYSLIP') {
this.cs.openPayslipPage();
@ -68,6 +76,9 @@ export class HomeComponent implements OnInit {
if (menuEntry.REQUEST_TYPE === 'TIME_CARD') {
this.cs.openTimeCardPage();
}
if (menuEntry.REQUEST_TYPE === 'CEI') {
this.cs.openCEIPage();
}
}
}

@ -0,0 +1,8 @@
import { Response } from '../../hmg-common/services/models/response';
import { EitRespModel } from './eit.response.model'
export class AddCeiResponse extends Response {
public static SHARED_DATA = 'add-cei-response';
SubmitCEITransactionList: EitRespModel;
}

@ -3,6 +3,7 @@ import { EitRespModel } from './eit.response.model'
export class AddEitResponse extends Response {
public static SHARED_DATA = 'add-eit-response';
public static isContact = 'isContact';
SubmitEITTransactionList: EitRespModel;
}

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

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

@ -5,6 +5,7 @@ import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AddEitResponse } from '../models/add.eit.response';
import { AddCeiResponse } from '../models/add.cei.response';
import { ApproversList } from 'src/app/absence/models/approvers';
import { WorkListButtonRequest } from '../models/NotificationButtonReq';
@ -16,19 +17,24 @@ export class EitService {
/* EIT Services URLs */
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS';
public static getCEITransctions = 'Services/ERP.svc/REST/GET_CEI_TRANSACTIONS';
public static getEITDFFStrutre = 'Services/ERP.svc/REST/GET_EIT_DFF_STRUCTURE';
public static getCEIDFFStrutre = 'Services/ERP.svc/REST/GET_CEI_DFF_STRUCTURE';
public static getSetValue = 'Services/ERP.svc/REST/GET_VALUE_SET_VALUES';
public static getDefaultValue = 'Services/ERP.svc/REST/GET_DEFAULT_VALUE';
public static validateEITTransctions = 'Services/ERP.svc/REST/VALIDATE_EIT_TRANSACTION';
public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION';
public static submitCEI = 'Services/ERP.svc/REST/SUBMIT_CEI_TRANSACTION';
public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS';
public static startCeiProcess = 'Services/ERP.svc/REST/START_CEI_APPROVAL_PROCESS';
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
public static getContactInfo = 'Services/ERP.svc/REST/GET_EMPLOYEE_CONTACTS';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
@ -49,6 +55,13 @@ export class EitService {
return this.con.post(EitService.getEITTransctions, request, onError, errorLabel);
}
// tslint:disable-next-line: no-shadowed-variable
public getCEITransactionsList(EITTransactionsRequest: EITTransactionsRequest, onError?: any, errorLabel?: string): Observable<any> {
const request = EITTransactionsRequest;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getCEITransctions, request, onError, errorLabel);
}
public submitEit(eit: any, onError?: any, errorLabel?: string): Observable<AddEitResponse> {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
@ -56,6 +69,20 @@ export class EitService {
return this.con.post(EitService.submitEit, request, onError, errorLabel);
}
public submitChildEducation(cei: any, onError?: any, errorLabel?: string): Observable<AddCeiResponse> {
const request = cei;
request.EITTransactionTBL = cei.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(EitService.submitCEI, request, onError, errorLabel);
}
public submitCEI(eit: any, onError?: any, errorLabel?: string): Observable<AddEitResponse> {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(EitService.submitEit, request, onError, errorLabel);
}
public validateEITTransaction(validateEITTransactionReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = validateEITTransactionReq;
this.authService.authenticateRequest(request);
@ -68,6 +95,12 @@ export class EitService {
return this.con.post(EitService.getEITDFFStrutre, request, onError, errorLabel);
}
public getCEIDFFStrutre(EITDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = EITDFFStrutreReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getCEIDFFStrutre, request, onError, errorLabel);
}
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = SetValueReq;
this.authService.authenticateRequest(request);
@ -101,6 +134,12 @@ export class EitService {
return this.con.post(EitService.startEitProcess, request, onError, errorLabel);
}
public startCeiApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
const request = eitProcess;
this.authService.authenticateRequest(request);
return this.con.post(EitService.startCeiProcess, request, onError, errorLabel);
}
public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable<any> {
const request = transactionID;
this.authService.authenticateRequest(request);
@ -131,4 +170,9 @@ export class EitService {
return this.con.post(EitService.resubmitEit, request, onError, errorLabel);
}
public getContactInfo(request: any, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
return this.con.post(EitService.getContactInfo, request, onError, errorLabel);
}
}

@ -60,9 +60,14 @@ export class HomeComponent implements OnInit {
}, (
) => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true;
this.cs.openHome();
})
if (this.cs.validResponse(result)){
this.cs.greenToastPK("erm-channel", "viedo-success");
CommonService.SKIP = true;
this.cs.openHome();
}else{
this.cs.redToastPK("erm-channel", "erm-failed");
}
});
}
}

@ -52,9 +52,14 @@ export class SurveyComponent implements OnInit {
this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true;
this.cs.openHome();
})
if (this.cs.validResponse(result)){
this.cs.greenToastPK("erm-channel", "survey-success");
CommonService.SKIP = true;
this.cs.openHome();
}else{
this.cs.redToastPK("erm-channel", "erm-failed");
}
});
}
select(rating) {
this.satisfied = rating;

@ -85,32 +85,39 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
import { FileUploadModule } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera} from '@ionic-native/Camera/ngx';
import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component';
import { Camera } from '@ionic-native/Camera/ngx';
import { File } from '@ionic-native/file/ngx';
import { FileUploderProfileComponent } from './ui/file-uploder-profile/file-uploder-profile.component';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component';
import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import {DashboredService} from './services/dashbored/dashbored.service';
import {NgxGaugeModule} from 'ngx-gauge';
import { AccordinTabCustomComponent } from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import { DashboredService } from './services/dashbored/dashbored.service';
import { NgxGaugeModule } from 'ngx-gauge';
import { StatsButtonComponent } from './ui/stats-button/stats-button.component';
import { ServicesButtonComponent } from './ui/services-button/services-button.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
import {WelcomeComponent} from './ui/welcome-login/welcome.component'
import {FabButtonComponent} from './ui/fab-button/fab-button.component'
import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-login.component'
import { WelcomeComponent } from './ui/welcome-login/welcome.component'
import { FabButtonComponent } from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress';
import { CardFilterComponent } from './ui/card-filter/card-filter.component';
import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component';
import { CircleCalendarComponent } from './ui/circle-calendar/circle-calendar.component';
import { NgCalendarModule } from 'ionic2-calendar';
import { NgCalendarModule } from 'ionic2-calendar';
import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component';
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';
import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component';
import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component';
import { FileOpener } from '@ionic-native/file-opener/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
import { FileChooser } from "@ionic-native/file-chooser/ngx";
import { IOSFilePicker } from '@ionic-native/file-picker/ngx';
import { SanitizeHtmlPipe } from '../itemforsale/services/domsafe';
@NgModule({
imports: [
@ -130,6 +137,7 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen
],
declarations: [
FabButtonComponent,
SanitizeHtmlPipe,
WelcomeComponent,
NumberRangeComponent,
SSpacerComponent,
@ -194,7 +202,9 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen
Modal,
GenericHeaderComponent,
AttendanceOptionsComponent,
CardCalendarComponent
CardCalendarComponent,
WorklistSettingComponent,
SubmitAddressModalComponent
],
exports: [
FabButtonComponent,
@ -265,7 +275,9 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen
Modal,
GenericHeaderComponent,
AttendanceOptionsComponent,
CardCalendarComponent
CardCalendarComponent,
SubmitAddressModalComponent,
SanitizeHtmlPipe
],
providers: [
AttendScanService,
@ -304,9 +316,13 @@ import { CardCalendarComponent } from './ui/card-calendar/card-calendar.componen
MenuService,
OpenNativeSettings,
BarcodeScanner,
BackgroundGeolocation
BackgroundGeolocation,
FileOpener,
FilePath,
FileChooser,
IOSFilePicker
],
entryComponents: [DateInfoModalComponent],
entryComponents: [DateInfoModalComponent, WorklistSettingComponent],
})
export class HmgCommonModule { }

@ -78,6 +78,15 @@ export class CommonService {
'نوفمبر',
'ديسمبر'
];
public filterKeys = {
'HRSSA': 0,
'INVMOA': 0,
'REQAPPRV': 0,
'POAPPRV': 0,
'INVITEM': 0,
"STAMP": 0,
'ITG': 0
}
private progressLoaders: any[] = [];
private loadingProgress: any;
@ -207,7 +216,7 @@ export class CommonService {
const toast = await this.toastController.create({
message: message,
showCloseButton: true,
position: 'middle',
position: 'top',
duration: 2000,
closeButtonText: this.ts.trPK('general', 'close')
});
@ -226,7 +235,7 @@ export class CommonService {
const toast = await this.toastController.create({
message: message,
showCloseButton: true,
position: 'middle',
position: 'top',
duration: 2000,
color: 'danger',
closeButtonText: this.ts.trPK('general', 'close')
@ -237,7 +246,7 @@ export class CommonService {
const toast = await this.toastController.create({
message: message,
showCloseButton: true,
position: 'middle',
position: 'top',
duration: 2000,
color: 'success',
closeButtonText: this.ts.trPK('general', 'close')
@ -819,6 +828,11 @@ export class CommonService {
return '/Date(' + date.getTime() + ')/';
}
public convertDateToJsonDateUpdated(date: Date): string {
const newDate = new Date(date);
return '/Date(' + newDate.getTime() + ')/';
}
/*
date iso format
and time is 24 format hh:mm:ss
@ -888,6 +902,11 @@ export class CommonService {
return this.getDateTimeISO(date) + ' ' + this.getTimeISO(date);
}
public getDateTimeISOFromStringUpdated(dateStr: string): string {
const date = this.evaluteDateAsObject(dateStr);
return this.getDateTimeISO(date);
}
public getCurrentTimeISO(): string {
return this.getTimeISO(new Date());
}
@ -1125,12 +1144,18 @@ export class CommonService {
public openAddSitPage() {
this.nav.navigateForward(['/sit/add-sit']);
}
public openAddCEIPage() {
this.nav.navigateForward(['/eit/add-cei']);
}
public openConfirmEitPage() {
this.nav.navigateForward(['/eit/confirm-add-eit']);
}
public openConfirmSitPage() {
this.nav.navigateForward(['/sit/confirm-add-sit']);
}
public openConfirmCEIPage() {
this.nav.navigateForward(['/eit/confirm-cei']);
}
public openConfirmBasicDetailsPage() {
this.nav.navigateForward(['/profile/confirm-basic']);
}
@ -1184,6 +1209,9 @@ export class CommonService {
public openMyTeamDetailPage() {
this.nav.navigateForward(['/my-team/details']);
}
public openSubordinateLeavePage() {
this.nav.navigateForward(['/my-team/subordinate-leave']);
}
public openMyRequestPage() {
this.nav.navigateForward(['/mowadhafi/my-request']);
}
@ -1228,6 +1256,9 @@ export class CommonService {
public openWorklistMainPage() {
this.nav.navigateForward(['/notification/worklist-main']);
}
public openWorklistSettingsPage() {
this.nav.navigateForward(['/notification/worklist-settings']);
}
public openWorklistMainPRPage() {
this.nav.navigateForward(['/notification/worklist-main-PR']);
}
@ -1302,6 +1333,16 @@ export class CommonService {
public openAddAddress() {
this.nav.navigateForward(['/profile/add-address']);
}
public openAddContact() {
this.nav.navigateForward(['/profile/contact']);
}
public openAddUpdateContact() {
this.nav.navigateForward(['/profile/add-update-contact']);
}
public confirmContact() {
this.nav.navigateForward(['/profile/confirm-contact']);
}
public openConfirmAddAddress() {
this.nav.navigateForward(['/profile/confirm-add-address']);
}
@ -1314,12 +1355,45 @@ export class CommonService {
public sitUpdate() {
this.nav.navigateForward(['/sit/sit-update-list']);
}
public openCEIPage() {
this.nav.navigateForward(['/eit/cei-homepage']);
}
public openCEIListPage() {
this.nav.navigateForward(['/eit/cei-list']);
}
public openAnnouncement() {
this.nav.navigateForward(['/backend-integrations/announcement']);
}
public openConcurrentReport() {
this.nav.navigateForward(['/reports/concurrent-report']);
}
public openConcurrentTransaction() {
this.nav.navigateForward(['/reports/transaction-list']);
}
public openTermination() {
this.nav.navigateForward(['/termination/termination-form']);
}
public confirmTermination() {
this.nav.navigateForward(['/termination/confirm-termination']);
}
public openTransactions() {
this.nav.navigateForward(['/pending-transaction/home']);
}
public openItemForSale() {
this.nav.navigateForward('/itemforsale/items');
}
public openCreateitems() {
this.nav.navigateForward('/itemforsale/home');
}
public filterItemforSale() {
this.nav.navigateForward('/itemforsale/filter');
}
public navigatePage(path) {
this.nav.navigateForward([path]);
}
@ -1522,4 +1596,136 @@ export class CommonService {
return this.activeType;
}
public totalCounter = 0;
getTotalNumberOfWorklistRequest() {
this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false));
return this.totalCounter;
}
setTotalNumberOfWorklistRequest() {
if (this.totalCounter > 0) {
this.totalCounter -= 1;
}
this.sharedService.setSharedData(this.totalCounter, 'total-count');
}
public setFilterValues(data) {
for (const notification of data) {
this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER
}
}
public filters = [
{
value: 0,
name: 'HR',
active: false,
color: '#18a169',
key: 'HRSSA',
disable: false,
total: 0
},
{
value: 0,
name: 'MR',
active: false,
color: '#3cb9d5',
key: 'INVMOA',
disable: false,
total: 0
},
{
value: 0,
name: 'PR',
active: false,
color: '#114475',
key: 'REQAPPRV',
disable: false,
total: 0
},
{
value: 0,
name: 'PO',
active: false,
color: '#38c9b3',
key: 'POAPPRV',
disable: false,
total: 0
},
{
value: 0,
name: 'ITG',
active: false,
color: '#cc3232',
key: 'ITG',
disable: false,
total: 0
},
{
value: 0,
name: 'IC',
active: false,
color: '#9e7e97',
key: 'INVITEM',
disable: false,
total: 0
},
{
value: 0,
name: 'STAMP',
active: false,
color: '#ff9800',
key: 'STAMP',
disable: false,
total: 0,
},
];
public data = {
datasets: [
{
data: [0, 0, 0, 0, 0, 0, 0],
backgroundColor: [
'#18a169',
'#3cb9d5',
'#114475',
'#38c9b3',
'#cc3232',
'#9e7e97',
'#ff9800'
],
borderWidth: 6
}]
};
getFiltersData() {
// for (const notification of openNotificationsArray) {
// if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[0].value = this.filterKeys['HRSSA'];
this.data.datasets[0].data[0] = this.filterKeys['HRSSA'];
// } else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[1].value = this.filterKeys['INVMOA'];
this.data.datasets[0].data[1] = this.filterKeys['INVMOA'];
// } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[2].value = this.filterKeys['REQAPPRV'];
this.data.datasets[0].data[2] = this.filterKeys['REQAPPRV'];
// } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[3].value = this.filterKeys['POAPPRV'];
this.data.datasets[0].data[3] = this.filterKeys['POAPPRV'];
// } else if (notification.ITEM_TYPE === 'INVITEM') {
this.filters[5].value = this.filterKeys['INVITEM'];
this.data.datasets[0].data[5] = this.filterKeys['INVITEM'];
// } else if (notification.ITEM_TYPE === 'STAMP') {
this.filters[6].value = this.filterKeys['STAMP'];
this.data.datasets[0].data[6] = this.filterKeys['STAMP'];
let val = { 'filters': [], 'data': {} };
val.filters = this.filters;
val.data = this.data;
return val;
}
}

@ -25,7 +25,7 @@ export class ConnectorService {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};
public static retryTimes = 0;
public static timeOut = 120 * 1000;
public static timeOut = 180 * 1000;
public static host = 'http://10.10.150.249:1234/';
// public static host = 'https://uat.hmgwebservices.com/';
@ -237,7 +237,7 @@ export class ConnectorService {
}
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
this.cs.stopLoading();
this.cs.stopLoading();
} else {
this.cs.stopLoading();
if (!fromSMS) {

@ -2,10 +2,13 @@ import { ListMenu } from './list.menu';
import { MenuEntry } from './menu.entry';
export class MenuResponse {
public static SHARED_DATA = 'menu_response';
public static SHARED_SEL_EMP= 'sel_empolyee';
public static SHARED_SEL_RESP_ID= 'sel_resp_id';
public userid:string;
public search:boolean;
public List_Menu:ListMenu;
public GetMenuEntriesList:MenuEntry;
public static MENU_LIST = 'menu_list';
public static SELECTED_MENU = 'selected_menu';
public static SHARED_SEL_EMP = 'sel_empolyee';
public static SHARED_SEL_RESP_ID = 'sel_resp_id';
public static ITG_COUNTS = 'itg-counts';
public userid: string;
public search: boolean;
public List_Menu: ListMenu;
public GetMenuEntriesList: MenuEntry;
}

@ -20,13 +20,13 @@ export class RateService {
}
public rateFeature(ratedFeedBack?: any , featureKey: string = RateService.app , delay: number = 2000) {
public rateFeature(ratedFeedBack?: any, featureKey: string = RateService.app, delay: number = 2000) {
if (this.isRated(featureKey)) {
if (ratedFeedBack) {
ratedFeedBack(true);
}
} else {
setTimeout( () => {
setTimeout(() => {
this.startRating(featureKey, ratedFeedBack);
}, delay);
}
@ -38,7 +38,7 @@ export class RateService {
this.appRate.preferences = {
displayAppName: this.ts.trPK('general', 'app-name'),
promptAgainForEachNewVersion: true,
inAppReview: true,
// inAppReview: true,
storeAppURL: {
ios: 'com.ejada.hmg',
android: 'market://details?id=com.ejada.hmg',
@ -47,7 +47,7 @@ export class RateService {
callbacks: {
handleNegativeFeedback: () => {
this.setAsRated(featureKey);
//this.cs.openFeedback();
//this.cs.openFeedback();
},
onButtonClicked: (buttonIndex) => {
// when user click rate

@ -1,13 +1,40 @@
<input [id]="attachmentname" type="file" name="attachment" style="display:none" (change)='loadAttachment($event)'
accept="image/*,video/*,audio/*">
<ion-button (click)="openFile()" slot="end" expand="block" fill="outline">
<ion-icon name="attach" slot="start"></ion-icon>
{{'general,select-attachment' | translate}}
</ion-button>
<!-- <two-option-select (selected)="switchOptions($event)" [option1]="ts.trPK('settings','file')" [option2]="ts.trPK('settings','camera')"
[isOption1]="true"></two-option-select> -->
<div *ngIf="inputFiles.length>0" class="uploader-icons">
<ion-item *ngFor="let file of inputFiles; let i = index" lines="none">
<p slot="start"> <img [src]="attachmentImg" /> {{file.name}}</p>
<p slot="end"><img [src]="deleteImg" (click)="deleteFiles(i)"></p>
</ion-item>
</div>
<!-- <input [id]="attachmentname" type="file" name="attachment" style="display:none" (change)='loadAttachment($event)'
accept="jpg, jpeg, png, gif, pdf, doc, docx"> -->
<ion-button (click)="openFile()" slot="end" expand="block" fill="outline" class="uploader">
<ion-icon name="attach" slot="start" ></ion-icon>
{{'general,select-attachment' | translate}}
</ion-button>
<!-- <div class="uploader-icons">
<ion-item lines="none">
<p slot="start" class="file-name"> <img [src]="attachmentImg" /> {{file.name}}</p>
<p slot="end" class="delete-cont"><img [src]="deleteImg" (click)="deleteFiles(i)"></p>
</ion-item>
</div> -->
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="inputFiles.length>0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let file of inputFiles; let i = index">
<div class="image-container">
<div class="uploaded">
<div class="closed" (click)="deleteFiles(i)">X</div>
<img [src]="getImgContent(file.data) " />
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-slide>
</ion-slides>
<div *ngIf="errorMsg" class="error">
{{errorMsg}}
</div>

@ -2,4 +2,21 @@
width: .7cm;
height: .6cm;
vertical-align: middle;
}
.closed{
position: absolute;
right: 0;
font-size: 14px;
color: #fff;
top: -5px;
right: -10px;
font-weight: bolder;
background: red;
padding: 6px;
border-radius: 50%;
text-align: center;
line-height: .7;
}
.image-container{
margin-top: 10px;
}

@ -1,100 +1,288 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AlertController } from '@ionic/angular';
import { Component, OnInit, Input, Output, EventEmitter, NgZone } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { AlertController, ActionSheetController, Platform } from "@ionic/angular";
import {
Camera,
CameraOptions,
PictureSourceType
} from "@ionic-native/Camera/ngx";
import { FileChooser } from "@ionic-native/file-chooser/ngx";
import { File } from "@ionic-native/file/ngx";
import { FilePath } from "@ionic-native/file-path/ngx";
import { Base64 } from "@ionic-native/base64/ngx";
import { IOSFilePicker } from '@ionic-native/file-picker/ngx';
import { Location } from '@angular/common';
import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
export interface CustomWindow extends Window {
File: any;
FileReader: any;
}
declare let window: CustomWindow;
@Component({
selector: 'file-uploader',
templateUrl: './file-uploader.component.html',
styleUrls: ['./file-uploader.component.scss']
selector: "file-uploader",
templateUrl: "./file-uploader.component.html",
styleUrls: ["./file-uploader.component.scss"]
})
export class FileUploaderComponent implements OnInit {
@Input() multiupload = false;
@Input() attachmentname = 'attachment-loader';
@Input() attachmentname = "attachment-loader";
public attachmentData: string;
@Input() maxFileSize = 10 * 1024 * 1024;
public errorMsg: string;
public selectedOpn: number = 1;
public allowdType: any = ["jpg", "jpeg", "png", "gif", "pdf", "doc", "docx"];
@Input() maxFileSize = 5 * 1024 * 1024;
@Output() fileSelected = new EventEmitter();
public inputFiles: any = [];
public attachmentImg = 'assets/icon/attachment.png';
public deleteImg = 'assets/icon/delete.png';
public attachmentImg = "assets/icon/attachment.png";
public deleteImg = "assets/icon/delete.png";
public nativePath: any;
public actionSheet: any;
public isActionSheetShown: boolean = false;
@Input() selectedAttachment = [];
constructor(
public cs: CommonService,
public ts: TranslatorService,
public alertController: AlertController
) {
}
public alertController: AlertController,
private cameraController: Camera,
private actionSheetController: ActionSheetController,
private fileChooser: FileChooser,
private file: File,
private filePath: FilePath,
public base64: Base64,
public platform: Platform,
private iOSfilePicker: IOSFilePicker,
public ngzone: NgZone,
public loc: Location,
public sanitizer: DomSanitizer
) { }
ngOnInit() {
this.platform.backButton.subscribeWithPriority(9999, () => {
// You decide what happens
if (this.isActionSheetShown)
this.actionSheet.dismiss();
else
this.loc.back();
});
this.inputFiles = this.selectedAttachment;
}
public loadAttachment(changeEvent) {
const fileInput = this.getFileElement();
if (this.isFileSupported()) {
if (fileInput.files != null && fileInput.files.length > 0) {
const file = fileInput.files[0];
const reader = new FileReader();
if (file.size <= this.maxFileSize) {
reader.onload = (data) => {
if (this.multiupload) {
this.inputFiles.push({name: file.name, data: data.target['result']});
} else {
this.inputFiles = [{name: file.name, data: data.target['result']}];
}
this.fileSelected.emit( {
name: file.name ,
data: data.target['result'],
inputFiles: this.inputFiles
});
};
reader.readAsDataURL(file);
} else {
this.attachmentData = null;
changeEvent.target.value = ''; // remove current selection
this.showFileExceededMaxSize();
}
} else {
this.attachmentData = null;
}
}
ngOnDestroy(): void {
}
async openFile() {
if (this.platform.is('ios'))
this.openiOSActionSheet();
else
this.openAndroidActionSheet();
//this.openiOSActionSheet();
private isFileSupported() {
return (window.FileReader && window.File);
}
async openAndroidActionSheet() {
this.actionSheet = await this.actionSheetController.create({
header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file",
private showFileExceededMaxSize() {
this.cs.presentConfirmDialog(
this.ts.trPK('general', 'large-file'),
() => {
this.openFile();
},
() => {
}
);
buttons: [
{
text: this.ts.trPK("itemforsale", "from-library"),
handler: () => {
this.takePictureiOS();
}
},
{
text: this.ts.trPK("itemforsale", "from-camera"),
handler: () => {
this.takePicture(this.cameraController.PictureSourceType.CAMERA);
}
},
{
text: this.ts.trPK("general", "cancel"),
role: "cancel"
}
]
});
this.isActionSheetShown = true;
await this.actionSheet.present();
}
private getFileElement(): HTMLInputElement {
return document.getElementById(this.attachmentname) as HTMLInputElement;
async openiOSActionSheet() {
this.actionSheet = await this.actionSheetController.create({
header: this.ts.trPK("itemforsale", "slect-source-file"), //"Select Image file",
buttons: [
{
text: this.ts.trPK("itemforsale", "from-library"),
handler: () => {
this.takePictureiOS();
}
},
{
text: this.ts.trPK("itemforsale", "from-camera"),
handler: () => {
this.takePicture(this.cameraController.PictureSourceType.CAMERA);
}
},
{
text: this.ts.trPK("itemforsale", "from-icloud"),
handler: () => {
this.takePicture(this.cameraController.PictureSourceType.PHOTOLIBRARY);
}
},
{
text: this.ts.trPK("general", "cancel"),
role: "cancel"
}
]
});
this.isActionSheetShown = true;
await this.actionSheet.present();
}
public openFile() {
const fileInput = this.getFileElement();
fileInput.click();
public takePictureiOS() {
const options: CameraOptions = {
quality: 60,
sourceType: this.cameraController.PictureSourceType.PHOTOLIBRARY,
destinationType: this.cameraController.DestinationType.DATA_URL,
encodingType: this.cameraController.EncodingType.JPEG,
mediaType: this.cameraController.MediaType.PICTURE,
correctOrientation: true,
}
this.cameraController.getPicture(options).then((imageData) => {
const data = "data:image/jpeg;base64," + imageData;
this.pushFiles(this.getFileName(), data);
}, (err) => {
});
}
public deleteFiles(index: number) {
this.inputFiles.splice(index, 1);
this.fileSelected.emit( {
this.fileSelected.emit({
name: null,
data: '',
data: "",
inputFiles: this.inputFiles
});
this.errorMsg = null;
}
public switchOptions($event) {
this.selectedOpn = $event;
}
public takePicture(sourceType: PictureSourceType) {
const options: CameraOptions = {
quality: 50,
destinationType: this.cameraController.DestinationType.DATA_URL,
encodingType: this.cameraController.EncodingType.JPEG,
sourceType: sourceType,
mediaType: this.cameraController.MediaType.PICTURE,
correctOrientation: true
};
if (sourceType === this.cameraController.PictureSourceType.PHOTOLIBRARY) {
if (this.platform.is('android')) {
this.fileChooser
.open()
.then(uri => {
this.readFile(uri);
})
.catch(e => { });
} else {
this.iOSfilePicker.pickFile(['public.content']).then(uri => {
let correctPath = uri.substr(0, uri.lastIndexOf('/') + 1);
let currentName = uri.substring(uri.lastIndexOf('/') + 1);
this.nativePath = uri;
this.file.readAsDataURL("file:///" + correctPath, currentName).then(result => {
this.pushFiles(currentName, result);
}).catch(e => { });
}).catch(e => { });
}
} else {
this.cameraController.getPicture(options).then(imageData => {
const data = "data:image/jpeg;base64," + imageData;
this.pushFiles(this.getFileName(), data);
});
}
}
pushFiles(name, files) {
this.ngzone.run(() => {
if (this.multiupload) {
this.inputFiles.push({ name: name, data: files });
} else {
this.inputFiles = [{ name: name, data: files }];
}
this.fileSelected.emit({
name: name,
data: files,
inputFiles: this.inputFiles
});
});
}
readFile(fileUrl: any) {
this.filePath.resolveNativePath(fileUrl).then(filePathResult => {
this.nativePath = filePathResult;
this.file.resolveLocalFilesystemUrl(this.nativePath).then(entry => {
entry.getMetadata(metadata => {
if (metadata.size <= this.maxFileSize) {
this.errorMsg = null;
this.encodeFiles(entry);
} else {
this.errorMsg = this.ts.trPK("general", "large-file");
}
}, (error) => {
console.log(error)
});
});
});
}
getImgContent(imgFile): SafeUrl {
console.log(imgFile);
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
checkDuplicate(name: string) {
return this.inputFiles.filter(a => {
return a.name === name;
});
}
encodeFiles(entry) {
let fileName = entry.nativeURL.split('/').pop();
let path = entry.nativeURL.substring(0, entry.nativeURL.lastIndexOf("/") + 1);
this.file.readAsDataURL(path, fileName)
.then(base64File => {
})
.catch((err) => {
console.log('Error reading file', err);
})
this.base64.encodeFile(this.nativePath).then(
(base64File: string) => {
const type = this.nativePath.substr(
this.nativePath.lastIndexOf(".") + 1
);
if (this.allowdType.includes(type.toLowerCase())) {
if (this.checkDuplicate(entry.name).length === 0) {
this.pushFiles(entry.name, base64File);
this.errorMsg = null;
} else {
this.errorMsg = this.ts.trPK("general", "file-name-exist");
}
} else {
this.attachmentData = null;
this.errorMsg = this.ts.trPK("general", "not-supported");
}
},
err => {
console.log(err);
}
);
}
getFileName() {
const date = new Date().valueOf();
let text = "";
const possibleText =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 5; i++) {
text += possibleText.charAt(
Math.floor(Math.random() * possibleText.length)
);
}
const imageName = date + "." + text + ".jpeg";
return imageName;
}
}

@ -30,6 +30,22 @@
</ion-buttons> -->
</ion-col>
<ion-col *ngIf="worklistSetting" [size]="2" style="padding: 0;" (click)="openNotifictionSetting()">
<div class="profile-image-container setting-conatainer">
<ion-icon src="../assets/icon/settings-not.svg" style="width: 30px;height: 30px;margin-top: 5px; color: white;"></ion-icon>
</div>
</ion-col>
<ion-col *ngIf="performanceEvaluation" [size]="2" style="padding: 0;" (click)="openPerormance()">
<div class="profile-image-container">
<ion-icon src='../assets/icon/bar-chart.svg' style="width: 30px;height: 25px;margin-top: 5px; color: white;"></ion-icon>
</div>
</ion-col>
<ion-col *ngIf="subordinateLeave" [size]="2" style="padding: 0;" (click)="openSubordinateLeavePage()">
<div class="profile-image-container">
<ion-icon name='people' style="width: 30px;height: 30px;margin-top: 5px; color: white;"></ion-icon>
</div>
</ion-col>
</ion-row>
</ion-toolbar>
</ion-header>

@ -23,4 +23,8 @@
}
.header-toolbar-new {
--background: #29B5BF;
}
.setting-conatainer{
height: 40px !important;
width: 40px !important;
}

@ -1,5 +1,11 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { WorklistSettingComponent } from 'src/app/notification/worklist-setting/worklist-setting.component';
import { CommonService } from '../../services/common/common.service';
import { DashboredService } from '../../services/dashbored/dashbored.service';
import { PerformanceAppraisalResponse } from '../../services/dashbored/performance-appraisal.response';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { TranslatorService } from '../../services/translator/translator.service';
@Component({
selector: 'app-generic-header',
@ -16,10 +22,21 @@ export class GenericHeaderComponent implements OnInit {
@Input() updateDirection = false;
@Input() headerText = '';
@Input() backLink: string;
@Input() worklistSetting = false;
@Input() performanceEvaluation = false;
@Input() subordinateLeave = false;
@Output() trigger = new EventEmitter();
public appraisalArr: any = [];
public performanceData: any = [];
public close = 'assets/imgs/cancel.png';
constructor(public common: CommonService) { }
constructor(
public common: CommonService,
public DS: DashboredService,
public sharedData: SharedDataService,
public ts: TranslatorService,
public modalController: ModalController) { }
ngOnInit() {
if (this.updateDirection) {
@ -35,4 +52,47 @@ export class GenericHeaderComponent implements OnInit {
this.trigger.emit();
}
async openNotifictionSetting() {
// const modal = await this.modalController.create({
// component: WorklistSettingComponent,
// cssClass: 'app-update-modal-css',
// });
// return await modal.present();
this.common.openWorklistSettingsPage();
}
public openPerormance() {
this.showPerformanceAppraisal();
}
public showPerformanceAppraisal() {
this.DS.getPerformanceAppraisal(() => {
this.showPerformanceAppraisal();
}).subscribe((result: PerformanceAppraisalResponse) => {
this.handlePerformanceAppraisalResult(result);
});
}
private handlePerformanceAppraisalResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetPerformanceAppraisalList)) {
this.appraisalArr = result.GetPerformanceAppraisalList;
this.performanceData = [];
for (let i = 0; i < this.appraisalArr.length; i++) {
this.performanceData.push({ name: this.appraisalArr[i].APPRAISAL_YEAR, value: parseInt(this.appraisalArr[i].APPRAISAL_SCORE).toFixed() });
}
console.log('PerformanceAppraisalResponse');
this.sharedData.setSharedData(this.performanceData, PerformanceAppraisalResponse.PERFORMANCE_DATA);
this.common.openPerformanceevaluation();
} else {
let msg: string = this.ts.trPK("userProfile", "no-appraisal");
this.common.presentAlert(msg);
}
}
}
public openSubordinateLeavePage() {
this.common.openSubordinateLeavePage();
}
}

@ -18,57 +18,56 @@ import { AlertController } from '@ionic/angular';
styleUrls: ['./smsdialog.page.scss'],
})
export class SmsdialogPage implements OnInit {
public timeInSeconds : number ;
public time : number;
public runTimer : boolean;
public timeInSeconds: number;
public time: number;
public runTimer: boolean;
public static SHARED_DATA = 'h2o-login-details';
public hasStarted : boolean;
public hasStarted: boolean;
public countryCode: CountryCode;
public hasFinished : boolean;
public remainingTime : number;
public displayTime : string = "";
public hasFinished: boolean;
public remainingTime: number;
public displayTime: string = "";
// public userData: UserDetailsModel;
public mobile : string;
public country_code : string;
public id : string;
public MobileNumber : string;
public token : string;
public resend : boolean = false;
public smc_code : any;
public mobile: string;
public country_code: string;
public id: string;
public MobileNumber: string;
public token: string;
public resend: boolean = false;
public smc_code: any;
constructor(public cs: CommonService,
public ts: TranslatorService,
public alertController: AlertController,
public smsService: SmsReaderService,
public sharedData: SharedDataService,
private modalCtrl:ModalController,
private modalCtrl: ModalController,
// private navParams: NavParams,
public smsservice: SMSDialogService) {
// this.country_code = this.navParams.get("c_code");
// this.MobileNumber = this.navParams.get('mobile');
// this.mobile = this.navParams.get('mobile');
// this.id = this.navParams.get('id');
// this.smsservice.sendActivationCode(this.id, this.mobile,
// this.country_code, () => { },
// this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => {
// if (this.cs.validResponse(result)) {
// if (result.isSMSSent) {
// this.token = result.LogInTokenID;
// this.initTimer();
// this.startTimer();
// } else {
// this.stopSMSMonitoring();
// }
// } else {
// this.stopSMSMonitoring();
// }
// });
}
public smsservice: SMSDialogService) {
// this.country_code = this.navParams.get("c_code");
// this.MobileNumber = this.navParams.get('mobile');
// this.mobile = this.navParams.get('mobile');
// this.id = this.navParams.get('id');
// this.smsservice.sendActivationCode(this.id, this.mobile,
// this.country_code, () => { },
// this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => {
// if (this.cs.validResponse(result)) {
// if (result.isSMSSent) {
// this.token = result.LogInTokenID;
// this.initTimer();
// this.startTimer();
// } else {
// this.stopSMSMonitoring();
// }
// } else {
// this.stopSMSMonitoring();
// }
// });
}
ngOnInit() {
}
closeModal()
{
closeModal() {
this.modalCtrl.dismiss();
}
@ -77,8 +76,8 @@ export class SmsdialogPage implements OnInit {
}
initTimer() {
if (!this.timeInSeconds) {
this.timeInSeconds = 60;
if (!this.timeInSeconds) {
this.timeInSeconds = 60;
}
this.time = this.timeInSeconds;
this.runTimer = false;
@ -87,22 +86,22 @@ export class SmsdialogPage implements OnInit {
this.remainingTime = this.timeInSeconds;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
}
startTimer() {
this.runTimer = true;
this.hasStarted = true;
this.resend = false;
this.timerTick();
}
pauseTimer() {
this.runTimer = false;
}
resumeTimer() {
this.startTimer();
}
timerTick() {
setTimeout(() => {
if (!this.runTimer) { return; }
@ -117,7 +116,7 @@ export class SmsdialogPage implements OnInit {
}
}, 1000);
}
getSecondsAsDigitalClock(inputSeconds: number) {
var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600);
@ -132,13 +131,12 @@ export class SmsdialogPage implements OnInit {
return minutesString + ':' + secondsString;
}
validate()
{
validate() {
this.checkSMSActivationCode(this.smc_code);
}
public presentSMSPasswordDialog() {
}
async presentAlert() {
@ -153,21 +151,20 @@ export class SmsdialogPage implements OnInit {
private checkSMSActivationCode(smsCode: string) {
this.smsservice.validateActivationCode(this.token, smsCode,
() => {}, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => {
if (this.cs.validResponse(result)) {
this.stopSMSMonitoring();
this.modalCtrl.dismiss();
SMSDialogService.modal_success = true;
}
});
() => { }, this.ts.trPK('settings', 'incorrect_otp')).subscribe((result: Response) => {
if (this.cs.validResponse(result)) {
//this.stopSMSMonitoring();
this.modalCtrl.dismiss();
SMSDialogService.modal_success = true;
}
});
}
public stopSMSMonitoring() {
this.smsService.stopSMSMonitoring();
this.smsService.stopSMSMonitoring();
}
public ResendOTP()
{
public ResendOTP() {
// this.smsservice.sendActivationCode(this.id, this.mobile,
// this.country_code, () => { },
// this.ts.trPK('general', 'ok')).subscribe((result: SendValidationResponse) => {

@ -64,7 +64,7 @@
<ion-label> {{'general,other-services' | translate}} </ion-label>
</ion-col>
<ion-slides [options]="slideOptsTwo" >
<ion-slide style="pointer-events: none; opacity: .3">
<ion-slide >
<app-services-button (click)="itemForSale()" [title]="'general,items-sales' | translate" >
</app-services-button>
</ion-slide>

@ -180,11 +180,11 @@ export class HomePage implements OnInit {
spaceBetween: 10
};
this.slideOptsTwo = {
slidesPerView: width > 320 ? 3.2 : 2.5,
spaceBetween: width > 320 ? 10 : 5
slidesPerView: width > 320 ? 3.2 : 2.5,
spaceBetween: width > 320 ? 10 : 5
};
this.showStaticServices = true;
}
}
ionViewWillEnter() {
this.common.startLoading();
this.slideSettingsTwo();
@ -357,10 +357,17 @@ export class HomePage implements OnInit {
callDashboardServices() {
this.getMenu();
this.setServicesPrivilage();
this.openNotificationsDashbored();
// this.showOpenMissingSwipes();
// this.showAttendanceTracking();
this.getAccrualBalance();
if (this.common.getTotalNumberOfWorklistRequest()) {
this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest();
} else {
this.openNotificationsDashbored();
}
this.showOpenMissingSwipes();
this.showAttendanceTracking();
var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false);
if (!accrualBalance)
this.getAccrualBalance();
}
public Vacation_Rule() {
@ -396,6 +403,7 @@ export class HomePage implements OnInit {
selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER;
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.common.sharedService.setSharedData(this.menuList, MenuResponse.MENU_LIST);
this.getMenuEntries(item);
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.menuList.length; i++) {
@ -646,12 +654,15 @@ export class HomePage implements OnInit {
result,
'worklistNotifications'
);
this.common.setFilterValues(result['GetOpenNotificationsList']);
}
});
}
ITGCountAllNotification() {
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
this.common.filterKeys['ITG'] = result.TotalCount;
this.statsButtons[1].statsValue =
Math.floor(this.countAllNotification + result.TotalCount);
this.common.stopLoading();
@ -759,6 +770,7 @@ export class HomePage implements OnInit {
this.showAttendanceOptions();
// tslint:disable-next-line: triple-equals
} else if (link == '1') {
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
this.common.startLoading();
this.common.openNotificationPage();
// tslint:disable-next-line: triple-equals
@ -793,7 +805,7 @@ export class HomePage implements OnInit {
itemForSale() {
this.common.navigateForward('/itemforsale/items');
this.common.openItemForSale();
}
offersDiscount() {
this.common.navigateForward('/offersdiscount/home');

@ -55,6 +55,13 @@ export class WifiModalComponent implements OnInit {
}, 1000);
}
async getConnectedBSSID(ssid:string){
let avaialbleSSID = await this.wifiWizard2.getConnectedBSSID();
console.log(avaialbleSSID);
}
async startWifiConnection() {
const isAndroid = this.platform.is("android");
const isIOS = this.platform.is("ios");

@ -0,0 +1,35 @@
<app-generic-header
showImage="false"
showBack="false"
navigate="false"
backlink="false"
[headerText]="'general,filter-offers' | translate">
</app-generic-header>
<ion-content>
<div class="container-icon" *ngIf="categories.length>0">
<ion-item lines="none" *ngFor="let key of categories" (click)="filterOffers(key)" [ngClass]="{'active':activeClass==key.title }">
<ion-label *ngIf="direction =='ltr'">
{{key.title}}
</ion-label>
<ion-label *ngIf="direction =='rtl'">
{{key.title_ar}}
</ion-label>
<ion-thumbnail slot="start">
<div class="top-filter" [innerHTML]="key.content | sanitizeHTMLPipe"></div>
</ion-thumbnail>
</ion-item>
</div>
<ion-footer >
<div class="centerDiv">
<ion-button class="footer-button" ion-button (click)="applyFilters()">
{{ts.trPK('general','apply-filters')}} </ion-button>
</div>
</ion-footer>
</ion-content>

@ -0,0 +1,38 @@
ion-label{
font-size: 14px !important;
}
ion-thumbnail img{
width: 40px;
height: 40px;
margin: 10px;
}
.active::before{
position: absolute;
right: 10px;
top: 15px;
padding: 0px;
background: #3cc353;
padding: 3px 2px 1px 3px;
border-radius: 60%;
font-size: 12px;
color: #fff;
content: '';
width: 20px;
height: 20px;
text-align: center;
z-index: 2;
}
ion-item{
border-bottom: 1px solid #ccc;
--padding-start: 0px;
margin: 0 20px 4px 20px;
}
.footer-button{
background: var(--newgreen)!important;border-radius: 10px; --background: transparent;
width: 80%;
}
ion-footer{
position: fixed;
bottom: 0;
}

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

@ -0,0 +1,56 @@
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ModalController } from '@ionic/angular';
import { OfferDiscountService } from 'src/app/offersdiscount/services/service';
import { ItemForSaleService } from '../services/service.service';
@Component({
selector: 'app-filter',
templateUrl: './filter.component.html',
styleUrls: ['./filter.component.scss'],
})
export class FilterComponent implements AfterViewInit {
segment: any = '1';
categoriesObj: any;
categories: any = [];
offersData: any = [];
activeClass: any;
tempSearch: any = [];
searchText: String;
public activeKey = {}
direction: any;
constructor(public ts: TranslatorService, public modalController: ModalController, public cs: CommonService, public offersService: OfferDiscountService) { }
ngAfterViewInit(): void {
this.direction = TranslatorService.getCurrentDirection();
this.categories = this.cs.sharedService.getSharedData(OfferDiscountService.categories, false);
// this.getOfferDiscount();
}
openDetails(offer) {
// this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers);
// var related = this.offersData.filter((res) => res.rowID != offer.rowID);
// this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers);
// this.cs.navigateForward('/offersdiscount/offer-details');
}
filterOffers(key) {
this.activeKey = key
this.activeClass = key.title;
}
applyFilters() {
this.cs.sharedService.setSharedData(this.activeKey, ItemForSaleService.selected_filters);
this.cs.back();
}
}

@ -22,7 +22,7 @@
<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]="direction == 'ltr' ? 'md-step-bar-left' : 'md-step-bar-right'" ></div>
<!-- <div class="md-step-bar-right" [ngClass]="step ==1 ? 'orange-border' : 'green-border'"></div> -->
</div>
</ion-col>
@ -34,7 +34,7 @@
</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-optional">{{step >2 ? ts.trPK('itemforsale','completed') :ts.trPK('itemforsale','locked')}}</div>
<div class="md-step-bar-left"></div>
</div></ion-col>
@ -42,9 +42,9 @@
<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-optional">{{step >3 ? ts.trPK('itemforsale','completed') : ts.trPK('itemforsale','locked')}}</div>
<div class="md-step-bar-left"></div>
</div></ion-col>
</ion-row>
</div>
@ -53,85 +53,34 @@
<div class="offering" *ngIf="step==1">
<h2>What are you offering?</h2>
<h2>{{ts.trPK('itemforsale','offering')}}</h2>
</div>
<ion-grid *ngIf="step==1">
<ion-row>
<ion-col size="4">
<div class="sale-icon" (click)="nextStep()">
<ion-col size="4" *ngFor="let category of categories">
<div class="sale-icon" (click)="nextStep(category)">
<div class="top">
<img src="/assets/imgs/itemsforsale/mobile.svg">
<div class="top-icon" [innerHTML]="category.content | sanitizeHTMLPipe" >
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
<p *ngIf="direction == 'ltr'">{{category.title}}</p>
<p *ngIf="direction =='rtl'">{{category.title_Ar}}</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-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>
</ion-grid>
<div class="offering" *ngIf="step==2">
<h2>Add Details</h2>
<h2>{{ts.trPK('itemforsale','add-details')}}</h2>
</div>
<div class="add-details" *ngIf="step==2">
<ion-grid>
<ion-row>
<p>Item Info</p>
<p>{{ts.trPK('itemforsale','item-info')}}</p>
<ion-col size="12">
<ion-item lines="none">
<ion-input placeholder="Item Info"></ion-input>
<ion-input [placeholder]="ts.trPK('itemforsale','item-info')" [(ngModel)]="itemInfo"></ion-input>
</ion-item>
</ion-col>
</ion-row>
@ -142,77 +91,63 @@
<ion-item lines="none">
<ion-textarea rows="6" cols="20" placeholder="Description"></ion-textarea>
<ion-textarea rows="6" cols="20" [placeholder]="ts.trPK('worklist','item-description')" [(ngModel)]="itemDescription"></ion-textarea>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<p>Item Condition</p>
<ion-radio-group value="new">
<p>{{ts.trPK('itemforsale','item-condition')}}</p>
<ion-radio-group value="new" [(ngModel)]="itemCondition">
<ion-col>
<ion-radio value="new"></ion-radio>
<ion-label>New</ion-label>
<ion-label>{{ts.trPK('itemforsale','new')}}</ion-label>
</ion-col>
<ion-col>
<ion-radio value="used"></ion-radio>
<ion-label>Used</ion-label>
<ion-label>{{ts.trPK('itemforsale','used')}}</ion-label>
</ion-col>
</ion-radio-group>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<p class="boldTxtNav" >{{ts.trPK('itemforsale','region')}}</p>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="regionID">
<ion-select-option *ngFor="let region of regions" [value]="region.regionID" >{{region.regionName}}</ion-select-option>
</ion-select>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
<p>Item Price</p>
<p>{{ts.trPK('itemforsale','item-price')}}</p>
<ion-item lines="none">
<ion-input placeholder="Item Price"></ion-input>
<ion-input [placeholder]="ts.trPK('itemforsale','item-price')" type="number" [(ngModel)]="itemPrice"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<p>Item Photos</p>
<p>{{ts.trPK('itemforsale','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 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)" /> -->
<file-uploader (fileSelected)="attachmentSelected($event)"
[multiupload]="true" [selectedAttachment]="selectedPicture">
</file-uploader>
</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>
@ -222,25 +157,48 @@
<div class="add-details" *ngIf="step==3">
<h2 class="review-title">Furniture Table</h2>
<h2 class="review-title" *ngIf="direction =='rtl'">
{{selectedCategory.title_Ar}}
</h2>
<h2 class="review-title" *ngIf="direction =='ltr'">
{{selectedCategory.title}}
</h2>
<p style="font-weight: 600;"> {{itemInfo}}</p>
<p>
Consectetur adipiscing elit. Donec blandit diam nulla, non euismod eros efficitur imperdiet. Fusce erat enim, volutpat at enim in, venenatis iaculis risus.
{{itemDescription}}
</p>
<div class="description-details">
<p class="orange">Used</p>
<p class="orange">{{itemCondition}}</p>
<img src="assets/imgs/itemsforsale/fashion.svg" />
<img src="assets/imgs/itemsforsale/fashion.svg" />
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="addAttachRequest.length>0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let obj of addAttachRequest">
<div class="image-container">
<div class="uploaded">
<!-- <div class="closed" (click)="deletePhoto(item)">X</div> -->
<img [src]="getImgContent('data:image/png;base64, ' +obj.Base64Data) " />
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-slide>
</ion-slides>
<div class="selling">
<strong>Selling for </strong> <h2>500 SAR</h2>
<strong>{{ts.trPK('itemforsale','selling-for')}} </strong> <h2>{{itemPrice}} 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>
<img src="/assets/imgs/itemsforsale/alert.svg"> <label>{{ts.trPK('itemforsale','warning')}}</label>
</div>
</div>
@ -250,8 +208,8 @@
<ion-footer *ngIf="step==1">
<div class="centerDiv">
<ion-button class="footer-button red-button" ion-button>
cancel </ion-button>
<ion-button class="footer-button red-button" (click)="cancelItem()" ion-button>
{{ts.trPK('general','cancel')}} </ion-button>
</div>
@ -260,13 +218,16 @@
<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">
<ion-button class="footer-button red-button small-btn" ion-button (click)="cancelItem()" *ngIf="step ==2 || step ==3">
{{ts.trPK('general','cancel')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="step =3" *ngIf="step ==2" [disabled]="!validate()">
{{ts.trPK('general','next')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="openItem()" *ngIf="step ==3">
Confirm </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="createItemForSale()" *ngIf="step ==3 && !editItem">
{{ts.trPK('general','confirm')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="updateItemForSale()" *ngIf="step ==3 && editItem">
{{ts.trPK('general','update')}} </ion-button>
</div>
</ion-footer>

@ -117,6 +117,10 @@ margin-left:0px
margin-right: 0px;
left: 40%;
}
.md-stepper-horizontal .md-step .md-step-bar-right {
margin-right: 0px;
right: 40%;
}
.orange .md-step-bar-left {
background:#CC9B14 !important;
font-weight: bold;
@ -214,7 +218,7 @@ margin-bottom: 70px;
background: #fff;
margin: 15px;
padding: 10px;
box-shadow: 3px 4px 3px -1px #ccc;
box-shadow: 0px 0px 2px 1px #ccc;
border-radius: 20px;
}
.add-details ion-item{
@ -246,7 +250,7 @@ position: relative;
right: 0;
font-size: 14px;
color: #fff;
top: -15px;
top: -10px;
right: -10px;
font-weight: bolder;
background: red;
@ -341,3 +345,57 @@ ion-footer{
position: absolute;
top: 15px;
}
.upload-container{
display: inline-block;
}
@media screen and (min-width: 325px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
}}
@media screen and (min-width: 1px) and (max-width:320px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
}}
.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;
}
.close-btn{
color: red;
font-size: 22px;
position: relative;
top: 5px;
}
ion-radio{
border: 1px solid;
border-radius: 5px;
color: gray;
height: 20px;
width: 21px;
margin-top: 5px;
}
.sale-icon .top-icon{
position: relative;
margin: 5px 8px;
}

@ -1,6 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { FileUploader } from 'ng2-file-upload';
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';
import { ItemForSaleService } from '../services/service.service';
@Component({
selector: 'app-home',
@ -9,19 +13,303 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class HomeComponent implements OnInit {
step: any = 1;
constructor(public ts: TranslatorService, public cs: CommonService,) { }
categories: any = [];
direction: string;
uploaded: any = [];
public selectedFile: any;
indexLastObj: any = 0;
addAttachRequest: any = [];
selectedPicture = [];
selectedCategory: any;
filterAllowedType: any = [
"image/jpeg",
"image/png",
"image/jpg",
];
itemInfo: string;
itemDescription: string;
itemCondition: string;
itemPrice: any;
regions: any = [];
regionID: any = 1;
editItem: any;
constructor(public ts: TranslatorService, private authService: AuthenticationService, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) { }
ngOnInit() { }
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.categories = this.cs.sharedService.getSharedData(ItemForSaleService.CATEGORIES, false);
this.categories.shift();
this.getRegion();
this.editItem = this.cs.sharedService.getSharedData(ItemForSaleService.EDIT_ITEMS);
if (this.editItem) {
this.setEditPage();
}
}
getRegion() {
this.itemService.getRegion({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.regions = this.itemService.parser(result);
console.log(this.regions);
})
}
openItem() {
this.cs.navigateForward('/itemforsale/items');
}
nextStep() {
nextStep(category) {
this.selectedCategory = category;
this.step = 2;
}
openMyAds() {
this.cs.navigateForward('/itemforsale/my-ads');
}
onFileSelectedclick(event) {
event.target.value = '';
}
public uploader: FileUploader = new FileUploader({
allowedMimeType: [
"image/jpeg",
"image/png",
"image/jpg",
],
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", "notSupportFile");
// 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,
// ContentType: 'image/' + attachType, //type.split('/')[1],
// Base64Data: fileData.split(",")[1],
// FileName: name, //.split('.')[0],
// });
// } catch (e) { }
// }
removeFile(objectitem) {
let objIndex = this.addAttachRequest.findIndex(
item => item.AttachmentID == objectitem.AttachmentID
);
this.addAttachRequest.splice(objIndex, 1);
}
getImgContent(imgFile): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
createItemForSale() {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
// var request = new FormData();
// request.append('title', this.itemInfo);
// request.append('title_Ar', this.itemInfo);
// request.append('categoryID', this.selectedCategory.categoryID);
// request.append('description', this.itemDescription);
// request.append('description_Ar', this.itemDescription);
// request.append('employeeNumber', authUser.P_USER_NAME);
// request.append('quotePrice', this.itemPrice);
// request.append('isActive', 'true');
// request.append('regionID', this.regionID);
// request.append('status', this.itemCondition);
// console.log(this.selectedFile);
// if (this.selectedFile && this.selectedFile !== undefined) {
// request.append('fileColl', this.addAttachRequest.toString());
// }
// 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);
var request = {
"TokenID": authUser.LogInTokenID, "EmployeeNumber": authUser.P_USER_NAME, "ItgImageCollList": this.addAttachRequest,
"ItgTitle": this.itemInfo,
"ItgTitleAr": this.itemInfo,
"ItgCategoryID": this.selectedCategory.categoryID,
"ItgDescription": this.itemDescription,
"ItgDescriptionAr": this.itemDescription,
"ItgQuotePrice": this.itemPrice,
"RegionID": this.regionID,
"ItgIsActive": true,
"ItgStatus": this.itemCondition
}
this.itemService.createItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.cs.greenToastPK("general", "success-create");
this.openItem();
} else {
this.cs.stopLoading();
this.cs.redToastPK("general", "try-again");
}
})
}
setEditPage() {
this.step = 2;
this.selectedCategory = {
categoryID: this.editItem.categoryID,
title: this.editItem.categoryTitle,
title_Ar: this.editItem.categoryTitle
}
this.itemInfo = this.editItem.title;
this.itemDescription = this.editItem.description;
this.itemPrice = this.editItem.quotePrice;
this.regionID = this.editItem.regionID;
this.itemCondition = this.editItem.status.toLowerCase();
this.selectedPicture = this.getAttachment(this.editItem.itemAttachments);
}
getAttachment(itemsArray) {
let item = [];
itemsArray.forEach(element => {
item.push({
// attachmentId: element.attachmentId,
// ContentType: element.contentType,
data: 'data:image/png;base64,' + element.content,
name: element.fileName,
});
});
return item;
}
updateItemForSale() {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('itemSaleID', this.editItem.itemSaleID);
request.append('title', this.itemInfo);
request.append('title_Ar', this.itemInfo);
request.append('categoryID', this.selectedCategory.categoryID);
request.append('description', this.itemDescription);
request.append('description_Ar', this.itemDescription);
request.append('employeeNumber', authUser.P_USER_NAME);
request.append('quotePrice', this.itemPrice);
request.append('isActive', 'true');
request.append('regionID', this.regionID);
request.append('status', this.itemCondition);
// console.log(this.selectedFile);
// if (this.selectedFile && this.selectedFile !== undefined) {
// request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
// }
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.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.cs.greenToastPK("general", "success-create");
this.openItem();
} else {
this.cs.stopLoading();
this.cs.redToastPK("general", "try-again");
}
})
}
cancelItem() {
if (this.step == 2 || this.step == 3) {
this.step = 1;
} else {
this.cs.back();
}
}
validate() {
if (!this.validateChar(this.itemInfo) || !this.itemDescription || !this.itemPrice || !this.itemCondition || this.addAttachRequest.length == 0) {
return false;
} else {
return true;
}
}
validateChar(text) {
var regExp = /^[a-zA-Z]*$/
if ((!regExp.test(text) && !this.hasArabicCharacters(text)) || !text) {
return false;
}
else {
return true;
}
}
hasArabicCharacters(text) {
var regex = new RegExp("[\u0600-\u06ff]|[\u0750-\u077f]|[\ufb50-\ufc3f]|[\ufe70-\ufefc]");
return regex.test(text);
}
public attachmentSelected(event: any) {
try {
this.addAttachRequest = event.inputFiles.map((res: any) => {
let array = res.name.split(".");
let attachType: string = array[array.length - 1];
this.indexLastObj++;
return { AttachmentID: this.indexLastObj, FileName: res.name, Base64Data: res.data.split(",")[1], ContentType: 'image/' + attachType };
});
} catch (e) { }
}
}

@ -1,4 +1,4 @@
<ion-content>
<ion-content *ngIf="itemDetails">
<div class="head-title">
<app-generic-header
@ -9,21 +9,29 @@
</div>
<div class="header"></div>
<div class="bottom"></div>
<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>
<img *ngIf="!itemDetails.itemAttachments[0] || !itemDetails.itemAttachments[0].content" src="assets/imgs/no-images.png" />
<!-- <img *ngIf="itemDetails.itemAttachments[0]" [src]="item.itemAttachments[0]" />
<img *ngIf="!itemDetails.itemAttachments[0]" src="assets/imgs/no-images.png" /> -->
<ion-slides *ngIf="itemDetails.itemAttachments.length>0">
<ion-slide *ngFor="let slide of itemDetails.itemAttachments">
<img [src]="getImgContent('data:image/png;base64, ' +slide.content)" />
</ion-slide>
</ion-slides>
<ion-card-title *ngIf="direction == 'ltr'">{{itemDetails.title}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{itemDetails.title_Ar}}</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.
<span *ngIf="direction == 'ltr'">{{itemDetails.description}}</span>
<span *ngIf="direction =='rtl'">{{itemDetails.description_Ar}}</span>
<div class="content-bottom">
<p class="green">New</p>
<h1>500 SAR</h1>
<p [class]="itemDetails.status=='Approved' ? 'green' : 'yellow'">{{itemDetails.status}}</p>
<h1> <strong>
{{itemDetails.quotePrice}} {{itemDetails.currencyCode}}
</strong></h1>
</div>
@ -33,9 +41,9 @@
<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>
<p class="profile-title">{{itemDetails.fullName}}</p>
<p>{{getDate(itemDetails.created) }}</p>
<!-- <p><a href="">View Profile</a></p> -->
</ion-label>
</ion-item>
@ -50,14 +58,15 @@
<ion-footer >
<div class="centerDiv details-button" >
<a [href]="'mail:' + itemDetails.emailAddress">
<ion-button class="footer-button" ion-button>
<img class="icon-footer" src="/assets/imgs/itemsforsale/sms.svg">
{{ts.trPK('sms','title')}} </ion-button>
<img [class]="direction == 'ltr' ? 'icon-footer' : 'icon-footer-ar'" src="/assets/imgs/itemsforsale/sms.svg">
{{ts.trPK('general','email')}} </ion-button></a>
<a [href]="'tel:' + itemDetails.mobileNumber">
<ion-button class="footer-button" ion-button>
<img class="icon-footer" src="/assets/imgs/itemsforsale/call.svg">
{{ts.trPK('vacation-rule','call')}} </ion-button>
<img [class]="direction == 'ltr' ? 'icon-footer' : 'icon-footer-ar'" src="/assets/imgs/itemsforsale/call.svg ">
{{ts.trPK('vacation-rule','call')}} </ion-button></a>
</div>
</ion-footer>
</ion-content>

@ -76,4 +76,9 @@ ion-footer{
margin: 0px;
position: relative;
left: -10px;
}
.icon-footer-ar{
margin: 0px;
position: relative;
left: 5px;
}

@ -1,15 +1,41 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ItemForSaleService } from '../services/service.service';
import * as moment from 'moment';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
@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,) { }
itemDetails: any;
direction: any;
constructor(public ts: TranslatorService, public itemService: ItemForSaleService, public route: ActivatedRoute, public cs: CommonService, private sanitizer: DomSanitizer,) {
this.route
.params.subscribe(val => {
setTimeout(() => {
this.ionEnter();
}, 100);
});
}
ngOnInit() {
}
ionEnter() {
this.direction = TranslatorService.getCurrentDirection();
this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false);
ngOnInit() { }
}
getDate(date) {
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
}
getImgContent(imgFile): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
}

@ -11,6 +11,8 @@ 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';
import { ItemForSaleService } from './services/service.service';
import { FilterComponent } from './filter/filter.component';
const routes: Routes = [
{
@ -32,6 +34,10 @@ const routes: Routes = [
{
path: 'my-ads',
component: MyAdsComponent
},
{
path: 'filter',
component: FilterComponent
}
],
}
@ -45,6 +51,8 @@ const routes: Routes = [
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent]
declarations: [ItemforsalePage, HomeComponent, ItemsComponent, ItemDetailsComponent, MyAdsComponent, FilterComponent],
providers: [ItemForSaleService],
})
export class ItemforsalePageModule { }

@ -28,7 +28,7 @@
<ion-col size="12">
<ion-item lines="none" class="SearchtextBox">
<ion-input [placeholder]="'itemforsale,search-items'| translate"></ion-input>
<ion-input [placeholder]="'itemforsale,search-items'| translate" (input)="search($event.target.value)"></ion-input>
</ion-item>
</ion-col>
</ion-row>
@ -37,73 +37,49 @@
<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">
<img class="filter-icon" src="assets/imgs/itemsforsale/filter.svg" (click)="openModel()">
</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 class="box-icon" *ngFor="let category of categories" >
<div class="sale-icon" [ngClass]="{'active':activeClass==category.categoryID }" (click)="selectCategory(category)">
<div class="top" [innerHTML]="category.content | sanitizeHTMLPipe" >
</div>
<div class="bottom-icon">
<p>Fashion & Beauty</p>
<p *ngIf="direction == 'ltr'">{{category.title}}</p>
<p *ngIf="direction =='rtl'">{{category.title_Ar}}</p>
</div>
</div>
</div>
</div>
<div class="grid-row">
<ion-row >
<ion-col size="6" (click)="openDetails()">
<ion-card>
<div class="loader" *ngIf="!items ">
<img src="../assets/icon/progress-loading.gif" />
</div>
<ion-row *ngIf="items">
<ion-col size="6" (click)="openDetails(item)" *ngFor="let item of items">
<ion-card *ngIf="item.status.toLowerCase() =='approved'">
<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>
<img *ngIf="item.itemAttachments[0] && item.itemAttachments[0].content" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" />
<img *ngIf="!item.itemAttachments[0] || !item.itemAttachments[0].content" src="/assets/imgs/no-images.png" />
<ion-card-title *ngIf="direction == 'ltr'">{{item.title}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{item.title_Ar}}</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break
<p class="orange">
Used
</p>
<div class="description-cont" *ngIf="direction == 'ltr'">{{getDotted(item.description, 60)}}</div>
<div class="description-cont" *ngIf="direction =='rtl'">{{getDotted(item.description_Ar, 60)}}</div>
<p [class]="item.status=='Approved' ? 'green' : 'yellow'">{{item.status}}</p>
<ion-row>
<ion-col size="10">
<strong>
500 SAR
{{item.quotePrice}} {{item.currencyCode}}
</strong>
</ion-col>
<ion-col size="2">
@ -114,62 +90,55 @@
</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" />
<div class="no-dataDiv" *ngIf="items.length == 0" >
<ion-row>
<img class="empty-data" src="../assets/imgs/box.png"/>
<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>
<h4> {{ts.trPK('general','empty')}}</h4>
</div>
</ion-row>
<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>
</div>
</div>
<div class="my-ads" *ngIf="segment =='2'">
<ion-row>
<ion-item button detail="false">
<ion-item button detail="false" *ngFor="let item of itemsByEmployee">
<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" />
<img *ngIf="item.itemAttachments[0] && item.itemAttachments[0].content" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" />
<img *ngIf="!item.itemAttachments[0] || !item.itemAttachments[0].content" src="assets/imgs/no-images.png" />
</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>
<h3 *ngIf="direction == 'ltr'">{{item.title}}</h3>
<h3 *ngIf="direction =='rtl'">{{item.title_Ar}}</h3>
<p class="posted-on">{{getDate(item.created) }}</p>
<p class="details-text" *ngIf="direction == 'ltr'"> {{getDotted(item.description, 30)}}</p>
<p *ngIf="direction =='rtl'">{{getDotted(item.description_Ar, 30)}}</p>
<ion-row>
<ion-col size="8">
<p class="yellow">Pending Review</p>
<p [class]="item.status=='Approved' ? 'green' : 'yellow'">{{item.status}}</p>
</ion-col>
<ion-col>
<img class="icon" src="assets/imgs/itemsforsale/delete.svg" />
<img class="icon edit" src="assets/imgs/itemsforsale/edit.svg" />
<img class="icon" *ngIf="item.status!='Approved'" src="assets/imgs/itemsforsale/delete.svg" (click)="deleteItems(item)"/>
<img [class]="direction =='ltr' ? 'icon edit' : 'icon edit-ar'" src="assets/imgs/itemsforsale/edit.svg" (click)="editItems(item)" />
</ion-col>
</ion-row>
</ion-label>
</ion-item>
<div class="space"></div>
</ion-row>
</div>

@ -7,9 +7,20 @@
background: #29B5BF;
top: 0;
}
.no-dataDiv{
position: absolute;
left: 0;
right: 0;
margin: auto;
}
.header-toolbar{
--background: #29B5BF !important;
}
.top{
position: relative;
margin: 5px 10px;
}
.bottom{
height: 100%;
width: 100%;
@ -51,7 +62,10 @@
margin-top: 5px;
margin-bottom: 5px;
margin-left: 5px;
font-size: 14px;
font-size: 12px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.bottom-icon{
text-overflow: clip;
@ -69,7 +83,8 @@ ion-card-title{
font-weight: bold;
font-size: 14px;
padding: 5px
padding: 5px;
height: 40px;
}
.orange{
color: #CC9B14;
@ -88,9 +103,9 @@ ion-card-content p{
font-weight: bold;
}
.my-ads ion-item{
margin: 10px;
margin:0px 10px;
--border-radius: 10px;
padding: 15px 10px 0px 10px;
padding: 10px 10px 0px 10px;
width: 100%;
}
.my-ads ion-thumbnail img{
@ -112,9 +127,10 @@ ion-segment-button{
}
ion-segment-button ion-label{
padding: 0;
font-size: 16px;
font-size: 14px;
white-space: normal;
font-weight: bold;
line-height: 1.1;
}
.segment-button-checked ion-label{
color: #fff !important;
@ -132,6 +148,7 @@ ion-item h3{
color: #000;
font-weight: bold;
font-size: 14px;
margin-top:10px;
}
.yellow{
color:#CC9B14;
@ -145,6 +162,10 @@ ion-item .icon{
position: absolute;
right: 0px;
}
.edit-ar{
position: absolute;
left: 0px;
}
.fab-button{
position: fixed;
bottom: 5%;
@ -155,7 +176,7 @@ ion-item .icon{
--background: #29B5BF;
}
ion-footer{
position: absolute;
position: fixed;
bottom: 0;
}
ion-footer .footer-button{
@ -219,4 +240,42 @@ ion-fab-button{
}
.grid-row{
margin:10px;
}
.active .top::before{
position: absolute;
right: 0px;
top: 2px;
padding: 0px;
background: #3cc353;
padding: 2px 3px 4px 3px;
border-radius: 60%;
font-size: 10px;
color: #fff;
content: '';
width: 12px;
height: 12px;
text-align: center;
}
.space{
height:100px;
}
.loader{
display: block;
position: absolute;
margin: auto;
text-align: center;
width: 100%;
}
.loader img{
display: inline-block;
margin: auto;
width: 25px;
}
.description-cont{
min-height: 60px;
height: 65px;
overflow: hidden;
font-size: 14px;
}

@ -1,6 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ItemForSaleService } from '../services/service.service';
import { deepCopy } from '@angular-devkit/core/src/utils/object';
import * as moment from 'moment';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
@Component({
selector: 'app-items',
@ -9,17 +15,157 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class ItemsComponent implements OnInit {
segment: any = '1';
constructor(public ts: TranslatorService, public cs: CommonService,) { }
items: any;
categories: any = [];
direction: string;
activeClass: any;
pageNo: number = 1;
tempSearch: any = [];
itemsByEmployee: any = [];
allCategory = {
categoryID: 0,
content: '<svg xmlns="http://www.w3.org/2000/svg" width="33.925" height="25.841" viewBox="0 0 33.925 25.841"><g id="More_Select" data-name="More Select"><path d="m30 1h-24a1 1 0 0 0 -1 1v1h21a3 3 0 0 1 3 3v21h1a1 1 0 0 0 1-1v-24a1 1 0 0 0 -1-1z"/><path d="m26 5h-24a1 1 0 0 0 -1 1v24a1 1 0 0 0 1 1h24a1 1 0 0 0 1-1v-24a1 1 0 0 0 -1-1zm-4.747 9.344-8.728 8.726a1 1 0 0 1 -1.414 0l-4.364-4.363a1 1 0 0 1 1.414-1.414l3.657 3.656 8.021-8.019a1 1 0 0 1 1.414 1.414z"/></g></svg>',
isActive: true,
title: "All",
title_Ar: "الجميع",
}
constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService, private authService: AuthenticationService) {
this.route
.params.subscribe(val => {
setTimeout(() => {
this.cs.startLoading();
var selectedFilter = this.cs.sharedService.getSharedData(ItemForSaleService.selected_filters);
if (selectedFilter) {
this.selectCategory(selectedFilter);
}
else {
this.getItemsCategories();
this.getItemsByEmployee();
}
}, 100);
});
}
ngOnInit() { }
openDetails() {
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
}
getItemsCategories() {
this.itemService.getCategories({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.categories = this.itemService.parser(result);
this.categories.unshift(this.allCategory);
this.cs.sharedService.setSharedData(this.categories, ItemForSaleService.CATEGORIES);
})
this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items = [];
this.items = this.itemService.parser(result);
this.tempSearch = deepCopy(this.items);
console.log(this.tempSearch);
this.cs.stopLoading();
})
}
openDetails(selected) {
this.cs.sharedService.setSharedData(selected, ItemForSaleService.ITEMS_SELECTED);
this.cs.navigateForward('/itemforsale/items-details');
}
segmentChanged(value) {
this.segment = value.detail.value;
}
openSale() {
this.cs.navigateForward('/itemforsale/home');
this.cs.openCreateitems();
}
selectCategory(item) {
this.cs.startLoading();
this.activeClass = item.categoryID;
this.pageNo = 1;
this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items = [];
this.items = this.itemService.parser(result);
this.tempSearch = deepCopy(this.items);
this.cs.stopLoading();
})
}
getDotted(temp: string, valueCount: number) {
temp = this.stripHtml(temp);
return temp.substring(0, valueCount) + " ...";
}
stripHtml(html) {
var temporalDivElement = document.createElement("div");
temporalDivElement.innerHTML = html;
return temporalDivElement.textContent || temporalDivElement.innerText || "";
}
loadData(event) {
this.pageNo = this.pageNo + 1;
this.itemService.getItems({ pageNo: this.pageNo, categoryID: this.activeClass }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items.concat(this.itemService.parser(result));
this.tempSearch = deepCopy(this.items);
event.target.complete();
})
}
search(t) {
if (t === '') {
this.items = this.tempSearch;
} else {
this.items = this.tempSearch.filter((post) => {
if (this.direction == 'ltr')
return (post.title.toLowerCase().indexOf(t.toLowerCase()) > -1);
else
return (post.title_Ar.indexOf(t) > -1);
});
}
}
getItemsByEmployee() {
this.cs.startLoading();
this.itemService.getItemsByEmployee({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.itemsByEmployee = this.itemService.parser(result);
this.cs.stopLoading();
console.log(this.itemsByEmployee);
})
}
getDate(date) {
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
}
getImgContent(imgFile): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
editItems(items) {
this.cs.sharedService.setSharedData(items, ItemForSaleService.EDIT_ITEMS);
this.cs.openCreateitems();
}
deleteItems(item) {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('itemSaleID', item.itemSaleID);
request.append('isActive', 'false');
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);
request.append('employeeNumber', authUser.P_USER_NAME);
this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.cs.greenToastPK('itemforsale', 'item-deleted');
this.getItemsByEmployee();
}
})
}
openModel() {
this.cs.filterItemforSale();
}
}

@ -0,0 +1,15 @@
import { Pipe, PipeTransform } from "@angular/core";
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({
name: 'sanitizeHTMLPipe'
})
export class SanitizeHtmlPipe implements PipeTransform {
constructor(private _sanitizer: DomSanitizer) {
}
transform(v: string): SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(v);
}
}

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

@ -0,0 +1,87 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { MowadhafiService } from 'src/app/mowadhafi/mowadhafi.service';
@Injectable({
providedIn: 'root'
})
export class ItemForSaleService {
public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSaleMobile';
public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale';
public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion';
public static ITEMS_SELECTED = 'item-selected';
public static CATEGORIES = 'categories';
public static EDIT_ITEMS = 'edit-items';
public static selected_filters = 'selected_filter';
constructor(
public con: ConnectorService,
private authService: AuthenticationService,
private http: HttpClient
) { }
public getItems(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
request.ItgPageNo = request.pageNo;
request.ItgPageSize = 10;
request.ItgStatus = "Approved";
return this.con.postNoLoad(ItemForSaleService.getItemForSale, request, onError, errorLabel);
}
public getCategories(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.postNoLoad(ItemForSaleService.getCategories, request, onError, errorLabel);
}
parser(response: any) {
try {
var result = JSON.parse(response.Mohemm_ITG_ResponseItem);
if (result.result)
return result.result.data
else
return {}
} catch (res) {
console.log(res);
}
}
getItemsByEmployee(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
request.ItgEmployeeNumber = request.UserName; //request.UserName;
return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel);
}
getRegion(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
request.ItgEmployeeNumber = request.UserName; //request.UserName;
return this.con.post(ItemForSaleService.getRegion, request, onError, errorLabel);
}
createItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
const request = itemRequest;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
//return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
return this.con.post(ItemForSaleService.createItemForSale, request, onError, errorLabel);
//}
//)
}
updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
const request = itemRequest;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
return this.http.post(ConnectorService.host + ItemForSaleService.updateItemForSale, itemRequest, {
}
)
}
}

@ -176,6 +176,7 @@
letter-spacing: -0.64px;
color: #2B353E;
opacity: 1;
line-height: 20px;
}

@ -270,6 +270,7 @@ export class DetailsComponent implements OnInit {
if (this.activeSegment === 'Attendance') {
this.common.startLoading();
this.initAttendance();
this.showAttendanceTracking();
}
else if (this.activeSegment != 'Attendance' && this.activeSegment != 'TeamMembers') {
this.activeSegment = 'About';

@ -1,5 +1,6 @@
<app-generic-header
showBack="true"
subordinateLeave='true'
backLink="/home"
[headerText]="'myTeam, myTeam-header' | translate">
</app-generic-header>

@ -10,6 +10,7 @@ import { MyTeamPage } from './my-team.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { from } from 'rxjs';
import { WorklistService } from '../notification/service/worklist.service';
import { SubordinateLeaveComponent } from './subordinate-leave/subordinate-leave.component';
const routes: Routes = [
@ -28,7 +29,10 @@ const routes: Routes = [
path: 'details-2',
component: DetailsComponent
},
{
path: 'subordinate-leave',
component: SubordinateLeaveComponent
}
]
}
@ -44,7 +48,11 @@ const routes: Routes = [
],
providers: [WorklistService],
declarations: [MyTeamPage, HomeComponent, DetailsComponent,
declarations: [
MyTeamPage,
HomeComponent,
DetailsComponent,
SubordinateLeaveComponent
]
})
export class MyTeamPageModule { }

@ -7,6 +7,7 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio
export class MyTeamService {
public static EMPLOYEE_SHARED_DATA = 'employee';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
public static getSubordintesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS';
// public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
@ -20,6 +21,13 @@ export class MyTeamService {
return this.con.post(MyTeamService.getMyTeam, request, onError, errorLabel);
}
public getEmployeeSubordinatesLeave(absence: any, onError?: any, errorLabel?: string){
const request = absence;
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
return this.con.post(MyTeamService.getSubordintesLeaves, request, onError, errorLabel);
}
// public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){
// const request = absence;
// this.authService.authenticateRequest(request);

@ -0,0 +1,89 @@
<app-generic-header
showBack="true"
[headerText]="'myTeam, subordinate-leave' | translate">
</app-generic-header>
<ion-content padding style="--background: #f5f5f5">
<div class="team-member-container">
<ion-label>
<ion-item lines='none'>
<p style="font-size: 18px; font-weight: bold;">{{ts.trPK('myTeam','select-duration')}}</p>
</ion-item>
</ion-label>
<ion-grid>
<ion-row>
<ion-col size='6'>
<ion-label position='floating' style="margin-left: 15px;" class="colBold">{{ts.trPK('general','from')}} </ion-label>
<ion-item class='dynamicField' lines='none'>
<ion-datetime style="padding: 0px" [(ngModel)]="startDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required
cancelText="{{ts.trPK('general','cancel')}}" doneText="{{ts.trPK('general','done')}}"></ion-datetime>
&nbsp;
<ion-icon style="width: 20px;" name="calendar"></ion-icon>
</ion-item>
</ion-col>
<ion-col size='6'>
<ion-label position='floating' style="margin-left: 15px;" class="colBold">{{ts.trPK('general','to')}} </ion-label>
<ion-item class='dynamicField' lines='none'>
<ion-datetime style="padding: 0px" [(ngModel)]="endDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required
cancelText="{{ts.trPK('general','cancel')}}"
doneText="{{ts.trPK('general','done')}}"></ion-datetime>
&nbsp;
<ion-icon style="width: 20px;" name="calendar"></ion-icon>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div *ngIf='noData'></div>
<div *ngIf='!noData'>
<div *ngIf='list.length === 0'>
<div class="team-member-container" style="text-align: center;">
<h2 style="margin-top: 5px !important; font-size: 20px;" class="name">
{{ts.trPK('general','empty')}}
</h2>
</div>
</div>
<div *ngIf='list.length > 0'>
<div class="team-member-container" *ngFor='let user of list'>
<ion-row>
<ion-col [size]="3">
<div class="user-image-container">
<div class="user-image">
<img *ngIf='user.image' [src]="user.image"/>
<img *ngIf='!user.image' src="../assets/imgs/profile.png"/>
</div>
</div>
</ion-col>
<ion-col [size]="9">
<div>
<span>
<h2 style="margin-top: 0px !important; font-size: 20px;" class="name">{{user.EMPLOYEE_NAME}}</h2>
<span class="title"><ion-label>{{ts.trPK('general','from')}}: </ion-label><b style="font-size: 12px;">{{getDate(user.DATE_START)}} &nbsp; &nbsp;</b></span>
<span class="title"><ion-label>{{ts.trPK('general','to')}}: </ion-label><b style="font-size: 12px;">{{getDate(user.DATE_END)}}</b></span>
<br>
<span class="title"><ion-label>{{ts.trPK('myTeam','no-of-days')}}: </ion-label><b style="font-size: 12px;">{{diffDays(user)}}</b></span>
</span>
</div>
</ion-col>
</ion-row>
</div>
</div>
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="confirmEitOkButton" [disabled]='checkDate()' (click)="subordinateLeaveList()">{{ts.trPK('general','submit')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,199 @@
.confirmEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
--background: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.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;
/* margin-top: 2px; */
font-family: WorkSans-Regular;
border: 1px solid #ccc;
border-radius: 15px;
padding-bottom: 8px;
padding-top: 9px;
margin-bottom: 7px;
}
// .user-image-container{
// position: relative;
// width: 70px;
// height: 70px;
// display: block;
// margin: 0 auto;
// &:before{
// position: absolute;
// content: "";
// width: 20px;
// height: 20px;
// border-radius: 20px;
// border: 1px solid white;
// top: 0;
// right: 0;
// background-color: red;
// z-index: 9;
// }
// &.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;
img {
// width: 100%;
// max-height: 100%;
width: 74%;
max-height: 74%;
margin-top: 7px;
margin-left: 6px;
}
}
.employee-name{
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: 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;
// 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{
width: 20%;
display: inline-block;
text-align: center;
vertical-align: top;
margin-top: 5px;
}
.swipe-information{
color: #888;
font-size: 12px;
border-top: 1px solid #ccc;
padding-top: 6px;
margin-top: 6px;
.check-in {
font-size: 12px;
margin-right: 15px;
}
}

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

@ -0,0 +1,57 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { MyTeamService } from '../service/my-team.service';
import * as moment from 'moment';
@Component({
selector: 'app-subordinate-leave',
templateUrl: './subordinate-leave.component.html',
styleUrls: ['./subordinate-leave.component.scss'],
})
export class SubordinateLeaveComponent implements OnInit {
public startDate: any;
public endDate: any;
public list = [];
public noData = true;
constructor(
public ts: TranslatorService,
public common: CommonService,
public myTeamService: MyTeamService,
) { }
ngOnInit() {}
subordinateLeaveList() {
const Sdata = this.common.convertDateToJsonDateUpdated(this.startDate);
const Edata = this.common.convertDateToJsonDateUpdated(this.endDate);
this.myTeamService.getEmployeeSubordinatesLeave({
P_DATE_FROM: Sdata,
P_DATE_TO: Edata
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.common.validResponse(result)) {
this.list = result.GetSubordinatesLeavesTotalVacationsList;
this.noData = false;
}
});
}
getDate(date) {
const newDate = this.common.localizeDate(new Date(this.common.getDateTimeISOFromStringUpdated(date).split(' ')[0]));
return newDate;
}
diffDays(date) {
const date1 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_START).split(' ')[0]);
const date2 = new Date(this.common.getDateTimeISOFromStringUpdated(date.DATE_END).split(' ')[0]);
const diff = Math.abs(date1.getTime() - date2.getTime());
const diffDays = Math.ceil(diff / (1000 * 3600 * 24));
return diffDays;
}
checkDate() {
if (this.startDate && this.endDate) {
return false;
} else { return true; }
}
}

@ -1,6 +1,7 @@
<app-generic-header
showBack="true"
backLink="/home"
[worklistSetting] ='true'
[headerText]="'home, worklist' | translate">
</app-generic-header>
@ -10,6 +11,7 @@
<div class="request-heading">
<span>{{ts.trPK('work-list','open-analysis')}}</span>
</div>
<<<<<<< HEAD
<div class="result-text-container" [ngStyle]="showChart === false ? {'visibility': 'hidden'} : {}">
<span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}} </span>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} </span>
@ -23,6 +25,22 @@
</div>
<ion-row class="filters-row" *ngIf="showChart">
=======
<div class="result-text-container" >
<h2>{{totalRequestCount}}</h2>
<!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2> -->
<!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2> -->
<span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span>
</div>
<!-- <div *ngIf="!showChart || !receivedITGCount" class="spinner-custom-class">
<ion-spinner class="spinner" name="lines"></ion-spinner>
</div> -->
<p-chart *ngIf="!showChart || !receivedITGCount" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="showChart && receivedITGCount" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<ion-row class="filters-row">
>>>>>>> MOHEMM-Q3-DEV-LATEST
<ion-slides [options]="slideOptsOne">
<ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''">
<app-card-filter
@ -41,7 +59,7 @@
<span style="margin-left: 5px;">{{ts.trPK('work-list','clear-search')}}</span>
<ion-icon name="close" ></ion-icon>
</ion-col>
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter === 'ALL'">
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter !== 'ITG' && !showSearchButton">
<ion-icon name="search" ></ion-icon>
<span>{{ts.trPK('work-list','advanced-search')}}</span>
</ion-col>
@ -70,7 +88,6 @@
</div>
</div>
<div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<!-- <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> -->
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' >
<div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
@ -99,9 +116,8 @@
</div>
</div>
</div>
<!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="selectedFilter === 'ALL' || itemType !== ''">
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>

@ -356,7 +356,7 @@ z-index: 99;
ion-col{
background: white;
border-radius: 12px;
padding-right: 30px;
// padding-right: 30px;
flex: none;
ion-icon{
margin-right: 3px;
@ -460,4 +460,10 @@ padding: 10px 30px;
}
.slideCss{
width: auto !important;
}
.spinner-custom-class{
position: absolute;
right: 160px;
top: 100px;
}

@ -11,6 +11,7 @@ import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/wor
import { DatePipe } from '@angular/common';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
@Component({
selector: 'app-home',
@ -22,6 +23,7 @@ export class HomeComponent implements OnInit {
public static REQUSET_INFO = 'requset_info';
public static ALL_REQUEST = 'all_request';
public static NOTIFICATION_DATA = 'notification_data';
public static COUNT_CHANGED = 'count_changed';
public static NOTIFICATION_ARR = 'notification_arr';
public static NAMES_ALL_iTEMS = 'names-all-items';
public static IS_ALL_NAME = 'is_all_names';
@ -65,11 +67,11 @@ export class HomeComponent implements OnInit {
public newWorkListResponse = [];
public showFormattedData = [];
public allFormattedData = [];
public selectedFilter = 'ALL';
public selectedFilter = 'HR';
public showSearchButton = false;
public itemType = '';
public itemType = 'HRSSA';
public receivedITGCount = false;
public countChanged: any = false;
public totalHR = 0;
public totalPO = 0;
public totalPR = 0;
@ -84,27 +86,24 @@ export class HomeComponent implements OnInit {
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [0, 0, 0],
backgroundColor: [
'#18a169',
'#114475',
'#38c9b3'
],
borderWidth: 5
}]
};
// public data = {
// datasets: [
// {
// data: [0, 0, 0, 0, 0, 0, 0],
// backgroundColor: [
// '#18a169',
// '#3cb9d5',
// '#114475',
// '#38c9b3',
// '#cc3232',
// '#9e7e97',
// '#ff9800'
// ],
// borderWidth: 6
// }]
// };
public data: any;
public filters = [
{
value: 0,
name: 'All',
active: true,
color: '#124375',
key: 'ALL',
disable: false
},
{
value: 0,
name: 'HR',
@ -156,7 +155,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 50;
this.WorkListObj.P_PAGE_LIMIT = 25;
}
ngOnInit() {
@ -164,8 +163,14 @@ export class HomeComponent implements OnInit {
this.isLoading = true;
}
ionViewWillEnter() {
console.log(this.filters);
this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest();
const values = this.common.getFiltersData();
this.data = values.data;
this.filters = values.filters;
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
if (loadWorkList) {
this.receivedITGCount = false;
@ -177,10 +182,11 @@ export class HomeComponent implements OnInit {
}
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.itemType = '';
this.selectedFilter = 'ALL';
this.itemType = 'HRSSA';
this.selectedFilter = 'HR';
this.enableFilters();
this.filters[0].active = true;
this.isPostNoLoad = true;
this.disableFilters();
this.resetData();
this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
@ -189,47 +195,42 @@ export class HomeComponent implements OnInit {
}
callWorkListServices() {
// if (this.countChanged) {
this.Count();
// }
this.getAllPushNotificationFun();
}
openNotificationsDashboard() {
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
this.worklistNotifications = result;
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.common.sharedService.setSharedData(result, 'worklistNotifications');
// this.Details();
this.callWorkListServices();
}
});
// if (this.countChanged) {
// this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
// if (this.common.validResponse(result)) {
// this.countChanged = false;
// this.worklistNotifications = result;
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
//this.resetFiltersUI();
// this.assignDataToFilters();
// this.common.sharedService.setSharedData(result, 'worklistNotifications');
this.Details();
this.callWorkListServices();
// }
// });
// } else {
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
// this.resetFiltersUI();
// this.assignDataToFilters();
// this.Details();
// this.callWorkListServices();
// }
}
assignDataToFilters() {
this.ngZone.run(() => {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.filters[1].value = this.totalHR;
this.filters[2].value = this.totalPR;
this.filters[3].value = this.totalPO;
});
if (this.totalHR === 0) {
this.data.datasets[0].data[0] = 0;
}
if (this.totalPO === 0) {
this.data.datasets[0].data[1] = 0;
}
if (this.totalPR === 0) {
this.data.datasets[0].data[2] = 0;
}
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
for (const notification of openNotificationsArray) {
if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = this.totalHR;
this.filters[0].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[2].value = this.totalPR;
@ -239,9 +240,7 @@ export class HomeComponent implements OnInit {
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
}
}
// this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
// this.common.stopLoading();
this.isLoading = false;
}
@ -254,16 +253,46 @@ export class HomeComponent implements OnInit {
}
}
public initiateNewWorklistData(selectedFilter: any, filterValue: any) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 25;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
this.itemType = this.selectedFilter;
this.newWorkListResponse = [];
this.showFormattedData = [];
this.allFormattedData = [];
if (filterValue > 0) {
this.getAllPushNotificationFun();
} else {
this.common.stopLoading();
}
}
activeFilter(index: number) {
console.log(this.filters);
if (this.currentActiveIndex !== index) {
if (index !== this.currentActiveIndex) {
if (index !== 4) {
this.common.startLoading();
}
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false;
this.filters[this.currentActiveIndex].active = true;
this.selectedFilter = this.filters[this.currentActiveIndex].key;
const filterValue = this.filters[this.currentActiveIndex].value;
if (this.selectedFilter !== 'ITG') {
this.getFilteredData(this.selectedFilter);
this.initiateNewWorklistData(this.selectedFilter, filterValue);
}
}
}
@ -272,12 +301,14 @@ export class HomeComponent implements OnInit {
this.common.openProfile('sideMenu');
}
disableFilters() {
configureFilters() {
for (const filter of this.filters) {
if (filter.key === this.itemType) {
const index = this.filters.map(function (e) { return e.key; }).indexOf(this.itemType);
this.currentActiveIndex = index;
this.previousActiveIndex = 0;
filter.disable = false;
filter.active = true;
filter.value = 0;
this.selectedFilter = filter.name;
} else if (this.itemType === '') {
filter.disable = false;
@ -287,17 +318,34 @@ export class HomeComponent implements OnInit {
filter.active = false;
}
}
if (this.itemType === '') {
this.filters[0].active = true;
}
}
enableFilters() {
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
for (const filter of this.filters) {
filter.disable = false;
if (filter.key === this.itemType) {
filter.active = true;
} else {
filter.active = false;
}
}
}
async openSearchModal() {
const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent,
cssClass: 'advanced-search-modal-custom',
backdropDismiss: false,
componentProps: {}
componentProps: {
itemType: this.itemType
}
});
modal.onDidDismiss().then(result => {
if (result.data) {
@ -313,13 +361,10 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = [];
this.showFormattedData = [];
this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true;
this.allFormattedData = [];
if (this.itemType !== '') {
this.disableFilters();
this.configureFilters();
}
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
@ -353,21 +398,6 @@ export class HomeComponent implements OnInit {
);
}
getFilteredData(filter: string) {
if (filter === 'ALL') {
this.showFormattedData = this.allFormattedData;
} else {
let arrayToFilter;
arrayToFilter = this.newWorkListResponse.filter((workList) => {
return workList.ITEM_TYPE === filter;
});
const categorizeData = this.categorizeData(arrayToFilter);
this.showFormattedData = this.sortArray(categorizeData);
// const sortData = this.sortArray(arrayToFilter);
// this.showFormattedData = this.categorizeData(sortData);
}
}
checkDateExistance(currentDate: any, formattedData: any) {
let existsBefore = false;
let index = 0;
@ -384,32 +414,10 @@ export class HomeComponent implements OnInit {
};
}
addCountInFilters(workList: any) {
if (workList.ITEM_TYPE === 'HRSSA') {
this.totalHR = this.totalHR + 1;
} else if (workList.ITEM_TYPE === 'POAPPRV') {
this.totalPO = this.totalPO + 1;
} else if (workList.ITEM_TYPE === 'REQAPPRV') {
this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVITEM') {
this.totalIC = this.totalIC + 1;
} else if (workList.ITEM_TYPE === 'STAMP') {
this.totalStamp = this.totalStamp + 1;
}
}
categorizeData(arrayToCategorize: any) {
this.ngZone.run(() => {
this.totalHR = 0;
this.totalPO = 0;
this.totalPR = 0;
this.totalIC = 0;
})
const datePipe = new DatePipe('en-US');
const formattedData = [];
for (const workList of arrayToCategorize) {
this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = {
date: '',
@ -470,36 +478,38 @@ export class HomeComponent implements OnInit {
this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
this.assignDataToFilters();
}
} else {
this.newWorkListResponse = [];
// this.assignDataToFilters();
if (this.showFormattedData.length === 0) {
this.resetFiltersUI();
// this.resetFiltersUI();
}
// this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
// this.common.stopLoading();
this.isLoading = false;
}
}
public resetFiltersUI () {
public resetFiltersUI() {
this.ngZone.run(() => {
this.filters[0].value = 0;
this.filters[1].value = 0;
this.filters[2].value = 0;
this.filters[3].value = 0;
this.filters[5].value = 0;
this.filters[6].value = 0;
this.data.datasets[0].data[0] = 0;
this.data.datasets[0].data[1] = 0;
this.data.datasets[0].data[2] = 0;
this.data.datasets[0].data[3] = 0;
this.data.datasets[0].data[5] = 0;
this.data.datasets[0].data[6] = 0;
});
}
openNotificationDetail(obj) {
this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter');
this.common.sharedService.setSharedData(this.itemType, 'selectedFilter');
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
@ -531,24 +541,19 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
// initializeWorkList() {
// }
clearSearch() {
this.common.startLoading();
this.isLoading = true;
this.itemType = '';
this.selectedFilter = 'ALL';
this.isLoading = false;
this.itemType = 'HRSSA';
this.selectedFilter = 'HR';
this.isPostNoLoad = true;
this.disableFilters();
this.enableFilters();
this.resetData();
this.getAllPushNotificationFun();
}
doInfinite(infiniteScroll) {
if (!this.isReachEnd && this.selectedFilter !== 'ITG') {
this.common.startLoading();
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
@ -568,46 +573,63 @@ export class HomeComponent implements OnInit {
this.ITGItem = [];
this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => {
if (result.RequestType.length > 0) {
this.ITGSegment[0] = {
name: 'All',
code: 'All',
data: null,
style: false
};
this.ITGSegment[0].data = datas;
this.ITGSegment[0].names = names;
this.setActive(this.ITGSegment[0].code);
}
console.log(result.RequestType);
let count = 1;
for (let i = 0; i < result.RequestType.length; i++) {
console.log()
this.ITGSegment[count] = {
name: result.RequestType[i].RequestTypeName,
code: result.RequestType[i].RequestTypeCode,
data: result.RequestType[i].RequestDetails,
style: false
};
datas[i] = result.RequestType[i].RequestDetails;
names[i] = result.RequestType[i].RequestTypeCode;
count++;
if (result.RequestType) {
if (result.RequestType.length > 0) {
this.countChanged = false;
this.ITGSegment[0] = {
name: 'All',
code: 'All',
data: null,
style: false
};
this.ITGSegment[0].data = datas;
this.ITGSegment[0].names = names;
this.setActive(this.ITGSegment[0].code);
}
console.log(result.RequestType);
let count = 1;
for (let i = 0; i < result.RequestType.length; i++) {
console.log()
this.ITGSegment[count] = {
name: result.RequestType[i].RequestTypeName,
code: result.RequestType[i].RequestTypeCode,
data: result.RequestType[i].RequestDetails,
style: false
};
datas[i] = result.RequestType[i].RequestDetails;
names[i] = result.RequestType[i].RequestTypeCode;
count++;
}
}
//this.sortArrayOfAll(this.ITGSegment[0].data)
console.log(this.ITGSegment);
});
}
Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => {
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.data.datasets[0].data[4] = this.ITGCount;
this.filters[5].value = result.TotalCount;
this.receivedITGCount = true;
});
// var result = this.common.sharedService.getSharedData(MenuResponse.ITG_COUNTS, false);
// if (this.countChanged) {
// this.workListService.getITGDetails('', '', this.isPostNoLoad)
// .subscribe((result: any) => {
// this.countChanged = false;
// this.ITGCount = result.TotalCount;
// // this.totalRequestCount = this.totalRequestCount + result.TotalCount;
// this.data.datasets[0].data[4] = this.ITGCount;
// this.filters[4].value = result.TotalCount;
// this.receivedITGCount = true;
// })
// } else {
//this.workListService.getITGDetails('', '', this.isPostNoLoad)
//.subscribe((result: any) => {
this.ITGCount = this.common.filterKeys['ITG'];//result.TotalCount;
// this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.data.datasets[0].data[4] = this.common.filterKeys['ITG'];//this.ITGCount;
this.filters[4].value = this.common.filterKeys['ITG'];
this.receivedITGCount = true;
//});
//}
}
searchBtn() {

@ -0,0 +1,6 @@
export class UserItemTypes extends Request {
public P_ITEM_TYPE: string;
public P_FYA_ENABLED_FALG: string;
public P_FYI_ENABLED_FLAG: string;
public ItemID: number;
}

@ -32,6 +32,7 @@ import { MoreActionModalComponent } from './more-action-modal/more-action-modal.
import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component';
import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component';
import { WorklistMainIcComponent } from './worklist-main-ic/worklist-main-ic.component';
import { WorklistSettingComponent } from './worklist-setting/worklist-setting.component';
const routes: Routes = [
@ -123,6 +124,10 @@ const routes: Routes = [
{
path: 'item-creation-IC',
component: WorklistMainIcComponent
},
{
path: 'worklist-settings',
component: WorklistSettingComponent
}
]
}

@ -20,6 +20,7 @@ import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes';
import { Request } from 'src/app/hmg-common/services/models/request';
import { LoginModel } from '../../authentication/models/LoginModel';
import { itgRequest } from '../models/itgFormDetailsRequest';
import { UserItemTypes } from "../models/userItemTypeRequest";
@Injectable()
export class WorklistMainService {
@ -31,7 +32,13 @@ export class WorklistMainService {
public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY";
public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY";
public static getPhoneNotificationBody = "Services/ERP.svc/REST/GET_PHONES_NOTIFICATION_BODY";
public static getTerminationNotificationBody = "Services/ERP.svc/REST/GET_TERM_NOTIFICATION_BODY";
public static getContactNotificationBody = "Services/ERP.svc/REST/GET_CONTACT_NOTIFICATION_BODY";
public static getStampMSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_MS_NOTIFICATION_BODY";
public static getStampNSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_NS_NOTIFICATION_BODY";
public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY";
public static getCEINotificationBody = "Services/ERP.svc/REST/GET_CEI_NOTIFICATION_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
@ -42,6 +49,8 @@ export class WorklistMainService {
public static getITGFormTaskCount = 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType';
public static getITGFormTaskDetails = 'Services/COCWS.svc/REST/ITGFormsPendingTasks';
public static getITGFormDetails = 'Services/COCWS.svc/REST/ITGGetFormDetials';
public static getWorklistNotificationURL = 'Services/ERP.svc/REST/GET_USER_ITEM_TYPES';
public static updateWorklistNotificationURL = 'Services/ERP.svc/REST/UPDATE_USER_ITEM_TYPES';
@ -110,6 +119,21 @@ export class WorklistMainService {
);
}
public getCEINotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<MONotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getCEINotificationBody,
request,
onError,
errorLabel
);
}
public getPRNotificationBody(
WorkListBodyRequest: any,
onError?: any,
@ -140,6 +164,36 @@ export class WorklistMainService {
);
}
public getStampMSNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getStampMSNotificationBody,
request,
onError,
errorLabel
);
}
public getStampNSNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getStampNSNotificationBody,
request,
onError,
errorLabel
);
}
public getAddressNotificationBody(
WorkListBodyRequest: any,
onError?: any,
@ -170,6 +224,52 @@ export class WorklistMainService {
);
}
public getPhoneNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getPhoneNotificationBody,
request,
onError,
errorLabel
);
}
public getTerminationNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getTerminationNotificationBody,
request,
onError,
errorLabel
);
}
public getContactNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getContactNotificationBody,
request,
onError,
errorLabel
);
}
public getPOItemHistory(
POItemHistoryReq: any,
onError?: any,
@ -362,4 +462,32 @@ export class WorklistMainService {
}
public getWorklistNotifications(
onError?: any,
errorLabel?: string
): Observable<any> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getWorklistNotificationURL,
request,
onError,
errorLabel
);
}
public updateWorklistNotifications(
requestData: any,
onError?: any,
errorLabel?: string
): Observable<any> {
this.authService.authenticateRequest(requestData);
return this.api.post(
WorklistMainService.updateWorklistNotificationURL,
requestData,
onError,
errorLabel
);
}
}

@ -6,6 +6,7 @@ import { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeR
import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq';
import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes';
import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes';
import { Request } from 'src/app/hmg-common/services/models/request';
@Injectable()
@ -16,6 +17,7 @@ export class WorklistService {
public static getRFCEmployeeList = 'Services/ERP.svc/REST/GET_RFC_EMPLOYEE_LIST';
public static getActionHistory = 'Services/ERP.svc/REST/GET_ACTION_HISTORY';
public static getFavorite = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacements';
public static getFavoriteWithoutImage = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacementsWithoutImage';
public static saveFavorite = 'Services/ERP.svc/REST/Mohemm_ChangeFavoriteReplacements';
constructor(
public api: ConnectorService,
@ -53,6 +55,15 @@ export class WorklistService {
public getFavorite(req: any, onError?: any, errorLabel?: string): Observable<WorkListActionHistoryResponse> {
this.authService.authenticateRequest(req);
console.log(req);
return this.api.post(WorklistService.getFavorite, req, onError, errorLabel);
}
public getFavoriteByLetter(letter: string, onError?: any, errorLabel?: string): Observable<WorkListActionHistoryResponse> {
const req = new Request();
this.authService.authenticateRequest(req);
req['ItgFilter'] = letter;
console.log(letter);
return this.api.post(WorklistService.getFavorite, req, onError, errorLabel);
}
public saveFavoriteList(request: any, onError?: any, errorLabel?: string): Observable<any> {
@ -63,6 +74,11 @@ export class WorklistService {
return this.api.post(WorklistService.saveFavorite, req, onError, errorLabel);
}
public getFavoriteWithoutImage(req: any, onError?: any, errorLabel?: string): Observable<WorkListActionHistoryResponse> {
this.authService.authenticateRequest(req);
return this.api.post(WorklistService.getFavoriteWithoutImage, req, onError, errorLabel);
}
public getFavoriteMyTeam(req: any, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(req);
return this.api.post(WorklistService.getFavorite, req, onError, errorLabel);

@ -112,10 +112,15 @@
<div *ngIf="approvalInfo.Notes">
<div class="containerNote">
<div class="containerNote" *ngIf='!actionHistory'>
Note: {{approvalInfo.Notes}}
</div>
<div class="containerNote" style="height: auto;" *ngIf='actionHistory'>
Note: {{approvalInfo.Notes}}
</div>
<div *ngIf='approvalInfo.Notes.length >= 16'>
<a (click)="actionHistory = !actionHistory">{{'general, show-more' | translate}}</a>
</div>
</div>
</div>

@ -62,6 +62,7 @@ export class WorkListMainItgComponent implements OnInit {
defaultSegment = '';
public slideIndex = 0;
public messageSuccess = false;
public actionHistory = false;
constructor(
public common: CommonService,
public ts: TranslatorService,
@ -148,28 +149,28 @@ export class WorkListMainItgComponent implements OnInit {
return '../assets/imgs/mohemm-action/info.png';
}
if (actionName === 'Grant') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/grant.png';
}
if (actionName === 'Delegate') {
return '../assets/imgs/mohemm-action/delegate.png';
}
if (actionName === 'Answer') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/answer.png';
}
if (actionName === 'Question') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/question.png';
}
if (actionName === 'ReportGenerated') {
return '../assets/imgs/mohemm-action/ReportGenerated.png';
}
if (actionName === 'Doable') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/Doable.png';
}
if (actionName === 'NotDoable') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/notDoable.png';
}
if (actionName === 'DataCorrected') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/data-corrected.png';
}
}
@ -194,6 +195,10 @@ export class WorkListMainItgComponent implements OnInit {
skip() {
// check if the user clicked on all type of request
this.common.setTotalNumberOfWorklistRequest();
// this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false), 'ITG');
if (this.common.filterKeys['ITG'] != 0)
this.common.filterKeys['ITG'] = (this.common.filterKeys['ITG'] - 1)
if (this.is_all_items_sents) {
for (let i = 1; i < this.all_request_names.length; i++) {
for (let j = 0; j < this.all_request_names[i].data.length; j++) {
@ -271,13 +276,17 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else if (action === 2) {// reject
@ -291,13 +300,16 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
// this.messageSuccess = false;
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -315,15 +327,18 @@ export class WorkListMainItgComponent implements OnInit {
}
if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(3);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -336,15 +351,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(4);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else if (action === 5) { // answer
@ -358,15 +376,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(5);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -383,15 +404,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else {
@ -409,15 +433,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else {
@ -470,8 +497,9 @@ export class WorkListMainItgComponent implements OnInit {
this.actionService(1, this.commentText);
}
if (this.actionSelected === 'Delegate') {
this.common.sharedService.setSharedData(info,'selectedEmpInfo'),
this.presentModal(4);
this.common.sharedService.setSharedData(info, 'selectedEmpInfo'),
this.common.sharedService.setSharedData('Delegate','pressedBtn')
this.presentModal(4);
}
if (this.actionSelected === 'Doable') {
this.actionService(1, this.commentText);
@ -489,6 +517,7 @@ export class WorkListMainItgComponent implements OnInit {
this.actionService(2, this.commentText);
}
if (this.actionSelected === 'RequestInformation') {
this.common.sharedService.setSharedData('RequestInformation','pressedBtn')
this.presentModal(3);
}
if (this.actionSelected === 'ReportGenerated') {
@ -509,9 +538,9 @@ export class WorkListMainItgComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
if(data.data.empData){
if (data.data.empData) {
this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID;
this.commentText = data.data.comments ? data.data.comments: null;
this.commentText = data.data.comments ? data.data.comments : null;
if (actionNumber === 3) {
this.actionService(3, this.commentText);
} else if (actionNumber === 4) {
@ -542,8 +571,8 @@ export class WorkListMainItgComponent implements OnInit {
returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2);
let dateArr= allDateTime[0].split('/')
let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2];
let dateArr = allDateTime[0].split('/')
let correctDate = dateArr[1] + '/' + dateArr[0] + '/' + dateArr[2];
let fullDate = this.transform(correctDate);
return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
@ -568,7 +597,7 @@ export class WorkListMainItgComponent implements OnInit {
return this.locale[lang].month_names_short[month];
}
backgroundColor(statusName: string){
backgroundColor(statusName: string) {
// {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}
switch (statusName) {
case 'Submit':

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

Loading…
Cancel
Save