MM-112 FIXED - worklist and home loader issue resolved

master
umasoodch 6 years ago
parent 23059e2fcc
commit ab2ace51b9

@ -12,14 +12,23 @@ export class AccrualService {
public con: ConnectorService,
public authService: AuthenticationService
) {}
public getAccrualBalances(balance: any, onError?: any, errorLabel?: string) {
public getAccrualBalances(balance: any, onError?: any, errorLabel?: string, isPostNoLoad = false) {
const request = balance;
this.authService.authenticateRequest(request);
return this.con.post(
AccrualService.GET_ACCRUAL_BALANCE,
request,
onError,
errorLabel
);
if (isPostNoLoad) {
return this.con.postNoLoad(
AccrualService.GET_ACCRUAL_BALANCE,
request,
onError,
errorLabel
);
} else {
return this.con.post(
AccrualService.GET_ACCRUAL_BALANCE,
request,
onError,
errorLabel
);
}
}
}

@ -27,18 +27,22 @@ export class EitService {
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION'
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string): Observable<any> {
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<any> {
const request = menuEntries;
this.authService.authenticateRequest(request);
console.log(request);
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
if (isPostNoLoad) {
return this.con.postNoLoad(EitService.getMenuEntries, request, onError, errorLabel);
} else {
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
}
}
// tslint:disable-next-line: no-shadowed-variable
public getEITTransactionsList(EITTransactionsRequest: EITTransactionsRequest, onError?: any, errorLabel?: string): Observable<any> {
const request = EITTransactionsRequest;
this.authService.authenticateRequest(request);
@ -78,9 +82,9 @@ export class EitService {
public getApproversList(abProcess: any, onError?: any, errorLabel?: string): Observable<ApproversList> {
const request = abProcess;
request.P_AME_TRANSACTION_TYPE = "SSHRMS";
request.P_AME_TRANSACTION_TYPE = 'SSHRMS';
request.P_PAGE_NUM = 1;
request.P_PAGE_LIMIT = 1000;//check later on
request.P_PAGE_LIMIT = 1000; // check later on
this.authService.authenticateRequest(request);
return this.con.post(EitService.getApproversList, request, onError, errorLabel);
}

@ -1,31 +1,31 @@
import { Injectable } from "@angular/core";
import { Injectable } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpErrorResponse
} from "@angular/common/http";
import { Observable, throwError, TimeoutError } from "rxjs";
import { catchError, retry, tap, timeout } from "rxjs/operators";
import { CommonService } from "../common/common.service";
//import { Response } from "../models/response";
} from '@angular/common/http';
import { Observable, throwError, TimeoutError } from 'rxjs';
import { catchError, retry, tap, timeout } from 'rxjs/operators';
import { CommonService } from '../common/common.service';
// import { Response } from "../models/response";
import { Response } from 'src/app/hmg-common/services/models/response';
@Injectable({
providedIn: "root"
providedIn: 'root'
})
export class ConnectorService {
/*
connection configuration settings
*/
static httpOptions = {
headers: new HttpHeaders({ "Content-Type": "application/json" })
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};
public static retryTimes = 0;
public static timeOut = 30 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service
public static host = "https://uat.hmgwebservices.com/";
//public static host = 'https://hmgwebservices.com/';
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.50.100.198:6060/';
// public static host = 'http://10.50.100.113:6060/'; // development service
/* public static host = 'http://10.50.100.198:6060/';
@ -64,17 +64,33 @@ public static host = "https://uat.hmgwebservices.com/";
);
}
public postNoLoad(service: string, data: any, onError: any): Observable<any> {
// public postNoLoad(service: string, data: any, onError: any): Observable<any> {
// return this.httpClient
// .post<any>(
// ConnectorService.host + service,
// data,
// ConnectorService.httpOptions
// )
// .pipe(
// retry(ConnectorService.retryTimes),
// tap(() => {}, () => {})
// );
// }
public postNoLoad(service: string, data: any, onError: any, errorLabel?: string): Observable<any> {
return this.httpClient
.post<any>(
.post<any>(
ConnectorService.host + service,
data,
ConnectorService.httpOptions
)
.pipe(
retry(ConnectorService.retryTimes),
tap(() => {}, () => {})
);
ConnectorService.httpOptions)
.pipe(
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap((res) => {
this.handleResponse(res, onError, errorLabel, true);
}, (error) => {
this.handleError(error, onError, errorLabel, true);
}));
}
// absolute url connection
@ -133,7 +149,10 @@ public static host = "https://uat.hmgwebservices.com/";
}
*/
public handleError(error: any, onError: any, errorLabel: string) {
public handleError(error: any, onError: any, errorLabel: string, isPostNoLoad = false) {
// if (!isPostNoLoad) {
// this.cs.stopLoading();
// }
this.cs.stopLoading();
if (error instanceof TimeoutError) {
this.cs.showConnectionTimeout(onError, errorLabel);
@ -142,20 +161,19 @@ public static host = "https://uat.hmgwebservices.com/";
}
}
public handleResponse(result: Response, onError: any, errorLabel: string) {
this.cs.stopLoading();
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
if (!isPostNoLoad) {
this.cs.stopLoading();
}
if (!this.cs.validResponse(result)) {
// not authorized
console.log(result.MessageStatus);
console.log("erroe");
if (result.IsAuthenticated == false) {
if (result.IsAuthenticated === false) {
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.cs.sharedService.clearAll();
this.cs.openLogin();
});
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
//console.log("error expired");
// console.log("error expired");
} else {
this.cs.showErrorMessageDialog(
onError,

@ -34,7 +34,7 @@ export class DashboredService {
public authService: AuthenticationService,
) { }
public getOrganizationSalaries(onError ?: any ,oerrorLable ?: any): Observable<OrganizationSalariesResponse>{
public getOrganizationSalaries(onError ?: any , oerrorLable ?: any): Observable<OrganizationSalariesResponse>{
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
@ -42,21 +42,20 @@ export class DashboredService {
request,
onError,
oerrorLable
);}
);
}
public getOpenMissingSwipes(onError ?: any, oerrorLable ?: any): Observable<OpenMissingSwipesResponse> {
public getOpenMissingSwipes(onError ?: any, oerrorLable ?: any, isPostNoLoad = false): Observable<OpenMissingSwipesResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
DashboredService.openMissingSwipesUrl,
request,
onError,
oerrorLable
);
if (isPostNoLoad) {
return this.con.postNoLoad(DashboredService.openMissingSwipesUrl, request, onError, oerrorLable);
} else {
return this.con.post( DashboredService.openMissingSwipesUrl, request, onError, oerrorLable);
}
}
public getPerformanceAppraisal(onError ?: any ,oerrorLable ?: any): Observable<PerformanceAppraisalResponse>{
public getPerformanceAppraisal(onError ?: any , oerrorLable ?: any): Observable<PerformanceAppraisalResponse>{
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
@ -66,30 +65,47 @@ export class DashboredService {
oerrorLable
);
}
public getAttendanceTracking(selectedEmployee: any, onError ?: any , oerrorLable ?: any): Observable<AttendanceTrackingResponse>{
// tslint:disable-next-line: max-line-length
public getAttendanceTracking(selectedEmployee: any, onError ?: any , oerrorLable ?: any, isPostNoLoad = false): Observable<AttendanceTrackingResponse>{
const request = selectedEmployee;
this.authService.authenticateRequest(request);
return this.con.post(
DashboredService.attendancetrackingUrl,
request,
onError,
oerrorLable
);
if (isPostNoLoad) {
return this.con.postNoLoad(
DashboredService.attendancetrackingUrl,
request,
onError,
oerrorLable
);
} else {
return this.con.post(
DashboredService.attendancetrackingUrl,
request,
onError,
oerrorLable
);
}
}
public getOpenPeriodDates( onError?: any, errorLabel?: string): Observable<OpenPeriodDatesResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(DashboredService.getOpenPeriodDates, request, onError, errorLabel);
}
public getOpenNotifications( onError?: any, errorLabel?: string): Observable<GetOpenNotificationsResponse> {
public getOpenNotifications( onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<GetOpenNotificationsResponse> {
console.log(isPostNoLoad);
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(DashboredService.getOpenNotifications, request, onError, errorLabel);
if (isPostNoLoad) {
return this.con.postNoLoad(DashboredService.getOpenNotifications, request, onError, errorLabel);
} else {
return this.con.post(DashboredService.getOpenNotifications, request, onError, errorLabel);
}
}
public getSubordinatesLeaves( req: GetSubordinatesLeavesRequest,onError?: any, errorLabel?: string): Observable<GetSubordinatesLeavesResponse> {
// tslint:disable-next-line: max-line-length
public getSubordinatesLeaves( req: GetSubordinatesLeavesRequest, onError?: any, errorLabel?: string): Observable<GetSubordinatesLeavesResponse> {
this.authService.authenticateRequest(req);
return this.con.post(DashboredService.getSubordinatesLeaves, req, onError, errorLabel);
}
// tslint:disable-next-line: max-line-length
public getSubordinatesAttStatus( req: GetSubordinatesAttdStatusRequest, onError?: any, errorLabel?: string): Observable<GetSubordinatesAttdStatusResponse> {
this.authService.authenticateRequest(req);
return this.con.post(DashboredService.getSubordinatesAttStatus, req, onError, errorLabel);

@ -1,51 +1,55 @@
import {Injectable} from '@angular/core';
import {Http, Response, Headers, } from "@angular/http";
import {AuthenticationService} from "../authentication/authentication.service";
import {Http, Response, Headers, } from '@angular/http';
import {AuthenticationService} from '../authentication/authentication.service';
import { Observable } from 'rxjs';
import {MenuEntries} from './models/menu-entries.request';
import { Request } from 'src/app/hmg-common/services/models/request';
//import {Request} from '../models/request';
import {MenuResponse} from './models/menu-response'
// import {Request} from '../models/request';
import {MenuResponse} from './models/menu-response';
import { ConnectorService } from '../connector/connector.service';
@Injectable()
export class MenuService {
public static getMenu ='Services/ERP.svc/REST/GET_MENU';
public static getMenu = 'Services/ERP.svc/REST/GET_MENU';
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
public static getNotCount='Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS_NUM';
public static disableSession="Services/ERP.svc/REST/DisableSession";
public static detectLanguage='Services/ERP.svc/REST/Get_LanguageAvailable';
public static getNotCount = 'Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS_NUM';
public static disableSession = 'Services/ERP.svc/REST/DisableSession';
public static detectLanguage = 'Services/ERP.svc/REST/Get_LanguageAvailable';
constructor(
public authService: AuthenticationService,
public con:ConnectorService
public con: ConnectorService
) { }
public getMenu(onError?: any, errorLabel?: string): Observable<MenuResponse> {
public getMenu(onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<MenuResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenu, request, onError, errorLabel);
if (isPostNoLoad) {
return this.con.postNoLoad(MenuService.getMenu, request, onError, errorLabel);
} else {
return this.con.post(MenuService.getMenu, request, onError, errorLabel);
}
}
public getMenuEntires(menuEntries:any, onError?: any, errorLabel?: string): Observable<MenuResponse> {
public getMenuEntires(menuEntries: any, onError?: any, errorLabel?: string): Observable<MenuResponse> {
const request = menuEntries;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenuEntries, request, onError, errorLabel);
}
public getNotificationCount(req:any, onError?: any, errorLabel?: string): Observable<any> {
public getNotificationCount(req: any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getNotCount, request, onError, errorLabel);
}
public disableSession(req:any, onError?: any, errorLabel?: string): Observable<any> {
public disableSession(req: any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.disableSession, request, onError, errorLabel);
}
}
public getAppLanguages(req:any, onError?: any, errorLabel?: string): Observable<any> {
public getAppLanguages(req: any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.detectLanguage, request, onError, errorLabel);
}
}
}
}

@ -183,11 +183,11 @@ export class PushService {
request.DeviceType = this.getDeviceType();
const user = this.authService.getAuthenticatedUser();
// request.PatientMobileNumber = user.MobileNo;
//request.NationalID = user.IdentificationNo;
// request.NationalID = user.IdentificationNo;
request.Gender = user.Gender;
request.PatientID = user.PatientID;
// request.PatientOutSA = user.PatientOutSA ? 1 : 0;
//request.LoginType = user.biometricEnabled ? 2 : 1; // 1 sms , 2 touch id
// request.LoginType = user.biometricEnabled ? 2 : 1; // 1 sms , 2 touch id
request.MACAddress = '00:00:00:00:00:00';
return this.con.postNoLoad(PushService.loggedInUserURL, request
, () => { }).subscribe((result: Response) => {

@ -8,7 +8,6 @@ import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.servic
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { Device } from '@ionic-native/device/ngx';
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
@ -33,8 +32,6 @@ import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/m
import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse';
import { AccrualService } from '../accrual-balances/services/accrual.service';
import { GetDayAndHoursDetailsRequest } from '../time-card/service/models/get-day-hours-type-details.request';
import * as moment from 'moment';
import { TimeCardService } from '../time-card/service/time-card.service';
import { WorklistMainService } from '../notification/service/work-list.main.service';
@ -57,9 +54,9 @@ export class HomePage implements OnInit {
public fileUploder: FileUploaderComponent;
location: boolean;
camera: boolean;
ticketRequestObject : any;
leaveRequestObject : any;
missingSwipeRequestObject : any;
ticketRequestObject: any;
leaveRequestObject: any;
missingSwipeRequestObject: any;
public statsButtons = [
{
title: 'Work List',
@ -93,25 +90,6 @@ export class HomePage implements OnInit {
}
];
// public employeeServicesButtons = [
// {
// title: 'Leave Management',
// icon: 'assets/icon/new-design/leave_management.png'
// },
// {
// title: 'Advance Payments',
// icon: 'assets/icon/new-design/advance_payments.png'
// },
// {
// title: 'Medical Insurance',
// icon: 'assets/icon/new-design/medical_insurance.png'
// },
// {
// title: 'Pay Slip',
// icon: 'assets/icon/new-design/pay_slip.png'
// }
// ];
public slideOptsOne = {
slidesPerView: 3.5,
spaceBetween: 10
@ -136,6 +114,7 @@ export class HomePage implements OnInit {
public menuType: any;
accrualBalancesList: any;
public countAllNotification = 0;
public isPostNoLoad = true;
constructor(
public ts: TranslatorService,
@ -145,35 +124,30 @@ export class HomePage implements OnInit {
public common: CommonService,
public events: Events,
private device: Device,
private zbar: ZBar,
private geolocation: Geolocation,
private attendanceService: AttendanceService,
private eitService: EitService,
private barcodeScanner: BarcodeScanner,
public actionSheetCtrl: ActionSheetController,
private cameraController: Camera,
public sharedData: SharedDataService,
private sanitizer: DomSanitizer,
private file: File,
private permissions: DevicePermissionsService,
public DS: DashboredService,
public accrualService: AccrualService,
//////////////////////////////////////// TIME AND DATE////////////////////////////
public timeCardService: TimeCardService,
///////////////////// END/////////////////////////////////////////////////////////
public workListService: WorklistMainService
) {
this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl(
'data:Image/*;base64,' + displayImg
);
console.log('html saved img: ' + this.userImage);
});
}
ngOnInit() {
this.menu.enable(true)
this.common.startLoading();
this.menu.enable(true);
// this.getUserDetails();
// this.getCount();
this.events.subscribe('getNotCount', badge => {
@ -182,6 +156,7 @@ export class HomePage implements OnInit {
}
ionViewWillEnter() {
this.common.startLoading();
this.remainingTime = 0;
this.displayTime = '00:00:00';
this.runTimer = false;
@ -320,9 +295,9 @@ export class HomePage implements OnInit {
this.userData,
AuthenticatedUser.SHARED_DATA
);
if(this.common.getUpdateImage().status){
this.userImage =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.common.getUpdateImage().img);
}else{
if (this.common.getUpdateImage().status) {
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.common.getUpdateImage().img);
} else {
this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
@ -341,6 +316,7 @@ export class HomePage implements OnInit {
this.showOpenMissingSwipes();
this.showAttendanceTracking();
this.getAccrualBalance();
// this.common.stopLoading();
}
public Vacation_Rule() {
@ -348,7 +324,7 @@ export class HomePage implements OnInit {
}
private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.menuService.getMenu('', '', this.isPostNoLoad).subscribe((result: MenuResponse) => {
this.handleMenuResult(result);
});
}
@ -356,7 +332,6 @@ export class HomePage implements OnInit {
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
console.log('list menu');
this.menuList = result.List_Menu;
this.getMenuDetails();
}
@ -376,15 +351,15 @@ export class HomePage implements OnInit {
const selMenu: MenuResponse = new MenuResponse();
selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER;
console.log("menu: " + selMenu.List_Menu);
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.getMenuEntries(item);
for(let i=0;i<this.menuList.length;i++){
if(this.menuList[i].MENU_TYPE=="M"){
this.events.publish("myTeamFlag","true");
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.menuList.length; i++) {
if (this.menuList[i].MENU_TYPE === 'M') {
this.events.publish('myTeamFlag', 'true');
}
}
// if (item.MENU_TYPE === 'M') {
// this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage");
@ -426,7 +401,6 @@ export class HomePage implements OnInit {
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
// set emp and resp id
console.log("set data");
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
@ -437,7 +411,7 @@ export class HomePage implements OnInit {
);
this.eitService
.getMenuEntries(request)
.getMenuEntries(request, '', '', this.isPostNoLoad)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
@ -446,9 +420,8 @@ export class HomePage implements OnInit {
sortMenuEntires(list) {
const tree = this.common.list_to_tree(list);
this.menuEntries = tree;
console.log(this.menuEntries);
this.common.sharedService.setSharedData(tree, "menuEntries");
this.common.sharedService.setSharedData("home", "homemenuentries");
this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.sharedService.setSharedData('home', 'homemenuentries');
// this.common.navigateForward("/eit/homepage");
// this.common.openEITPage();
}
@ -456,24 +429,26 @@ export class HomePage implements OnInit {
private handleMenuEntiresResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMenuEntriesList)) {
for(let i=0;i<result.GetMenuEntriesList.length;i++){
if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HMG_TKT_NEW_EIT_SS"){
this.ticketRequestObject=result.GetMenuEntriesList[i];
}else if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HR_LOA_SS"){
this.leaveRequestObject=result.GetMenuEntriesList[i];
} else if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HMG_OTL_MISSING_SWIPE_EIT_SS"){
this.missingSwipeRequestObject=result.GetMenuEntriesList[i];
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < result.GetMenuEntriesList.length; i++) {
// tslint:disable-next-line: triple-equals
if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HMG_TKT_NEW_EIT_SS') {
this.ticketRequestObject = result.GetMenuEntriesList[i];
// tslint:disable-next-line: triple-equals
} else if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HR_LOA_SS') {
this.leaveRequestObject = result.GetMenuEntriesList[i];
// tslint:disable-next-line: triple-equals
} else if (result.GetMenuEntriesList[i].FUNCTION_NAME == 'HMG_OTL_MISSING_SWIPE_EIT_SS') {
this.missingSwipeRequestObject = result.GetMenuEntriesList[i];
}
}
}
this.sortMenuEntires(result.GetMenuEntriesList);
}
}
}
parentFn($event: string) {
console.log($event); // this will output 'hello from child'
console.log($event);
}
private Change_password() {
@ -502,7 +477,7 @@ export class HomePage implements OnInit {
this.swipeAttendance();
})
.catch(err => {
console.log("Error", err);
console.log('Error', err);
});
}
@ -513,14 +488,13 @@ export class HomePage implements OnInit {
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log(JSON.stringify(request));
this.attendanceService
.attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance");
console.log('Error inside in swipe attendance');
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
this.showAttendanceTracking();
}
// else {
@ -533,8 +507,7 @@ export class HomePage implements OnInit {
this.common.openProfile();
}
/*************************************Dashboards Services**********************************************************8 */
// Dashboard Services
showOrganizationSalaries() {
this.DS.getOrganizationSalaries().subscribe(
(result: OrganizationSalariesResponse) => {}
@ -542,10 +515,10 @@ export class HomePage implements OnInit {
}
showOpenMissingSwipes() {
this.DS.getOpenMissingSwipes().subscribe(
this.DS.getOpenMissingSwipes('', '', this.isPostNoLoad).subscribe(
(result: OpenMissingSwipesResponse) => {
if (this.common.validResponse(result)) {
const key = "GetOpenMissingSwipesList";
const key = 'GetOpenMissingSwipesList';
this.statsButtons[1].statsValue = Math.floor(result[key].P_OPEN_MISSING_SWIPES);
}
}
@ -567,7 +540,6 @@ export class HomePage implements OnInit {
}
convertAndAssignTime(data) {
console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
@ -581,7 +553,7 @@ showAttendanceTracking() {
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
};
this.DS.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
this.DS.getAttendanceTracking(request, '', '', this.isPostNoLoad).subscribe((result: AttendanceTrackingResponse) => {
if (this.common.validResponse(result)) {
const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]);
@ -598,10 +570,7 @@ openPeriodDateDashbored() {
}
openNotificationsDashbored() {
// work list
this.DS.getOpenNotifications(() => {
console.log("Error ");
}).subscribe((result: GetOpenNotificationsResponse) => {
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
const key = 'P_OPEN_NTF_NUMBER';
this.countAllNotification = result[key];
@ -615,18 +584,19 @@ openPeriodDateDashbored() {
}
ITGCountAllNotification() {
this.workListService.getITGDetails().subscribe((result: any) => {
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
this.statsButtons[0].statsValue =
Math.floor(this.countAllNotification + result.TotalCount);
this.common.stopLoading();
});
}
getSubordinatesLeaves() {
const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = "/Date(1578603600000+0300)/"; // test
request.P_DATE_TO = "/Date(1576011600000+0300)/"; // test
request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test
request.P_DATE_TO = '/Date(1576011600000+0300)/'; // test
this.DS.getSubordinatesLeaves(request, () => {
console.log("Error ");
console.log('Error ');
}).subscribe((result: GetSubordinatesLeavesResponse) => {
if (this.common.validResponse(result)) {
console.log('response');
@ -637,10 +607,10 @@ openPeriodDateDashbored() {
getSubordinatesAttStatus() {
const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; // test
request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/"; // test
request.P_SCHEDULE_DATE_FROM = '/Date(1578603600000+0300)/'; // test
request.P_SCHEDULE_DATE_TO = '/Date(1576011600000+0300)/'; // test
this.DS.getSubordinatesAttStatus(request, () => {
console.log("Error ");
console.log('Error ');
}).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.common.validResponse(result)) {
console.log('response');
@ -650,7 +620,6 @@ getSubordinatesAttStatus() {
}
openPage(subMenu) {
console.log("openPage");
let selMenu: MenuResponse = new MenuResponse();
selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
@ -681,41 +650,28 @@ getSubordinatesAttStatus() {
const day = today.getDate();
const month = today.getMonth() + 1;
const year = today.getFullYear();
const todayDate = month + "/" + day + "/" + year;
const todayDate = month + '/' + day + '/' + year;
const effectiveDate = todayDate;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER,
P_EFFECTIVE_DATE: effectiveDate
};
this.accrualService.getAccrualBalances(request).subscribe((result: any) => {
this.accrualService.getAccrualBalances(request, '', '', this.isPostNoLoad).subscribe((result: any) => {
if (this.common.validResponse(result)) {
let totalTicketsLeft = 0;
this.accrualBalancesList = result.GetAccrualBalancesList;
for (const accrualBalance of result.GetAccrualBalancesList) {
if (
accrualBalance.ACCURAL_PLAN_NAME ===
"HMG Annual Vacation Accrual Plan"
) {
if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') {
this.statsButtons[2].statsValue =
Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT);
this.common.sharedService.setSharedData(
accrualBalance,
"leaveAccrualBalance"
);
this.common.sharedService.setSharedData(
request,
"leaveAccrualBalanceDate"
);
this.common.sharedService.setSharedData(
this.accrualBalancesList,
"tickitsbalance"
);
this.common.sharedService.setSharedData(accrualBalance, 'leaveAccrualBalance');
this.common.sharedService.setSharedData(request, 'leaveAccrualBalanceDate');
this.common.sharedService.setSharedData(this.accrualBalancesList, 'tickitsbalance');
} else {
totalTicketsLeft =
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
}
});
}
@ -730,14 +686,18 @@ openProfilePage() {
openStatsButton(link: any) {
// console.log(link);
if (link == "1") {
// tslint:disable-next-line: triple-equals
if (link == '1') {
this.common.startLoading();
this.common.openNotificationPage();
} else if (link == "2") {
// tslint:disable-next-line: triple-equals
} else if (link == '2') {
this.openPage(this.missingSwipeRequestObject);
} else if (link == "3") {
// tslint:disable-next-line: triple-equals
} else if (link == '3') {
this.openPage(this.leaveRequestObject);
} else if (link =="4") {
// tslint:disable-next-line: triple-equals
} else if (link == '4') {
this.openPage(this.ticketRequestObject);
}
}

@ -7,7 +7,6 @@
</ion-toolbar>
</ion-header>
<ion-content>
<div class="contentBg">
<div class="result-graph">
@ -50,9 +49,6 @@
<span>Advanced Search</span>
</ion-col>
</ion-row>
<!-- <div class="total-result" *ngIf="isEmptyObject() && selectedFilter === 'ALL' && showSearchButton === false">
<span>showing {{newWorkListResponse.length}} of {{filters[0].value}}</span>
</div> -->
<ion-row *ngIf='selectedFilter === "ITG"'>
<ion-col>
@ -75,7 +71,6 @@
</div>
</div>
</div>
<div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'>
<span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
@ -84,19 +79,13 @@
</div>
</div>
</div>
<div class="no-data-available" *ngIf="showFormattedData.length === 0">
<span>No Data Available</span>
</div>
</div>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="selectedFilter === 'ALL' || itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>

@ -72,6 +72,7 @@ export class HomeComponent implements OnInit {
public totalMR = 0;
public showChart = false;
public isPostNoLoad = true;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
@ -165,6 +166,7 @@ export class HomeComponent implements OnInit {
}
ngOnInit() {
this.common.startLoading();
this.openNotificationsDashboard();
}
@ -175,7 +177,7 @@ export class HomeComponent implements OnInit {
}
openNotificationsDashboard() {
this.DS.getOpenNotifications().subscribe((result: GetOpenNotificationsResponse) => {
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
this.worklistNotifications = result;
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
@ -256,6 +258,7 @@ export class HomeComponent implements OnInit {
modal.onDidDismiss().then(result => {
if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading();
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
@ -273,6 +276,7 @@ export class HomeComponent implements OnInit {
if (this.itemType !== '') {
this.disableFilters();
}
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
}
}
@ -296,7 +300,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
this.WorklistService.getWorkList(this.WorkListObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
}
@ -412,6 +416,7 @@ export class HomeComponent implements OnInit {
this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
this.common.stopLoading();
} else {
this.newWorkListResponse = [];
}
@ -449,8 +454,10 @@ export class HomeComponent implements OnInit {
}
clearSearch() {
this.common.startLoading();
this.itemType = '';
this.selectedFilter = 'ALL';
this.isPostNoLoad = true;
this.disableFilters();
this.resetData();
this.getAllPushNotificationFun();
@ -471,7 +478,7 @@ export class HomeComponent implements OnInit {
}
Count() {
this.workListService.getITGCount()
this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => {
for (let i = 0; i < result.RequestType.length; i++) {
this.ITGSegment[i] = {
@ -486,7 +493,7 @@ export class HomeComponent implements OnInit {
}
Details() {
this.workListService.getITGDetails()
this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => {
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount;

@ -240,19 +240,27 @@ export class WorklistMainService {
);
}
public getITGCount( onError?: any, errorLabel?: string): Observable<any> {
const request = new Request;
console.log(request)
public getITGCount( onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<any> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getITGFormTaskCount,
request,
onError,
errorLabel
);
if (isPostNoLoad) {
return this.api.postNoLoad(
WorklistMainService.getITGFormTaskCount,
request,
onError,
errorLabel
);
} else {
return this.api.post(
WorklistMainService.getITGFormTaskCount,
request,
onError,
errorLabel
);
}
}
public getITGFormDetails(request:itgRequest, onError?: any, errorLabel?: string): Observable<any> {
public getITGFormDetails(request: itgRequest, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.P_USER_NAME;
console.log(request);
@ -266,16 +274,25 @@ export class WorklistMainService {
public getITGDetails( onError?: any, errorLabel?: string): Observable<any> {
const request = new Request;
console.log(request)
public getITGDetails( onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<any> {
const request = new Request();
console.log(request);
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getITGFormTaskDetails,
request,
onError,
errorLabel
);
if (isPostNoLoad) {
return this.api.postNoLoad(
WorklistMainService.getITGFormTaskDetails,
request,
onError,
errorLabel
);
} else {
return this.api.post(
WorklistMainService.getITGFormTaskDetails,
request,
onError,
errorLabel
);
}
}

@ -22,10 +22,14 @@ export class WorklistService {
) { }
public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string): Observable<any> {
public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<any> {
const request = WorkListReq;
this.authService.authenticateRequest(request);
return this.api.post(WorklistService.getWorkList, request, onError, errorLabel);
if (isPostNoLoad) {
return this.api.postNoLoad(WorklistService.getWorkList, request, onError, errorLabel);
} else {
return this.api.post(WorklistService.getWorkList, request, onError, errorLabel);
}
}
public getReplacmentEmployeeList(ReplacmentEmployeeRequest: any, onError?: any, errorLabel?: string): Observable<any> {

@ -7,8 +7,8 @@
<div class="search-container">
<ion-item lines="none">
<ion-label>{{ts.trPK('worklist','view')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
<ion-label class="enable-overflow">{{ts.trPK('worklist','view')}}</ion-label>
<ion-select class="custom-width" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
(ionChange)=onChangeView($event)>
<ion-select-option value="1">{{ts.trPK('worklist','openNot')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','fyi')}}</ion-select-option>
@ -19,8 +19,8 @@
</ion-item>
<ion-item lines="none" [ngStyle]="(hideDateInput === true || hideTextInput === true) ? {'margin-bottom': '0px'} : {}">
<ion-label>{{ts.trPK('worklist','searchby')}}</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
<ion-label class="enable-overflow">{{ts.trPK('worklist','searchby')}}</ion-label>
<ion-select class="custom-width" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
(ionChange)="getValueSelected($event)">
<ion-select-option value="1">{{ts.trPK('worklist','from')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('worklist','subject')}}</ion-select-option>
@ -32,7 +32,7 @@
<div>
<div *ngIf="hideDateInput">
<ion-item lines='none' style="border-radius: 10px;margin-right: 10px;margin-left: 10px;margin-top: 5px;">
<ion-label>{{ts.trPK('worklist','sent')}} </ion-label>
<ion-label class="enable-overflow">{{ts.trPK('worklist','sent')}} </ion-label>
<ion-datetime placeholder="{{ts.trPK('worklist','enter')}}" displayFormat="DD-MMM-YYYY"
pickerFormat="DD-MMM-YYYY" [(ngModel)]="inputDate"></ion-datetime>
</ion-item>
@ -46,8 +46,8 @@
</div>
<ion-item lines="none">
<ion-label>Item Type</ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
<ion-label class="enable-overflow">Item Type</ion-label>
<ion-select class="custom-width" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="itemType">
<ion-select-option value="HRSSA">HR</ion-select-option>
<ion-select-option value="POAPPRV">PO</ion-select-option>

@ -18,7 +18,7 @@
.search-container {
margin-right: 15px;
margin-left: 15px;
padding-bottom: 100px;
// padding-bottom: 100px;
margin-top: 5px;
ion-item{
border: 2px solid #eaeaea;
@ -37,4 +37,10 @@
span{
color: white;
}
}
.custom-width{
max-width: 100% !important;
}
.enable-overflow{
overflow: visible !important;
}
Loading…
Cancel
Save