Merge branch 'MOHEMM-Q3-DEV-LATEST' into enad-pre-live

# Conflicts:
#	Mohem/src/app/eit/cei-homepage/cei-homepage.component.html
#	Mohem/src/app/eit/cei-homepage/cei-homepage.component.ts
MOHEMM-Q3-DEV-LATEST
umasoodch 4 years ago
commit 744740ac44

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

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

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@
</div>
<div padding>
<ion-radio-group [(ngModel)]="SelectedServiceType">
<ion-radio-group [(ngModel)]="selectedServiceType">
<ion-item *ngFor="let user of familyMemberData" lines='none'
style="padding-bottom: 10px; border-radius: 10px 10px 25px 25px;">
<ion-grid>

@ -11,33 +11,37 @@ import { EitService } from '../services/eit.service';
export class CeiHomepageComponent implements OnInit {
public familyMemberData;
public SelectedServiceType;
public selectedServiceType;
public direction: string;
myColor: string = 'secondary';
constructor(
private eitService: EitService,
public ts: TranslatorService,
public cs: CommonService
) {
this.eitService.getContactInfo({
P_MENU_TYPE: 'E',
P_SELECTED_RESP_ID: -999
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
if (this.cs.validResponse(response)) {
this.familyMemberData = response['GetEmployeeContactsList'];
this.SelectedServiceType = this.familyMemberData[0];
console.log(this.familyMemberData);
}
});
}
) {}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.getContactInfo();
}
selectedUser(user){
this.SelectedServiceType = user;
public getContactInfo () {
this.eitService.getContactInfo({
P_MENU_TYPE: 'E',
P_SELECTED_RESP_ID: -999
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
if (this.cs.validResponse(response)) {
this.familyMemberData = response['GetEmployeeContactsList'];
this.selectedServiceType = this.familyMemberData[0];
console.log(this.familyMemberData);
}
});
}
public gotoTransactionsPage() {
console.log(this.selectedServiceType);
this.cs.sharedService.setSharedData(this.selectedServiceType, 'selectedContactFORChildEducation');
this.cs.openCEIListPage();
}
}

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

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

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

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

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

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

@ -15,7 +15,9 @@ import { WorkListAttachViewComponent } from '../notification/work-list-attach-vi
import { EitUpdateListComponent } from './eit-update-list/eit-update-list.component';
import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component';
import { CeiHomepageComponent } from './cei-homepage/cei-homepage.component';
import { CeiListComponent } from './cei-list/cei-list.component';
import { AddCeiComponent } from './add-cei/add-cei.component';
import { ConfirmAddCeiComponent } from './confirm-add-cei/confirm-add-cei.component';
const routes: Routes = [
{
@ -51,9 +53,21 @@ const routes: Routes = [
component: SubmitEitModalComponent
},
{
path: 'eit-cei',
path: 'cei-homepage',
component: CeiHomepageComponent
}
},
{
path: 'cei-list',
component: CeiListComponent
},
{
path: 'add-cei',
component: AddCeiComponent
},
{
path: 'confirm-cei',
component: ConfirmAddCeiComponent
},
]
}
];
@ -75,7 +89,10 @@ const routes: Routes = [
AddAttachComponent,
EitUpdateListComponent,
SubmitEitModalComponent,
CeiHomepageComponent
CeiHomepageComponent,
CeiListComponent,
AddCeiComponent,
ConfirmAddCeiComponent
],
entryComponents: [
WorkListAttachViewComponent

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

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

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

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

@ -142,7 +142,7 @@ export class AuthenticationService {
} else {
mobileType = 'android';
}
request.VersionID = 3.3;//3.2;
request.VersionID = 3.4;//3.2;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;

@ -1129,9 +1129,15 @@ export class CommonService {
public openAddEitPage() {
this.nav.navigateForward(['/eit/add-eit']);
}
public openAddCEIPage() {
this.nav.navigateForward(['/eit/add-cei']);
}
public openConfirmEitPage() {
this.nav.navigateForward(['/eit/confirm-add-eit']);
}
public openConfirmCEIPage() {
this.nav.navigateForward(['/eit/confirm-cei']);
}
public openConfirmBasicDetailsPage() {
this.nav.navigateForward(['/profile/confirm-basic']);
}
@ -1326,7 +1332,10 @@ export class CommonService {
this.nav.navigateForward(['/eit/eit-update-list']);
}
public openCEIPage() {
this.nav.navigateForward(['/eit/eit-cei']);
this.nav.navigateForward(['/eit/cei-homepage']);
}
public openCEIListPage() {
this.nav.navigateForward(['/eit/cei-list']);
}
public openAnnouncement() {
this.nav.navigateForward(['/backend-integrations/announcement']);

@ -12,11 +12,9 @@
<span>{{ts.trPK('work-list','open-analysis')}}</span>
</div>
<div class="result-text-container" [ngStyle]="showChart === false || receivedITGCount === false ? {'visibility': 'hidden'} : {}">
<!-- <span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}} </span>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} </span> -->
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2>
<h2>{{totalRequestCount}}</h2>
<!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2> -->
<!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2> -->
<span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span>
</div>
<div *ngIf="!showChart || !receivedITGCount" class="spinner-custom-class">
@ -45,7 +43,7 @@
<span style="margin-left: 5px;">{{ts.trPK('work-list','clear-search')}}</span>
<ion-icon name="close" ></ion-icon>
</ion-col>
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter !== 'ITG'">
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter !== 'ITG' && !showSearchButton">
<ion-icon name="search" ></ion-icon>
<span>{{ts.trPK('work-list','advanced-search')}}</span>
</ion-col>
@ -74,7 +72,6 @@
</div>
</div>
<div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<!-- <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> -->
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' >
<div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
@ -103,7 +100,6 @@
</div>
</div>
</div>
<!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content>

