From b9f691e76fb38ffc0f12e8fe279fc5bdf38831a2 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Thu, 9 Sep 2021 14:44:58 +0300 Subject: [PATCH] fixing delegate itg --- .../work-list-main-itg.component.ts | 15 +- .../work-list-replacement-itg.component.html | 271 +++++++++++------- .../work-list-replacement-itg.component.scss | 215 +++++++++++++- .../work-list-replacement-itg.component.ts | 67 ++++- 4 files changed, 459 insertions(+), 109 deletions(-) diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 06342907..4db168ab 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -106,6 +106,7 @@ export class WorkListMainItgComponent implements OnInit { this.segmentsArray = [this.segmentsArray[1], this.segmentsArray[2], this.segmentsArray[0]]; this.segmentData = [this.segmentData[1], this.segmentData[0]]; this.workList = this.request_details.WFHistory.reverse(); + this.common.sharedService.setSharedData(this.workList, 'workflow-user'); // this.workList = this.request_details.WFHistory; this.options = this.request_details.AllowedActions; this.activeSegment = this.segmentsArray[0].name; @@ -506,12 +507,14 @@ export class WorkListMainItgComponent implements OnInit { modal.cssClass = 'replaceRoll-modal'; modal.onDidDismiss() .then((data) => { - this.replcamentID = data.data.empData.USER_NAME; - this.commentText = data.data.comments; - if (actionNumber === 3) { - this.actionService(3, this.commentText); - } else if (actionNumber === 4) { - this.actionService(4); + if(data.data.empData){ + this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID; + this.commentText = data.data.comments ? data.data.comments: null; + if (actionNumber === 3) { + this.actionService(3, this.commentText); + } else if (actionNumber === 4) { + this.actionService(4); + } } }); diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html index bb4aa1b2..aec4a7d0 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html @@ -1,19 +1,19 @@ - - - {{ 'vacation-rule, search-employee' | translate}} - - - - - - - - - -
- - + {{ 'worklistMain, delegate' | translate}} + + + + + + + + + + + + - - - + + + + + {{'replacementRoll, searchBy' | translate}} + + + + + + +

{{'replacementRoll, workflow' | translate}}

+
+
+ + + +

{{'replacementRoll, favorite' | translate}}

+
+
+ + + +

{{'replacementRoll, employee-id' | translate}}

+
+
+ + + +

{{'replacementRoll, employee-email' | translate}}

+
+
+ + + +

{{'replacementRoll, employee-name' | translate}}

+
+
+
+
+ + + + + - - - - - - +
+ + +
+
- - -
-
+
{{'replacementRoll, search-result' | translate}}
-
- +
+ - - -
-
-
- - - - - - - {{employee.EMPLOYEE_DISPLAY_NAME}} - + + + + + + {{employee.EMPLOYEE_DISPLAY_NAME}} + - -
- -
-
+ +
+ +
+
- -
-
- -
-
+
+ + +
- {{'replacementRoll, favorite' | translate}} + {{'replacementRoll, related' | translate}}
+ +
+
+
+ + + + + + {{employee.Name}} + + +
+ +
+
+
+
+
+ -
-
-
- - - - - - {{employee.EMPLOYEE_DISPLAY_NAME}} - - -
- -
-
+
+
+ {{'replacementRoll, favorite' | translate}} +
+ +
+
+
+ + + + + + {{employee.EMPLOYEE_DISPLAY_NAME}} + + +
+ +
+
+
+
+ +
+ + + + +
Transaction Successful
+
-
- -
- - - -
Transaction Successful
-
- + + +
-
- - - - - -
-
+ + + +
+
- - - -
- {{'general, save' | translate}} - -
-
\ No newline at end of file + + + +
+ {{'general, save' | translate}} + +
+
+ {{'general, close' | translate}} + +
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss index 58101d5d..5f0ca300 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss @@ -64,4 +64,217 @@ } .top-radio-row{ font-size: 12px; - } \ No newline at end of file + } + + button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; + } + + .footer-button { + background: #dbdbdb; + border-radius: 10px; + color: black; + --background: transparent; + font-weight: bold; + width: 75%; + } + + // 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{ + + z-index: 3; + position: relative; + top: 0; + + } + .profileImage{ + width:60px !important; + + } + + .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; + } + + .filterInput-ar{ + // border: solid var(--gray) 1px; + // border-radius: 21px; + // padding-left: 10px !important; + border: solid var(--gray) 1px; + border-radius: 21px; + // width:250px + // padding-left: 145px !important; + //margin-left: 123px; + // padding-right: 129px; + //margin-right: -136px; + + } + .filterBtn{ + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; + } + .filterBtn-ar{ + // background: var(--newgreen); + // --background: var (--newgreen); + // border-radius: 50%; + // height: 60px; + // width: 60px; + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; + margin-left: -183px; + margin-right: 260px; + } + + + + *{ + box-sizing: border-box; + } + + .square-container{ + // padding: 8px; + width:100%; + } + .square{ + // width:calc(100% / 2); + width:100%; + 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: 92px; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); + } + + .disabledButton{ + opacity:.5; + + } + + .radio-label{ + font-size: 9px; + margin: 4px; + position: relative; + bottom: 4px; + } + ion-radio{ + --color-checked: #269db8; + } + .center{text-align: center;padding: 5px;} + .boldTxtNav{ + font-weight: bold; + padding: 5px; + } + .employee-details{ + display:inline-block; + margin: 10px; + text-overflow: ellipsis; + white-space: nowrap; + width: 70%; + } + .empImgeRep{ + display: inline-block; + height: 40px; + width: 40px; + } + .star-fav{ + float: right; + margin: 15px 0px 0px 0px; + } + .uk-margin{margin: 15px 15px 0px 15px; + font-weight: bold; + clear: both; + position: relative; + top: 10px;} + .uk-padding{ padding: 20px;} + .uk-padding .employee-details{ + bottom: 10px; + position: relative;} + + .star-fav-left{ + float: left; + margin: 10px 5px; + } + .top-radio-row{ + font-size: 12px; + display: block; + padding-bottom: 25px; + padding-top: 15px; + } + .textSearchType{ + padding-top: 8px; + font-size: 12px; + } + + \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts index 1f2fcd78..a1c5c5c1 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts @@ -33,9 +33,12 @@ export class WorkListReplacementItgComponent implements OnInit { userSelected: any; active: any; isAnswer: boolean = false; - favoriteUserList: [] = []; + favoriteUserList = []; userNote: any; + isFilter = true; + relatedList = []; public direction = ''; + arr = []; constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, @@ -46,6 +49,18 @@ export class WorkListReplacementItgComponent implements OnInit { ngOnInit() { this.getFavruite(); + if(!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined){ + this.arr = this.cs.sharedService.getSharedData('workflow-user', false); + var lookupObject = {}; + + for(var i in this.arr) { + lookupObject[this.arr[i]['Name']] = this.arr[i]; + } + console.log(lookupObject); + for(i in lookupObject) { + this.relatedList.push(lookupObject[i]); + } + } } SearchReplacementList() { @@ -145,12 +160,27 @@ export class WorkListReplacementItgComponent implements OnInit { } } + closeFunction(){ + this.modalController.dismiss({ + 'dismissed': true, + // comments: this.userNote + }); + } + onChangeSelect(select) { console.log(select.detail.value); let selectValue = select.detail.value; - if (selectValue == "1" || selectValue == "2" || selectValue == "3") { + if (selectValue == "1") { + this.listOfRealted = this.relatedList; this.isSelect = true; + this.isFilter = true; + } else if(selectValue == "4" ){ + this.listOfFav = this.favoriteUserList; + this.isFilter = true; + } else if(selectValue === '2' || selectValue === '3' || selectValue === '5'){ + this.isSelect = true; + this.isFilter = false; } else { this.isSelect = false; @@ -170,11 +200,12 @@ export class WorkListReplacementItgComponent implements OnInit { }, 3000); } select(selectEmp, index) { - console.log(selectEmp.EMPLOYEE_DISPLAY_NAME); + console.log(selectEmp); this.selEmp = selectEmp this.userSelected = true; this.active = index; - this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.NAME; + this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.Name; + console.log(this.searchKey) //this.closePage(); } @@ -244,4 +275,32 @@ export class WorkListReplacementItgComponent implements OnInit { } }) } + + listOfRealted = []; + listOfFav = [] + + filterList(event){ + console.log(this.relatedList); + console.log(this.favoriteUserList); + const val = event.target.value; + if(this.searchKeySelect === '1'){ + if(val === '') { + this.relatedList = this.listOfRealted; + } else { + this.relatedList = this.listOfRealted.filter((item) => { + return (item.Name.toLowerCase().indexOf(val.toLowerCase()) > -1); + }); + } + } else if(this.searchKeySelect ==='4') { + if(val === '') { + this.favoriteUserList = this.listOfFav; + } else { + this.favoriteUserList = this.listOfFav.filter((item) => { + return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1); + }); + } + }else{ + return; + } + } }