fixed change password in welcome page and added CONTACT request type in worklist

sultan-q3
enadhilal 4 years ago
parent 718ec53b2a
commit 57be247a0a

@ -12,7 +12,7 @@ import { GetLoginInfoResponse } from '../../hmg-common/services/authentication/m
import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request';
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { PushService } from 'src/app/hmg-common/services/push/push.service';
import { ModalController, Platform } from '@ionic/angular';
import { ModalController, Platform, AlertController } from '@ionic/angular';
import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response';
import { LoginModel } from '../models/LoginModel';
import * as moment from 'moment';
@ -20,6 +20,8 @@ import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authenticat
import { NFC } from "@ionic-native/nfc/ngx";
import { DigitalIdComponent } from '../digital-id/digital-id.component';
import { AppUpdateComponent } from '../app-update/app-update.component';
import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
@Component({
selector: 'app-confirm-login',
@ -54,7 +56,7 @@ export class ConfirmLoginComponent implements OnInit {
direction: string;
userInfo: any;
public businessInfo: object;
private checkUserResult: CheckUserAuthenticationResponse;
constructor(
public ts: TranslatorService,
public cs: CommonService,
@ -64,6 +66,7 @@ export class ConfirmLoginComponent implements OnInit {
public pushService: PushService,
public platform: Platform,
public modalController: ModalController,
public alertController: AlertController,
private nfc: NFC
) {
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
@ -376,7 +379,7 @@ export class ConfirmLoginComponent implements OnInit {
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
qr: result.MemberInformationList[0].BusinessCardQR,
company_logo: result.BC_Logo ? result.BC_Logo: result.CompanyImageURL,
company_logo: result.BC_Logo ? result.BC_Logo : result.CompanyImageURL,
company_url: result.BC_Domain,
company_type: result.CompanyMainCompany,
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
@ -446,13 +449,77 @@ export class ConfirmLoginComponent implements OnInit {
this.confirm(this.loginType);
} else {
if (result.IsPasswordExpired) {
// alert("dont forget to handelpresentPasswordExpiredDialog() ");
// this.presentPasswordExpiredDialog(); *****
this.presentPasswordExpiredDialog();
}
}
});
}
async presentPasswordExpiredDialog() {
const alert = await this.alertController.create({
header: this.ts.trPK('general', 'confirm'),
message: this.ts.trPK('login', 'password-expired'),
buttons: [
{
text: this.ts.trPK('general', 'ok'),
handler: () => {
console.log('Confirm Okay');
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
this.userCheck();
}
}
]
});
await alert.present();
}
public userCheck() {
this.cs.startLoading();
const request = new CheckUserAuthenticationRequest();
request.P_USER_NAME = this.username;
this.authService.checkUserAuthentication(
request,
() => {
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
this.cs.stopLoading();
this.sendSMSForForgotPassword();
}
});
}
private sendSMSForForgotPassword() {
this.cs.startLoading();
const changePwdObj = new LoginRequest();
changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
changePwdObj.P_USER_NAME = this.username;
changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
this.authService.sendPublicSMS(
changePwdObj,
() => {
// this.sendSMSForForgotPassword();
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
console.log('2');
console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username;
// this.loginData.EmployeeName =result.MemberLoginList[0].EMPLOYEE_NAME;
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.sharedData.setSharedData(true, Password.IS_FORGET_PSW);
this.cs.stopLoading();
this.cs.openSMSPage();
}
});
}
private handleAppUpdate(result) {
this.iosLink = result.IOSLink;
this.androidLink = result.AndroidLink;
@ -478,14 +545,14 @@ export class ConfirmLoginComponent implements OnInit {
});
}
async appUpdate(msg, result) {
async appUpdate(msg, result) {
const modal = await this.modalController.create({
component: AppUpdateComponent,
cssClass: 'app-update-modal-css',
componentProps: {'msg':msg}
componentProps: { 'msg': msg }
});
modal.onDidDismiss().then((data) => {
this.handleAppUpdate(result);
this.handleAppUpdate(result);
});
return await modal.present();
}
@ -517,9 +584,9 @@ export class ConfirmLoginComponent implements OnInit {
let buttonSelected;
this.buttons.forEach(element => {
element.forEach(elementValue => {
if(typeNumber === elementValue.value){
if (typeNumber === elementValue.value) {
buttonSelected = elementValue;
}else{
} else {
elementValue.visible = false;
}
});

@ -33,6 +33,7 @@ export class WorklistMainService {
public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY";
public static getPhoneNotificationBody = "Services/ERP.svc/REST/GET_PHONES_NOTIFICATION_BODY";
public static getTerminationNotificationBody = "Services/ERP.svc/REST/GET_TERM_NOTIFICATION_BODY";
public static getContactNotificationBody = "Services/ERP.svc/REST/GET_CONTACT_NOTIFICATION_BODY";
public static getStampMSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_MS_NOTIFICATION_BODY";
public static getStampNSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_NS_NOTIFICATION_BODY";
public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY";
@ -222,6 +223,21 @@ export class WorklistMainService {
);
}
public getContactNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<any> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getContactNotificationBody,
request,
onError,
errorLabel
);
}
public getPOItemHistory(
POItemHistoryReq: any,
onError?: any,

@ -48,7 +48,8 @@
<ion-row>
<!-- NOT ADDRESS & BASIC_DETAILS -->
<ion-col *ngIf="getPassNotificationDetails?.REQUEST_TYPE != 'ADDRESS' &&
getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' &&
getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' &&
getPassNotificationDetails?.REQUEST_TYPE != 'CONTACT' &&
getPassNotificationDetails?.REQUEST_TYPE != 'PHONE_NUMBERS' &&
getPassNotificationDetails?.REQUEST_TYPE != 'TERMINATION'">
@ -293,9 +294,10 @@
</ion-item>
</ion-col>
<!-- IF BASIC_DETAILS -->
<!-- IF BASIC_DETAILS OR ADDRESS OR CONTACT -->
<ion-col *ngIf="getPassNotificationDetails?.REQUEST_TYPE == 'BASIC_DETAILS' ||
getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS' &&
getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS' ||
getPassNotificationDetails?.REQUEST_TYPE == 'CONTACT' &&
getPassNotificationDetails?.REQUEST_TYPE != 'PHONE_NUMBERS' &&
getPassNotificationDetails?.REQUEST_TYPE != 'TERMINATION'">
<div *ngIf="showInformation">

@ -292,6 +292,8 @@ export class WorklistMainComponent implements OnInit {
this.getTerminationNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'PHONE_NUMBERS') {
this.getPhoneNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'CONTACT') {
this.getContactNotificationDetails(this.WorkListBodyObj);
}
}
@ -327,6 +329,14 @@ export class WorklistMainComponent implements OnInit {
});
}
getContactNotificationDetails(notificationBodyObj) {
this.worklistMainService
.getContactNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "CONTACT");
});
}
getBasicDetailsNotification(notificationBodyObj) {
this.worklistMainService
.getBasicDetailNotificationBody(notificationBodyObj)
@ -455,6 +465,13 @@ export class WorklistMainComponent implements OnInit {
console.log(result);
}
}
else if (Type === "CONTACT"){
if (result.GetContactNotificationBodyList) {
this.notificationBodyRes =
result.GetContactNotificationBodyList.ContactNotificationBody;
console.log(result);
}
}
}
} //End handleWorkListBodyResult

@ -1176,7 +1176,7 @@ border:0px
}
.logoHeader {
max-width: 130%;
max-width: 90%;
width: 130%;
border: 0px;
}

Loading…
Cancel
Save