diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.ts b/Mohem/src/app/eit/add-eit/add-eit.component.ts index b57a1330..e36c1d5e 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -1231,6 +1231,7 @@ export class AddEitComponent implements OnInit { } if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { elem.classList.add("requiredClassElm"); + this.cs.redToastPK("eit", "required-text"); //this.common.showRequiredMsg(); return false; } else { diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts index b64746bc..d52f92ae 100644 --- a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts +++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts @@ -267,7 +267,7 @@ export class ConfirmAddressComponent implements OnInit { //if(this.isResubmitEIT==false){ // let msg: string = this.ts.trPK("eit", "approval-message-success"); // this.cs.presentAlert(msg); - this.cs.greenToastPK("eit", "approval-message-success") + this.cs.greenToastPK("eit", "contact-approval-message-success") // } // this.navCtrl.popToRoot(); this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); diff --git a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts index 5c9dca61..92e8da0b 100644 --- a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts +++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts @@ -194,7 +194,7 @@ export class ConfirmBasicDetailsComponent implements OnInit { this.isSubmitBtnClicked = true; // let msg: string = this.ts.trPK("eit", "approval-message-success"); // this.cs.presentAlert(msg); - this.cs.greenToastPK("eit", "approval-message-success"); + this.cs.greenToastPK("eit", "basic-approval-message-success"); this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); // this.cs.openProfile('sideMenu'); this.cs.openHome(); diff --git a/Mohem/src/app/profile/contact/contact.component.ts b/Mohem/src/app/profile/contact/contact.component.ts index 5df72271..189358a3 100644 --- a/Mohem/src/app/profile/contact/contact.component.ts +++ b/Mohem/src/app/profile/contact/contact.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, NgZone } from '@angular/core'; import { AddEitResponse } from 'src/app/eit/models/add.eit.response'; import { EitRequest } from 'src/app/eit/models/eit.request'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; @@ -20,7 +20,7 @@ export class ConatactComponent implements OnInit { respID: any; selMenu: any; submitrequest: any; - constructor(public cs: CommonService, public ts: TranslatorService, public profileService: ProfileService,) { + constructor(public cs: CommonService, public ts: TranslatorService, public profileService: ProfileService, public ngzone: NgZone) { this.direction = TranslatorService.getCurrentLanguageName(); this.selEmp = this.cs.sharedService.getSharedData( MenuResponse.SHARED_SEL_EMP, @@ -40,10 +40,13 @@ export class ConatactComponent implements OnInit { ngOnInit() { - this.phoneNumbers = this.cs.sharedService.getSharedData(ProfileService.EMP_PHONE, false); - this.setIsUpdated(); - this.direction = TranslatorService.getCurrentLanguageName(); - this.getObjectValue(); + this.ngzone.run(() => { + this.phoneNumbers = []; + this.phoneNumbers = this.cs.sharedService.getSharedData(ProfileService.EMP_PHONE, false); + this.setIsUpdated(); + this.direction = TranslatorService.getCurrentLanguageName(); + this.getObjectValue(); + }) } setIsUpdated() { this.phoneNumbers.forEach(element => { @@ -93,6 +96,14 @@ export class ConatactComponent implements OnInit { addNewRow() { this.phoneNumbers.push({ 'PHONE_NUMBER': '', 'PHONE_TYPE': '', 'ACTION': 'NEW_ROW', 'OBJECT_VERSION_NUMBER': null, 'PHONE_ID': null }) } + + ionViewDidLeave() { + this.phoneNumbers = this.phoneNumbers.filter(function( obj ) { + return obj.ACTION !== 'NEW_ROW'; + }); + this.cs.sharedService.setSharedData(this.phoneNumbers, ProfileService.EMP_PHONE); + + } deleteRow(row) { row['DELETE_ROW'] = true; // this.phoneNumbers = diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index eb8a2955..b2e645ca 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -396,7 +396,6 @@ export class HomeComponent implements OnInit { if (this.cs.validResponse(response)) { this.cs.stopLoading(); this.phoneNumbers = response['GetEmployeePhonesList']; - console.log(this.phoneNumbers); this.cs.sharedService.setSharedData(this.phoneNumbers, ProfileService.EMP_PHONE); } }) diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index fad4b1e2..2ad2f0c1 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2075,6 +2075,10 @@ } }, "eit": { + "required-text": { + "en": "Please fill the required fields!", + "ar": "يرجى تعبئة جميع الحقول المطلوبة!" + }, "done-text": { "en": "Done", "ar": "تم" @@ -2123,6 +2127,14 @@ "en": "Your request has been submitted for approvals.", "ar": "تم إرسال طلبك للحصول على الموافقات." }, + "basic-approval-message-success": { + "en": "Update Basic details request has been submitted for approvals.", + "ar": "تم إرسال طلب تحديث التفاصيل الأساسية للموافقات." + }, + "contact-approval-message-success": { + "en": "Update Contact details request has been submitted for approvals.", + "ar": "تم إرسال طلب تحديث تفاصيل الاتصال للحصول على الموافقات." + }, "delete-perm": { "en": "Are you sure from deleting this file permanently?", "ar": "هل أنت متأكد من حذف هذا الملف نهائيًا؟" @@ -3566,8 +3578,8 @@ "ar": "طلب معرف" }, "output": { - "en": "Output", - "ar": "انتاج" + "en": "Download", + "ar": "تحميل" } } } \ No newline at end of file