Merge branch 'mohemm-wifi-feature' into ZohaibIqbalKambrani

# Conflicts:
#	Mohem/package-lock.json
MOHEMM-Q3-DEV-LATEST
umasoodch 5 years ago
commit 33d55363bb

@ -21,11 +21,10 @@
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="fullscreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="orientation" value="portrait" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
@ -110,7 +109,6 @@
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="mx.ferreyra.callnumber" spec="0.0.2" />
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="cordova-plugin-ionic-webview" spec="4.1.0">
@ -127,7 +125,6 @@
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
<plugin name="call-number" spec="~0.0.2" />
<plugin name="cordova-plugin-badge" spec="^0.8.8" />
<plugin name="cordova.plugins.diagnostic" spec="^5.0.1" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">

@ -90,16 +90,11 @@ call npm install @ionic-native/device
call ionic cordova plugin add cordova-plugin-local-notification
call npm install @ionic-native/local-notifications
@echo call phone number
call ionic cordova plugin add call-number
call npm install @ionic-native/call-number
@echo badge
call ionic cordova plugin add cordova-plugin-badge
call npm install @ionic-native/badge
@echo biometric features
call ionic cordova plugin add cordova-plugin-fingerprint-aio --variable FACEID_USAGE_DESCRIPTION="User Authentication"
call npm install @ionic-native/fingerprint-aio

@ -93,10 +93,6 @@ echo local notifications
ionic cordova plugin add cordova-plugin-local-notification
npm install @ionic-native/local-notifications
echo call phone number
ionic cordova plugin add call-number
npm install @ionic-native/call-number
echo badge
ionic cordova plugin add cordova-plugin-badge
npm install @ionic-native/badge

30428
Mohem/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -29,7 +29,6 @@
"@ionic-native/barcode-scanner": "^5.18.0",
"@ionic-native/base64": "^5.18.0",
"@ionic-native/ble": "^5.18.0",
"@ionic-native/call-number": "^5.18.0",
"@ionic-native/camera": "^5.18.0",
"@ionic-native/core": "^5.8.0",
"@ionic-native/date-picker": "^5.10.0",
@ -60,7 +59,6 @@
"@swimlane/ngx-charts": "^10.1.0",
"angular-calendar": "^0.26.11",
"app": "0.1.0",
"call-number": "~0.0.2",
"chart.js": "^2.9.3",
"com-badrit-base64": "^0.2.0",
"cordova-android": "^8.1.0",
@ -101,7 +99,6 @@
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"ionic2-calendar": "^0.5.8",
"mx.ferreyra.callnumber": "0.0.2",
"ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
@ -159,7 +156,6 @@
"cordova-plugin-nativestorage": {},
"cordova-plugin-globalization": {},
"cordova-plugin-android-permissions": {},
"mx.ferreyra.callnumber": {},
"cordova-plugin-badge": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-datepicker": {},
@ -189,7 +185,6 @@
"cordova-plugin-themeablebrowser": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"call-number": {},
"cordova-opentok-android-permissions": {},
"cordova-plugin-appavailability": {},
"cordova-plugin-apprate": {},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 37 KiB

@ -1,28 +1,22 @@
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { Platform, Events, MenuController } from '@ionic/angular';
import { TranslatorService } from './hmg-common/services/translator/translator.service';
import { CommonService } from './hmg-common/services/common/common.service';
import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from './hmg-common/services/authentication/models/authenticated-user';
import { TabsBarComponent } from './hmg-common/ui/tabs-bar/tabs-bar.component';
import { KeyboardService } from './hmg-common/services/keyboard/keyboard.service';
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { PushService } from '../../src/app/hmg-common/services/push/push.service';
import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-loading.service';
import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { Router } from '@angular/router';
import { rejects } from 'assert';
@Component({
selector: 'app-root',
styleUrls: ['./app.component.scss'],
templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit, AfterViewInit {
// rootPage:any = LoginPage;
// @ViewChild(Nav) nav: Nav;
export class AppComponent implements OnInit {
start: any = false;
menuList: any = [];
User_name_Emp = '';
@ -34,13 +28,15 @@ export class AppComponent implements OnInit, AfterViewInit {
direction = 'ltr';
User_Job_name: string;
public logoutFlage: any = false;
requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; // this.deviceToken
};
user: boolean;
deviceToken: string;
TeamFlag: string = 'false';
isIOS = false;
public requestGetLoginInfo: {
DeviceType: string;
DeviceToken: string; // this.deviceToken
};
constructor(
public ts: TranslatorService,
private cs: CommonService,
@ -57,25 +53,30 @@ export class AppComponent implements OnInit, AfterViewInit {
) {
this.events.subscribe('img-change', displayImg => {
console.log('app compont: ' + displayImg);
// this.user_image = "data:image/png;base64"+displayImg;
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
});
}
ngOnInit() {
this.initializeApp();
}
ngAfterViewInit() {}
initializeApp() {
private hideSplashScreen() {
setTimeout(() => {
this.splashScreen.hide();
}, 1000);
}
public initializeApp() {
this.cs.startLoading();
this.start = false;
this.menu.enable(false);
this.lazyLoadingService.monitorLazyLoading(15, true);
this.platform.ready().then(() => {
this.hideSplashScreen();
this.ts.loadResources(() => {
this.isIOS = this.platform.is('ios') ? true : false;
this.initializeDirection();
// this.statusBar.styleDefault();
this.start = true;
if (this.isIOS) {
this.monitUrlChange();
@ -88,7 +89,7 @@ export class AppComponent implements OnInit, AfterViewInit {
});
}
private monitUrlChange() {
private monitUrlChange() {
this.router.events.subscribe((val) => {
if (this.router.isActive('/authentication/login', true)) {
this.direction = 'ltr';
@ -96,62 +97,43 @@ export class AppComponent implements OnInit, AfterViewInit {
this.direction = TranslatorService.getCurrentDirection();
}
});
}
private startReceivingPushService() {
console.log('platform.ready');
this.pushService.startReceiving();
setTimeout(() => {
console.log(' in setTimeout startReceiving');
this.getLastLoginInfo();
}, 4000);
}
}
subscribeEvents() {
public subscribeEvents() {
this.platform.backButton.subscribe(() => {
if (this.router.isActive('/authentication/login', true)) {
// tslint:disable-next-line: no-string-literal
navigator['app'].exitApp();
}
});
this.events.subscribe('setMenu', () => {
const user = this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.companyUrl = user.CompanyImageURL
? user.CompanyImageURL
: '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription
? user.CompanyImageDescription
: 'Powered By Cloud Solutions';
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {
this.user_image = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: '../assets/imgs/profile.png';
}
} else {
this.user_image = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : '../assets/imgs/profile.png';
}
this.User_Job_name = user.JOB_NAME;
console.log(user);
} else {
console.log(user);
}
});
});
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
this.events.subscribe('myTeamFlag', myTeamFlag => {
this.TeamFlag = myTeamFlag;
});
console.log("this.TeamFlag>>>>>>>>>"+ this.TeamFlag);
this.events.subscribe('getNotCount', badge => { this.notBadge = badge; });
this.events.subscribe('myTeamFlag', myTeamFlag => { this.TeamFlag = myTeamFlag; });
}
private initializeDirection() {
if (this.isIOS) {
if (this.router.isActive('/authentication/login', true)) {
@ -162,14 +144,8 @@ export class AppComponent implements OnInit, AfterViewInit {
} else {
this.direction = TranslatorService.getCurrentDirection();
}
}
private watchUserLoginChangeEvents() {
this.events.subscribe(
AuthenticationService.LOGIN_EVENT,
(user: AuthenticatedUser, time: Date) => {}
);
}
private watchLanguageChangeEvents() {
this.events.subscribe(TranslatorService.CHANGE_EVENT, () => {
this.start = false;
@ -179,91 +155,68 @@ export class AppComponent implements OnInit, AfterViewInit {
}, 100);
});
}
logout() {
public logout() {
this.cs.sharedService.clearAll();
// this.menu.toggle();
this.menu.enable(false);
this.logoutFlage = true;
this.events.publish('logoutFlage', this.logoutFlage);
this.cs.setUpdateImage('', false);
this.TeamFlag = 'false';
this.getLastLoginInfo();
// this.cs.openLogin();
}
openMyTeamPage() {
public openMyTeamPage() {
this.menu.toggle();
this.cs.openMyTeamPage();
}
// profile() {
// this.cs.openProfile();
// this.menu.toggle();
// }
profile() {
public profile() {
this.cs.openEditProfile();
this.menu.toggle();
}
openNotification() {
public openNotification() {
this.cs.openNotificationPage();
this.menu.toggle();
}
openChangePassword() {
public openChangePassword() {
this.cs.openChangePassword();
this.menu.toggle();
}
// openPayslipPage(){
// this.cs.openPayslipPage();
// this.menu.toggle();
// }
private changeImage() {
this.cs.openChangeImagePage();
this.menu.toggle();
}
closeMenu() {
public closeMenu() {
this.menu.toggle();
}
getLastLoginInfo() {
public getLastLoginInfo() {
this.deviceToken = this.cs.getDeviceToken();
// this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
}, 1000);
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
}, 1000);
}
this.requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(), // 'Android',
DeviceToken: this.deviceToken// "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: this.deviceToken
};
this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0],
res.Mohemm_GetMobileLoginInfoList[0],
AuthenticationService.IMEI_USER_DATA
);
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
this.user = true;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
}, 3000);
if (this.logoutFlage) {
this.cs.openLogin();
@ -271,21 +224,12 @@ export class AppComponent implements OnInit, AfterViewInit {
} else {
this.user = false;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
}, 3000);
if (this.logoutFlage) {
this.cs.openLogin();
}
}
} else {
// this.user = false;
// this.splashScreen.hide();
// if(this.logoutFlage){
// this.cs.openLogin();
// }
}
} else {}
});
}
}

