From f1e2251a7a43c5e9151bf925180112a82f11efc6 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Thu, 16 Dec 2021 14:15:48 +0300 Subject: [PATCH] add Stamp and remove the replacment loading. --- .../app/notification/home/home.component.ts | 54 ++--- .../work-list-main-itg.component.html | 9 +- .../work-list-main-itg.component.ts | 50 +++-- .../work-list-replacement-itg.component.ts | 6 +- .../work-list-replacement-roll.component.ts | 21 +- .../worklist-main-ic.component.ts | 14 +- .../worklist-main-mr.component.ts | 14 +- .../worklist-main-po.component.ts | 13 +- .../worklist-main-pr.component.ts | 18 +- .../worklist-main.component.html | 186 ++++++++++++++++-- .../worklist-main/worklist-main.component.ts | 25 ++- Mohem/src/assets/localization/i18n.json | 8 + 12 files changed, 324 insertions(+), 94 deletions(-) diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 13add5f0..c26fd2c5 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -638,33 +638,35 @@ export class HomeComponent implements OnInit { this.ITGItem = []; this.workListService.getITGCount('', '', this.isPostNoLoad) .subscribe((result: any) => { - if (result.RequestType.length > 0) { - this.ITGSegment[0] = { - name: 'All', - code: 'All', - data: null, - style: false - }; - this.ITGSegment[0].data = datas; - this.ITGSegment[0].names = names; - this.setActive(this.ITGSegment[0].code); - } - console.log(result.RequestType); - let count = 1; - for (let i = 0; i < result.RequestType.length; i++) { - console.log() - this.ITGSegment[count] = { - name: result.RequestType[i].RequestTypeName, - code: result.RequestType[i].RequestTypeCode, - data: result.RequestType[i].RequestDetails, - style: false - }; - datas[i] = result.RequestType[i].RequestDetails; - names[i] = result.RequestType[i].RequestTypeCode; - count++; + if (result.RequestType) { + if (result.RequestType.length > 0) { + this.ITGSegment[0] = { + name: 'All', + code: 'All', + data: null, + style: false + }; + this.ITGSegment[0].data = datas; + this.ITGSegment[0].names = names; + this.setActive(this.ITGSegment[0].code); + } + console.log(result.RequestType); + let count = 1; + for (let i = 0; i < result.RequestType.length; i++) { + console.log() + this.ITGSegment[count] = { + name: result.RequestType[i].RequestTypeName, + code: result.RequestType[i].RequestTypeCode, + data: result.RequestType[i].RequestDetails, + style: false + }; + datas[i] = result.RequestType[i].RequestDetails; + names[i] = result.RequestType[i].RequestTypeCode; + count++; + } + //this.sortArrayOfAll(this.ITGSegment[0].data) + console.log(this.ITGSegment); } - //this.sortArrayOfAll(this.ITGSegment[0].data) - console.log(this.ITGSegment); }); } diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index d6286590..e7dec45b 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -112,10 +112,15 @@
- -
+
Note: {{approvalInfo.Notes}}
+
+ Note: {{approvalInfo.Notes}} +
+
+ {{'general, show-more' | translate}} +
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 6ebede5e..681ea344 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 @@ -62,6 +62,7 @@ export class WorkListMainItgComponent implements OnInit { defaultSegment = ''; public slideIndex = 0; public messageSuccess = false; + public actionHistory = false; constructor( public common: CommonService, public ts: TranslatorService, @@ -271,13 +272,16 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(1); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else if (action === 2) {// reject @@ -291,13 +295,16 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = true; + // this.messageSuccess = true; this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(2); this.skip(); - this.messageSuccess = false; + // this.messageSuccess = false; }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -315,15 +322,18 @@ export class WorkListMainItgComponent implements OnInit { } if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(3); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -336,15 +346,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(4); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else if (action === 5) { // answer @@ -358,15 +371,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(5); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } @@ -383,15 +399,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(6); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else { @@ -409,15 +428,18 @@ export class WorkListMainItgComponent implements OnInit { this.common.presentAlert(this.ts.trPK('general', 'error-itg')); } else if (result.MessageStatus === 1) { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.common.sharedService.setSharedData(true, 'loadWorkList'); // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ')); this.common.sharedService.setSharedData(true, 'loadWorkList'); this.confirmMsg(6); this.skip(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); } else { 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 bd1ab765..42910539 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 @@ -68,7 +68,7 @@ export class WorkListReplacementItgComponent implements OnInit { this.relatedList.push(lookupObject[i]); } } - this.getFavruite(); + // this.getFavruite(); } else { this.select(this.delegtedEmp, 1); } @@ -164,9 +164,11 @@ export class WorkListReplacementItgComponent implements OnInit { if (this.isSave == true) { if (this.selEmp) { data = this.selEmp; - this.messageSuccess = true; + // this.messageSuccess = true; + this.cs.greenToastPK('worklist', 'save-successfully'); } else { data = null; + this.cs.redToastPK('worklist', 'save-error'); } if (typeof this.callback == 'function') { this.callback(data); diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index f39e81c2..d2ddf81b 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -53,7 +53,7 @@ export class WorkListReplacementRollComponent implements OnInit { this.P_PAGE_NUM = 1; this.P_PAGE_LIMIT = 50; this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false); - this.getFavruite(); + // this.getFavruite(); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false); this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false); @@ -489,8 +489,13 @@ export class WorkListReplacementRollComponent implements OnInit { // } } getPlaceHolder() { - return this.searchBy == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchBy == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail'); + return this.searchBy === '1' ? + this.ts.trPK('replacementRoll', 'searchbyname') : + this.searchBy === '2' ? + this.ts.trPK('replacementRoll', 'searchbyusername') : + this.ts.trPK('replacementRoll', 'searchbyemail'); } + getFavruite() { this.cs.startLoading(); this.worklistService.getFavorite({}, () => { @@ -503,20 +508,10 @@ export class WorkListReplacementRollComponent implements OnInit { this.favoriteUserList.forEach((obj) => { obj.IsFavorite = true; }); - /**** THIS CODE TO CHECK STAR OF EMPLOYEE IF IT IS IN FAVORITE LIST AND SHOW IN WORKFLOW LIST****/ - // this.actionHistory.forEach((obj, i) => { - // if(this.favoriteUserList.some(x => x['USER_NAME'] === obj.USER_NAME)) { - // this.actionHistory[i].isInFavorite = true; - // } else { - // this.actionHistory[i].isInFavorite = false; - // } - // }); - // console.log(this.actionHistory); - /**** END ****/ - } }); } + saveUserFavruiteList(request, isFav: boolean) { this.worklistService.saveFavoriteList(request, () => { }).subscribe((result) => { diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts index f5c2abec..09a818f3 100644 --- a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts @@ -427,12 +427,15 @@ export class WorklistMainIcComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; // this.openNotificationsDashboard(); this.nextNotfification(); }, 5000); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -1210,13 +1213,16 @@ export class WorklistMainIcComponent implements OnInit { return; } else if (data.data.data == "Success") { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.nextNotfification(); }, 2000); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index c64765f5..b481ea5f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -368,12 +368,15 @@ export class WorklistMainMRComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; // this.openNotificationsDashboard(); this.nextNotfification(); }, 5000); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -1111,13 +1114,16 @@ export class WorklistMainMRComponent implements OnInit { return; } else if (data.data.data == 'Success') { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.nextNotfification(); }, 2000); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index 844f3af6..f0dcf22c 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -404,12 +404,15 @@ export class WorklistMainPoComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; // this.openNotificationsDashboard(); this.nextNotfification(); }, 5000); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -1187,9 +1190,11 @@ export class WorklistMainPoComponent implements OnInit { return; } else if (data.data.data == "Success") { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; + this.common.redToastPK('worklist', 'save-error'); this.nextNotfification(); }, 2000); // this.nextNotfification(); 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 83f68c84..71b038cc 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 @@ -394,13 +394,16 @@ export class WorklistMainPRComponent implements OnInit { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 1) { this.common.sharedService.setSharedData(true, 'loadWorkList'); + this.common.greenToastPK('worklist', 'save-successfully'); // show succsfull popup - this.messageSuccess = true; - setTimeout(() => { - this.messageSuccess = false; - }, 5000); + // this.messageSuccess = true; + // setTimeout(() => { + // this.messageSuccess = false; + // }, 5000); // this.openNotificationsDashboard(); this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -1111,13 +1114,16 @@ export class WorklistMainPRComponent implements OnInit { return; } else if (data.data.data == 'Success') { // this.openNotificationsDashboard(); - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.nextNotfification(); }, 2000); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); 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 dfffa55c..e633778a 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -40,7 +40,8 @@ -
{{pInformation}}
+
{{pInformation}} +
@@ -50,13 +51,16 @@ *ngIf="getPassNotificationDetails?.REQUEST_TYPE != 'ADDRESS' && getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' ">
-

{{'worklist, loading'| translate}}

+

{{'worklist, loading'| translate}}

-
+

{{ 'general, empty' | translate}}

- +
@@ -76,6 +80,165 @@
+ +
+ + +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+
+
+
+ +
+ + +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+
+
+
+
+
{{ts.trPK('worklistMain','employee-on-leave')}} @@ -131,13 +294,14 @@ -
-

{{'worklist, loading'| translate}}

-
+
+

{{'worklist, loading'| translate}}

+
-
-

{{ 'general, empty' | translate}}

-
+
+

{{ 'general, empty' | translate}}

+
@@ -154,7 +318,7 @@ - + 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 e502ea5f..841d91d0 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -53,6 +53,8 @@ export class WorklistMainComponent implements OnInit { public static PASS_RES_ATTR = "passResAttr"; TransactionID: number = -999; notificationBodyRes: any = []; + stampNsNotificationBodyRes: any =[]; + stampMsNotificationBodyRes: any =[]; actionHistoryRes: any = []; notificationButtonRes: any; actionMode: any; @@ -110,6 +112,7 @@ export class WorklistMainComponent implements OnInit { public arr_hr_req_only = []; public showInformation = true; + constructor( public worklistService: WorklistService, public common: CommonService, @@ -405,15 +408,15 @@ export class WorklistMainComponent implements OnInit { } } else if (Type === "STAMP_MS"){ - if (result.GetBasicDetNtfBodyList) { - this.notificationBodyRes = + if (result.GetStampMsNotificationBodyList) { + this.stampMsNotificationBodyRes = result.GetStampMsNotificationBodyList; console.log(result); } } else if (Type === "STAMP_NS"){ - if (result.GetBasicDetNtfBodyList) { - this.notificationBodyRes = + if (result.GetStampNsNotificationBodyList) { + this.stampNsNotificationBodyRes = result.GetStampNsNotificationBodyList; console.log(result); } @@ -486,12 +489,15 @@ export class WorklistMainComponent implements OnInit { // this.notificationArray.splice(i, 1); // } // } - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; // this.openNotificationsDashboard(); this.nextNotfification(); }, 2000); + } else { + this.common.redToastPK('worklist', 'save-error'); } } // valid it } @@ -1066,12 +1072,15 @@ export class WorklistMainComponent implements OnInit { if (data.data.data == "cancel" || data.data.data == undefined) { return; } else if (data.data.data == "Success") { - this.messageSuccess = true; + // this.messageSuccess = true; + this.common.greenToastPK('worklist', 'save-successfully'); setTimeout(() => { - this.messageSuccess = false; + // this.messageSuccess = false; this.nextNotfification(); }, 2000); // this.nextNotfification(); + } else { + this.common.redToastPK('worklist', 'save-error'); } }); return await modal.present(); diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index c188decf..638ec185 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2559,6 +2559,14 @@ "save-error":{ "ar":"هناك شئ خاطئ، يرجى المحاولة فى وقت لاحق", "en":"Something went wrong please try again later" + }, + "assignment-number":{ + "ar":"رقم التخصيص ", + "en":"Assignment Number" + }, + "schedule-date":{ + "ar":"تاريخ الجدول", + "en":"Schedule Date" } }, "worklistMain": {