fix skip action

mekawy-issues
ashwaq 6 years ago
parent ea34f65959
commit 00e36290d4

@ -275,7 +275,7 @@ export class WorkListReplacementRollComponent implements OnInit {
}); });
}, 5000); }, 5000);
this.cs.openNotificationPage();
} }
} // not valid it } // not valid it

@ -141,6 +141,7 @@ export class WorkListRfcComponent implements OnInit {
}); });
}, 5000); }, 5000);
this.cs.openNotificationPage();
} }
} // valid it } // valid it

@ -321,26 +321,58 @@ export class WorklistMainMRComponent implements OnInit {
} // valid it } // 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() { public nextNotfification() {
//let itemExist = false; //let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1; console.log(itemNo);
if (itemNo > this.notificationArray.length) { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
this.common.openNotificationPage(); console.log(index);
} else { console.log(this.notificationArray);
for (let i = 0; i < this.notificationArray.length; i++) { index += 1;
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); if (index < this.notificationArray.length) {
// itemExist = true; 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(); this.intializeNotificationDetail();
// this.common.openNotificationPage();
break; }else{
this.common.openWorklistMainPage();
} }
} }
// if(itemExist==false){ else{
// this.nextNotfification(); this.common.openNotificationPage();
// }
} }
} }

@ -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 { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
@Component({ @Component({
selector: 'app-worklist-main-po', selector: 'app-worklist-main-po',
@ -354,24 +355,54 @@ export class WorklistMainPoComponent implements OnInit {
} // valid it } // 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() { public nextNotfification() {
//let itemExist = false; //let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1; console.log(itemNo);
if (itemNo > this.notificationArray.length) { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
this.common.openNotificationPage(); console.log(index);
} else { console.log(this.notificationArray);
for (let i = 0; i < this.notificationArray.length; i++) { index += 1;
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); if (index < this.notificationArray.length) {
// itemExist = true; this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
if(this.notificationArray[index].REQUEST_TYPE == "PO" ){
this.intializeNotificationDetail(); this.intializeNotificationDetail();
break; }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();
} }
} }

@ -351,24 +351,55 @@ export class WorklistMainPRComponent implements OnInit {
} // valid it } // 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() { public nextNotfification() {
//let itemExist = false; //let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1; console.log(itemNo);
if (itemNo > this.notificationArray.length) { let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
this.common.openNotificationPage(); console.log(index);
} else { console.log(this.notificationArray);
for (let i = 0; i <= this.notificationArray.length; i++) { index += 1;
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); if (index < this.notificationArray.length) {
// itemExist = true; 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(); this.intializeNotificationDetail();
break;
} }
else
if(this.notificationArray[index].REQUEST_TYPE == "MR" ){
this.common.openWorklistMainMRPage()
}else{
this.common.openWorklistMainPage();
} }
// if(itemExist==false){
// this.nextNotfification(); }
// } else{
this.common.openNotificationPage();
} }
} }

@ -157,7 +157,7 @@ export class WorklistMainComponent implements OnInit {
false false
); );
console.log(this.getPassNotificationDetails.ROW_NUM); console.log("for next()"+ this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData( this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR, HomeComponent.NOTIFICATION_ARR,
false false
@ -363,16 +363,13 @@ export class WorklistMainComponent implements OnInit {
} // valid it } // valid it
} }
public nextNotfification() { // public nextNotfification() {
//let itemExist = false; // //let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
console.log( this.notificationArray); // let itemNo = this.getPassNotificationDetails.ROW_NUM;
let sortArr =this.sortArray(this.notificationArray); // itemNo += 1;
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) { // if (itemNo > this.notificationArray.length) {
// this.common.openNotificationPage(); // this.common.openNotificationPage();
// } else { // } else {
@ -388,6 +385,37 @@ export class WorklistMainComponent implements OnInit {
// // this.nextNotfification(); // // this.nextNotfification();
// // } // // }
// } // }
// }
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
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) { handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
this.NotRespondAttributeList =
this.NotRespondAttributeList = [];
result.NotificationGetRespondAttributesList; result.NotificationGetRespondAttributesList;
if ( if (
result.NotificationRespondRolesList != "" && result.NotificationRespondRolesList != "" &&

Loading…
Cancel
Save