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 81a2ea80..705bd712 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 @@ -275,7 +275,7 @@ export class WorkListReplacementRollComponent implements OnInit { }); }, 5000); - + this.cs.openNotificationPage(); } } // not valid it diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts index 50b4a5ee..bf04ab9d 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts @@ -141,6 +141,7 @@ export class WorkListRfcComponent implements OnInit { }); }, 5000); + this.cs.openNotificationPage(); } } // valid it 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 1674519f..c418e5f3 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 @@ -321,26 +321,58 @@ export class WorklistMainMRComponent implements OnInit { } // valid it } + // public nextNotfification() { + // //let itemExist = false; + // let itemNo = this.getPassNotificationDetails.ROW_NUM; + // itemNo += 1; + // if (itemNo > this.notificationArray.length) { + // this.common.openNotificationPage(); + // } else { + // for (let i = 0; i < this.notificationArray.length; i++) { + // if (this.notificationArray[i].ROW_NUM == itemNo) { + // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // // itemExist = true; + // this.intializeNotificationDetail(); + // // this.common.openNotificationPage(); + + // break; + // } + // } + // // if(itemExist==false){ + // // this.nextNotfification(); + // // } + // } + // } + + public nextNotfification() { //let itemExist = false; let itemNo = this.getPassNotificationDetails.ROW_NUM; - itemNo += 1; - if (itemNo > this.notificationArray.length) { - this.common.openNotificationPage(); - } else { - for (let i = 0; i < this.notificationArray.length; i++) { - if (this.notificationArray[i].ROW_NUM == itemNo) { - this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); - // itemExist = true; - this.intializeNotificationDetail(); - // this.common.openNotificationPage(); - - break; - } + console.log(itemNo); + let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); + console.log(index); + console.log(this.notificationArray); + index += 1; + + if (index < this.notificationArray.length) { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ + this.common.openWorklistMainPOPage(); + }else + if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ + this.common.openWorklistMainPRPage(); + } + else + if(this.notificationArray[index].REQUEST_TYPE == "MR" ){ + this.intializeNotificationDetail(); + + }else{ + this.common.openWorklistMainPage(); } - // if(itemExist==false){ - // this.nextNotfification(); - // } + + } + else{ + this.common.openNotificationPage(); } } 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 50056319..c56399d3 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 @@ -36,6 +36,7 @@ import { MoreActionModalComponent } from '../more-action-modal/more-action-modal import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; @Component({ selector: 'app-worklist-main-po', @@ -354,24 +355,54 @@ export class WorklistMainPoComponent implements OnInit { } // valid it } + // public nextNotfification() { + // //let itemExist = false; + // let itemNo = this.getPassNotificationDetails.ROW_NUM; + // itemNo += 1; + // if (itemNo > this.notificationArray.length) { + // this.common.openNotificationPage(); + // } else { + // for (let i = 0; i < this.notificationArray.length; i++) { + // if (this.notificationArray[i].ROW_NUM == itemNo) { + // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // // itemExist = true; + // this.intializeNotificationDetail(); + // break; + // } + // } + // // if(itemExist==false){ + // // this.nextNotfification(); + // // } + // } + // } + public nextNotfification() { //let itemExist = false; let itemNo = this.getPassNotificationDetails.ROW_NUM; - itemNo += 1; - if (itemNo > this.notificationArray.length) { - this.common.openNotificationPage(); - } else { - for (let i = 0; i < this.notificationArray.length; i++) { - if (this.notificationArray[i].ROW_NUM == itemNo) { - this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); - // itemExist = true; - this.intializeNotificationDetail(); - break; - } + console.log(itemNo); + let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); + console.log(index); + console.log(this.notificationArray); + index += 1; + + if (index < this.notificationArray.length) { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ + this.intializeNotificationDetail(); + }else + if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ + this.common.openWorklistMainPRPage() + } + else + if(this.notificationArray[index].REQUEST_TYPE == "MR" ){ + this.common.openWorklistMainMRPage() + }else{ + this.common.openWorklistMainPage(); } - // if(itemExist==false){ - // this.nextNotfification(); - // } + + } + else{ + this.common.openNotificationPage(); } } 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 9797a8d1..b3f12921 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 @@ -351,24 +351,55 @@ export class WorklistMainPRComponent implements OnInit { } // valid it } + // public nextNotfification() { + // //let itemExist = false; + // let itemNo = this.getPassNotificationDetails.ROW_NUM; + // itemNo += 1; + // if (itemNo > this.notificationArray.length) { + // this.common.openNotificationPage(); + // } else { + // for (let i = 0; i <= this.notificationArray.length; i++) { + // if (this.notificationArray[i].ROW_NUM == itemNo) { + // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // // itemExist = true; + // this.intializeNotificationDetail(); + // break; + // } + // } + // // if(itemExist==false){ + // // this.nextNotfification(); + // // } + // } + // } + + public nextNotfification() { //let itemExist = false; let itemNo = this.getPassNotificationDetails.ROW_NUM; - itemNo += 1; - if (itemNo > this.notificationArray.length) { - this.common.openNotificationPage(); - } else { - for (let i = 0; i <= this.notificationArray.length; i++) { - if (this.notificationArray[i].ROW_NUM == itemNo) { - this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); - // itemExist = true; - this.intializeNotificationDetail(); - break; - } + console.log(itemNo); + let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); + console.log(index); + console.log(this.notificationArray); + index += 1; + + if (index < this.notificationArray.length) { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ + this.common.openWorklistMainPOPage() + }else + if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ + this.intializeNotificationDetail(); + } + else + if(this.notificationArray[index].REQUEST_TYPE == "MR" ){ + this.common.openWorklistMainMRPage() + }else{ + this.common.openWorklistMainPage(); } - // if(itemExist==false){ - // this.nextNotfification(); - // } + + } + else{ + this.common.openNotificationPage(); } } 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 7bdf179c..0a2eb0fc 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -156,8 +156,8 @@ export class WorklistMainComponent implements OnInit { HomeComponent.NOTIFICATION_DATA, false ); - - console.log(this.getPassNotificationDetails.ROW_NUM); + + console.log("for next()"+ this.getPassNotificationDetails.ROW_NUM); this.notificationArray = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_ARR, false @@ -363,31 +363,59 @@ export class WorklistMainComponent implements OnInit { } // valid it } + // public nextNotfification() { + // //let itemExist = false; + + + // let itemNo = this.getPassNotificationDetails.ROW_NUM; + // itemNo += 1; + + // if (itemNo > this.notificationArray.length) { + // this.common.openNotificationPage(); + // } else { + // for (let i = 0; i < this.notificationArray.length; i++) { + // if (this.notificationArray[i].ROW_NUM == itemNo) { + // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // // itemExist = true; + // this.intializeNotificationDetail(); + // break; + // } + // } + // // if(itemExist==false){ + // // this.nextNotfification(); + // // } + // } + // } + + public nextNotfification() { //let itemExist = false; let itemNo = this.getPassNotificationDetails.ROW_NUM; - itemNo += 1; - console.log( this.notificationArray); - let sortArr =this.sortArray(this.notificationArray); - console.log( sortArr); - - const sortedActivities = this.notificationArray.slice().sort((a, b) => b.BEGIN_DATE - a.BEGIN_DATE) - console.log(sortedActivities); - // if (itemNo > this.notificationArray.length) { - // this.common.openNotificationPage(); - // } else { - // for (let i = 0; i < this.notificationArray.length; i++) { - // if (this.notificationArray[i].ROW_NUM == itemNo) { - // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); - // // itemExist = true; - // this.intializeNotificationDetail(); - // break; - // } - // } - // // if(itemExist==false){ - // // this.nextNotfification(); - // // } - // } + console.log(itemNo); + let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); + console.log(index); + console.log(this.notificationArray); + index += 1; + + if (index < this.notificationArray.length) { + this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); + if(this.notificationArray[index].REQUEST_TYPE == "PO" ){ + this.common.openWorklistMainPOPage() + }else + if(this.notificationArray[index].REQUEST_TYPE == "PR" ){ + this.common.openWorklistMainPRPage() + } + else + if(this.notificationArray[index].REQUEST_TYPE == "MR" ){ + this.common.openWorklistMainMRPage() + }else{ + this.intializeNotificationDetail(); + } + + } + else{ + this.common.openNotificationPage(); + } } @@ -642,7 +670,8 @@ export class WorklistMainComponent implements OnInit { handleNotificationResAttrResult(result) { if (this.common.validResponse(result)) { // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); - this.NotRespondAttributeList = + + this.NotRespondAttributeList = []; result.NotificationGetRespondAttributesList; if ( result.NotificationRespondRolesList != "" &&