From 50505d3f07e241c4918bcf7478d4a1513edd4d05 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Wed, 1 Dec 2021 12:00:22 +0300 Subject: [PATCH] fixed notify in worklist --- .../service/work-list.main.service.ts | 16 ++++++++++++++ .../worklist-main.component.html | 3 +++ .../worklist-main/worklist-main.component.ts | 22 +++++++++---------- Mohem/src/assets/localization/i18n.json | 4 ++++ 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index a68047d4..9e18ac7f 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -24,6 +24,7 @@ import { itgRequest } from '../models/itgFormDetailsRequest'; @Injectable() export class WorklistMainService { public static getEITNotificationBody = "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; + public static getSITNotificationBody = "Services/ERP.svc/REST/GET_SIT_NOTIFICATION_BODY"; public static getAbsenceNotificationBody = "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; public static getPoNotificationBody = "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY"; public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY"; @@ -64,6 +65,21 @@ export class WorklistMainService { ); } + public getSITNotificationBody( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getSITNotificationBody, + request, + onError, + errorLabel + ); + } + public getAbsencesNotificationBody( WorkListBodyRequest: any, onError?: any, 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 4af4d073..c474a59a 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -49,6 +49,9 @@ +
+

{{'worklist, loading'| translate}}

+
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 8212c4fe..3e91d787 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -264,8 +264,8 @@ export class WorklistMainComponent implements OnInit { this.getAttachmentNotification(this.WorkListAttachObj); this.getActionHistory(this.WorkListActionHistoryObj); - if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { - this.getEITNotificationDetails(this.WorkListBodyObj); + if (this.getPassNotificationDetails.REQUEST_TYPE == "SIT") { + this.getSITNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.getAbsenceNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { @@ -318,12 +318,12 @@ export class WorklistMainComponent implements OnInit { }); } - getEITNotificationDetails(notificationBodyObj) { + getSITNotificationDetails(notificationBodyObj) { this.notificationBodyRes = [] this.worklistMainService - .getEITNotificationBody(notificationBodyObj) + .getSITNotificationBody(notificationBodyObj) .subscribe((result: EITNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "EIT"); + this.handleWorkListBodyResult(result, "SIT"); }); } @@ -341,10 +341,10 @@ export class WorklistMainComponent implements OnInit { if (this.common.validResponse(result)) { this.pInformation = result.P_INFORMATION; this.pQuestion = result.P_QUESTION; - if (Type == "EIT") { - if (result.GetEITCollectionNotificationBodyList) { + if (Type == "SIT") { + if (result.GetSITCollectionNotificationBodyList) { this.notificationBodyRes = - result.GetEITCollectionNotificationBodyList; + result.GetSITCollectionNotificationBodyList; if (this.notificationBodyRes[0].Collection_Notification) { console.log(this.notificationBodyRes[0].Collection_Notification); } @@ -692,7 +692,7 @@ export class WorklistMainComponent implements OnInit { ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" ) { - if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { + if (this.getPassNotificationDetails.REQUEST_TYPE == "SIT") { this.common.sharedService.setSharedData( this.notificationBodyRes, EITNotificatonBodyResponse.SHARED_DATA @@ -804,7 +804,7 @@ export class WorklistMainComponent implements OnInit { } openNotificationBody() { - if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { + if (this.getPassNotificationDetails.REQUEST_TYPE == "SIT") { this.common.sharedService.setSharedData( this.notificationBodyRes, EITNotificatonBodyResponse.SHARED_DATA @@ -814,7 +814,7 @@ export class WorklistMainComponent implements OnInit { EITNotificatonBodyResponse.NOT_WORKLIST ); // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" }); - this.common.sharedService.setSharedData("EIT", "NotBodyType"); + this.common.sharedService.setSharedData("SIT", "NotBodyType"); this.common.openNotificationDetailsPage(); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.common.sharedService.setSharedData( diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 1817c6ea..89afc9fc 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2284,6 +2284,10 @@ }, "worklist": { + "loading":{ + "en":"Loading", + "ar":"يتم التحميل" + }, "view": { "en": "View", "ar": "عرض"