From 18dabcb13e8824bbafb73d7174d94249ba0caca9 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Sun, 23 Feb 2020 16:15:34 +0300 Subject: [PATCH 1/9] add vacation rule --- .../services/common/common.service.ts | 4 +- .../ui/fab-button/fab-button.component.html | 10 +- .../ui/fab-button/fab-button.component.scss | 36 +- .../ui/fab-button/fab-button.component.ts | 5 +- Mohem/src/app/home/home.page.html | 4 +- Mohem/src/app/home/home.page.ts | 1 + .../vacation-rule/home/home.component.html | 58 +- .../vacation-rule/home/home.component.scss | 61 ++ .../app/vacation-rule/home/home.component.ts | 8 +- .../notification-type.component.html | 10 +- .../replacement-list.component.html | 73 +- .../replacement-list.component.scss | 156 +++- .../replacement-list.component.ts | 93 +- .../app/vacation-rule/vacation-rule.module.ts | 3 + .../vacation-type.component.html | 171 +++- .../vacation-type.component.scss | 63 +- .../vacation-type/vacation-type.component.ts | 855 +++++++++++++++++- Mohem/src/assets/imgs/delete-circle.png | Bin 0 -> 983 bytes Mohem/src/assets/imgs/green.png | Bin 0 -> 977 bytes Mohem/src/assets/imgs/update-circle.png | Bin 0 -> 886 bytes Mohem/src/assets/localization/i18n.json | 10 + Mohem/src/theme/styles.scss | 15 +- Mohem/src/theme/worklist.scss | 4 +- 23 files changed, 1548 insertions(+), 92 deletions(-) create mode 100644 Mohem/src/assets/imgs/delete-circle.png create mode 100644 Mohem/src/assets/imgs/green.png create mode 100644 Mohem/src/assets/imgs/update-circle.png diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 88fdba44..dc65e9a3 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -482,7 +482,7 @@ public getMonthNameAr(value: number): string { { text: cancelLabel, role: "cancel", - cssClass: "cancelBtn", + cssClass: "checkOutCancelBtn", handler: () => { if (onCancel) { onCancel(); @@ -494,7 +494,7 @@ public getMonthNameAr(value: number): string { text: acceptLabel, role: "Confirm", - cssClass: "confirmBtn", + cssClass: "checkOutOkBtn", handler: () => { diff --git a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.html b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.html index 8e405be4..18d70a13 100644 --- a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.html +++ b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.html @@ -3,10 +3,16 @@
- + - +
+

{{ 'attendance-tracking,title' | translate }}

+
+
+ + +
diff --git a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.scss b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.scss index e6cfd86d..cc8cdf42 100644 --- a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.scss +++ b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.scss @@ -1,15 +1,15 @@ ////////////////////book btn///////////////////// -ion-fab-button{ - --background: var(--darkblue)!important; - // background: url(/assets/icon/sliderBG.jpg); - background-size: cover; - background-position: top right; - border-radius: 50%; - height:112px; - width: 112px; -} +// ion-fab-button{ +// --background: var(--darkblue)!important; +// // background: url(/assets/icon/sliderBG.jpg); +// background-size: cover; +// background-position: top right; +// border-radius: 50%; +// height:112px; +// width: 112px; +// } .cbookApointmentBtn{ // --background:transparent !important; @@ -19,6 +19,22 @@ ion-fab-button{ --background: transparent; } +.addnon{ + --background: var(--darkblue)!important; + background-size: cover; + background-position: top right; + border-radius: 50%; + height: 80px; + width: 80px; + width: 80px; + height: 80px; + right: 8%; + position: fixed; + color: white; + bottom: 20%; + border-radius: 50%; + z-index: 999; +} .fab-p{ // position: absolute; @@ -51,7 +67,7 @@ button-inner{ } .iconFab{ - margin-top: -37px; + margin-top: -37px; width: 100px; height: 60px; } diff --git a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.ts b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.ts index c61f785e..cd6b4502 100644 --- a/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.ts +++ b/Mohem/src/app/hmg-common/ui/fab-button/fab-button.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; import { TranslatorService } from '../../services/translator/translator.service'; @Component({ @@ -7,13 +7,14 @@ import { TranslatorService } from '../../services/translator/translator.service' styleUrls: ['./fab-button.component.scss'], }) export class FabButtonComponent implements OnInit { - + @Input() type:string; @Output() trigger = new EventEmitter(); public direction: any; constructor( ) { } ngOnInit() { + console.log("type" + this.type); this.direction = TranslatorService.getCurrentDirection(); } diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index ab687c35..362f46a6 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -28,8 +28,8 @@

Monthly Attendance

View your Monthly Time Sheet - - View Detail + + View Detail Vacation Rule *
diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index c29c014b..b013bc8f 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -596,6 +596,7 @@ export class HomePage implements OnInit { this.common.openEditProfile(); } + } diff --git a/Mohem/src/app/vacation-rule/home/home.component.html b/Mohem/src/app/vacation-rule/home/home.component.html index 0106c44a..4d59d520 100644 --- a/Mohem/src/app/vacation-rule/home/home.component.html +++ b/Mohem/src/app/vacation-rule/home/home.component.html @@ -1,6 +1,6 @@ - - + + @@ -10,13 +10,13 @@ - + -
- + + + + + + + + {{notBadge}} + +

{{item.RULE_STATUS}}


+

{{item.RULE_NAME}} | {{item.ITEM_TYPE_DISPLAY_NAME}}


+

{{item.BEGIN_DATE | dateString }} - {{item.END_DATE | dateString}}


+

Created on:


+ +
+ + + + +
+ + + + + + + + + + + + + + + +
+ +
- - -
+
+ + +
+ + \ No newline at end of file diff --git a/Mohem/src/app/vacation-rule/home/home.component.scss b/Mohem/src/app/vacation-rule/home/home.component.scss index af66a677..e777adaa 100644 --- a/Mohem/src/app/vacation-rule/home/home.component.scss +++ b/Mohem/src/app/vacation-rule/home/home.component.scss @@ -69,3 +69,64 @@ ion-card-header { margin: 0px 5px !important; } } + +//////////new design//////////////////////// +.itemVR +{ + background: #f0efef !important; + --background: #f0efef !important; + border: #dbdbdb 1px solid; + border-radius: 10px; + margin-bottom: 7px; +} +.listVR{ + background: transparent !important; + +} + +.red-status{ + color: var(--light) !important; + font-weight:bold; + background: var( --red); + border-radius: 9px; + text-align: center; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 15px 0px 15px; +} + +.green-status{ + color: var(--light) !important; + font-weight:bold; + background: var( --custgreen); + border-radius: 9px; + text-align: center; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 15px 0px 15px; +} + +.textBold{ + color: black; + font-weight: bold; + font-size: 17px; + +} +.label{ + margin-top: -19px; + border-bottom: #eaeaea solid; + padding-bottom: 8px; + color: black !important; +} +.createdOn{ + margin: -12px 0px -14px 0px; +} +.optionBtn{ +background: transparent !important; +} diff --git a/Mohem/src/app/vacation-rule/home/home.component.ts b/Mohem/src/app/vacation-rule/home/home.component.ts index 7ba084bc..fb95a2a3 100644 --- a/Mohem/src/app/vacation-rule/home/home.component.ts +++ b/Mohem/src/app/vacation-rule/home/home.component.ts @@ -25,7 +25,7 @@ export class HomeComponent implements OnInit { isUpdate: boolean = false; IsReachEnd: boolean = false; RespondAttributeList: any; - + add:any='add'; button: ButtonInput; // dateTime: DateTimeInput; // date: DateInput; @@ -37,7 +37,7 @@ export class HomeComponent implements OnInit { constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) { this.P_PAGE_NUM = 1; - this.P_PAGE_LIMIT = 1; + this.P_PAGE_LIMIT = 50; //this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y'); // this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y'); @@ -141,7 +141,9 @@ export class HomeComponent implements OnInit { this.isUpdate = true; this.cs.sharedService.setSharedData(this.isUpdate, 'isUpdate'); - this.router.navigate(['/vacation-rule/create-vacation-rule']); + // this.router.navigate(['/vacation-rule/create-vacation-rule']); + this.cs.navigateForward('/vacation-rule/vacation-type'); + } diff --git a/Mohem/src/app/vacation-rule/notification-type/notification-type.component.html b/Mohem/src/app/vacation-rule/notification-type/notification-type.component.html index 3db310f4..794c5bcb 100644 --- a/Mohem/src/app/vacation-rule/notification-type/notification-type.component.html +++ b/Mohem/src/app/vacation-rule/notification-type/notification-type.component.html @@ -10,25 +10,19 @@ -
    +
  • {{'vacation-rule, itemType' | translate}}
  • - -
  • {{'vacation-rule, notification-type' | translate}}
  • -
    -
  • {{'vacation-rule, create-vacation-rule' | translate}}
  • -
    -
+ -->
diff --git a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.html b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.html index b36cf41d..44770b53 100644 --- a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.html +++ b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.html @@ -1,17 +1,17 @@ - + - {{ 'vacation-rule, search-employee' | translate}} - + {{ 'vacation-rule, search-employee' | translate}} + - -
+ + {{'vacation-rule, search-by' | translate}} @@ -23,13 +23,16 @@ - - - - + + + + + + + - + + +
+
+
+ + + + +
+ + + +
+ +
+ +
+ + + {{employee.EMPLOYEE_DISPLAY_NAME}} +
{{employee.USER_NAME}}
+ {{employee.EMAIL_ADDRESS}} +
+
+
+ +
+
+ + +
-
+ + + + +
+ + {{'general, save' | translate}} + + + {{'general, cancel' | translate}} +
\ No newline at end of file diff --git a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.scss b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.scss index 0187d5a3..31ba8d46 100644 --- a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.scss +++ b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.scss @@ -2,7 +2,18 @@ ion-item { margin-top: 5%; margin-right: 7%; } - +.labelRep{ + --color: initial; + display: block; + color: var(--color); + font-family: var(--ion-font-family,inherit); + font-size: inherit; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} .footer-button { border-radius: 3px; padding: 0 1.1em; @@ -12,4 +23,145 @@ ion-item { .item-radio-checked ion-label { color: #3ac1f1 !important; } -.boldTxt{font-weight:bold;} \ No newline at end of file +.boldTxt{font-weight:bold;} +//////////////////////// +button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; +} + +.footer-button { + border-radius: 3px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; +} + +// ion-item { +// margin-top: 5%; +// margin-right: 7%; +// width: 100%; +// } +.ionItem{ + border: #e4e4e4 solid; + /* margin: 6px; */ + /* padding: 11px; */ + height: 85px; + width: 164px; + border-radius: 5px; + text-align: center; + +} + + +.profileImageDiv{ + text-align: center; + margin-bottom: -27px; + z-index: 3; + position: relative; + top: 0; + +} +.profileImage{ + width:60px !important; + // margin-left: -25px; + // margin-right: 22px; +} + +.activated{ + border: #209a83 0.02cm solid ; +} +.deactivated{ border: #e4e4e4 0.02cm solid; +} +.repContentDiv{ + text-align: center; + width: 85%; + font-size: 14px; + border: #e4e4e4 solid; + border-radius: 5px; + padding: 20px 8px 8px 8px; + margin-top: -9px; + margin-right: -35px + +} +.selIEmpDiv{ + text-align: right; + margin-bottom: -26px; + margin-right: 0px; + z-index: 3; + position: relative; + top: 0; +} + +.selIEmpImage{ + width:22px !important + +} + +.noteInput{ + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; +} +.filterInput{ + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; +} +.filterBtn{ + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; +} + + + +*{ + box-sizing: border-box; +} + +.square-container{ + // padding: 8px; + width:100%; +} +.square{ + // width:calc(100% / 2); + width:50%; + float:left; + position: relative; + // padding-bottom: calc(100% / 2); +} + +.square .content{ + width: calc(100% - 16px) !important; + height: calc(100% - 16px) !important; + margin: 8px; + padding: 16px; + // position: absolute; + color: white; + border-radius: 9px; + text-align: center; + min-height: 90px; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); +} + + + +.empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + +} +.empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; +} + + diff --git a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts index d294e22c..d136c2a1 100644 --- a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts +++ b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts @@ -28,6 +28,7 @@ export class ReplacementListComponent implements OnInit { replacmentRequest: any = ""; isAbs: boolean = false; isSave: boolean = false; + active: any; constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public modalController: ModalController) { } @@ -104,27 +105,97 @@ export class ReplacementListComponent implements OnInit { } } - doInfinite(infiniteScroll) { - - } + closePage() { this.isSave = true; let data: any = null; if (this.isSave == true) { if (this.selEmp) { - data = this.ReplacementList[this.selEmp]; + // data = this.ReplacementList[this.selEmp]; + data=this.selEmp; } else { - data = null; + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.presentAlert(msg); + return; } - if (typeof this.callback == 'function') { - this.callback(data); + // if (typeof this.callback == 'function') { + // this.callback(data); + // } + + + // this.modalController.dismiss({ + // 'dismissed': true, + // empData: data + // }); + + + this.modalController.dismiss(data); + + // }else{ + + // let msg: string = this.ts.trPK("replacementRoll", "msg"); + // this.cs.presentAlert(msg); + // return; + + + // } + } + + } + closeModal() { + this.modalController.dismiss(); + } - this.modalController.dismiss({ - 'dismissed': true, - empData: data - }); + select(selectEmp,index){ + console.log(selectEmp.EMPLOYEE_DISPLAY_NAME); + this.selEmp=selectEmp + console.log("this.selEmp" + this.selEmp); + + this.active=index; + } + + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + + + const request = new ReplacementServiceRequest(); + request.P_PAGE_NUM = this.P_PAGE_NUM; + request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + + // request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp; + + this.vacationRuleService.getReplacementList(request). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.ReplacementList)) { + this.P_PAGE_NUM++; + result.ReplacementList.forEach(vr => { + if (vr.ROW_NUM == vr.NO_OF_ROWS) { + this.IsReachEnd = true; + } + else { + this.IsReachEnd = false; + } + this.ReplacementList.push(vr); + // this.pro.GetVacationRulesList.push(vr); + }); + } else { + this.IsReachEnd = true; + } + } + //this.P_PAGE_NUM++; + if (infiniteScroll) + infiniteScroll.target.complete(); + + + // console.log(resFlag); + }, (Error) => console.log(Error), () => infiniteScroll.target.complete()); + } else { + if (infiniteScroll) + infiniteScroll.target.complete(); } } } diff --git a/Mohem/src/app/vacation-rule/vacation-rule.module.ts b/Mohem/src/app/vacation-rule/vacation-rule.module.ts index 7f2456cc..d376a3e0 100644 --- a/Mohem/src/app/vacation-rule/vacation-rule.module.ts +++ b/Mohem/src/app/vacation-rule/vacation-rule.module.ts @@ -13,6 +13,7 @@ import { CreateVacationRuleComponent } from './create-vacation-rule/create-vacat import { ReplacementListComponent } from './replacement-list/replacement-list.component'; // import { MaterialDesignFrameworkModule } from 'angular6-json-schema-form'; +import { PipesModule } from '../pipes/pipes.module'; const routes: Routes = [ { @@ -48,6 +49,8 @@ const routes: Routes = [ CommonModule, FormsModule, IonicModule, + PipesModule, + HmgCommonModule, // { // ngModule: JsonSchemaFormModule, diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html index ef4dc2d2..b526fb7f 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html @@ -1,45 +1,44 @@ - - + + {{ 'vacation-rule, vacation-type' | translate}} - + -
    +
  • {{'vacation-rule, itemType' | translate}}
  • - -
  • {{'vacation-rule, notification-type' | translate}}
  • -
    -
  • {{'vacation-rule, create-vacation-rule' | translate}}
  • -
    -
+ --> - + +
+
+
+ +
- + {{'vacation-rule, itemType' | translate}} + [(ngModel)]="index" (ionChange)="vacationRuleSel($event)" required> {{x.ITEM_TYPE_DISPLAY_NAME}} @@ -54,12 +53,148 @@

+
+
+ +
+ +
+ + + + + + {{'vacation-rule, all-label' | translate}} + + + + {{'vacation-rule, select-label' | translate}} + + + + + + + + + + {{'vacation-rule, notification' | translate}} + + + {{x.NOTIFICATION_DISPLAY_NAME}} + + + + +
+ +
+
+ +
+ + + + + +

{{'vacation-rule, itemType' | translate}}


+

{{P_ITEM_TYPE_TITLE}}

+
+ +

{{'vacation-rule, notification' | translate}}


+

{{Notification_Title}}

+
+
+
+ + + + + + + {{'vacation-rule, start-date' | translate}} + + + + {{'vacation-rule, end-date' | translate}} + + + + {{'vacation-rule, message-label' | translate}} + + + + + + + {{assignMode.RADIO_BUTTON_LABEL}} + + + + {{'vacation-rule, deliver' | translate}} + + + + + {{'vacation-rule, close' | translate}} + + + + + + {{'vacation-rule, respond' | translate}} + + + + +
+
+ + + + + + + + + + +
+
- +
- + -
+ + +
+ +
+ +
+ +
+
+ + +
\ No newline at end of file diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss index 2c5eb1e1..c42fe244 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss @@ -12,7 +12,7 @@ li { } ion-item { - width: 100%; + width: 95%; margin-left: 2%; margin-right: 5%; } @@ -30,6 +30,67 @@ p.smallTip { min-width: 200px; } +.noteInput{ + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; +} +// new css // +.divStep{ + border: solid var(--gray) 1px; + border-radius: 15px; + padding: 10px 2px 10px 2px; + background: white; + box-shadow: 0px 0px 6px 0px #d5d5d5ab; + margin-bottom: 17px; +} +.ionItemStep{ + width: 100%; + margin-left: 5%; + margin-right: 5%; + margin-top: 10px; + border-radius: 30px; + border: 1px solid #dbdbdb; +} + +.selectItem{ + border: solid 1px #dbdbdb; + border-radius: 25px; + margin: 15px; + width: 100%; +} + +.labelTitle{ + + margin-left: 15px; +} +.labelValue{ + margin-top: -27px; + font-weight: 900; + margin-left: 15px; +} + +.labelRadio{ +white-space: pre-line !important; +color: black !important; +} +.dynamicFields{ + width: 321px; + border: #dbdbdb solid 1px; + border-radius: 16px; + margin: 10px; + padding: 10px; + +} +.stepHeaderDiv{ + text-align: center; + margin: auto; + font-weight: bolder; +} +.stepHeaderLebal{ + margin:0; +} // .progcontainer { // margin: auto; // text-align: center; diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts index ac3df459..04823ce6 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.ts @@ -1,10 +1,23 @@ import { vacationTypeResponse } from './../model/vacationType.Respond'; import { notificationTypeResponse } from './../model/notification.Respond'; import { VacationTypeRequest } from './../model/VacationTypeRequest'; -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ElementRef } from '@angular/core'; import { VacationRuleServiceService } from '../service/vacation-rule-service.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { notificationTypeRequest } from '../model/notification.Request'; +import * as moment from 'moment'; +import { vacationRuleResponse } from '../model/vacationRule.Respond'; +import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; +import { ReplacementServiceRequest } from '../model/replacement-Service.request'; +import { NumberInput } from 'src/app/uI-elements/number.input'; +import { DateInput } from 'src/app/uI-elements/date.input'; +import { SelectInput } from 'src/app/uI-elements/select.input'; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { ModalController } from '@ionic/angular'; +import { ReplacementListComponent } from '../replacement-list/replacement-list.component'; +import { createVacationRequest } from '../model/createVacation.Request'; +import { WorkListReplacementRollComponent } from 'src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component'; @Component({ selector: 'app-vacation-type', @@ -12,14 +25,194 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service styleUrls: ['./vacation-type.component.scss'], }) export class VacationTypeComponent implements OnInit { - ruleTypeList: any; index: any; + vactionRuleSelected:any =-1; + notificationTypeSelected: number; + notification_list: any; //// + notificationTypeShow:boolean=false; + notificationSelected: any; + createVacationRuleShow: boolean=false; + createBtn: boolean; + Sdate: any; + isUpdate: any; + SelAction: any; + updateData: any; + notificationType: { NOTIFICATION_NAME: any; NOTIFICATION_DISPLAY_NAME: any; NOTIFICATION_SUBJECT: any; FYI_FLAG: any; }; + P_ITEM_TYPE_TITLE: any; + selEmployeeID: any; + selEmployeeName: any; + employeeSel: any; + msgVal: any; + notifTypeSel: any; + itemType: any; + Edate: string; + Notification_Title: any; + showForType_Y: boolean; + isDeliver: boolean; + REASSIGN_val: any =[]; + var_notification: any; + exampleJsonObject: {}; + RespondAttributeList: any=[]; + GetRespondAttributeValueList: any; + wFLookUpList: any; + Resp2_val: any; + dateInput: DateInput; + numberInput: NumberInput; + selectInput: any; + textInput: TextInput; + hideForwordEmployee: any; + notifTypeSelP2: string; + P_RESPOND_ATTRIBUTES_TBL: any=[]; + vacationRuleRequest: createVacationRequest; + confirmMsg: string; + + constructor(public vacationRuleService: VacationRuleServiceService, + public ts: TranslatorService, + public cs: CommonService, + public modalController: ModalController, + private elementRef: ElementRef) { - constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService) { } + + + } ngOnInit() { - this.getVacationType(); + this.isUpdate = this.cs.sharedService.getSharedData('isUpdate'); + if (this.isUpdate) { + this.initCreateVaction(); + + } + else{ + this.getVacationType(); + } + } + + initCreateVaction(){ + this.Sdate = moment().format('YYYY-MM-DDTHH:mm:ssZ'); + this.Edate=""; + + // this.isUpdate = this.cs.sharedService.getSharedData('isUpdate'); + + if (this.isUpdate) { + this.updateData = this.cs.sharedService.getSharedData(vacationRuleResponse.SHARED_DATA, false); + this.SelAction = this.updateData.ACTION; + if (this.updateData.ACTION == "RESPOND" && this.updateData.FYI_FLAG == "Y") { + this.SelAction = "Close" + } + this.notificationType = { + NOTIFICATION_NAME: this.updateData.NOTIFICATION_NAME, + NOTIFICATION_DISPLAY_NAME: this.updateData.NOTIFICATION_SUBJECT, + NOTIFICATION_SUBJECT: this.updateData.NOTIFICATION_SUBJECT, + FYI_FLAG: this.updateData.FYI_FLAG + } + /*************** */ + this.P_ITEM_TYPE_TITLE = this.updateData.ITEM_TYPE_DISPLAY_NAME; + this.selEmployeeID = this.updateData.REPLACEMENT_USER_NAME; + if (this.selEmployeeID) { + this.selEmployeeName = this.updateData.RULE_NAME; + this.employeeSel = this.updateData.RULE_NAME; + } + /************ */ + this.msgVal = this.updateData.MESSAGE; + this.notifTypeSel = this.updateData.ACTION; + this.itemType = this.updateData; + this.notificationType = this.updateData; + //this.Sdate = this.updateData.BEGIN_DATE; + //this.Edate = this.updateData.END_DATE; + let _Sdate = this.updateData.BEGIN_DATE ? this.updateData.BEGIN_DATE : ""; + let _Edate = this.updateData.END_DATE ? this.updateData.END_DATE : ""; + //let tzoffset = moment().utcOffset(); //offset in milliseconds + if (_Sdate) { + this.Sdate = moment(_Sdate).format('YYYY-MM-DDTHH:mm:ssZ'); + //this.Sdate = (new Date(myStartTime - tzoffset)).toISOString().slice(0, -1); + //this.startTime = this.Sdate; + } + if (_Edate) { + this.Edate = moment(_Edate).format('YYYY-MM-DDTHH:mm:ssZ'); + //this.Edate = (new Date(myEndTime - tzoffset)).toISOString().slice(0, -1); + // this.endTime = this.Edate; + } + + //this.schemaNotific =this.updateData.RespondAttributeList; + + //this.notifTypeSel=this.REASSIGN_val[0].RADIO_BUTTON_LABEL; + //console.log(this.notifTypeSel); + // this.getNotificationReassign(); + } else { + this.msgVal=""; + this.isUpdate = false; + this.SelAction = ""; + this.employeeSel = ""; + this.itemType = this.cs.sharedService.getSharedData(vacationTypeResponse.SHARED_DATA, false); + this.notificationType = this.cs.sharedService.getSharedData(notificationTypeResponse.SHARED_DATA, false); + } + this.Notification_Title = this.notificationType.NOTIFICATION_DISPLAY_NAME; + this.P_ITEM_TYPE_TITLE = this.itemType.ITEM_TYPE_DISPLAY_NAME; + console.log("showForType_Y"); + if (this.notificationType.FYI_FLAG == 'Y') { + this.showForType_Y = true; + } else { + this.showForType_Y = false; + } + if (this.itemType.ITEM_TYPE == "*") { + this.isDeliver = false; + } else { + this.isDeliver = true; + } + + this.getNotificationReassign(); + this.respondAttributes(); + + + } + vacationRuleSel(event){ + this.vactionRuleSelected=event.detail.value; + if(this.notificationTypeShow){ + //this.notificationTypeShow = false + this.notificationTypeShow = false + this.notifTypeSelP2 = "*"; + //this.part3show = false + } + if (this.createVacationRuleShow){ + this.createVacationRuleShow = false + this.createBtn=false; + + + + } + + + + + console.log("event: "+ event.detail.value); + } + notificationSel(event){ + + this.notificationSelected=event.detail.value; + if(this.createVacationRuleShow){ + //this.notificationTypeShow = false + this.createVacationRuleShow = false + this.createBtn=false; + //this.part3show = false + } + + + // + console.log("notificationSel event: "+ event.detail.value); + + } + + notificationTypeSel(event){ + // notifTypeSelP2 + this.notificationTypeSelected=event.detail.value; + if(this.createVacationRuleShow){ + //this.notificationTypeShow = false + this.createVacationRuleShow = false + this.createBtn=false; + //this.part3show = false + } + } getVacationType() { @@ -38,6 +231,11 @@ export class VacationTypeComponent implements OnInit { } NextPage() { + //notification_list + + if(this.vactionRuleSelected >= 0 ){ + //&& !this.notificationTypeShow && !this.notificationTypeShow){ + if(!this.notificationTypeShow){ this.cs.sharedService.setSharedData(this.ruleTypeList[this.index], vacationTypeResponse.SHARED_DATA); if (this.ruleTypeList[this.index].ITEM_TYPE == "*") { @@ -47,12 +245,657 @@ export class VacationTypeComponent implements OnInit { notificatioAtt.NOTIFICATION_NAME = "*"; notificatioAtt.NOTIFICATION_SUBJECT = ""; this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA); - this.cs.navigateForward('/vacation-rule/create-vacation-rule'); + //part 3 + this.createVacationRuleShow = true + this.createBtn=true; + // if (this.notifTypeSelP2 == "*") { + // let notificatioAtt: notificationTypeResponse = new notificationTypeResponse(); + // notificatioAtt.FYI_FLAG = ""; + // notificatioAtt.NOTIFICATION_DISPLAY_NAME = "All"; + // notificatioAtt.NOTIFICATION_NAME = "*"; + // notificatioAtt.NOTIFICATION_SUBJECT = ""; + // this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA); + // } else { + // this.cs.sharedService.setSharedData(this.notification_list[this.var_notification], notificationTypeResponse.SHARED_DATA); + // } + + this.initCreateVaction(); + + //this.cs.navigateForward('/vacation-rule/create-vacation-rule'); + + } else { + //part 2 + this.getNotificationType(); + + // this.cs.navigateForward('/vacation-rule/notification-type'); + } + + }//end part not show + else{ + // check if notifictype sele and part 3 not show + //this.notificationSelected=event.detail.value; + ///if(this.createVacationRuleShow + if((this.notificationSelected >= 0 || this.notifTypeSelP2 == '*') && !this.createVacationRuleShow){ + //call part3 + this.createVacationRuleShow = false + this.createBtn=false; + + if (this.notifTypeSelP2 == "*") { + let notificatioAtt: notificationTypeResponse = new notificationTypeResponse(); + notificatioAtt.FYI_FLAG = ""; + notificatioAtt.NOTIFICATION_DISPLAY_NAME = "All"; + notificatioAtt.NOTIFICATION_NAME = "*"; + notificatioAtt.NOTIFICATION_SUBJECT = ""; + this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA); + } else { + this.cs.sharedService.setSharedData(this.notification_list[this.var_notification], notificationTypeResponse.SHARED_DATA); + } + + this.initCreateVaction(); + } + + } + } + + + else{ + alert("please select vaction rule"); + } + + }//////////////////////////////// + + getNotificationType() { + let request: notificationTypeRequest = new notificationTypeRequest(); + request.P_ITEM_TYPE = this.ruleTypeList[this.index].ITEM_TYPE; //;this.itemTypeObj.ITEM_TYPE; + this.vacationRuleService.getNotificationType(request, () => { + this.getNotificationType(); + }, this.ts.trPK('general', 'retry')).subscribe((result) => { + console.log(result); + if (this.cs.validResponse(result)) { + console.log(result.GetItemTypeNotificationsList); + this.notification_list = result.GetItemTypeNotificationsList; + //rest radio button of notifTypeSel (All , select) + this.notificationTypeShow=true; + + } else { + this.cs.presentAlert(result.ErrorEndUserMessage); + } + }); + } + + getNotificationReassign() { + let request: LoginRequest = new LoginRequest(); + + this.vacationRuleService.notificationReassign(request, () => { + this.getNotificationReassign(); + }, this.ts.trPK('general', 'retry')).subscribe((result) => { + console.log(result); + if (this.cs.validResponse(result)) { + console.log(result.GetNotificationReassignModeList); + this.REASSIGN_val = result.GetNotificationReassignModeList;//[0].RADIO_BUTTON_ACTION; + this.notifTypeSel = this.REASSIGN_val[0].RADIO_BUTTON_ACTION; + this.reverseAction(); + this.createVacationRuleShow = true; + this.createBtn=true; + } else { + this.cs.presentAlert(result.ErrorEndUserMessage); + } + }); + } + reverseAction() { + if (this.updateData) { + switch (this.SelAction) { + case 'FORWARD': { + this.notifTypeSel = "DELEGATE"; + break; + } + case 'RESPOND': { + this.notifTypeSel = "RESPOND"; + break; + } + case 'CLOSE': { + this.notifTypeSel = "CLOSE"; + break; + } + case 'NOOP': { + this.notifTypeSel = "DELIVER"; + break; + } + case 'TRANSFER': { + this.notifTypeSel = "TRANSFER"; + break; + } + default: { + this.notifTypeSel = ""; + break; + } + } + } + } +///////////////////////////////////// +respondAttributes() { + let request: notificationTypeRequest = new notificationTypeRequest(); + request.P_NOTIFICATION_NAME = this.notificationType.NOTIFICATION_NAME; + request.P_ITEM_TYPE = this.itemType.ITEM_TYPE; + // this.vacationRuleService.respondAttributes( + // request). + // subscribe((result: Response) => { + // this.handlerespondAttributesResult(result); + // }); + this.vacationRuleService.respondAttributes(request, () => { + this.respondAttributes(); + }, this.ts.trPK('general', 'retry')).subscribe((result) => { + this.handlerespondAttributesResult(result); + }); + + +} +handlerespondAttributesResult(result) { + if (this.cs.validResponse(result)) { + this.RespondAttributeList = result.RespondAttributesList; + if (result.RespondRolesList != "" && result.RespondRolesList[0].ATTRIBUTE_NAME != null && result.RespondRolesList[0].ATTRIBUTE_NAME != undefined) { + this.Resp2_val = result.RespondRolesList[0].ATTRIBUTE_NAME; + this.hideForwordEmployee = result.RespondRolesList[0]; + } + + if (result.RespondAttributesList) { + //this.schemaNotific = JSON.parse(result.P_Schema); + ////////************************************** */ + this.createVacationDynamicFields(result.RespondAttributesList); + } + this.reverseAction(); + if (this.isUpdate) { + this.fillResposeAtrributes(result.RespondAttributesList); + } + // ATTRIBUTE_DISPLAY_NAME: "Note" + // ATTRIBUTE_FORMAT: "4000" + // ATTRIBUTE_NAME: "WF_NOTE" + // ATTRIBUTE_TYPE: "VARCHAR2" + } +} + +createVacationDynamicFields(RespondAttributesList) { + console.log("createVacationDynamicFields"); + const containerId = 'CVDynamicFields'; + for (let i = 0; i < RespondAttributesList.length; i++) { + if (RespondAttributesList[i].ATTRIBUTE_TYPE == "VARCHAR2") { + console.log("1"); + + this.textInput = new TextInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", "", ""); + } else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "LOOKUP") { + console.log("2"); + //call create WF_LOOKUP + //call there or when the got response from responsedAtt + this.selectInput = new SelectInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); + this.getWFLookUp(RespondAttributesList[i].ATTRIBUTE_FORMAT, RespondAttributesList[i].ATTRIBUTE_NAME); + + } else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "DATE") { + console.log("3"); + + this.dateInput = new DateInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); + } else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "NUMBER") { + console.log("4"); + + this.numberInput = new NumberInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", ""); + } + } +} + +fillResposeAtrributes(respList) { + let body = { + P_RULE_ID: this.updateData.RULE_ID, + GetRespondAttributeValueTBL: respList + } + this.vacationRuleService.getRespondAttributeValues( + body). + subscribe((result: Response) => { + this.handleFillResponseAttr(result); + }); +} + +handleFillResponseAttr(result) { + if (this.cs.validResponse(result)) { + if (result.GetRespondAttributeValueList && result.GetRespondAttributeValueList.length > 0) { + this.GetRespondAttributeValueList=result.GetRespondAttributeValueList; + let resp_val: any = result.GetRespondAttributeValueList[0].P_ATTRIBUTE_NAME; + let Emp_ID: any = result.GetRespondAttributeValueList[0].P_ATTRIBUTE_TEXT_VALUE; + let valueList = result.GetRespondAttributeValueList; + var obj = {}; + if (resp_val == this.Resp2_val) { + let request: ReplacementServiceRequest = new ReplacementServiceRequest(); + + request.P_SEARCH_USER_NAME = Emp_ID; + request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + request.P_SEARCH_EMAIL_ADDRESS = ""; + request.P_PAGE_NUM = 1; + request.P_PAGE_LIMIT = 1000 + + this.vacationRuleService.getReplacementList(request). + subscribe((result: Response) => { + this.handleFillRole(result); + }); + } + for (let i = 0; i < valueList.length; i++) { + obj[valueList[i].P_ATTRIBUTE_NAME] = valueList[i].P_ATTRIBUTE_TEXT_VALUE; + } + this.exampleJsonObject = obj; + //Call set value of responsed attribute + // this.createVacationDynamicFields(this.exampleJsonObject);//ashwaq + this.setRespondAttributeValue(); + // this.exampleJsonObject = new Map(valueList.map(obj => [ obj., obj.P_ATTRIBUTE_TEXT_VALUE ])); + } + } +} +handleFillRole(result) { + if (this.cs.validResponse(result)) { + this.selEmployeeName = result.ReplacementList[0].EMPLOYEE_DISPLAY_NAME; + this.selEmployeeID = result.ReplacementList[0].USER_NAME; + } +} +setRespondAttributeValue(){ + + for (let i = 0; i < this.RespondAttributeList.length; i++) { + if(this.RespondAttributeList[i].ATTRIBUTE_NAME == this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NAME){ + if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "VARCHAR2") { + console.log("1"); + let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLInputElement; + x.value=this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NUMBER_VALUE; + } else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "LOOKUP") { + console.log("2"); + //call create WF_LOOKUPP_ATTRIBUTE_NAME + //call there or when the got response from responsedAtt + + let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLSelectElement; + if(this.wFLookUpList){ + let index= this.wFLookUpList.findIndex(x => x.LOOKUP_CODE == this.GetRespondAttributeValueList[i].P_ATTRIBUTE_TEXT_VALUE); + console.log("Hel: "+ index); + x.options[index+1].selected=true; + + } + + } else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "DATE") { + console.log("3"); + + } else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "NUMBER") { + console.log("4"); + let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLInputElement; + x.value=this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NUMBER_VALUE; + + } + }//end if + } + +} + +getWFLookUp(resAttrFormat: any, ATTRIBUTE_NAME) { + + const request = { + P_LOOKUP_TYPE: resAttrFormat, + } + + this.vacationRuleService.getLookup(request, () => { }, this.ts.trPK('general', 'retry')).subscribe( + (result: any) => { + if (this.cs.validResponse(result)) { + // console.log("Lookup result "+ result); + + this.wFLookUpList=result.WFLookUpList + this.fillDropdownList(result.WFLookUpList, ATTRIBUTE_NAME); + } else { + this.cs.presentAlert(result.ErrorEndUserMessage); + } + }); + +} + +fillDropdownList(optionList: any = [],attributeID) { + let elemID: any = attributeID; + let eitObj: any; + + if (optionList.length > 0) { + + let select = document.getElementById(elemID) as HTMLSelectElement; + document.getElementById(elemID).innerHTML = ""; + + + var firstoption = document.createElement("option"); + firstoption.text = this.ts.trPK("general", "choose"); + firstoption.value = ""; + select.add(firstoption); + for (let i = 0; i < optionList.length; i++) { + + var option = document.createElement("option"); + option.text = optionList[i].LOOKUP_MEANING; + option.value = optionList[i].LOOKUP_CODE; + select.add(option); + + } + + select.disabled = false; + } + +} + +async SearchReplacment() { + const modal = await this.modalController.create({ + component: ReplacementListComponent + }); + modal.cssClass = 'replaceRoll-modal'; + + + modal.onDidDismiss() + .then((data) => { + const user = data.data; + console.log(data) + console.log(user); + if (data) { + this.selEmployeeName = user.EMPLOYEE_DISPLAY_NAME; + this.selEmployeeID = user.USER_NAME; + this.employeeSel = this.selEmployeeName + "," + this.selEmployeeID + } + + + + + + }); + + return await modal.present(); +} + +clearEmployee() { + this.selEmployeeName = ""; + this.selEmployeeID = ""; +} + +///////////////////////////////////////////// + +ApplyFunc() { + (this.elementRef.nativeElement.querySelectorAll('ion-item') as HTMLElement[]).forEach((x) => { + if (x.classList.contains('requiredItem')) { + x.classList.add('ng-touched'); + x.classList.remove('ng-untouched'); + } + }); + let msg: string = ""; + if (this.notifTypeSel == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillAction'); + this.cs.presentAlert(msg); + } else if (this.msgVal == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillMsg'); + this.cs.presentAlert(msg); + } else if (this.Sdate == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillSDate'); + this.cs.presentAlert(msg); + } + // else if (this.selEmployeeID == undefined) { + // msg = this.ts.trPK('vacation-rule', 'fillReplacement'); + // this.cs.presentAlert(msg); + // } + else { + // var responseAttrDic = this.exampleJsonObject;//haroon + var responseAttrDic =this.RespondAttributeList; // Ashwaq + this.P_RESPOND_ATTRIBUTES_TBL = []; + for (let key in responseAttrDic) { + let obj: any = {}; + obj.ATTRIBUTE_NAME =responseAttrDic[key].ATTRIBUTE_NAME;//ashwaq to get ATTRIBUTE_NAME + + if (typeof responseAttrDic[key] === "number") { + obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(responseAttrDic[key].ATTRIBUTE_NAME) as HTMLInputElement).value; + + } + + else { + obj.ATTRIBUTE_TEXT_VALUE =(document.getElementById(responseAttrDic[key].ATTRIBUTE_NAME) as HTMLInputElement).value; + + } + this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + } + + + + let repUserName = this.selEmployeeID; + if(repUserName == null || repUserName ==""){ + + } + if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { + let obj: any = {}; + repUserName = ""; + obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; + obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; + this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + } + let pAction = ""; + pAction = this.getActionValue(); + let jsonSDate = ""; + let jsonEDate = ""; + if (this.Sdate) { + let startDate = moment(this.Sdate).format('YYYY-MM-DDTHH:mm:ssZ'); + jsonSDate = this.cs.convertISODateToJsonDate(startDate); + } else { + jsonSDate = null; + } + if (this.Edate) { + + let endDate = moment(this.Edate).format('YYYY-MM-DDTHH:mm:ssZ'); + jsonEDate = this.cs.convertISODateToJsonDate(endDate); } else { - this.cs.navigateForward('/vacation-rule/notification-type'); + jsonEDate = null; } + let request: createVacationRequest = new createVacationRequest(); + request.P_BEGIN_DATE = jsonSDate; + request.P_END_DATE = jsonEDate; + request.P_MESSAGE = this.msgVal; + request.P_REPLACEMENT_USER_NAME = repUserName; + request.P_ITEM_TYPE = this.itemType.ITEM_TYPE; + request.P_NOTIFICATION_NAME = this.notificationType.NOTIFICATION_NAME; + request.P_ACTION = pAction; + request.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; + this.vacationRuleRequest = request; + + + + + + this.vacationRuleService.createVacationRule(request, () => { + }, this.ts.trPK('general', 'retry')).subscribe((result) => { + if (this.cs.validResponse(result)) { + console.log(result); + this.handlecreateVacationResult(result); + } else { + this.cs.presentAlert(result.ErrorEndUserMessage); + } + }); } +} +handlecreateVacationResult(result) { + if (this.cs.validResponse(result)) { + this.cs.JustAlertDialog(this.ts.trPK('general', 'ok'), this.ts.trPK('vacation-rule', 'rule-success')) + this.goToStart(); + + } +} + +goToStart() { + + this.cs.navigateRoot('/home') +} + +updateVacationRule() { + (this.elementRef.nativeElement.querySelectorAll('ion-item') as HTMLElement[]).forEach((x) => { + if (x.classList.contains('requiredItem')) { + x.classList.add('ng-touched'); + x.classList.remove('ng-untouched'); + } + }); + let msg: string = ""; + if (this.notifTypeSel == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillAction'); + } else if (this.msgVal == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillMsg'); + } else if (this.Sdate == undefined) { + msg = this.ts.trPK('vacation-rule', 'fillSDate'); + } else { + var responseAttrDic = this.exampleJsonObject; + this.P_RESPOND_ATTRIBUTES_TBL = []; + for (let key in responseAttrDic) { + let obj: any = {}; + obj.ATTRIBUTE_NAME = key; + if (typeof responseAttrDic[key] === "number") { + obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key]; + } + + else { + obj.ATTRIBUTE_TEXT_VALUE = responseAttrDic[key]; + } + this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + } + let repUserName = this.selEmployeeID; + if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { + let obj: any = {}; + repUserName = ""; + obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; + obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; + this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + } + let pAction = ""; + pAction = this.getActionValue(); + let jsonSDate = ""; + let jsonEDate = ""; + + if (this.Sdate) { + + let startDate = moment(this.Sdate).format('YYYY-MM-DDTHH:mm:ssZ'); + + jsonSDate = this.cs.convertISODateToJsonDate(startDate); + } else { + jsonSDate = null; + } + + if (this.Edate) { + + let endDate = moment(this.Edate).format('YYYY-MM-DDTHH:mm:ssZ'); + jsonEDate = this.cs.convertISODateToJsonDate(endDate); + } else { + jsonEDate = null; + } + let body: any = { + P_RULE_ID: this.updateData.RULE_ID, + P_BEGIN_DATE: jsonSDate, + P_END_DATE: jsonEDate, + P_MESSAGE: this.msgVal, + P_REPLACEMENT_USER_NAME: repUserName, + P_ACTION: pAction, + RespondAttributeList: this.P_RESPOND_ATTRIBUTES_TBL + } + this.vacationRuleService.updateVacationRule( + body). + subscribe((result: Response) => { + this.handleupdateVacationResult(result); + }); + } } + +handleupdateVacationResult(result) { + if (this.cs.validResponse(result)) { + this.cs.JustAlertDialog(this.ts.trPK('general', 'ok'), this.ts.trPK('vacation-rule', 'rule-update-success')) + this.goToStart(); + } +} + + +getActionValue(): string { + let pAction = ""; + //this.pAction = this.notifTypeSel; + //console.log(this.pAction); + if (this.notifTypeSel) { + switch (this.notifTypeSel) { + case 'DELEGATE': { + pAction = "FORWARD"; + break; + } + case 'RESPOND': { + pAction = "RESPOND"; + break; + } + case 'CLOSE': { + pAction = "RESPOND"; + break; + } + case 'DELIVER': { + pAction = "NOOP"; + break; + } + case 'TRANSFER': { + pAction = "TRANSFER"; + break; + } + default: { + pAction = ""; + break; + } + } + return pAction; + } +} + +async openReplacementRoll() { + + const modal = await this.modalController.create({ + component: ReplacementListComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss().then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + this.selEmployeeName = data.data.EMPLOYEE_DISPLAY_NAME; + this.selEmployeeID = data.data.USER_NAME; + this.employeeSel = this.selEmployeeName + "," + this.selEmployeeID + } + }); + + return await modal.present(); + + + + +} + +////// +openConfirmAlertDialogAction(flag){ + if(flag==true){ + + this.confirmMsg = this.ts.trPK('vacation-rule', 'confirm-msg-success') + + } + else{ + this.confirmMsg= this.ts.trPK('vacation-rule', 'update-msg-success') + + } +this.cs.confirmAlertDialogAction( + () => { + if(flag==true){ + this.ApplyFunc(); + } + else{ + this.updateVacationRule(); + } + }, this.ts.trPK('general', 'ok'), + () => { }, this.ts.trPK('general', 'cancel'), + this.ts.trPK('vacation-rule', 'confirmation'), + this.confirmMsg + ) +} + + +////// +} \ No newline at end of file diff --git a/Mohem/src/assets/imgs/delete-circle.png b/Mohem/src/assets/imgs/delete-circle.png new file mode 100644 index 0000000000000000000000000000000000000000..3c478232df20c5148f7cac545731c1e2363c30c7 GIT binary patch literal 983 zcmV;|11S87P)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91E1&}a z1ONa40RR91D*ylh08JES!TEI>i~7Yb$~nII=~&E z65N503Zf1oDu}4SqJoGD;2Wb8wh~!7onkZZjc>KLGrN-R*~#6TG<-yEVGd2Vvh=8l zT3B`b&bk`u@s3GP;wFPXT zJRYEhtK%z^SMnQDQw`i2i1J)Swo%S$^HdJdKEdm z6%37Acze5V!jo-Y+__D%qOFd@GZ-?u69=cDvy^g7q?N}MECrfr zGc4SZXoks=Yc-pDV?ztqX}80Tk?Wd#Io#9N#cr6qaP8QO9XMz_+PQEPs*iz3SU#1= zk5}_Q9Hnyy4z(Ul3^Iz(dK4tu7>AQuM|@^>vKPWo<3l2Ht*P&|B^MQ33WsoP;IQYZ zS&AJ({ZJjDK#3GM#KVC@&a;<-0Eo7bvn`eF5Y*m z{&jI(yvAbQuHiD`QH|u6rZWlGJ_a67*ZFEqg~gyh20v2W&^xHtKYaD!NO<;^B0m*Y zT!>5I5bDl79Kw;%p4O$%H&q?P1%ZBUm%t$!8#MTZ8m&uEAu5B=5~$(X;|`k_R>$7d zpg|sLwZh*788mm|$iL)4C zLTwn-E%DI6E!2@P@U@_ap|_}q!_$HT>GJ7#^S=$}0XDMkUmpKR^ppVK4|! zvm(~@s<5~E{|X(UUfHKERkK#G?N*i^Igx={Efn;} z{tkK=g(bs=28O_P)G#05OZZ8$h7~Mf1OFQsCeiS#;}6iK(!1n=#!3JH002ovPDHLk FV1laktSPx#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91BA^2R z1ONa40RR91A^-pY03ou2ZU6uSM@d9MR9FeUSV2z{Q4pT@wm_-|Dqct|q{fqQphir* zi6#n(F}4Xe1A-UCizV?a#b3Zl@I=8FJ&;hZUet@>KmvF*CRH%ei?$}3v~hQwdF^Yq z?QVA~UEXDP=grLby_tEh^D3Z)5nG*(n6m4#5F#M}Vt^t70^-UA!Y&BRBR~!jvxZfC zmz&At{kkWA-sAN1`|*&83#6Iw)~?aW{x!tn*V|8aYorbzO^Nia-ivh_upmH8JJ|Xb zAz-Ft!s54?m7JTAE0O+Za|vm|Duq7cX55k-A#X}d9!##hb+VIA!hyBf2NGekZ6p|k z7G$7!!@iv`je6n0`do^Naj9P3u5a=^-jlpoC~R(T*?rceMx}!zaRkE@c*UNkDiJQs zE-7}}nvP}*qM9jMcwQH9wMIInNFNyqCP+1-Fe_wLL@MXRPO}9BHCHt83`a#p#4xRN zP(WUO>6}s5IY=QOW*7eNyCyMIiNx#u4{-4Nhc9=`K>|XLFKtq~d+w@Z z$m>aLeAP`i^$gZj}Sd^3I=+t~zk|szupWmeLA6R8LMS0C5bkKlex6L`SLu&ZeZ0Nl$E2x_ z;=o5d8sVQ!H3OdfJhdz&xBS%Hz6u!2)xE}6+t)N?+Ep{)3F_`s455hdy@Lv7Env(B z_l()lp_MF5Q~eeiv;z}hp^RAusGh9M%o1WcFx)!FrhtTw22WLq@W=k-a+dC{^ZXv< zU<`W)&sYuj8oqDvy@Q(B@gT@Bi7!*jsy(#(SIx6spx?`P9L&)1>$^?Rw$4v1a60NE zp>=CgqlNtBG!;#Vw_`W45BB9og7I7Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91Dxd=Z z1ONa40RR91DgXcg0Qb^|F#rGp>`6pHR9Fekm*H`nKoCabO#Yh^=s!P{2p4prEzwk-|aJpO_*AmCJ?u5Pj|YOu zg!t65M+1}0p4()&gxG8v7I%#%ufV4>KDUBdJ?vGdR zcjt@ynsTwf;g!rkVpm&($DzTeyoN{UwvrR(3)uDG`_68a zT2E`Dmp&_k0>-E$$=5`DcX9~Qgll2{SJ>#sD%#sVyOp{zwdcwe3l|0>6ikG%j?Tmn z5%%+bKV=MSVO;imLqp+N-_fy32NL(~zqgkR)Z5seVzlMtpN-S6KVHJp_6^1FX-$&z zSam!ZioXmcZ0+aF3rIm@6$DiT-qH=UP(cSlIl&#Iu!IsOsUdsvp-CN%OV(TCN8dqq zT&8;UR4t{0K@mBSuw;W#7@we>bISqQ!+gcUT(|R_aKu=X{Cu8Cj z-^Pm.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction { @@ -992,3 +993,15 @@ border:0px justify-content: center !important; } +.replaceRoll-modal { + + padding: 30% 1% !important; + --height: 15cm !important; + --width: 100% !important; + --border-radius: 0.4cm; + +} +.header-toolbar-new { + --background: #22c6b3; + background: #22c6b3; +} \ No newline at end of file diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index ff4399e6..7a8ec184 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -1,5 +1,7 @@ .colorBG{ - --background: #f0efef; + --background: #f0efef !important; + background: #f0efef !important; + } .footerSearchBtn{ padding: 0px !important; From 527ee02627c91f2d1005c587b5efa436c963ac21 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Wed, 26 Feb 2020 13:30:02 +0300 Subject: [PATCH 2/9] add get login last info --- Mohem/src/app/app.component.ts | 8 +- .../change-password.component.html | 2 +- .../check-user/check-user.component.ts | 1 + .../confirm-login.component.html | 7 +- .../confirm-login/confirm-login.component.ts | 21 ++- .../forgot/forgot.component.html | 2 +- .../authentication/login/login.component.html | 12 +- .../authentication/login/login.component.ts | 77 ++++++++-- .../app/authentication/models/LoginModel.ts | 3 + .../sms-page/sms-page.page.html | 2 +- .../authentication/sms-page/sms-page.page.ts | 14 +- .../authentication/authentication.service.ts | 7 +- .../models/check-user-auth.response.ts | 4 +- .../models/get-login-info.request.ts | 2 + .../models/get-login-info.response.ts | 3 +- .../authentication/models/member.list.ts | 2 + .../hmg-common/services/push/push.service.ts | 23 ++- .../ui/welcome-login/welcome.component.html | 35 +++-- .../ui/welcome-login/welcome.component.ts | 52 ++++++- Mohem/src/app/home/home.page.html | 2 +- .../apply-action-modal.component.html | 36 +++-- .../apply-action-modal.component.scss | 15 +- .../apply-action-modal.component.ts | 135 ++++++++++++++---- .../more-action-modal.component.scss | 19 ++- .../work-list-replacement-roll.component.html | 27 ++-- .../work-list-replacement-roll.component.scss | 1 + .../work-list-replacement-roll.component.ts | 28 ---- .../work-list-rfc.component.html | 18 +-- .../worklist-main-mr.component.html | 15 +- .../worklist-main-mr.component.scss | 1 + .../worklist-main-mr.component.ts | 19 +-- .../worklist-main-po.component.html | 16 +-- .../worklist-main-po.component.ts | 2 +- .../worklist-main-pr.component.html | 14 +- .../worklist-main-pr.component.ts | 2 +- .../worklist-main.component.html | 11 +- .../worklist-main.component.scss | 10 +- .../worklist-main/worklist-main.component.ts | 54 ++++++- Mohem/src/assets/localization/i18n.json | 9 +- Mohem/src/theme/styles.scss | 72 ++++------ Mohem/src/theme/worklist.scss | 26 +++- 41 files changed, 567 insertions(+), 242 deletions(-) diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 28f84927..7378cfea 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -29,6 +29,10 @@ export class AppComponent implements OnInit, AfterViewInit { companyDesc: string = "Powered By Cloud Solutions"; public direction = "ltr"; User_Job_name: string; + requestGetLoginInfo: { + DeviceType: string; DeviceToken: string; //this.deviceToken + }; + user: boolean; constructor( public ts: TranslatorService, private cs: CommonService, @@ -71,6 +75,7 @@ export class AppComponent implements OnInit, AfterViewInit { } private startReceivingPushService() { + console.log("platform.ready") this.pushService.startReceiving(); } subscribeEvents() { @@ -159,6 +164,7 @@ export class AppComponent implements OnInit, AfterViewInit { closeMenu(){ this.menu.toggle(); } - + + } diff --git a/Mohem/src/app/authentication/change-password/change-password.component.html b/Mohem/src/app/authentication/change-password/change-password.component.html index ef0cdcd7..29eb0d85 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -1,5 +1,5 @@ - + diff --git a/Mohem/src/app/authentication/check-user/check-user.component.ts b/Mohem/src/app/authentication/check-user/check-user.component.ts index f0bd66a9..5e9f5dab 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.ts +++ b/Mohem/src/app/authentication/check-user/check-user.component.ts @@ -78,6 +78,7 @@ export class CheckUserComponent implements OnInit { console.log(result); this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.P_USER_NAME = this.P_USER_NAME; + // this.loginData.EMPLOYEE_NAME=result.MemberLoginList[0].EMPLOYEE_NAME; this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(true,Password.IS_FORGET_PSW); this.cs.stopLoading(); diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html index ba09e11a..931f7349 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html @@ -1,5 +1,5 @@ - + @@ -28,7 +28,10 @@ -

{{empname}}

+

{{ts.trPK('login','verify-login-with')}}

- +
@@ -19,7 +19,7 @@
- + @@ -30,12 +30,12 @@ - +

{{ts.trPK('login','login')}}

-
+
- diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index 4a8ce8aa..a71d4621 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -89,7 +89,7 @@ export class WorklistMainPRComponent implements OnInit { closeMsg: string; truncating: boolean; orgNote: any; - lines_note_limit: any = 15; + lines_note_limit: any = 24; selectedIndex: any; showLessBtn: boolean; showMoreBtn: boolean; diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index c120b383..0d87349f 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -1,5 +1,5 @@ - + {{ts.trPK('worklistMain','title')}} @@ -75,8 +75,13 @@
-
+ + + +
@@ -377,7 +382,7 @@
- diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss index a152e092..813ab8cb 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -92,12 +92,12 @@ .rowBorder{ - border-bottom: solid 0.03cm var(--grayBG); + border-bottom: solid 0.02cm var(--grayBG); } .colBorder{ - border-right: solid 0.03cm var(--grayBG); + border-right: solid 0.02cm var(--grayBG); } @@ -183,7 +183,7 @@ // border: var(--cusgray) 1px solid !important; --background: transparent; margin-left: -15px; - margin-right: 7px; + margin-right: 6px; } .status{ text-align: center; @@ -231,7 +231,7 @@ color: white; .subOrdinateDiv{ z-index: 4; - margin-left: -44px; + margin-left: -32px; position: absolute; top: -2px; } @@ -244,7 +244,7 @@ color: white; } .subOrdinateRow{ - margin-left: 40px; + margin-left: 55px; } .label{ diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index ff2de615..938e09aa 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -78,7 +78,7 @@ export class WorklistMainComponent implements OnInit { P_PAGE_LIMIT: number = 100; notificationCount: any; activeSegment: any = "info"; - lines_note_limit: any = 15; + lines_note_limit: any = 24; attachmentRes: any; private WorkListActionHistoryObj: WorkListActionHistoryRequest; IsReachEnd: boolean = false; @@ -401,6 +401,7 @@ export class WorklistMainComponent implements OnInit { obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; this.P_RESPOND_ATTRIBUTES_TBL.push(obj); } + if ( ButtonAction == "APPROVED" || ButtonAction == "REJECTED" || @@ -410,7 +411,7 @@ export class WorklistMainComponent implements OnInit { this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_COMMENTS = ""; - this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; + // this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.common.sharedService.setSharedData( this.getPassNotificationDetails, @@ -420,6 +421,7 @@ export class WorklistMainComponent implements OnInit { ButtonAction, WorklistMainComponent.PASS_ACTION_MODE ); + this.common.sharedService.setSharedData( this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainComponent.PASS_RES_ATTR @@ -450,11 +452,14 @@ export class WorklistMainComponent implements OnInit { this.ts.trPK('vacation-rule', 'confirmation'), this.confirmMsg) - // this.openApplyModal(this.WorkListActionObj); + // this.openApplyModal(this.WorkListActionObj); } + + + if (ButtonAction == "RFC") { // alert("Return For Correction"); this.WorkListActionObj.P_ACTION_MODE = ButtonAction; @@ -614,6 +619,10 @@ export class WorklistMainComponent implements OnInit { } this.notificationDynamicFields(result.NotificationGetRespondAttributesList); this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; + this.common.sharedService.setSharedData( + this.notificationDynamicAttributeArr, + "notificationDynamicAttributeArr" + ); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); } // valid it } // End handleWorkListButtonsResult @@ -701,6 +710,7 @@ export class WorklistMainComponent implements OnInit { } handleWorkListActionHistoryResult(result) { + console.log( "1"+ this.IsReachEnd); if (this.common.validResponse(result)) { if (this.common.hasData(result.GetActionHistoryList)) { this.actionHistoryRes = result.GetActionHistoryList; @@ -711,8 +721,12 @@ export class WorklistMainComponent implements OnInit { let lastitem = result.GetActionHistoryList[lastItemIndex]; if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { this.IsReachEnd = true; + console.log( "2"+ this.IsReachEnd); + } else { this.IsReachEnd = false; + console.log( "3"+ this.IsReachEnd); + } } this.turnCateFun(this.actionHistoryRes); @@ -944,6 +958,40 @@ export class WorklistMainComponent implements OnInit { + loadMoreActionHistory() { + console.log("doInfinite action history MR"); + + if (!this.IsReachEnd) { + 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; + } else { + this.IsReachEnd = false; + } + this.actionHistoryRes.push(element); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + // infiniteScroll.target.complete(); + }); + } else { + //if (infiniteScroll) + //infiniteScroll.target.complete(); + } + }//end infiniteScroll } diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index e77f027b..9ffa093b 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1782,19 +1782,20 @@ "ar":"العناصر المطلوبة" }, "approveMsg":{ - "en": "Are you sure to approve this request ?", + + "en": "

Are you sure to Approve this request ?

", "ar":"العناصر المطلوبة" }, "rejectMsg":{ - "en": "Are you sure to reject this request?", + "en": "

Are you sure to Reject this request ?

", "ar":"العناصر المطلوبة" }, "delMsg":{ - "en": "Are you sure to delete this request?", + "en": "

Are you sure to Delete this request ?

", "ar":"العناصر المطلوبة" }, "closeMsg":{ - "en": "Are you sure to close this request?", + "en": "

Are you sure to Close this request ?

", "ar":"العناصر المطلوبة" }, "Supplier":{ diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 809593a0..cc1f0c05 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -862,13 +862,13 @@ color: var(--dark); } .checkOutOkBtn{ - margin-left: 55px !important; - margin-right: 55px !important; + /* margin-left: 50px !important; */ + /* margin-right: 55px !important; */ margin-top: 10px !important; - margin-bottom: 10px !important; + /* margin-bottom: 10px !important; */ border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; + height: 40px !important; + min-height: 40px !important; background: var(--lightblue) !important; -webkit-box-flex: 1; flex: 1 1 auto; @@ -876,17 +876,19 @@ color: var(--dark); border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); color: white !important; border: none !important; + width: 80%; + --background: var(--lightblue) !important; } .checkOutCancelBtn{ - margin-left: 55px !important; - margin-right: 55px !important; - margin-top: 10px !important; - margin-bottom: 10px !important; + /* margin-left: 55px !important; */ + /* margin-right: 55px !important; */ + /* margin-top: 10px !important; */ + /* margin-bottom: 10px !important; */ border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; + height: 40px !important; + min-height: 40px !important; background: var(--darkblue) !important; -webkit-box-flex: 1; flex: 1 1 auto; @@ -894,6 +896,8 @@ color: var(--dark); border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); color: white !important; border: none !important; + width: 80%; + --background: var(--darkblue) !important; } .buttonClassWhite { @@ -1002,40 +1006,9 @@ border:0px margin-top: 10px; } -.checkOutOkBtn{ - margin-left: 55px !important; - margin-right: 55px !important; - margin-top: 10px !important; - margin-bottom: 10px !important; - border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; - background: var(--lightblue) !important; - -webkit-box-flex: 1; - flex: 1 1 auto; - border-top: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); - border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); - color: white !important; - border: none !important; -} -.checkOutCancelBtn{ - margin-left: 55px !important; - margin-right: 55px !important; - margin-top: 10px !important; - margin-bottom: 10px !important; - border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; - background: var(--darkblue) !important; - -webkit-box-flex: 1; - flex: 1 1 auto; - border-top: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); - border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); - color: white !important; - border: none !important; -} + .more-modal { background: rgba(0, 0, 0, 0.5) !important; @@ -1093,6 +1066,17 @@ border:0px height: 0px !important; display: none !important; } -.header-toolbar-new{ +.header-toolbar-new { --background: #22c6b3; + background: #22c6b3; } + +.boldText{ + color: var(--dark) !important; + font-weight: bold; + font-size: 20px; +} +.boldP{ + + font-size: 20px; +} \ No newline at end of file diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index fc5b409a..fcc772cf 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -206,7 +206,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated } .timeline .timeline-thumb.timeline-icon { - height: 70px; + height: 67px; // text-align: center; // color: white; // border: 5px solid #CBD0D3; @@ -442,11 +442,11 @@ left: 66px; .rowBorder{ - border-bottom: solid 0.03cm var(--grayBG); + border-bottom: solid 0.02cm var(--grayBG); } .colBorder{ - border-right: solid 0.03cm var(--grayBG); + border-right: solid 0.02cm var(--grayBG); } @@ -543,6 +543,13 @@ left: 66px; height: 80px; border: #dedede solid 1px; } + .empImgeSub{ + border-radius: 50%; + width: 85px; + height: 85px; + border: #dedede solid 1px; + + } ion-card{ color:black !important; @@ -550,4 +557,17 @@ left: 66px; .line{ padding-bottom:87px; + } + + ion-segment-button ion-label { + max-width: 100px; + overflow: hidden; + padding: 10px; + font-size: 14px; + color: black !important; + } + + .colItems ion-label { + color: black !important; + } \ No newline at end of file From a4ad4e9d49d65c77f37f4943ee9d8b9617c43fa5 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Wed, 26 Feb 2020 13:37:28 +0300 Subject: [PATCH 3/9] fix static value --- Mohem/src/app/authentication/login/login.component.ts | 2 +- Mohem/src/app/authentication/sms-page/sms-page.page.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 4df10859..8dacee1a 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -332,7 +332,7 @@ export class LoginComponent implements OnInit, OnDestroy { this.deviceToken this.requestGetLoginInfo= { DeviceType:this.cs.getDeviceType(), - DeviceToken:"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken + DeviceToken:this.deviceToken;//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken } this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => { if (this.cs.validResponse(res)) { diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 2a03e624..eb7895b3 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -396,7 +396,7 @@ export class SmsPageComponent implements OnInit { request.DeviceType= this.common.getDeviceType(); - request.DeviceToken="5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken; + request.DeviceToken=this.deviceToken;//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken; request.LoginType=this.loginTypeData.loginType; From fee59fb259fc1f6e372519eb783c427560294206 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Wed, 26 Feb 2020 13:38:54 +0300 Subject: [PATCH 4/9] fix --- Mohem/src/app/authentication/login/login.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 8dacee1a..48ce155c 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -332,7 +332,7 @@ export class LoginComponent implements OnInit, OnDestroy { this.deviceToken this.requestGetLoginInfo= { DeviceType:this.cs.getDeviceType(), - DeviceToken:this.deviceToken;//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken + DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken } this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => { if (this.cs.validResponse(res)) { From 5d41967ed7bad801e4985cc8647aed5dc343674c Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 26 Feb 2020 14:41:16 +0300 Subject: [PATCH 5/9] edit login token --- .../authentication/login/login.component.ts | 46 ++++++++++++++----- .../hmg-common/services/push/push.service.ts | 4 ++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 48ce155c..244012bc 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -45,7 +45,7 @@ export class LoginComponent implements OnInit, OnDestroy { public loginDiv:boolean =true; public welcomeBack:boolean =false; public logo = "assets/icon/login/password.png"; - deviceToken: any; + deviceToken: any=""; user: boolean =false; DeviceType: string; requestGetLoginInfo:any; @@ -67,10 +67,35 @@ export class LoginComponent implements OnInit, OnDestroy { ) { } ngOnInit() { - this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); - console.log("get deviceToken login"+ this.deviceToken) + // this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + // console.log("get deviceToken login"+ this.deviceToken) + + + this.deviceToken= localStorage.getItem('devicyeToken'); + console.log("let deviceToken" + this.deviceToken); + + if (this.deviceToken) { + console.log('login enabled first time: ' + this.deviceToken); + } else { + console.log("no deviceToken" ); + + this.pushService.startReceiving(); + setTimeout(() => { + this.deviceToken= localStorage.getItem('deviceToken'); + console.log('login enabled second time: ' + this.deviceToken); + + }, 1000); + } + + + setTimeout(() => { + + this.getLastLoginInfo(); + },5000); + + - this.getLastLoginInfo(); + //here will delete below part and depdding on user (response from getMobileInfo) this.username = localStorage.getItem("user"); this.password = localStorage.getItem("password"); //****// @@ -143,20 +168,20 @@ export class LoginComponent implements OnInit, OnDestroy { // this.checkAppUpdated(); // this.checkUserAuthentication(); - let deviceToken = localStorage.getItem('deviceToken'); - console.log("let deviceToken" + deviceToken); + this.deviceToken = localStorage.getItem('deviceToken'); + console.log("let deviceToken" + this.deviceToken); - if (deviceToken) { - console.log('login enabled first time: ' + deviceToken); + if (this.deviceToken) { + console.log('login enabled first time: ' + this.deviceToken); this.checkAppUpdated(); } else { console.log("no deviceToken" ); this.pushService.startReceiving(); setTimeout(() => { - deviceToken = localStorage.getItem('deviceToken'); + this.deviceToken = localStorage.getItem('deviceToken'); this.checkAppUpdated(); - console.log('login enabled second time: ' + deviceToken); + console.log('login enabled second time: ' + this.deviceToken); }, 1000); } } @@ -329,7 +354,6 @@ export class LoginComponent implements OnInit, OnDestroy { /// getLastLoginInfo(){ - this.deviceToken this.requestGetLoginInfo= { DeviceType:this.cs.getDeviceType(), DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken diff --git a/Mohem/src/app/hmg-common/services/push/push.service.ts b/Mohem/src/app/hmg-common/services/push/push.service.ts index 0cb42314..9b9dcc79 100644 --- a/Mohem/src/app/hmg-common/services/push/push.service.ts +++ b/Mohem/src/app/hmg-common/services/push/push.service.ts @@ -166,6 +166,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); @@ -249,4 +250,7 @@ export class PushService { + + + } From c3339148edab923f08bd9cae1b999fa812e7a63a Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 26 Feb 2020 16:07:04 +0300 Subject: [PATCH 6/9] fix my team request for employee list --- Mohem/src/app/eit/home/home.component.html | 44 ++++++++++++++++++- Mohem/src/app/eit/home/home.component.ts | 2 + Mohem/src/app/home/home.page.ts | 1 + .../app/my-team/details/details.component.ts | 1 + 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Mohem/src/app/eit/home/home.component.html b/Mohem/src/app/eit/home/home.component.html index 761904cc..28c4956e 100644 --- a/Mohem/src/app/eit/home/home.component.html +++ b/Mohem/src/app/eit/home/home.component.html @@ -12,7 +12,9 @@ - + + + @@ -46,4 +48,44 @@ *ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"> --> + + + + + + + + + + +
+ + {{menuItem.PROMPT}} + + + + + +
+ + + + +  {{subPage.PROMPT}} + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts index 82ac3374..2f250a21 100644 --- a/Mohem/src/app/eit/home/home.component.ts +++ b/Mohem/src/app/eit/home/home.component.ts @@ -16,9 +16,11 @@ export class HomeComponent implements OnInit { selMenu: MenuResponse = new MenuResponse(); // Selected Side Menu selectedMenu: any; + pageType :string; constructor(private cs: CommonService, private ts: TranslatorService) { this.menu = this.cs.sharedService.getSharedData('menuEntries', false); + this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); const title: string = this.ts.trPK('eit', 'my-requests'); this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title; diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 9c086dd5..b81dc705 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -431,6 +431,7 @@ export class HomePage implements OnInit { this.menuEntries = tree; console.log(this.menuEntries); this.common.sharedService.setSharedData(tree, "menuEntries"); + this.common.sharedService.setSharedData("home", "homemenuentries"); // this.common.navigateForward("/eit/homepage"); // this.common.openEITPage(); } diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index 3a98c7c1..8f430397 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -520,6 +520,7 @@ doInfinite(infiniteScroll) { sortMenuEntires(list) { const tree = this.common.list_to_tree(list); this.common.sharedService.setSharedData(tree, 'menuEntries'); + this.common.sharedService.setSharedData("myteam", "homemenuentries"); this.common.openEITPage(); } From 8c55d3995abdd0912c7f64a862f357b4f98816f1 Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 26 Feb 2020 16:14:21 +0300 Subject: [PATCH 7/9] edit time input --- Mohem/package.json | 2 +- Mohem/src/app/uI-elements/time.input.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mohem/package.json b/Mohem/package.json index 80fa73f1..e4223885 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -201,4 +201,4 @@ "android" ] } -} +} \ No newline at end of file diff --git a/Mohem/src/app/uI-elements/time.input.ts b/Mohem/src/app/uI-elements/time.input.ts index 001589f0..ace25328 100644 --- a/Mohem/src/app/uI-elements/time.input.ts +++ b/Mohem/src/app/uI-elements/time.input.ts @@ -31,7 +31,7 @@ export class TimeInput extends UiElement { this.formatDate(); } const template = - "
" + + "
" + " " + // " "+ "
"+this.value+"
"+ From 5557f7d3bac598a04d67491d1337baf87b935692 Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 26 Feb 2020 16:35:47 +0300 Subject: [PATCH 8/9] add vacation rule to service list --- Mohem/package-lock.json | 13 ++++++++++--- Mohem/package.json | 4 ++-- Mohem/src/app/home/home.page.html | 13 +++++++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Mohem/package-lock.json b/Mohem/package-lock.json index 2a5976ca..7eadf53b 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -1217,11 +1217,18 @@ } }, "@ionic-native/vibration": { - "version": "5.19.1", - "resolved": "https://registry.npmjs.org/@ionic-native/vibration/-/vibration-5.19.1.tgz", - "integrity": "sha512-f9fMtBRJmVLklRrnqcSqKktw6skdp+dDQpbBOq1m5VSQF7b6EKkCIUTN69EjeSn2z3AD0kSYn1hCGTp2q+cJIw==", + "version": "5.21.6", + "resolved": "https://registry.npmjs.org/@ionic-native/vibration/-/vibration-5.21.6.tgz", + "integrity": "sha512-sVmB4sHJ0MG+3IwmSvaHUATEM9D8ZFKko/1orHALTwGN57o0Ncf/n37PKWdPp8BANmYhTAoj6iOBd+YNonhf3w==", "requires": { "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } } }, "@ionic-native/zbar": { diff --git a/Mohem/package.json b/Mohem/package.json index 43dc7e46..c515f9b0 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -52,7 +52,7 @@ "@ionic-native/sqlite": "^5.18.0", "@ionic-native/status-bar": "^5.0.0", "@ionic-native/themeable-browser": "^5.18.0", - "@ionic-native/vibration": "^5.19.1", + "@ionic-native/vibration": "^5.21.6", "@ionic-native/zbar": "^5.10.0", "@ionic/angular": "^4.1.0", "@ng-bootstrap/ng-bootstrap": "^4.2.2", @@ -204,4 +204,4 @@ "android" ] } -} \ No newline at end of file +} diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 362f46a6..4e43c464 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -28,8 +28,8 @@

Monthly Attendance

View your Monthly Time Sheet - - View Detail Vacation Rule * + + View Detail
@@ -48,6 +48,15 @@ icon="assets/icon/new-design/leave_balance.png"> + + + + + + From b0b76cd5e0e8e26ad7da8a9a81b26cb9c9c81e25 Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 26 Feb 2020 17:26:35 +0300 Subject: [PATCH 9/9] add vacation rule icon --- Mohem/src/app/home/home.page.html | 2 +- .../icon/new-design/vacation_rules_icon.png | Bin 0 -> 984 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Mohem/src/assets/icon/new-design/vacation_rules_icon.png diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 5bf51a83..f8150eef 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -66,7 +66,7 @@ + icon="assets/icon/new-design/vacation_rules_icon.png"> diff --git a/Mohem/src/assets/icon/new-design/vacation_rules_icon.png b/Mohem/src/assets/icon/new-design/vacation_rules_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ab4d5676705a2fd1eb691eb236a7155df414f2da GIT binary patch literal 984 zcmV;}11J26P)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91C7=TU z1ONa40RR91B>(^b0J8uiH2?quPDw;TR9FekmCb7tK^VqoYYwFdi3k->u85)sHHsi9 zqKgMFg6Y|d<3CV)@+PhqJ(`1Fq_oqUx3>NRUBNFr)D#aYB8`fqf?$FbdeDr|lgWZUBH^LHv;Be)W~0 zrg-3!Y6%IM&ZEtg7{7R4>;ZA~{?7fMo1dGdII&SNR#T&U$3^kv(Wn}|xx(1kuihX- zXImch%%-#!^BwK*!<(BjnWCYmm8ujwe&hS5v;5*}c%$B*cLGzojlb7h;c|qACSER- zM>@{35Kh_yu2AzDm=(tqR@mZB+(~aCH@;sCNhNt zswSKSM{z5MSDqP4fnkO`%(ZOQ+n;70iZ|D9uWvTLB7U&iE3d`M<*D_JcOQy~Xbq0) z-c`6p8VYkYI(|6lYh8>LV2s{<_H^^q!UK&h>~iqNlrHQl{xI_mv=R)H!UXHEr6k~( z+gbwuD9ThA$Rrp%jV6ax4Rwv+^s zh8UE@6yuXfAvm!iJ|K-L4|y(#lEP#vLoAxclr86;sT=SCkOa)(mh%WiD$RF_1wVpw z5tTR09AoBy1pF|1pamjj`%Vo@R+#Vr-@YH*5}UjjNwl#IF(>Ux`N-u~l))g?%*|1> zhk*o>fKuJ7<-#}hEirja2Pi_U;`X(HYmLkva2zEXamvtC0IFcvR$wZ#Br23ZJx(PD zL9PkrHU_4TCO3JgL>`+KO+2{>TLcZz|7*%R=IZz$w*CNX_$6K)Hw-@j0000