import { Component, OnInit } from '@angular/core'; import { ModalController } from '@ionic/angular'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { WorklistMainService } from '../service/work-list.main.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { WorkListActionRequest } from '../models/NotificationActionReq'; @Component({ selector: 'app-apply-action-modal', templateUrl: './apply-action-modal.component.html', styleUrls: ['./apply-action-modal.component.scss'], }) export class ApplyActionModalComponent implements OnInit { private textArea: TextAreaInput; getpassResAttr: any; getPassNotificationDetails: any; getPassNotification: any; confirmMsg: string; getPassActionMode: any; P_RESPOND_ATTRIBUTES_TBL: any; selEmployeeID: any; hideForwordEmployee: any; private WorkListActionObj: WorkListActionRequest; messageSuccess: boolean; constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService, ) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false); this.getpassResAttr = this.cs.sharedService.getSharedData('notificationDynamicAttributeArr' ,false); this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage',false); this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode',false); this.WorkListActionObj = new WorkListActionRequest(); } ngOnInit() { document.getElementById("notificationDynamicFieldsModal").innerHTML=""; console.log(this.getPassNotificationDetails); //this.applyAction(this.getPassNotificationDetails); this.notificationDynamicFields(this.getpassResAttr); console.log("confirmMsg" + this.confirmMsg) if (this.getPassActionMode === "APPROVED") { this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') } else if (this.getPassActionMode === "REJECTED") { this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') } else if (this.getPassActionMode === "DEL") { this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg') } else if (this.getPassActionMode === "CLOSE") { this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') } } notificationDynamicFields(notificationAttr){ const containerId = 'notificationDynamicFieldsModal'; for(let i=0;i { this.handleApplayActionResult(result); }); } handleApplayActionResult(result) { if (this.cs.validResponse(result)) { if (result.MessageStatus == 1) { // this.navCtrl.push("HomePage"); //this.common.openHome(); //this.common.openNotificationPage(); // for( var i = 0; i < this.notificationArray.length; i++){ // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { // this.notificationArray.splice(i, 1); // } // } this.messageSuccess = true; setTimeout(() => { this.messageSuccess = false; }, 5000); this.cs.openNotificationPage(); // this.getNotificationCountAfterSubmit(); //this.nextNotfification(); } } // valid it } }