@ -186,7 +186,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 5;
this.WorkListObj.P_PAGE_LIMIT = 25;
}
ngOnInit() {
@ -212,7 +212,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = 'HR';
this.filters[0].active = true;
this.isPostNoLoad = true;
// this.disableFilters();
this.resetData();
this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
@ -303,11 +302,10 @@ export class HomeComponent implements OnInit {
}
activeFilter(index: number) {
if (index !== 4) {
this.common.startLoading();
}
console.log(this.filters);
if (this.currentActiveIndex !== index) {
if (index !== this.currentActiveIndex) {
if (index !== 4) {
this.common.startLoading();
}
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false;
@ -315,7 +313,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = this.filters[this.currentActiveIndex].key;
const filterValue = this.filters[this.currentActiveIndex].value;
if (this.selectedFilter !== 'ITG') {
// this.getFilteredData(this.selectedFilter);
this.initiateNewWorklistData(this.selectedFilter, filterValue);
}
}
@ -325,9 +322,12 @@ export class HomeComponent implements OnInit {
this.common.openProfile('sideMenu');
}
disableFilters() {
configureFilters() {
for (const filter of this.filters) {
if (filter.key === this.itemType) {
const index = this.filters.map(function(e) { return e.key; }).indexOf(this.itemType);
this.currentActiveIndex = index;
this.previousActiveIndex = 0;
filter.disable = false;
filter.active = true;
this.selectedFilter = filter.name;
@ -339,12 +339,26 @@ export class HomeComponent implements OnInit {
filter.active = false;
}
}
if (this.itemType === '') {
this.filters[0].active = true;
}
}
enableFilters() {
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
for (const filter of this.filters) {
filter.disable = false;
if (filter.key === this.itemType) {
filter.active = true;
} else {
filter.active = false;
}
}
}
async openSearchModal() {
const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent,
@ -369,19 +383,10 @@ export class HomeComponent implements OnInit {
this.newWorkListResponse = [];
this.showFormattedData = [];
this.allFormattedData = [];
// this.selectedFilter = 'ALL';
if (this.itemType !== '') {
this.disableFilters();
this.configureFilters();
}
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.filters[this.currentActiveIndex].active = true;
// if (this.itemType !== '') {
// this.disableFilters();
// }
this.isPostNoLoad = false;
this.getAllPushNotificationFun();
}
@ -494,7 +499,6 @@ export class HomeComponent implements OnInit {
this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
// this.assignDataToFilters();
}
} else {
this.newWorkListResponse = [];
@ -503,7 +507,6 @@ export class HomeComponent implements OnInit {
}
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
// this.common.stopLoading();
this.isLoading = false;
}
}
@ -562,11 +565,11 @@ export class HomeComponent implements OnInit {
clearSearch() {
this.common.startLoading();
this.isLoading = true;
this.itemType = '';
this.selectedFilter = 'ALL';
this.isLoading = false;
this.itemType = 'HRSSA';
this.selectedFilter = 'HR';
this.isPostNoLoad = true;
// this.disableFilters();
this.enableFilters();
this.resetData();
this.getAllPushNotificationFun();
}

@ -21,7 +21,7 @@
</ion-item>
<ion-item class="country dynamicField" lines="none" *ngIf="isUpdate ==false">
<ion-label> Effective Date</ion-label>
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-datetime [(ngModel)]="effectiveDate" min="1900" max="2100" displayFormat="DD/MM/YYYY " placeholder="MM/DD/YYYY"
></ion-datetime>
</ion-item>

@ -10,7 +10,7 @@
<ion-content padding>
<ion-item class="country dynamicField" lines="none" *ngIf="targetValue === 'correct' && showEffectiveDate">
<ion-label>Effective Date</ion-label>
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-label>{{showEffectiveDate}}</ion-label>
</ion-item>
<div #containerDiv id="containerDiv">

@ -1585,6 +1585,10 @@
}
},
"vacation-rule": {
"effectiveDate": {
"en": "Effective Date",
"ar": "تاريخ الفعالية"
},
"vacationRule": {
"en": "Vacation Rule",
"ar": "الإنابة بالإجازات"

Loading…
Cancel
Save