@ -1,31 +1,11 @@
<!-- <ion-header>
<ion-toolbar class="header-toolbar">
<ion-title color="light">Attendance Tracking </ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header> -->
<!-- <ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons>
</ion-buttons>
<ion-title>Attendance Tracking</ion-title>
</ion-toolbar>
</ion-header> -->
<app-generic-header
class="attendance-home"
backLink="/home"
showBack="true">
</app-generic-header>
<ion-content>
<!-- <div class="back-button-container">
<nav-buttons backLink="/home"></nav-buttons>
</div> -->
<div class="timer-chart">
<ion-label class="shift-title" style="font-weight: bold; font-size: 20px;"> {{curentDate}}</ion-label><br/>
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','today-time-left')}}</ion-label>

@ -100,8 +100,7 @@ export class LoginComponent implements OnInit, OnDestroy {
ngOnInit() {
this.monitorKeyboardChange();
this.currentLang = TranslatorService.getCurrentLanguageCode();
console.log(TranslatorService.CURRENT_LANGUAGE)
console.log(TranslatorService.EN)
if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) {
this.language = "US";
this.changeLanguage('2')
@ -109,11 +108,9 @@ export class LoginComponent implements OnInit, OnDestroy {
this.language = "AR";
this.changeLanguage('1')
}
console.log("current lang: "+this.currentLang);
this.events.subscribe('user', user => {
this.user = user;
});
this.deviceToken =this.cs.getDeviceToken();
this.events.subscribe('user', user => { this.user = user; });
this.deviceToken = this.cs.getDeviceToken();
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {

@ -4,7 +4,7 @@ import { Globalization } from '@ionic-native/globalization/ngx';
import { NumberRangeComponent } from './ui/number-range/number-range.component';
import { IonicModule } from '@ionic/angular';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { FormsModule } from '@angular/forms';
import { SSpacerComponent } from './ui/spacer/s-spacer/s-spacer.component';
import { MSpacerComponent } from './ui/spacer/m-spacer/m-spacer.component';
import { LSpacerComponent } from './ui/spacer/l-spacer/l-spacer.component';
@ -33,7 +33,6 @@ import { KeysPipe } from './pipes/keys/keys.pipe';
import { SegmentContentComponent } from './ui/segment-content/segment-content.component';
import { GraphComponent } from './ui/graph/graph.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { ExpandableComponent } from './ui/expandable/expandable.component';
import { ProjectsService } from './services/projects/projects.service';
import { NationalityService } from './services/nationality/nationality.service';
@ -43,8 +42,6 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service';
import { BarChartComponent } from './ui/bar-chart/bar-chart.component';
import { DonutChartComponent } from './ui/donut-chart/donut-chart.component';
// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service';
// import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx';
import { PushService } from './services/push/push.service';
@ -53,15 +50,12 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
import { GuidService } from './services/guid/guid.service';
import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
// import { GeofencingService } from './services/geofencing/geofencing.service';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent, Modal } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox';
import { GenderSelectComponent } from './ui/gender-select/gender-select.component';
import { DateSelectComponent } from './ui/date-select/date-select.component';
import { ToggleButtonComponent } from './ui/toggle-button/toggle-button.component';
import { Footer } from 'primeng/components/common/shared';
import { FooterComponent } from './ui/footer/footer.component';
import { ScrollContentComponent } from './ui/scroll-content/scroll-content.component';
import { ScrollSegmentContentComponent } from './ui/scroll-segment-content/scroll-segment-content.component';
@ -82,20 +76,16 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { DetailButtonComponent } from './ui/detail-button/detail-button.component';
import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component';
// import { CallNumber } from '@ionic-native/call-number/ngx';
import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
// import { PaymentComponent } from './ui/payment/payment.component';
// import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileUploadModule } from 'ng2-file-upload';
// import { FileSelectDirective } 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, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
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';
@ -120,6 +110,7 @@ import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
@NgModule({
imports: [
CommonModule,
@ -153,7 +144,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DatePipeTransform,
DateTimePipe,
SafeHtmlPipe,
// TurncatePipe,
BackButtonComponent,
IfDatePipe,
DynamicTableComponent,
@ -188,7 +178,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
// FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@ -219,7 +208,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DividerComponent,
NavButtonsComponent,
DatePipeTransform,
// TurncatePipe,
TranslatePipe,
DateTimePipe,
SafeHtmlPipe,
@ -254,7 +242,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
// FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@ -293,14 +280,10 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
NativeStorage,
ProgressLoadingService,
PushService,
// UserLocalNotificationService,
// LocalNotifications,
Badge,
LifeCycleService,
HmgBrowserService,
GuidService,
// BackgroundGeolocation,
// GeofencingService,
Keyboard,
KeyboardService,
Diagnostic,
@ -315,7 +298,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
RateService,
Camera,
File,
// PaymentService,
MenuService,
OpenNativeSettings,
BarcodeScanner,

@ -26,7 +26,6 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { Badge } from '@ionic-native/badge/ngx';
import { LifeCycleService } from '../life-cycle/life-cycle.service';
import { Diagnostic } from '@ionic-native/diagnostic/ngx';
//import { CallNumber } from "@ionic-native/call-number/ngx";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable({
@ -104,7 +103,6 @@ export class CommonService {
public badge: Badge,
public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic,
//public callNumber: CallNumber,
public iab: InAppBrowser,
private menu: MenuController,
) {}
@ -241,7 +239,6 @@ public getMonthNameAr(value: number): string {
public mobileNumber(number: string) {
return number.substr(1, number.length - 1);
}
public testFunction() {}
public stopLoading() {
this.progressLoadingService.dismiss();
@ -1325,20 +1322,6 @@ public getMonthNameAr(value: number): string {
});
}
// public callPhoneNumber(phoneNumber: string) {
// this.platform.ready().then(() => {
// if (this.isCordova()) {
// this.callNumber
// .callNumber(phoneNumber, true)
// .then(res => {})
// .catch(err => {});
// } else {
// window.open("tel:" + phoneNumber);
// // this.presentAlert(this.ts.trPK('error', 'call'));
// }
// });
// }
list_to_tree(list) {
let map = {},
node,

@ -1,21 +1,15 @@
import { Injectable, NgZone } from '@angular/core';
// import { Push, PushObject, PushOptions } from '@ionic-native/push/ngx';
import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service';
import { NotificationModel } from './models/notification.model';
import { SharedDataService } from '../shared-data-service/shared-data.service';
import { ConnectorService } from '../connector/connector.service';
//import { Response } from '../models/response';
import { Response } from 'src/app/hmg-common/services/models/response';
import { RegisterAuthenticatedUserRequest } from './models/register-authenticated-user.request';
import { Platform, Events } from '@ionic/angular';
import { RegisterNormalUserRequest } from './models/register-normal-user.request';
import { AuthenticationService } from '../authentication/authentication.service';
// import { AppointmentModel } from 'src/app/eservices/appointments/service/models/appointment.model';
import { SessionModel } from './models/session.model';
import { AuthenticatedUser } from '../authentication/models/authenticated-user';
// import { NotificationsCenterService } from 'src/app/eservices/notifications-center/service/notifications-center.service';
// import { NotificationsComponent } from 'src/app/eservices/notifications-center/notifications/notifications.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Injectable({
@ -28,7 +22,6 @@ export class PushService {
public static CHANNEL_ID = '679409052782';//'815750722565';
constructor(
// public push: Push,
public cs: CommonService,
public ts: TranslatorService,
public sharedService: SharedDataService,
@ -36,72 +29,14 @@ export class PushService {
private platform: Platform,
private authService: AuthenticationService,
public ngZone: NgZone,
// public notifyService: NotificationsCenterService,
public events: Events,
public firebasex: FirebaseX,
public firebasex: FirebaseX
) { }
public startReceiving() {
console.log("startReceiving");
// this.processStartReceiving();
this.processStartReceivingWithFirebase();
}
private processStartReceiving1() {
// if (this.cs.isCordova()) {
// this.stopNotifications(() => {
// this.push.hasPermission()
// .then((res: any) => {
// if (res.isEnabled) {
// this.createChannel();
// } else {
// this.cs.presentAlert(this.ts.trPK('push', 'no-permiss'));
// }
// });
// });
// }
}
private createChannel() {
// Create a channel (Android O and above). You'll need to provide the id, description and importance properties.
// this.push.createChannel({
// id: PushService.CHANNEL_ID,
// description: 'HMG push notifications',
// importance: 3
// }).then(() => {
// this.initialize();
// });
}
private initialize() {
// const options: PushOptions = {
// android: {
// senderID: PushService.CHANNEL_ID,
// sound: true,
// forceShow: true
// },
// ios: {
// alert: true,
// badge: true,
// sound: true
// },
// windows: {},
// browser: {
// pushServiceURL: 'http://push.api.phonegap.com/v1/push'
// }
// };
// const pushObject: PushObject = this.push.init(options);
// pushObject.on('notification').subscribe((notification: any) => {
// this.processNotification(notification);
// });
// pushObject.on('registration').subscribe((data: any) => {
// this.registerInBackend(data);
// });
// pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
}
private processNotification(data: any) {
const notification = new NotificationModel();
@ -120,12 +55,9 @@ export class PushService {
const type = Number(data.additionalData.NotificationType);
if (type === NotificationModel.TYPE_APPOINTMENT) {
this.sharedService.setSharedData(notification, NotificationModel.SHARED_DATA);
// this.ngZone.run(() => this.cs.openAppointmentDetails());
} else if (type === NotificationModel.TYPE_CONFERENCE) {
const session = data.additionalData.sessionId;
// console.log('session Id Recieved>>>>>'+ session);
this.sharedService.setSharedData( new SessionModel(session) , SessionModel.SHARED_DATA);
// this.ngZone.run( () => this.cs.openConference() );
} else {
if (type === NotificationModel.TYPE_VIDEO) {
notification.MessageType = 'video';
@ -137,28 +69,11 @@ export class PushService {
notification.MessageType = 'text';
}
this.sharedService.setSharedData(notification, NotificationModel.SHARED_DATA);
//this.ngZone.run(async () => this.cs.openNotificationDetails());
}
}
private setAsReadNotification(notification: NotificationModel) {
notification.IsRead = true;
// this.notifyService.setNotificationRead(notification, () => {
// }).subscribe((result: Response) => {
// if (this.cs.validResponse(result)) {
// this.events.publish( NotificationsCenterService.NOTIFICATIONS_COUNT_EVENT, notification.count);
// }
// });
}
public stopNotifications(done: any) {
// Delete a channel (Android O and above)
// if (this.cs.isCordova()) {
// this.push.deleteChannel(PushService.CHANNEL_ID).then(() => {
// done();
// });
// }
}
private registerInBackend(data: any) {
@ -166,14 +81,7 @@ export class PushService {
if (data) {
this.cs.sharedService.setSharedData(data, AuthenticationService.DEVICE_TOKEN);
localStorage.setItem('deviceToken', data);
}
//
// if (this.authService.isAuthenticated()) {
// this.registerAuthenticatedUser(data);
// } else {
// this.registerNotAuthenticatedUser(data);
// }
}
@ -198,7 +106,6 @@ export class PushService {
});
}
private registerNotAuthenticatedUser(deviceToken: any) {
const request = new RegisterNormalUserRequest();
this.authService.setPublicFields(request);
@ -220,26 +127,13 @@ export class PushService {
private processStartReceivingWithFirebase() {
console.log("processStartReceivingWithFirebase");
this.firebasex.getToken().then(token => {
// alert("token: "+ token);
this.cs.sharedService.setSharedData(token, "new-device-token");
localStorage.setItem('deviceToken', token);
this.cs.setDeviceToken(token); //last way to set the device Token to get it through getDeviceToken
this.registerInBackend(token);
}).catch(error => console.error('Error getting token', error));
// this.firebase.getToken()
// .then(token => console.log(`The token is ${token}`))
// .catch(error => console.error('Error getting token', error));
// this.firebasex.onTokenRefresh().subscribe(token => {
// alert("token: "+ token);
// this.registerInBackend(token);
// });
}
public onPushReceived(payload: any) {
@ -253,10 +147,4 @@ export class PushService {
console.log("onPushOpened openConference");
this.processNotification(payload);
}
}

@ -26,14 +26,14 @@
<ion-col [size]="12">
<ion-label>{{menuItem.PROMPT}}</ion-label>
</ion-col>
<ion-slides [options]="slideOptsTwo">
<ion-slide *ngFor="let subMenu of menuItem.children; let j=index">
<app-services-button
(click)="openPage(subMenu)"
[title]="subMenu.PROMPT"
[icon]="subMenu.ICON">
</app-services-button>
<app-services-button
(click)="openPage(subMenu)"
[title]="subMenu.PROMPT"
[icon]="subMenu.ICON">
</app-services-button>
</ion-slide>
<ion-slide *ngIf="i == 0 && showVcationRule">
<app-services-button
@ -41,8 +41,8 @@
[title]="vacationRuleTitle"
>
</app-services-button>
</ion-slide>
</ion-slides>
</ion-slide>
</ion-slides>
<ion-row class="attendance-module" *ngIf="i == 0">
<ion-col [size]="8">
@ -55,8 +55,8 @@
<ion-col [size]="4">
<img src="assets/icon/new-design/attendance_button_icon.png"/>
</ion-col>
</ion-row>
</ion-row>
</ion-row>
</ion-grid>
</ion-content>

@ -17,12 +17,12 @@
.ripple-div {
display: block;
text-align: center;
margin-top: -20%;
margin-top: -5%;
p {
font-size: 16px;
color: #bbbbbb;
font-family: 'WorkSans-Bold';
margin-top: -20%;
// margin-top: -20%;
padding-right: 10px;
}
ion-button {

@ -72,7 +72,8 @@ export class NfcModalComponent implements OnInit {
});
setTimeout(() => {
this.modalController.dismiss();
this.common.openHome();
// this.common.openHome();
this.common.openAttenTrackingpage();
}, 4000);
}
});

@ -19,7 +19,7 @@
<span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span>
</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>
<p-chart *ngIf="checkLoadingStatus()" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<ion-row class="filters-row" *ngIf="showChart && receivedITGCount">
@ -90,13 +90,15 @@
</div>
</div>
</div>
<div class="no-data-available" *ngIf="showFormattedData.length === 0 && selectedFilter != 'ITG'">
<span>{{ts.trPK('work-list','No-data-available')}}</span>
<div *ngIf="!isLoading">
<div class="no-data-available" *ngIf="showFormattedData.length === 0 && selectedFilter != 'ITG'">
<span>{{ts.trPK('work-list','No-data-available')}}</span>
</div>
<div class="no-data-available" *ngIf="ITGItem.length === 0 && selectedFilter == 'ITG'">
<span>{{ts.trPK('work-list','No-data-available')}}</span>
</div>
</div>
<div class="no-data-available" *ngIf="ITGItem.length === 0 && selectedFilter == 'ITG'">
<span>{{ts.trPK('work-list','No-data-available')}}</span>
</div>
</div>
<!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="selectedFilter === 'ALL' || itemType !== ''">

@ -355,17 +355,18 @@ z-index: 99;
ion-col{
background: white;
border-radius: 12px;
padding-right: 10px;
padding-right: 30px;
flex: none;
ion-icon{
margin-right: 3px;
font-size: 14px;
font-size: 20px;
margin-left: 3px;
vertical-align: middle;
}
span{
font-size: 12px;
font-size: 14px;
vertical-align: middle;
margin: 5px;
}
}
}
@ -439,21 +440,23 @@ font-size: 15px;
font-size: 12px;
color: #888;
background-color: white;
width: 93%;
height: 30px;
width: auto;
height: 40px;
border: 1px solid;
border-radius: 15px;
border-radius: 30px;
padding: 10px 30px;
}
.text-span-active{
font-size: 12px;
color: #888;
color:white;
background-color:#269DB8;
width: 93%;
height: 30px;
width: auto;
height: 40px;
border: 1px solid;
border-radius: 15px;
border-radius: 30px;
padding: 10px 30px;
}
.slideCss{
width: 200px !important;
width: auto !important;
}

@ -29,6 +29,7 @@ export class HomeComponent implements OnInit {
private WorkListObj: WorkListRequest;
WorkListResObj: any;
notificationType = '1';
public isLoading: boolean;
pageNum = 1;
rowsNo: number;
noOfrows: number;
@ -49,7 +50,6 @@ export class HomeComponent implements OnInit {
public noData = false;
public isITG = false;
public isSearch = false;
// public direction = 'ltr';
public direction: string;
public ITGCount = 0;
public ITGSegment: { name: string, code: any, data: any, style: boolean, names?: any }[] = [];
@ -176,6 +176,7 @@ export class HomeComponent implements OnInit {
ngOnInit() {
this.common.startLoading();
this.isLoading = true;
}
ionViewWillEnter() {
@ -185,6 +186,7 @@ export class HomeComponent implements OnInit {
this.receivedITGCount = false;
this.showChart = false;
this.common.startLoading();
this.isLoading = true;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
@ -202,7 +204,6 @@ export class HomeComponent implements OnInit {
}
callWorkListServices() {
// this.Details();
this.Count();
this.getAllPushNotificationFun();
}
@ -240,7 +241,17 @@ export class HomeComponent implements OnInit {
}
// this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
this.common.stopLoading();
// this.common.stopLoading();
this.isLoading = false;
}
checkLoadingStatus () {
if (this.showChart && this.receivedITGCount) {
this.common.stopLoading();
return true;
} else {
return false;
}
}
activeFilter(index: number) {
@ -292,6 +303,7 @@ export class HomeComponent implements OnInit {
if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading();
this.isLoading = true;
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
@ -459,7 +471,8 @@ export class HomeComponent implements OnInit {
this.newWorkListResponse = [];
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
this.common.stopLoading();
// this.common.stopLoading();
this.isLoading =false;
}
}
@ -501,6 +514,7 @@ export class HomeComponent implements OnInit {
clearSearch() {
this.common.startLoading();
this.isLoading = true;
this.itemType = '';
this.selectedFilter = 'ALL';
this.isPostNoLoad = true;
@ -563,11 +577,11 @@ export class HomeComponent implements OnInit {
Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => {
this.receivedITGCount = true;
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;
});
}
@ -612,6 +626,7 @@ export class HomeComponent implements OnInit {
let count = 0;
let ITEM: any;
let NAME: any;
console.log(this.ITGSegment)
for (let i = 1; i < this.ITGSegment.length; i++) {
// tslint:disable-next-line: prefer-for-of
for (let j = 0; j < this.ITGSegment[i].data.length; j++) {

@ -1,97 +1,192 @@
<app-generic-header
showBack="true"
backLink="/notification/homepage"
[headerText]="'worklistMain,title' | translate">
<app-generic-header showBack="true" backLink="/notification/homepage" [headerText]="'worklistMain,title' | translate">
</app-generic-header>
<ion-content class="colorBG">
<ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)"
[value]="defaultSegment" class="ion-segment-all">
<ion-segment mode="md" color="secondary" (ionChange)="segmentChangedClick($event)" [value]="activeSegment"
class="ion-segment-all">
<ion-segment-button value="{{segmentVal.name}}"
[ngClass]="activeSegment == segmentVal.name ? 'active-Segment' : 'normal-Segment'"
*ngFor="let segmentVal of segmentsArray">
{{segmentVal.name}}
<p style="font-size: 11px;">{{segmentVal.name}}</p>
</ion-segment-button>
</ion-segment>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentData'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label *ngIf="dataContant.Value && dataContant.Type != 'table'">{{dataContant.Value}}</label>
<div *ngIf="dataContant.MultipleValue && dataContant.Type == 'list'">
<label *ngFor="let data of dataContant.MultipleValue">{{data}}<br/></label>
</div>
<div *ngIf="dataContant.Value && dataContant.Type =='table'">
<ion-card class="cardContent">
<ion-card-content>
<div *ngFor="let multiData of dataLabelAndValue">
<div *ngFor="let dataAll of multiData">
<div *ngFor="let dataLabel of dataAll">
<label class="colItemReq">{{dataLabel.label}}
<br/></label>
<div *ngIf="dataLabel.isTable =='false'">
<label *ngIf="dataLabel.textvalue">{{dataLabel.textvalue}}
<br/></label>
<label *ngIf="dataLabel.textvalue==''">none
<br/></label>
<br/>
<!-- <ion-slides #slides pager="false" (ionSlideDidChange)="slideChanged($event)">
<ion-slide>
<p>SLide 1</p>
</ion-slide>
<ion-slide>
<p>SLide 2</p>
</ion-slide>
<ion-slide>
<p>SLide 3</p>
</ion-slide>
</ion-slides> -->
<ion-slides #slides (ionSlideDidChange)="slideChanged($event)">
<ion-slide *ngFor='let segmentContant of segmentData'>
<ion-card class="cardContent" *ngIf='activeSegment === segmentContant.name' style="width: 100%;">
<ion-card-content>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label *ngIf="dataContant.Value && dataContant.Type != 'table'">{{dataContant.Value}}</label>
<div *ngIf="dataContant.MultipleValue && dataContant.Type == 'list'">
<label *ngFor="let data of dataContant.MultipleValue">{{data}}<br /></label>
</div>
<div *ngIf="dataContant.Value && dataContant.Type =='table'">
<ion-card class="cardContent">
<ion-card-content>
<div *ngFor="let multiData of dataLabelAndValue">
<div *ngFor="let dataAll of multiData">
<div *ngFor="let dataLabel of dataAll">
<label class="colItemReq">{{dataLabel.label}}
<br /></label>
<div *ngIf="dataLabel.isTable =='false'">
<label *ngIf="dataLabel.textvalue">{{dataLabel.textvalue}}
<br /></label>
<label *ngIf="dataLabel.textvalue==''">none
<br /></label>
<br />
</div>
<div *ngIf="dataLabel.isTable == 'true'">
<div *ngFor="let subData of dataLabel.textvalue">
<div>
<label style="font-weight: bold;">{{subData.label}}
<br /></label>
<label>{{subData.textvalue}}
<br /></label>
<br />
</div>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="dataLabel.isTable == 'true'">
<div *ngFor="let subData of dataLabel.textvalue">
<div>
<label style="font-weight: bold;">{{subData.label}}
<br/></label>
<label >{{subData.textvalue}}
<br/></label>
<br/>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-slide>
<ion-slide>
<ion-card class="cardContent" *ngIf='activeSegment === "Approval Level"'>
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-list class="notification-list" style="margin-left: -30px;" *ngFor="let approvalInfo of workList">
<div class="timeline">
<ion-item>
<div class="timeline-item" slot="start">
<div>
<button ion-button style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png">
</button>
<div
[ngClass]="{'bg-blue-dot' : approvalInfo.Action === 'Submit', 'bg-green-dot':approvalInfo.Action === 'Approved', 'bg-red-dot':approvalInfo.Action === 'Rejected', 'bg-gray-dot':approvalInfo.Action === 'Pending'}"
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'"
[ngClass]="{'bg-gray-dot' : approvalInfo.Action === ''}">
</div>
<p style="margin-left: -0%; font-size: 12px !important; width: 66px;">{{approvalInfo.Action}}</p>
</div>
</div>
<div>
<p style="margin-left: 10%; font-weight: bold;">{{approvalInfo.Name}}</p>
<div *ngIf="approvalInfo.Notes">
<p style="margin-left: 10%;">{{ 'submitAbsence, comments' | translate}}:</p>
<p style="margin-left: 10%;">{{approvalInfo.Notes}}</p>
</div>
</div>
</ion-item>
</div>
</div>
</ion-list>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides>
<!-- <div *ngFor='let segmentContant of segmentData'>
<ion-card class="cardContent" *ngIf='activeSegment === segmentContant.name'>
<ion-card-content>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row>
<ion-col>
<label class="colItemReq"> {{dataContant.Title}}</label>
<br />
<label *ngIf="dataContant.Value && dataContant.Type != 'table'">{{dataContant.Value}}</label>
<div *ngIf="dataContant.MultipleValue && dataContant.Type == 'list'">
<label *ngFor="let data of dataContant.MultipleValue">{{data}}<br /></label>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<!-- if there is additional screen like in VIDA -->
<!-- <ng-container>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentDataTable'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row *ngFor="let headerData of dataContant.Header">
<ion-col>
<label class="colItemReq"> {{headerData}}</label>
<br />
<label>{{headerData}}</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ng-container> -->
<!-- END -->
<div *ngIf="dataContant.Value && dataContant.Type =='table'">
<ion-card class="cardContent">
<ion-card-content>
<div *ngFor="let multiData of dataLabelAndValue">
<div *ngFor="let dataAll of multiData">
<div *ngFor="let dataLabel of dataAll">
<label class="colItemReq">{{dataLabel.label}}
<br /></label>
<div *ngIf="dataLabel.isTable =='false'">
<label *ngIf="dataLabel.textvalue">{{dataLabel.textvalue}}
<br /></label>
<label *ngIf="dataLabel.textvalue==''">none
<br /></label>
<br />
</div>
<div *ngIf="dataLabel.isTable == 'true'">
<div *ngFor="let subData of dataLabel.textvalue">
<div>
<label style="font-weight: bold;">{{subData.label}}
<br /></label>
<label>{{subData.textvalue}}
<br /></label>
<br />
</div>
</div>
</div>
</div>
</div>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
<ion-row *ngIf='dataContant.TableValue'>
<ion-col style="border: 1px solid gainsboro; border-radius: 15px; padding-left: 20px;">
<label class="colItemReq" *ngFor="let header of dataContant.TableValue.Header"><br /> {{header}}</label>
<br />
<label *ngFor="let rows of dataContant.TableValue.Rows"><br />{{rows}}</label>
<label *ngIf="dataContant.TableValue.Rows"><br />none</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
<ion-card class="cardContent" *ngIf='activeSegment === "Approval Level"'>
<ion-card-content>
@ -107,7 +202,7 @@
<button ion-button style=" background: none;width: 60%;">
<img src="../assets/imgs/noteSmall.png">
</button>
<div
[ngClass]="{'bg-blue-dot' : approvalInfo.Action === 'Submit', 'bg-green-dot':approvalInfo.Action === 'Approved', 'bg-red-dot':approvalInfo.Action === 'Rejected', 'bg-gray-dot':approvalInfo.Action === 'Pending'}"
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'"
@ -132,36 +227,56 @@
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-card> -->
<ion-card class="cardContent">
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-label>
<h2 class="boldTxtNav">Comment</h2>
</ion-label>
<ion-input type='text' [(ngModel)]='commentText'></ion-input>
<ion-item *ngFor="let object of grantInfo">
<ion-label>{{object.Label}}</ion-label>
<ion-select *ngIf="!object.ConditionalFieldName" [(ngModel)]='ExchangeServerSelected'
(ionChange)="filterGrantDB(ExchangeServerSelected,object, object.FieldName)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of object.Value">
{{value}}</ion-select-option>
</ion-select>
<ion-select *ngIf="object.ConditionalFieldName" [(ngModel)]='ExchangeServerDBSelected'
(ionChange)="filterGrantDB(ExchangeServerDBSelected,object)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of filteredGrantFieldsConditionalValue">
{{value}}</ion-select-option>
</ion-select>
</ion-item>
<ion-label>
<h2 class="boldTxtNav">Comment</h2>
</ion-label>
<ion-input type='text' [(ngModel)]='commentText'></ion-input>
<ion-item *ngFor="let object of grantInfo">
<ion-label>{{object.Label}}</ion-label>
<ion-select *ngIf="!object.ConditionalFieldName" [(ngModel)]='ExchangeServerSelected'
(ionChange)="filterGrantDB(ExchangeServerSelected,object, object.FieldName)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of object.Value">
{{value}}</ion-select-option>
</ion-select>
<ion-select *ngIf="object.ConditionalFieldName" [(ngModel)]='ExchangeServerDBSelected'
(ionChange)="filterGrantDB(ExchangeServerDBSelected,object)" id='{{object.FieldName}}'>
<ion-select-option value="{{value}}" *ngFor="let value of filteredGrantFieldsConditionalValue">
{{value}}</ion-select-option>
</ion-select>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<!-- if there is additional screen like in VIDA -->
<!-- <ng-container>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentDataTable'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
<ion-grid style="text-align: left" *ngFor='let dataContant of segmentContant.data'>
<ion-row *ngFor="let headerData of dataContant.Header">
<ion-col>
<label class="colItemReq"> {{headerData}}</label>
<br />
<label>{{headerData}}</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ng-container> -->
<!-- END -->
</ion-content>

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild } 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 { HomeComponent } from '../home/home.component';
@ -7,7 +7,7 @@ import { itgRequest } from '../models/itgFormDetailsRequest';
import { ModalController } from '@ionic/angular';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component';
import { IonSlides } from '@ionic/angular';
@Component({
selector: 'app-work-list-main-itg',
@ -15,6 +15,7 @@ import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/wo
styleUrls: ['./work-list-main-itg.component.scss'],
})
export class WorkListMainItgComponent implements OnInit {
@ViewChild('slides') slides: IonSlides;
public static APPROVAL = "Services/COCWS.svc/REST/ITGApproveRequest"
public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest'
@ -56,6 +57,7 @@ export class WorkListMainItgComponent implements OnInit {
index2: number;
direction: string;
defaultSegment = '';
public slideIndex = 0;
constructor(
public common: CommonService,
public ts: TranslatorService,
@ -84,6 +86,8 @@ export class WorkListMainItgComponent implements OnInit {
this.request.Comments = this.request_info.Comments;
this.request.NewUserEMPId = this.request_info.NewUserEMPId;
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
console.log(this.request);
console.log(result);
this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields;
let count =0;
@ -160,10 +164,22 @@ export class WorkListMainItgComponent implements OnInit {
}
public segmentChangedClick(event: any) {
this.activeSegment = event.detail.value;
for(let i=0; i< this.segmentsArray.length; i++){
if(this.segmentsArray[i].name === event.detail.value){
this.slides.slideTo(i);
this.activeSegment = event.detail.value;
}
}
}
slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
this.activeSegment = this.segmentsArray[index].name;
});
}
skip() {
//check if the user clicked on all type of request
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++) {
@ -187,24 +203,37 @@ export class WorkListMainItgComponent implements OnInit {
}
}
}
} else {
}
//if user clicked on spicific type of ITG request
else {
console.log(this.all_request);
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
console.log("IF statment check the IDs:");
console.log(this.request_info.ID);
console.log(this.all_request[i].ID);
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
this.index = i + 1;
console.log("value of i: "+i);
console.log("value of index: "+this.index);
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
this.clearDataArray();
console.log(this.all_request[this.index]);
console.log(this.request_name)
this.changeITGForm(this.all_request[this.index], this.request_name);
break;
return;
} else {
console.log("no 1");
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
break;
return;
}
} else {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
break;
}
}
// else {
// console.log("no 2");
// this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.openNotificationPage();
// return;
// }
}
}
}
@ -468,5 +497,4 @@ export class WorkListMainItgComponent implements OnInit {
}
}
}

@ -1,471 +1,400 @@
<app-generic-header
*ngIf="!messageSuccess"
showBack="true"
backLink="/notification/homepage"
[headerText]="'worklistMain,title' | translate">
<app-generic-header *ngIf="!messageSuccess" showBack="true" backLink="/notification/homepage"
[headerText]="'worklistMain,title' | translate">
</app-generic-header>
<ion-content class="colorBG">
<div *ngIf="!messageSuccess">
<!-- add segemnt part -->
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)"
[value]="defaultSegment" class="ion-segment-all">
<ion-content class="colorBG">
<div *ngIf="!messageSuccess">
<!-- add segemnt part -->
<div class="subjectNotification">{{getPassNotificationDetails.SUBJECT}}</div>
<ion-segment mode="md" color="secondary" (ionChange)="segmentChanged($event)" [value]="activeSegment"
class="ion-segment-all">
<ion-segment-button value="item-req"
[ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, details-emp'| translate}}</ion-label>
<ion-segment-button value="item-req"
[ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
<ion-label class="padding-zero"> {{'worklistMain, details-emp'| translate}}</ion-label>
</ion-segment-button>
<ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, action' | translate}}</ion-label>
</ion-segment-button>
</ion-segment-button>
<ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
<ion-label class="padding-zero"> {{'worklistMain, action' | translate}}</ion-label>
</ion-segment-button>
<ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, attach-file' | translate}}</ion-label>
<ion-segment-button value="attach"
[ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
<ion-label class="padding-zero"> {{'worklistMain, attach-file' | translate}}</ion-label>
</ion-segment-button>
<ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
<ion-label> {{'worklistMain, info'| translate}} </ion-label>
</ion-segment-button>
</ion-segment>
</ion-segment-button>
<ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
<ion-label class="padding-zero"> {{'worklistMain, info'| translate}} </ion-label>
</ion-segment-button>
</ion-segment>
<ng-container *ngIf="activeSegment === 'info'">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<div *ngIf="notificationBodyRes?.length > 0 ">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; ">
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{'worklistMain, notfDetails' | translate}}</div>
</ion-card-header> -->
<ion-card-content>
<div>
<ion-row class="" *ngIf=" item.Collection_Notification.DISPLAY_FLAG != 'N' ">
<ion-col class="rowBorder" *ngFor="let notificationBody of item.Collection_Notification;"
size="6" [hidden]="notificationBody.DISPLAY_FLAG == 'N'" >
<label class="colItemReq" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
<!-- </ion-col>
<ion-col col-7> -->
<br />
<label for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
<div style="margin: 10px;font-weight: bold; " *ngIf="subordinatesleaveList != undefined && subordinatesleaveList?.length > 0">
{{ts.trPK('worklistMain','employee-on-leave')}} </div>
<ion-item lines="none"
[ngClass]=" direction === 'en' ? 'subOrdinateList' :'subOrdinateList-Ar' "
*ngFor="let List of subordinatesleaveList;">
<ion-grid
[ngClass]=" direction === 'en' ? 'gridSubordinates' :'gridSubordinates-Ar' ">
<div
[ngClass]=" direction === 'en' ? 'subOrdinateDiv' :'subOrdinateDiv-Ar' ">
<!-- <img class="subOrdinateImg" src="../assets/imgs/profile.png"> -->
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
[src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE">
<img *ngIf="List.EMPLOYEE_IMAGE == null"
class="empImgeSub" src="../assets/imgs/profile.png">
</div>
<ion-row class="rowHeader "
[ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar' "
>
<ion-col size="9">
<label style="font-weight: bold; " class="label" for="">{{List.EMPLOYEE_NAME}} </label>
<br />
<label class="label" for="">{{List.POSITION_TITLE}} </label><br />
</ion-col>
<ion-col class="status" size="3">
<label class="label" style="font-size: 11px;" for="label">{{List.STATUS}}</label>
</ion-col>
</ion-row>
<br />
<ion-row [ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar'">
<ion-col>
<label class="label" for=""> {{ts.trPK('worklistMain','from')}}</label><br />
<label class="label" for="">{{List.DATE_START |date}}</label>
</ion-col>
<ion-col>
<label class="label" for="">{{ts.trPK('worklistMain','to')}}</label><br />
<label class="label" for="">{{List.DATE_END | date}}</label>
</ion-col>
</ion-row>
</ion-grid>
<!-- </ion-col> -->
</ion-item>
<!-- </ion-card-content>
</ion-card> -->
</ng-container>
<ng-container *ngIf="activeSegment === 'item-req'">
<ion-card class="cardContent">
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('worklistMain','info')}} </div>
</ion-card-header> -->
<ion-card-content>
<div>
<ion-grid style="text-align: left">
<ion-row class="rowBorder">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col>
<!-- </ion-row>
<ion-row> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col>
</ion-row>
<ion-row class="">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col>
<!-- </ion-row>
<ion-row *ngIf=" getPassNotificationDetails.RESPONDER != '' "> -->
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}}
</label>
<br />
<!-- </ion-col>
<ion-col> -->
<label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col>
</ion-row>
<!-- <ion-row class="">
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','subject')}} </label>
</ion-col>
<ion-col>
<br/>
<label for="">{{getPassNotificationDetails.SUBJECT}} </label>
</ion-col>
</ion-row> -->
<!-- <ion-row>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openNotificationBody()">
<p>{{ts.trPK('worklistMain','notfDetails')}} </p>
<ion-img class="serviceItemImg" src="../assets/imgs/details.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openActionHistory()">
<p>{{ts.trPK('worklistMain','actionHis')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/actionHistory.png"></ion-img>
</button>
</ion-col>
<ion-col class="greenTxt" col-4>
<button ion-button block class="notColBtn" (click)="openSupportDocuments()">
<p>{{ts.trPK('worklistMain','suppDoc')}}</p>
<ion-img class="serviceItemImg" src="../assets/imgs/documents.png"></ion-img>
</button>
</ion-col>
</ion-row> -->
</ion-grid>
</div>
</ion-card-content>
</ion-card>
<div *ngIf="submitterInfoRes?.length > 0 ">
<ion-card>
<!-- <ion-card-header class="boxHdr">
<div class="hrTitle"> {{'general, info' | translate}}</div>
</ion-card-header> -->
<ion-card-content>
<div style="font-weight: bold;" class="hrTitle"> {{'userProfile, emp-detail' | translate}}</div>
<div *ngFor="let submitterInfo of submitterInfoRes">
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, empNo' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NUMBER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, name' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, job-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.POSITION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, grade' | translate}}</label>
<br />
<label for="">{{submitterInfo.GRADE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, job_cate' | translate}}</label>
<br />
<label for="">{{submitterInfo.JOB_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, category' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYMENT_CATEGORY_MEANING}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, emp-email' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_EMAIL_ADDRESS}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, org-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.ORGANIZATION_NAME}}</label>
</ion-col>
</ion-row>
<!-- <ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, busG' | translate}}</label>
<br />
<label for="">{{submitterInfo.BUSINESS_GROUP_NAME}}</label>
</ion-col>
</ion-row> -->
<ion-row class="rowBorder submitterInfo">
<ion-slides #slides (ionSlideDidChange)="slideChanged($event)">
<ion-slide>
<ng-container *ngIf="activeSegment === 'item-req'">
<ion-grid>
<ion-row>
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, loc-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.LOCATION_NAME}}</label>
<ion-card class="cardContent">
<ion-card-content>
<div>
<ion-grid style="text-align: left">
<ion-row class="rowBorder">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for=""> {{ts.trPK('worklistMain','from')}}
</label>
<br />
<label for="">{{getPassNotificationDetails.FROM_USER}}</label>
</ion-col>
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','to')}}
</label>
<br />
<label for=""> {{getPassNotificationDetails.TO_USER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','sent')}}
</label>
<br />
<label for="">{{getPassNotificationDetails.BEGIN_DATE}}</label>
</ion-col>
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','closed')}}
</label>
<br />
<label for="">{{getPassNotificationDetails.END_DATE}}</label>
</ion-col>
</ion-row>
<ion-row class="">
<ion-col [ngClass]=" direction === 'en' ? 'colBorder' :'colBorder-ar' ">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','id')}}
</label>
<br />
<label for="">{{getPassNotificationDetails.NOTIFICATION_ID}}</label>
</ion-col>
<ion-col class="">
<label class="colItemReq" for="">{{ts.trPK('worklistMain','responder')}}
</label>
<br />
<label for="">{{getPassNotificationDetails.RESPONDER}} </label>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<label class="colItemReq" for="">{{'worklistMain, branch-payrol' | translate}}</label>
<br />
<ion-card *ngIf="submitterInfoRes?.length > 0 ">
<label for="">{{submitterInfo.PAYROLL_NAME}}</label>
<ion-card-content [ngClass] = " direction === 'en' ? 'cardAlignTextEn' : 'cardAlignTextAr'">
<div style="font-weight: bold;" class="hrTitle">
{{'userProfile, emp-detail' | translate}}</div>
<div *ngFor="let submitterInfo of submitterInfoRes">
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'userProfile, empNo' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NUMBER}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq" for="">{{'userProfile, name' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, job-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.POSITION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'userProfile, grade' | translate}}</label>
<br />
<label for="">{{submitterInfo.GRADE_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, job_cate' | translate}}</label>
<br />
<label for="">{{submitterInfo.JOB_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, category' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYMENT_CATEGORY_MEANING}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, emp-email' | translate}}</label>
<br />
<label for="">{{submitterInfo.EMPLOYEE_EMAIL_ADDRESS}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, org-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.ORGANIZATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, loc-name' | translate}}</label>
<br />
<label for="">{{submitterInfo.LOCATION_NAME}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<label class="colItemReq"
for="">{{'worklistMain, branch-payrol' | translate}}</label>
<br />
<label for="">{{submitterInfo.PAYROLL_NAME}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-grid>
</ion-card>
</div>
</ng-container>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;">
{{actionHistory.NAME}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
</ng-container>
</ion-slide>
<ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'">
<div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
<ion-card class="cardContent" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="actionHistoryRes && actionHistoryRes.length > 0 ">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item *ngFor="let actionHistory of actionHistoryRes">
<div class="timeline-item" slot="start">
<div
[class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+actionHistory.EMPLOYEE_IMAGE">
<img *ngIf="actionHistory.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;">
{{actionHistory.NAME}}
</ion-label>
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
Note: {{actionHistory.NOTE}}
</div>
</div>
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''" class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
<div *ngIf="checkLines(actionHistory.NOTE)">
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">
{{ 'general, load-more' | translate}}
</button>
<div class="containerNote"
[ngClass]="actionHistory.visible ? 'show' : '' ">
Note: {{actionHistory.NOTE}}
</ion-card-content>
</ion-card>
</ng-container>
<ng-container *ngIf="activeSegment === 'attach'">
<ion-card class="cardContent">
<ion-card-content>
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">{{ actionHistory.visible ? 'Show less': 'Show More' }}</button>
<div class="noDataDiv" [hidden]="attachmentRes && attachmentRes.length > 0">
<p>{{ 'general, notAttch' | translate}}</p>
</div>
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}"
class=""> {{actionHistory.ACTION}}</ion-label>
<div *ngIf="attachmentRes && attachmentRes.length > 0 ">
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''"
class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE| dateString }} </ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
<button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">
{{ 'general, load-more' | translate}}
</button>
</ion-card-content>
</ion-card>
</ng-container>
</ion-slide>
<ion-slide>
<ng-container *ngIf="activeSegment === 'attach'">
<ion-card class="cardContent" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="attachmentRes && attachmentRes.length > 0">
<p>{{ 'general, notAttch' | translate}}</p>
</div>
<div *ngIf="attachmentRes && attachmentRes.length > 0 ">
<ion-grid>
<ion-item class="itemAttch" *ngFor="let attachList of attachmentRes ;let i=index;">
<ion-label style="color: black !important">
{{i+1 }}. {{attachList.FILE_NAME}} </ion-label>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-item>
</ion-grid>
</div>
</ion-card-content>
</ion-card>
</ng-container>
</ion-slide>
<ion-slide>
<ng-container *ngIf="activeSegment === 'info'">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<div *ngIf="notificationBodyRes?.length > 0 ">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; " style="width: 91%;">
<ion-card-content *ngIf="item.Collection_Notification.length > 0">
<div>
<ion-row *ngIf=" item.Collection_Notification.DISPLAY_FLAG != 'N' ">
<ion-col class="rowBorder"
*ngFor="let notificationBody of item.Collection_Notification;" size="6"
[hidden]="notificationBody.DISPLAY_FLAG == 'N'">
<label class="colItemReq" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
<br />
<label for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
<ion-grid>
<ion-item class="itemAttch" *ngFor="let attachList of attachmentRes ;let i=index;">
<!-- <div *ngIf="attachList.FILE_CONTENT_TYPE === 'pdf' || attachList.FILE_CONTENT_TYPE === 'PDF'">
<img float-start class="attachImg" src="../assets/imgs/pdf.png">
</div>
<div *ngIf="attachList.FILE_CONTENT_TYPE === 'txt'"> <img float-start class="attachImg"
src="../assets/imgs/doc.png">
</ion-card>
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE != 'txt' && attachList.FILE_CONTENT_TYPE != 'PDF' && attachList.FILE_CONTENT_TYPE != 'pdf' && attachList.FILE_CONTENT_TYPE != 'png' && attachList.FILE_CONTENT_TYPE != 'jpeg' && attachList.FILE_CONTENT_TYPE != 'jpg' && attachList.FILE_CONTENT_TYPE != 'PNG' && attachList.FILE_CONTENT_TYPE != 'JPEG' && attachList.FILE_CONTENT_TYPE != 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/nonfile.png">
</div>
<div
*ngIf="attachList.FILE_CONTENT_TYPE === 'png' || attachList.FILE_CONTENT_TYPE === 'jpeg' || attachList.FILE_CONTENT_TYPE === 'jpg'|| attachList.FILE_CONTENT_TYPE === 'PNG' || attachList.FILE_CONTENT_TYPE === 'JPEG'|| attachList.FILE_CONTENT_TYPE === 'JPG'">
<img float-start class="attachImg" src="../assets/imgs/img.png">
</div> -->
<ion-label style="color: black !important">
{{i+1 }}. {{attachList.FILE_NAME}} </ion-label>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.FILE_DATA,attachList.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
</ion-item>
<div style="margin: 10px;font-weight: bold; "
*ngIf="subordinatesleaveList != undefined && subordinatesleaveList?.length > 0">
{{ts.trPK('worklistMain','employee-on-leave')}} </div>
<ion-item lines="none" [ngClass]=" direction === 'en' ? 'subOrdinateList' :'subOrdinateList-Ar' "
*ngFor="let List of subordinatesleaveList;">
</ion-grid>
</div>
</ion-card-content>
</ion-card>
</ng-container>
<ion-grid [ngClass]=" direction === 'en' ? 'gridSubordinates' :'gridSubordinates-Ar' ">
<div [ngClass]=" direction === 'en' ? 'subOrdinateDiv' :'subOrdinateDiv-Ar' ">
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
[src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE">
<img *ngIf="List.EMPLOYEE_IMAGE == null" class="empImgeSub"
src="../assets/imgs/profile.png">
</div>
<ion-row class="rowHeader "
[ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar' ">
<ion-col size="9">
<label style="font-weight: bold; " class="label" for="">{{List.EMPLOYEE_NAME}}
</label>
<br />
<label class="label" for="">{{List.POSITION_TITLE}} </label><br />
</ion-col>
<ion-col class="status" size="3">
<label class="label" style="font-size: 11px;" for="label">{{List.STATUS}}</label>
</ion-col>
</ion-row>
<br />
<ion-row [ngClass]=" direction === 'en' ? 'subOrdinateRow' :'subOrdinateRow-Ar'">
<ion-col>
<ion-row>
<ion-col col-12>
<div id="notificationDynamicFields">
</div>
</ion-col>
</ion-row>
<label class="label" for=""> {{ts.trPK('worklistMain','from')}}</label><br />
<label class="label" for="">{{List.DATE_START |date}}</label>
</ion-col>
<ion-col>
<label class="label" for="">{{ts.trPK('worklistMain','to')}}</label><br />
<label class="label" for="">{{List.DATE_END | date}}</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
</ng-container>
</ion-slide>
</ion-slides>
<ion-row>
<ion-col col-12>
<div id="notificationDynamicFields">
</div>
</ion-col>
</ion-row>
</div>
<div *ngIf="messageSuccess" class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
</ion-col>
<ion-col size="12"> <div style="font-size: 30px !important"> {{'worklistMain, Tran_Succ' | translate}} </div> </ion-col>
</div>
<ion-col size="12">
<div style="font-size: 30px !important"> {{'worklistMain, Tran_Succ' | translate}} </div>
</ion-col>
</div>
</ion-content>
@ -511,41 +440,41 @@
<ion-tab-button *ngIf="approveDis" (click)="actionButton('APPROVED')">
<img src="../assets/imgs/action-approve.png">
<!-- <ion-label> {{'worklistMain, approve' | translate}}</ion-label> -->
<ion-label style="white-space: nowrap"> {{approve_label}}</ion-label>
<ion-label style="white-space: nowrap"> {{approve_label}}</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="closeDis" (click)="actionButton('CLOSE')">
<img src="../assets/imgs/action-approve.png">
<!-- <ion-label> {{'worklistMain, approve' | translate}}</ion-label> -->
<ion-label style="white-space: nowrap"> {{close_label}}</ion-label>
<ion-label style="white-space: nowrap"> {{close_label}}</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="rejectDis" (click)="actionButton('REJECTED')">
<img src="../assets/imgs/action-reject.png">
<!-- <ion-label > {{'worklistMain, reject' | translate}}</ion-label> -->
<ion-label style="white-space: nowrap"> {{reject_label}}</ion-label>
<ion-label style="white-space: nowrap"> {{reject_label}}</ion-label>
</ion-tab-button>
<ion-tab-button *ngIf="requestDis" (click)="actionButton('REQUEST_INFO')">
<img src="../assets/imgs/action-info.png">
<!-- <ion-label > {{'worklistMain, request' | translate}}</ion-label> -->
<ion-label style="white-space: nowrap"> {{reqInfo_label}}</ion-label>
<ion-label style="white-space: nowrap"> {{reqInfo_label}}</ion-label>
</ion-tab-button>
<ion-tab-button (click)="nextNotfification()">
<img src="../assets/imgs/action-skip.png">
<ion-label> {{'worklistMain, skip' | translate}}</ion-label>
<ion-label> {{'worklistMain, skip' | translate}}</ion-label>
</ion-tab-button>
<ion-tab-button [disabled]="moreDisabled" (click)="openMoreActions()">
<img src="../assets/imgs/action-more.png">
<ion-label> {{'worklistMain, more' | translate}}</ion-label>
<ion-label> {{'worklistMain, more' | translate}}</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

@ -292,3 +292,14 @@ ion-card{
.tabBar{
height:70px
}
.cardAlignTextEn{
text-align: left;
}
.cardAlignTextAr{
text-align: right;
}
.padding-zero {
padding: 0px !important;
}

@ -1,4 +1,4 @@
import { Component, OnInit, ElementRef } from "@angular/core";
import { Component, OnInit, ElementRef, ViewChild } 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 { WorkListBodyRequest } from "../models/NotificationBodyReq";
@ -7,9 +7,7 @@ import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBod
import { NotificatonButtonResponse } from "../models/NotificationButtonRes";
import { WorkListActionRequest } from "../models/NotificationActionReq";
import { WorkListButtonRequest } from "../models/NotificationButtonReq";
// import { isDate } from 'angular6-json-schema-form';
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { WorklistMainService } from "../service/work-list.main.service";
import { HomeComponent } from "src/app/notification/home/home.component";
import { TextInput } from 'src/app/uI-elements/text.input';
@ -36,8 +34,7 @@ import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { IonSlides } from '@ionic/angular';
@Component({
selector: "app-worklist-main",
@ -45,6 +42,7 @@ import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbo
styleUrls: ["./worklist-main.component.scss"]
})
export class WorklistMainComponent implements OnInit {
@ViewChild('slides') slides: IonSlides;
private WorkListBodyObj: WorkListBodyRequest;
private WorkListButtonsObj: WorkListButtonRequest;
private WorkListActionObj: WorkListActionRequest;
@ -78,7 +76,7 @@ export class WorklistMainComponent implements OnInit {
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100;
notificationCount: any;
activeSegment: any = "item-req";
activeSegment: any = 'item-req';
lines_note_limit: any = 24;
attachmentRes: any = [];
private WorkListActionHistoryObj: WorkListActionHistoryRequest;
@ -119,18 +117,15 @@ export class WorklistMainComponent implements OnInit {
private modalCtrl: ModalController,
public dashboredService: DashboredService,
public authService: AuthenticationService
) {
) {
this.direction = TranslatorService.getCurrentLanguageName()
console.log("ENAD TEST LANG: "+this.direction);
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
}
ngOnInit() {
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
false
@ -139,38 +134,64 @@ export class WorklistMainComponent implements OnInit {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.selEmp = user.ASSIGNMENT_NUMBER;
}
});
}
//name=document.getElementById('notificationDynamicFields').value;
//removeElement('parentDiv', name);"
//var navbar = document.getElementById("notificationDynamicFields").value;
// document.querySelector('svg .gauge.chart > text').remove();
// var inputValue = (<HTMLInputElement>document.getElementById("notificationDynamicFields")).value;
console.log(" this.selEmp" + this.selEmp);
this.intializeNotificationDetail();
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if(this.activeSegment === 'item-req')
{
this.slides.slideTo(0);
}
else if(this.activeSegment === 'action-history')
{
this.slides.slideTo(1);
}
else if(this.activeSegment === 'attach')
{
this.slides.slideTo(2);
}
else if(this.activeSegment === 'info')
{
this.slides.slideTo(3);
}
console.log(" event.detail.value: " + event.detail.value);
}
intializeNotificationDetail() {
public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
if(index === 0)
{
this.activeSegment = 'item-req';
}
else if(index === 1)
{
this.activeSegment = 'action-history';
}
else if(index === 2)
{
this.activeSegment = 'attach';
}
else if(index === 3)
{
this.activeSegment = 'info';
}
console.log(this.activeSegment);
});
}
public intializeNotificationDetail() {
this.approveDis = false;
this.rejectDis = false;
this.requestDis = false;
this.moreDisabled = true;
this.closeDis = false;
// this.approve_label="";
// this.reject_label="";
// this.reqInfo_label="";
if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = "";
@ -181,7 +202,6 @@ export class WorklistMainComponent implements OnInit {
false
);
console.log("for next()" + this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = []
this.subordinatesleaveList = [];
this.notificationArray = this.common.sharedService.getSharedData(
@ -255,7 +275,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService
.getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => {
//this.handleWorkListBodyResult(result, "MO");
});
}
@ -263,8 +282,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService
.getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => {
// console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
// this.handleWorkListBodyResult(result, "PO");
});
}
@ -307,13 +324,10 @@ export class WorklistMainComponent implements OnInit {
console.log(this.notificationBodyRes[0].Collection_Notification);
}
// getDimensions(this.notificationBodyRes) {
let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) {
return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE";
});
// return obj;
// }
this.getSubordinatesleave(obj)
}
} else if (Type == "PR") {
@ -325,8 +339,6 @@ export class WorklistMainComponent implements OnInit {
}
} //End handleWorkListBodyResult
getNotificationButtons(notificationButtonsObj) {
this.notificationButtonRes = [];
this.worklistMainService
@ -365,7 +377,7 @@ export class WorklistMainComponent implements OnInit {
this.moreDisabled = false;
}
} // valid it
}
}
}
} // End handleWorkListButtonsResult
@ -398,8 +410,6 @@ export class WorklistMainComponent implements OnInit {
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
}
} // valid it
}
@ -430,11 +440,8 @@ export class WorklistMainComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
if (document.getElementById("notificationDynamicFields") != null) {
document.getElementById("notificationDynamicFields").innerHTML = "";
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
@ -455,10 +462,8 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationArray[index].REQUEST_TYPE == "MO") {
this.common.openWorklistMainMRPage()
} else {
this.intializeNotificationDetail();
}
}
else {
this.common.openNotificationPage();
@ -483,9 +488,6 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
// else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// }
else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
@ -502,8 +504,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
console.log("b" + this.P_RESPOND_ATTRIBUTES_TBL);
if (
ButtonAction == "APPROVED" ||
ButtonAction == "REJECTED" ||
@ -528,7 +528,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
// this.applyAction(this.WorkListActionObj);
if (ButtonAction === "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
@ -543,7 +542,6 @@ export class WorklistMainComponent implements OnInit {
}
else if (ButtonAction === "CLOSE") {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
}
this.common.confirmAlertDialogAction(
@ -553,15 +551,8 @@ export class WorklistMainComponent implements OnInit {
() => { }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg)
// this.openApplyModal(this.WorkListActionObj);
}
if (ButtonAction == "RFC") {
// alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
@ -581,12 +572,6 @@ export class WorklistMainComponent implements OnInit {
//this.common.openWorklistRFCPage();
this.openRFCModal();
} else if (ButtonAction == "ANSWER_INFO") {
// this.navCtrl.push("WorkListReplacmentRollPage", {
// pQuestion: this.pQuestion,
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
@ -610,11 +595,6 @@ export class WorklistMainComponent implements OnInit {
) {
// alert("multi option: "+ ButtonAction);
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
// this.navCtrl.push("WorkListReplacmentRollPage", {
// passNotificationInfo: this.getPassNotificationDetails,
// passActionMode: ButtonAction,
// passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
// });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -628,8 +608,6 @@ export class WorklistMainComponent implements OnInit {
WorklistMainComponent.PASS_RES_ATTR
);
console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
// this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if (
ButtonAction == "UPDATE_ACTION" ||
@ -655,11 +633,6 @@ export class WorklistMainComponent implements OnInit {
this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST
);
// this.navCtrl.push("SubmitAbsencePage", {
// dirfromNotificationPage: true,
// submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
// });
//this.common.openConfirmAbsece();
this.dirfromNotificationPage = true,
this.common.sharedService.setSharedData(
this.dirfromNotificationPage,
@ -689,9 +662,6 @@ export class WorklistMainComponent implements OnInit {
}
openActionHistory() {
// this.navCtrl.push("WorkListActionHistoryPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -699,12 +669,7 @@ export class WorklistMainComponent implements OnInit {
this.common.openWorklistHistoryPage();
}
openSupportDocuments() {
// this.navCtrl.push("WorkListAttachPage", {
// passNotificationInfo: this.getPassNotificationDetails
// });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@ -723,8 +688,6 @@ export class WorklistMainComponent implements OnInit {
handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
this.NotRespondAttributeList = [];
result.NotificationGetRespondAttributesList;
if (
@ -859,52 +822,32 @@ export class WorklistMainComponent implements OnInit {
}
public checkLines(note) {
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
}
return false;
};
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
}
this.actionHistoryRes = actionHis;
console.log("test");
}
async openMoreActions() {
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
@ -912,21 +855,14 @@ export class WorklistMainComponent implements OnInit {
this.actionButton(this.actionType);
}
});
return await modal.present();
}
async OpenAttachFiles(value, Type) {
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage')
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
return await modal.present();
}
@ -934,7 +870,6 @@ export class WorklistMainComponent implements OnInit {
///calling getSubleave
getSubordinatesleave(list) {
console.log(list);
let to;
let from;
@ -946,33 +881,20 @@ export class WorklistMainComponent implements OnInit {
from = list[i].DATE_VALUE;
}
}
console.log(new Date(to));
console.log(new Date(from));
const request = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = "/Date(" + Date.parse(from) + '+0300' + ")/";//new Date(from);
request.P_DATE_TO = "/Date(" + Date.parse(to) + '+0300' + ")/" //new Date(to);
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
// ="'/Date(" + Date.parse(from) + ")'"
this.dashboredService.getSubordinatesLeaves(request).
subscribe((result: any) => {
this.handleSubordinatesLeavesResult(result);
});
}
public handleSubordinatesLeavesResult(result) {
if (this.common.validResponse(result)) {
// GetSubordinatesLeavesList it used in dashbored
// if (this.common.hasData(result.GetSubordinatesLeavesList)) {
if (this.common.hasData(result.SubordinatesOnLeavesList)) {
this.subordinatesleaveList = result.SubordinatesOnLeavesList;
}
}
}
@ -984,6 +906,7 @@ export class WorklistMainComponent implements OnInit {
this.handleSubmitterInfoResult(result);
});
}
handleSubmitterInfoResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
@ -995,107 +918,66 @@ export class WorklistMainComponent implements OnInit {
}// End handleWorkListButtonsResult
async openRepRolModal() {
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
// this.openNotificationsDashboard();
this.nextNotfification();
}
});
return await modal.present();
}
async openRFCModal() {
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
// this.openNotificationsDashboard();
this.nextNotfification();
}
});
return await modal.present();
}
async openApplyModal(WorkListActionObj) {
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage')
// this.common.sharedService.setSharedData(
// this.WorkListActionObj,
// WorklistMainPRComponent.PASS_NOTIFICATION_INFO
// );
const modal = await this.modalCtrl.create({
component: ApplyActionModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data); // Here's your selected user!
});
return await modal.present();
}
loadMoreActionHistory() {
if (!this.IsReachEnd) {
console.log("doInfinite action history MR");
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@ -1113,17 +995,12 @@ export class WorklistMainComponent implements OnInit {
}// if response == 1
//this.pageNum++;
// infiniteScroll.target.complete();
});
} else {
console.log("no doInfinite action history MR");
//if (infiniteScroll)
//infiniteScroll.target.complete();
}
}//end infiniteScroll
openNotificationsDashboard() {
this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
@ -1133,5 +1010,4 @@ export class WorklistMainComponent implements OnInit {
}
});
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 KiB

After

Width:  |  Height:  |  Size: 276 KiB

Loading…
Cancel
Save