Merge branch 'MOHEMM-Q2-DEV' into enad-Q1

MOHEMM-SFH-COLORS
enadhilal 5 years ago
commit 1d1c0bfb6a

@ -222,4 +222,4 @@
"ios"
]
}
}
}

@ -11,6 +11,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { Router } from '@angular/router';
import { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
import { checkAndUpdatePureExpressionInline } from '@angular/core/src/view/pure_expression';
@Component({
selector: 'app-root',
@ -132,6 +133,17 @@ export class AppComponent implements OnInit {
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
this.authService.checkAds({
EmployeeNumber: '',
ItgEnableAt: "Before Service Initiation",
ItgServiceName: "Ticket"
}, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
console.log("Check Ads")
console.log(res);
});
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {

@ -27,19 +27,19 @@
</ion-col>
</ion-row>
<ion-row class="faces-row">
<ion-col [ngClass]="select2">
<ion-col [ngClass]="{'select2' : satisfied=='1'}">
<img class="face" src="assets/icon/rate/bad.svg" (click)="select(1)">
</ion-col>
<ion-col [ngClass]="select2">
<ion-col [ngClass]="{'select2' : satisfied=='2'}">
<img class="face" src="assets/icon/rate/poor.svg" (click)="select(2)">
</ion-col>
<ion-col [ngClass]="select3">
<ion-col [ngClass]="{'select2' : satisfied=='3'}">
<img class="face" src="assets/icon/rate/normal.svg" (click)="select(3)">
</ion-col>
<ion-col [ngClass]="select4">
<ion-col [ngClass]="{'select2' : satisfied=='4'}">
<img class="face" src="assets/icon/rate/good.svg" (click)="select(4)">
</ion-col>
<ion-col [ngClass]="select5">
<ion-col [ngClass]="{'select2' : satisfied=='5'}">
<img class="face" src="assets/icon/rate/xcellent.svg" (click)="select(5)">
</ion-col>
@ -65,7 +65,7 @@
</ion-content>
<ion-footer >
<div class="centerDiv">
<ion-button class="footer-button" ion-button (click)="submit()">
<ion-button class="footer-button" ion-button (click)="submit()" [disabled]="!rate || (rate==1 && !Note)">
{{'general,submit' | translate}} </ion-button>
</div>

@ -37,7 +37,9 @@ margin-right:20px;
}
ion-footer .footer-button{
--background: #259CB8;
width: 80%;
width: 80%;
background: #259CB8;
border-radius: 10px;
}
.skip-btn{
position: absolute;
@ -47,4 +49,7 @@ ion-footer .footer-button{
right: 10px;
padding: 5px;
border-radius: 5px;
}
.select2{
border:1px solid #000;
}

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@ -12,7 +13,9 @@ export class SurveyComponent implements OnInit {
rate: any;
isSkip: boolean = false;
setTime: number = 5;
constructor(public ts: TranslatorService, public cs: CommonService, public nav: NavController) { }
satisfied: any = '5';
constructor(public ts: TranslatorService, public cs: CommonService, public nav: NavController, public authService: AuthenticationService) { }
ngOnInit() {
this.setTimer();
@ -31,4 +34,15 @@ export class SurveyComponent implements OnInit {
}
}, 1000);
}
saveSruvey() {
var request = {}
this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
})
}
select(rating) {
this.satisfied = rating;
}
}

@ -38,87 +38,96 @@ import { SendActivationByType } from 'src/app/authentication/models/sendActivati
})
export class AuthenticationService {
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static login = 'Services/ERP.svc/REST/MemberLogin';
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
public static smsCheck='Services/ERP.svc/REST/CheckActivationCode';
public static smsCheckForget='Services/ERP.svc/REST/CheckPublicActivationCode';
public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode';
public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType';
public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo
public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo';
/* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration';
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration';
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS';
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser;
public static servicePrivilage : PrivilageModel[];
/*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired';
public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion';
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user';
public static LOGIN_DATA="logindata";
public static DEVICE_TOKEN = "device_token";
public static LAST_LOGIN = 'last-login';
public static IMEI_USER_DATA = "imei-user-data";
// private static user: AuthenticatedUser;
constructor(
public con: ConnectorService,
public cs: CommonService,
public ts: TranslatorService,
public nativeStorage: NativeStorage,
// public localNotifications: UserLocalNotificationService,
private events: Events,
private menu: MenuController,
public platform: Platform
) { }
public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request);
const user = this.getAuthenticatedUser();
if (user) {
request.P_SESSION_ID = user.P_SESSION_ID;
request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
request.LogInTokenID = user.LogInTokenID;
request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS;
if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog();
}
} else {
this.cs.userNeedToReLogin();
}
/*
else {
if (automaticLogin) {
this.cs.openUserLogin();
}
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static login = 'Services/ERP.svc/REST/MemberLogin';
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
public static smsCheck = 'Services/ERP.svc/REST/CheckActivationCode';
public static smsCheckForget = 'Services/ERP.svc/REST/CheckPublicActivationCode';
public static smsSendCode = 'Services/ERP.svc/REST/SendPublicActivationCode';
public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType';
public static getMobileLoginInfo = 'Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo
public static insertMobileLoginInfo = 'Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo';
/* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration';
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration';
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS';
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser;
public static servicePrivilage: PrivilageModel[];
/*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget = 'Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword = 'Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired';
public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion';
/* check survey or ads */
public static getITGPageNotification = 'Services/COCWS.svc/REST/Mohemm_ITG_GetPageNotification';
public static getITGPageNotificationDetails = 'Services/COCWS.svc/REST/Mohemm_ITG_GetPageNotificationDetails';
public static saveSurveyAds = 'Services/COCWS.svc/REST/Mohemm_ITG_Survey_Response';
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user';
public static LOGIN_DATA = "logindata";
public static DEVICE_TOKEN = "device_token";
public static LAST_LOGIN = 'last-login';
public static IMEI_USER_DATA = "imei-user-data";
// private static user: AuthenticatedUser;
constructor(
public con: ConnectorService,
public cs: CommonService,
public ts: TranslatorService,
public nativeStorage: NativeStorage,
// public localNotifications: UserLocalNotificationService,
private events: Events,
private menu: MenuController,
public platform: Platform
) { }
public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request);
const user = this.getAuthenticatedUser();
if (user) {
request.P_SESSION_ID = user.P_SESSION_ID;
request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
request.LogInTokenID = user.LogInTokenID;
request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS;
if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog();
}
} else {
this.cs.userNeedToReLogin();
}
/*
else {
if (automaticLogin) {
this.cs.openUserLogin();
}
*/
}
*/
return request;
}
@ -127,17 +136,17 @@ export class AuthenticationService {
const isIOS = this.platform.is('ios');
let mobileType = '';
if (isAndroid) {
mobileType = 'android';
mobileType = 'android';
} else if (isIOS) {
mobileType = 'ios';
}else{
mobileType = 'android';
mobileType = 'ios';
} else {
mobileType = 'android';
}
request.VersionID = 2.9;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;
return request;
}
public authenticateAndSetPersonalInformation(
@ -194,65 +203,65 @@ export class AuthenticationService {
public getPublicRequest(): Request {
const request = new Request();
this.setPublicFields(request);
return request;
}
public getPublicRequest(): Request {
const request = new Request();
this.setPublicFields(request);
return request;
}
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
}
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
}
public isAuthenticated(): boolean {
return AuthenticationService.user != null;
}
/**
* this fucntion load from user information if he logged in before
* and save user into memory and local storage
* disable notifications for previous user if new user logged in with different user
*
*
* info:
* 1- user stored in local storage without token
* @param result check activation code result
*/
public setAuthenticatedUser(
result: SMSCheckResponse
): Observable<boolean> {
return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user;
this.publishUserChangeEvent();
observer.next(true);
observer.complete();
});
}
);
});
}
public isAuthenticated(): boolean {
return AuthenticationService.user != null;
}
/**
* this fucntion load from user information if he logged in before
* and save user into memory and local storage
* disable notifications for previous user if new user logged in with different user
*
*
* info:
* 1- user stored in local storage without token
* @param result check activation code result
*/
public setAuthenticatedUser(
result: SMSCheckResponse
): Observable<boolean> {
return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user;
this.publishUserChangeEvent();
observer.next(true);
observer.complete();
});
}
);
});
}
public resetAuthenticatedUser(user: AuthenticatedUser) {
AuthenticationService.user = user;
AuthenticationService.requireRelogin = false;
@ -334,8 +343,8 @@ export class AuthenticationService {
user.P_SESSION_ID = result.P_SESSION_ID;
user.MobileNumber = result.EMPLOYEE_MOBILE_NUMBER;
user.TokenID = result.TokenID;
user.CompanyImageDescription=result.CompanyImageDescription;
user.CompanyImageURL=result.CompanyImageURL;
user.CompanyImageDescription = result.CompanyImageDescription;
user.CompanyImageURL = result.CompanyImageURL;
user.CompanyBadge = result.CompanyBadge;
user.CompanyMainCompany = result.CompanyMainCompany;
user.LogInTokenID = this.cs.sharedService.getSharedData(
@ -455,163 +464,163 @@ export class AuthenticationService {
return AuthenticationService.user;
}
*/
if(AuthenticationService.user){
return AuthenticationService.user;
}else{
this.cs.openLogin();
}
if (AuthenticationService.user) {
return AuthenticationService.user;
} else {
this.cs.openLogin();
}
}
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheckForget, request, onError, errorLabel);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheckForget, request, onError, errorLabel);
}
public sendPublicSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public sendPublicSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
/*
client side:
id no , mobile no , zip code
*/
/*
client side:
id no , mobile no , zip code
*/
/*
client side:
id no , mobile no , zip code
*/
// public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
// : Observable<CheckUserAuthenticationResponse> {
// this.setPublicFields(request);
// request.TokenID = '';
// request.isRegister = false;
// return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel);
// }
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
// public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
// : Observable<CheckUserAuthenticationResponse> {
// this.setPublicFields(request);
// request.TokenID = '';
// request.isRegister = false;
// return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel);
// }
public sendForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public submitForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.changePasswordForget, request, onError, errorLabel);
}
public sendForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsSendCode, request, onError, errorLabel);
}
public submitChangePassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
this.authenticateRequest(request);
return this.con.post(AuthenticationService.changePassword, request, onError, errorLabel);
}
public submitForgetPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.changePasswordForget, request, onError, errorLabel);
}
public submitExpiredPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.expiredPassword, request, onError, errorLabel);
}
public submitChangePassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
this.authenticateRequest(request);
return this.con.post(AuthenticationService.changePassword, request, onError, errorLabel);
}
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
//request.SearchType = 2;
//request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
}
public submitExpiredPassword(request: ForgetPassword, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.expiredPassword, request, onError, errorLabel);
}
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<ForgotFileIDResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.SearchType = 2;
request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel);
}
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
//request.SearchType = 2;
//request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
}
// tslint:disable-next-line: max-line-length
public insertMobileLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string, isPostNoLoad = false): Observable<GetLoginInfoResponse> {
this.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
} else {
return this.con.post(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
}
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<ForgotFileIDResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.SearchType = 2;
request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel);
}
// tslint:disable-next-line: max-line-length
public insertMobileLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string, isPostNoLoad = false): Observable<GetLoginInfoResponse> {
this.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
} else {
return this.con.post(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
}
}
public isSAUDIIDValid(id: string): boolean {
if (!id) {
public isSAUDIIDValid(id: string): boolean {
if (!id) {
return false;
}
try {
id = id.toString();
id = id.trim();
const returnValue = Number(id);
let sum = 0;
if (returnValue > 0) {
const type = Number(id.charAt(0));
if (id.length !== 10) {
return false;
}
try {
id = id.toString();
id = id.trim();
const returnValue = Number(id);
let sum = 0;
if (returnValue > 0) {
const type = Number(id.charAt(0));
if (id.length !== 10) {
return false;
}
if (type !== 2 && type !== 1) {
return false;
}
for (let i = 0; i < 10; i++) {
if (i % 2 === 0) {
const a = id.charAt(i);
const x = Number(a) * 2;
let b = x.toString();
if (b.length === 1) {
b = "0" + b;
}
sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else {
sum += Number(id.charAt(i));
}
if (type !== 2 && type !== 1) {
return false;
}
for (let i = 0; i < 10; i++) {
if (i % 2 === 0) {
const a = id.charAt(i);
const x = Number(a) * 2;
let b = x.toString();
if (b.length === 1) {
b = "0" + b;
}
return sum % 10 === 0;
sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else {
sum += Number(id.charAt(i));
}
} catch (err) {}
return false;
}
return sum % 10 === 0;
}
} catch (err) { }
return false;
}
public checkUserHasEmailDialog(): Observable<void> {
return Observable.create(observer => {
if (this.isAuthenticatedUserHasRealEmail()) {
@ -662,26 +671,26 @@ export class AuthenticationService {
public getLastLoginInfo() {
let deviceToken = localStorage.getItem('deviceToken');
let deviceToken = localStorage.getItem('deviceToken');
const requestGetLoginInfo = {
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
DeviceType: this.cs.getDeviceType(),
DeviceToken: deviceToken
};
this.getLoginInfo(requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
this.getLoginInfo(requestGetLoginInfo, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else {}
if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(res.Mohemm_GetMobileLoginInfoList[0], AuthenticationService.IMEI_USER_DATA);
const user = true;
this.events.publish('user', user);
this.cs.openLogin();
} else {
const user = false;
this.events.publish('user', user);
this.cs.openLogin();
}
} else { }
});
}
@ -727,6 +736,27 @@ export class AuthenticationService {
);
}
}
checkAds(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.getITGPageNotification, request, onError, errorLabel);
}
adsDetails(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.getITGPageNotificationDetails, request, onError, errorLabel);
}
saveAdsStatus(request, onError, errorLabel) {
request = this.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(AuthenticationService.saveSurveyAds, request, onError, errorLabel);
}
//**************************//
public sendActivationCodeByType(
@ -744,4 +774,5 @@ export class AuthenticationService {
onError,
errorLabel
);
}}
}
}

@ -9,14 +9,14 @@ import { IonicModule } from '@ionic/angular';
import { MyTeamPage } from './my-team.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { from } from 'rxjs';
import { WorklistService } from 'src/app/notification/service/worklist.service';
import { WorklistService } from '../notification/service/worklist.service';
const routes: Routes = [
{
path: '',
component: MyTeamPage,
children:[{
children: [{
path: 'home',
component: HomeComponent
},
@ -28,9 +28,9 @@ const routes: Routes = [
path: 'details-2',
component: DetailsComponent
},
]
]
}
];
@ -41,10 +41,10 @@ const routes: Routes = [
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
providers:[WorklistService],
declarations: [MyTeamPage,HomeComponent,DetailsComponent,
]
providers: [WorklistService],
declarations: [MyTeamPage, HomeComponent, DetailsComponent,
]
})
export class MyTeamPageModule {}
export class MyTeamPageModule { }

@ -399,7 +399,7 @@
</ion-grid>
</ion-card-content>
</ion-card> -->
<!--
<ion-card class="cardContent">
<ion-card-content>
<ion-grid>
@ -430,7 +430,7 @@
</ion-card>
<!-- if there is additional screen like in VIDA -->
if there is additional screen like in VIDA -->
<!-- <ng-container>
<ion-card class="cardContent" *ngFor='let segmentContant of segmentDataTable'>
<ion-card-content *ngIf='activeSegment === segmentContant.name'>
@ -474,7 +474,7 @@
<img [src]="action.image">
<ion-label style="font-size: 12px" *ngIf="action.name !== 'RequestInformation'">{{action.name}}</ion-label>
<ion-label style="font-size: 12px; white-space: nowrap;" *ngIf="action.name === 'RequestInformation'">{{'worklistMain, worklistMain' | translate}}</ion-label>
<ion-label style="font-size: 12px; white-space: nowrap;" *ngIf="action.name === 'RequestInformation'">{{'worklistMain, request' | translate}}</ion-label>
</ion-tab-button>

@ -476,7 +476,7 @@ export class WorkListMainItgComponent implements OnInit {
modal.onDidDismiss()
.then((data) => {
this.replcamentID = data.data.empData.USER_NAME;
this.commentText = data.data.comments;
if (actionNumber == 3) {
this.actionService(3, this.commentText);
} else if (actionNumber == 4) {

@ -86,7 +86,7 @@
</ion-item>
</ion-radio-group>
</ion-list> -->
<div *ngIf="!userSelected">
<div *ngIf="ReplacementList.length>0" class="uk-margin">
{{'replacementRoll, search-result' | translate}}
</div>
@ -95,8 +95,8 @@
<ion-item lines="none">
<div class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="square-container" >
<div *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
@ -104,31 +104,81 @@
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} -->
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite()">
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
</div>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> -->
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</div>
</ion-item>
</div>
<div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}}
</div>
<div class="square-container uk-padding" >
<div (click)="select(employee,i)" *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div class="profileImageDiv">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
</div>
</div>
</div>
<div *ngIf="messageSuccess" class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
<!--filled-->
</ion-col>
<ion-col size="12"> <div style="font-size: 30px !important"> Transaction Successful </div> </ion-col>
</div>
</ion-content>
<ion-footer *ngIf="!messageSuccess">
<div class="noteInput" *ngIf="isAnswer== false && userSelected ==true">
<!-- <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label> -->
<ion-item>
<ion-textarea [(ngModel)]="userNote" [placeholder]="'replacementRoll, enterNote' | translate"></ion-textarea>
</ion-item>
</div>
<br/>
<!-- <div class="centerDiv">
<ion-button *ngIf="userSelected ==true" class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button>
<ion-button class="footer-button" style="border-radius: 10px; --background: transparent; " ion-button (click)="closeModal()">
{{'general, cancel' | translate}}</ion-button>
</div> -->
</ion-footer>
</ion-content>
<ion-footer>
<ion-footer *ngIf="userSelected ==true">
<div class="centerDiv">
<ion-button (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button>

@ -4,6 +4,7 @@ import { ReplacementServiceRequest } from 'src/app/vacation-rule/model/replaceme
import { VacationRuleServiceService } from 'src/app/vacation-rule/service/vacation-rule-service.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { WorklistService } from '../service/worklist.service';
@Component({
@ -28,12 +29,20 @@ export class WorkListReplacementItgComponent implements OnInit {
isSave: boolean = false;
isSelect: boolean = false;
typingTimer: any;
userSelected: any;
active: any;
isAnswer: boolean = false;
favoriteUserList: [] = [];
userNote: any;
constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService,
public cs: CommonService,
public worklistService: WorklistService,
public modalController: ModalController) { }
ngOnInit() { }
ngOnInit() {
this.getFavruite();
}
SearchReplacementList() {
this.ReplacementList = [];
@ -106,9 +115,9 @@ export class WorkListReplacementItgComponent implements OnInit {
}
}
doInfinite(infiniteScroll) {
// doInfinite(infiniteScroll) {
}
// }
closePage() {
this.isSave = true;
@ -125,7 +134,8 @@ export class WorkListReplacementItgComponent implements OnInit {
this.modalController.dismiss({
'dismissed': true,
empData: data
empData: data,
comments: this.userNote
});
}
}
@ -157,9 +167,76 @@ export class WorkListReplacementItgComponent implements OnInit {
select(selectEmp, index) {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp = selectEmp
// this.active = index;
// this.userSelected = true;
this.userSelected = true;
this.active = index;
this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.NAME;
this.closePage();
//this.closePage();
}
setFavorite(selEmp) {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
var confirmBoxhtml = `<div>
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
<br/>
<br/>
<div class="fav-profileImageDiv"><ion-row>`;
if (selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
if (!selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
</ion-label>
</div></ion-row> </div>
</div>`
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
if (userIndex == -1)
this.cs.presentConfirmDialog(
confirmBoxhtml
, () => {
var request =
[{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
this.saveUserFavruiteList(request);
}, () => {
})
// if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
// this.isSelect = true;
// }
// else {
// this.isSelect = false;
// }
}
saveUserFavruiteList(request) {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
this.cs.toastPK("replacementRoll", "favorite-saved");
}
})
}
getFavruite() {
this.cs.startLoading();
this.worklistService.getFavorite({}, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
}
})
}
}

@ -65,14 +65,14 @@
</div>
<div class="square-container uk-padding" >
<div (click)="select(employee,i)" *ngFor="let employee of actionHistory;let i=index;" class="square">
<div *ngFor="let employee of actionHistory;let i=index;" class="square">
<div class="profileImageDiv">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.NAME}}</span>
<span (click)="select(employee,i)">{{employee.NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
@ -90,14 +90,14 @@
</div>
<div class="square-container uk-padding" >
<div (click)="select(employee,i)" *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div class="profileImageDiv">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">

@ -17,7 +17,7 @@
<ion-col size="12">
<ion-item lines="none" class="SearchtextBox">
<ion-input [placeholder]="'itemforsale,search-items'| translate"></ion-input>
<ion-input [placeholder]="'itemforsale,search-items'| translate" [(ngModel)]="searchText" (ionInput)="search($event.target.value)"></ion-input>
</ion-item>
</ion-col>
</ion-row>
@ -31,111 +31,52 @@
</ion-row>
</ion-grid>
<div class="container-icon">
<div class="box-icon">
<div class="sale-icon">
<div class="container-icon" *ngIf="categories.length>0">
<div class="box-icon" *ngFor="let key of categories">
<div class="sale-icon" (click)="filterOffers(key)" [ngClass]="{'active':activeClass==key }">
<div class="top">
<ion-icon name="images"></ion-icon>
<!-- <ion-icon name="images"></ion-icon> -->
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<ion-icon name="images"></ion-icon>
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<ion-icon name="images"></ion-icon>
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<ion-icon name="images"></ion-icon>
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
</div>
</div>
</div>
<div class="box-icon">
<div class="sale-icon">
<div class="top">
<ion-icon name="images"></ion-icon>
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
<p>{{key}}</p>
</div>
</div>
</div>
</div>
<ion-row>
<ion-col size="6" (click)="openDetails()">
<ion-col size="6" *ngFor="let item of offersData" (click)="openDetails(item)">
<ion-card>
<ion-card-header>
<img src="assets/imgs/itemsforsale/furniture.svg" />
<img [src]="item.Banner_Image" />
<ion-card-title>Card Title</ion-card-title>
<ion-card-title>{{item.Title}}</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break
<div [innerHTML]="getDotted(item.Description)"></div>
<strong class="dark">
15% Off + Free Delivery
{{item.Discount}} {{ts.trPK('general','discount')}}
</strong>
<ion-row class="green">
<ion-col size="10">
Offer Valid
<ion-row [class]="checkDate(item['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="2">
<ion-icon name="arrow-round-forward"></ion-icon>
</ion-col>
</ion-row>
</ion-card-content>
</ion-card>
</ion-col>
<ion-col size="6" (click)="openDetails()">
<ion-card>
<ion-card-header>
<img src="assets/imgs/itemsforsale/furniture.svg" />
<ion-card-title>Card Title</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break
<strong class="dark">
15% Off + Free Delivery
</strong>
<ion-row class="green">
<ion-col size="10">
Offer Valid
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
<ion-col size="2">
<ion-col size="2" *ngIf="checkDate(item['End Date']) ==false">
<ion-icon name="arrow-round-forward"></ion-icon>
</ion-col>
</ion-row>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</div>

@ -23,12 +23,12 @@
border-radius: 20px;
}
.filterText{
margin: 5px 15px 15px;
margin: 5px 15px 5px;
font-size: 18px;
font-weight: bold;
}
.container-icon{
padding: 0 10px 20px;
padding: 0 10px 0px;
position: relative;
white-space:nowrap;
overflow-x:auto;
@ -46,6 +46,7 @@
margin: 5px;
border-radius: 10px;
background: #fff;
position: relative;
}
.sale-icon ion-icon{
font-size: 25px;
@ -53,11 +54,15 @@
.sale-icon p{
margin-top:5px;
margin-bottom: 5px;
text-transform: capitalize;
font-size: 15px;
}
.bottom-icon{
text-overflow: clip;
white-space: normal;
font-size: 14px;
padding: 4px;
font-weight: bold;
}
ion-card{
margin:5px;
@ -67,22 +72,29 @@ ion-card-header{
}
ion-card-header img{
margin:15px auto;
margin: 15px auto;
height: 85px;
}
.dark{
display: block;
margin: 6px;
font-size: 18px;
margin: 2px;
font-size: 15px;
font-weight: bold;
}
ion-card-title{
font-weight: bold;
font-size: 18px;
}
ion-card-content{
padding: 5px;
}
.orange{
color: orange;
}
.red{
color:rgb(172, 9, 9)
}
.green{
color:#00AE4D;
}
@ -116,4 +128,24 @@ margin: 5px;
}
.edit{
margin-left:20px !important;
}
.offer-valid{
font-weight: bold;
margin:2px;
font-size: 14px;
}
.active .top::before{
position: absolute;
right: 0px;
top: -3px;
padding: 0px;
background: #3cc353;
padding: 3px;
border-radius: 60%;
font-size: 10px;
color: #fff;
content: '';
}
ion-content{
--background:#F5F5F5 ;
}

@ -1,19 +1,80 @@
import { Component, OnInit } from '@angular/core';
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { connectableObservableDescriptor } from 'rxjs/internal/observable/ConnectableObservable';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { OfferDiscountService } from '../services/service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
export class HomeComponent implements AfterViewInit {
segment: any = '1';
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
categoriesObj: any;
categories: any = [];
offersData: any = [];
activeClass: any;
tempSearch: any = [];
searchText: String;
constructor(public ts: TranslatorService, public cs: CommonService, public offersService: OfferDiscountService) { }
ngAfterViewInit(): void {
this.getOfferDiscount();
}
openDetails(offer) {
this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers);
var related = this.offersData.filter((res) => res.rowID != offer.rowID);
this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers);
openDetails() {
this.cs.navigateForward('/offersdiscount/offer-details');
}
getOfferDiscount() {
this.cs.startLoading();
this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((res) => {
var data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
this.cs.stopLoading();
if (data['result'])
this.displayOffers(data['result']);
});
}
displayOffers(data) {
if (data['data']) {
var parseJSON = data['data'];
var offers = JSON.parse(parseJSON)
this.categoriesObj = this.groupBy(offers, 'categoryName');
this.categories = Object.keys(this.categoriesObj);
this.filterOffers(this.categories[0]);
}
}
groupBy(xs, key) {
return xs.reduce((rv, x) => {
(rv[x[key]] = rv[x[key]] || []).push(x);
return rv;
}, {});
};
filterOffers(key) {
this.activeClass = key;
this.offersData = this.categoriesObj[key];
this.tempSearch = JSON.parse(JSON.stringify(this.offersData));
}
checkDate(date) {
return new Date(date) >= new Date()
}
getDotted(temp) {
return temp.substring(0, 60) + " ...";
}
search(t) {
this.offersData = this.tempSearch.filter((post, index) => {
if (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1)
return true;
});
}
}

@ -2,7 +2,7 @@
<div class="head-title">
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<ion-title color="light" >{{ts.trPK('itemforsale','offersdiscount')}}</ion-title>
</ion-toolbar>
@ -12,27 +12,73 @@
<div>
<ion-card>
<ion-card-header>
<img src="assets/imgs/itemsforsale/furniture.svg" />
<img [src]="details.Banner_Image" />
<ion-card-title>Furniture Table</ion-card-title>
<ion-card-title *ngIf="direction =='ltr'">{{details.Title}}</ion-card-title>
<ion-card-title *ngIf="direction =='rtl'">{{details.Title_AR}}</ion-card-title>
</ion-card-header>
<ion-card-content>
Keep close to Nature's heart... and break clear away, once in awhile,
and climb a mountain or spend a week in the woods. Wash your spirit clean.
<div *ngIf="direction =='ltr'" [innerHTML]="details.Description"> </div>
<div *ngIf="direction =='rtl'" [innerHTML]="details.Description_AR"> </div>
<div class="content-bottom">
<p class="green">Offer Valid</p>
<h1>15% oFF + FREE HOME DELIVERY</h1>
<ion-row [class]="checkDate(details['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(details['End Date']) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="10">
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
<ion-col size="2" *ngIf="checkDate(details['End Date']) ==false">
</ion-col>
</ion-row>
<h1> {{details.Discount}} {{ts.trPK('general','discount')}}</h1>
</div>
<ion-item-divider>
</ion-item-divider>
</ion-card-content>
</ion-card>
</div>
<p class="related-offers">
<strong>
{{ts.trPK('itemforsale','related-offers')}}
</strong>
</p>
<ion-row *ngIf="related">
<ion-col size="6" *ngFor="let item of related">
<ion-card class="related-card">
<ion-card-header>
<img [src]="item.Banner_Image" />
<ion-card-title>{{item.Title}}</ion-card-title>
</ion-card-header>
<ion-card-content>
<div [innerHTML]="getDotted(item.Description)" class='description'></div>
<strong class="dark">
{{item.Discount}} {{ts.trPK('general','discount')}}
</strong>
<ion-row [class]="checkDate(item['End Date']) ==true ? 'green' : 'red'">
<ion-col size="10" *ngIf="checkDate(item['End Date']) ==true">
<p class="offer-valid">{{ts.trPK('general','offer-valid')}}</p>
</ion-col>
<ion-col size="10">
<p class="offer-valid"> {{ts.trPK('general','expired')}}</p>
</ion-col>
<ion-col size="2" *ngIf="checkDate(item['End Date']) ==false">
<ion-icon name="arrow-round-forward"></ion-icon>
</ion-col>
</ion-row>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-content>

@ -18,10 +18,10 @@
}
ion-card-header{
background-color: #fff;
padding: 15px !important;
padding: 10px !important;
}
.content-bottom{
padding: 15px;
padding: 5px;
}
.green{
color:green;
@ -34,4 +34,31 @@ ion-card-header{
}
.details-button ion-button{
--background: #565656;
}
ion-card-title{
margin:10px;
}
ion-card-content{
padding-top:0px;
}
.red{
color:rgb(172, 9, 9)
}
.green{
color:#00AE4D;
}
.related-card{
margin:5px;
}
.related-card ion-card-title{
font-size: 16px;
}
.related-offers{
position: relative;
margin-left: 20px;
font-size: 18px;
}
.description{
height: 55px;
overflow: hidden;
}

@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { OfferDiscountService } from '../services/service';
@Component({
selector: 'app-offer-details',
@ -8,9 +9,21 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
styleUrls: ['./offer-details.component.scss'],
})
export class OfferDetailsComponent implements OnInit {
public details: any;
public direction: String;
public related: any;
constructor(public ts: TranslatorService, public cs: CommonService, public offersService: OfferDiscountService) { }
constructor(public ts: TranslatorService, public cs: CommonService,) { }
ngOnInit() { }
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.details = this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false);
this.related = this.cs.sharedService.getSharedData(OfferDiscountService.related_offers, false);
}
checkDate(date) {
return new Date(date) >= new Date()
}
getDotted(temp) {
return temp.substring(0, 75) + " ...";
}
}

@ -9,6 +9,7 @@ import { OffersdiscountPage } from './offersdiscount.page';
import { HomeComponent } from './home/home.component';
import { OfferDetailsComponent } from './offer-details/offer-details.component';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { OfferDiscountService } from './services/service';
const routes: Routes = [
@ -38,6 +39,7 @@ const routes: Routes = [
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent]
declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent],
providers: [OfferDiscountService]
})
export class OffersdiscountPageModule { }

@ -0,0 +1,30 @@
import { Injectable } from '@angular/core';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
@Injectable({
providedIn: 'root'
})
export class OfferDiscountService {
public static offersDiscountData = 'Services/COCWS.svc/REST/GetOfferDiscountsConfigData';
public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
public static selected_offers = 'selected-offers';
public static related_offers = 'related-offers';
constructor(
public con: ConnectorService,
private authService: AuthenticationService,
public cs: CommonService
) {
this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false);
}
getOffers(offer_request, onError, errorLabel) {
var request = this.authService.getAuthenticatedRequest();
request['EmployeeNumber'] = request.UserName;
return this.con.postNoLoad(OfferDiscountService.offersDiscountData, request, onError, errorLabel);
}
}

@ -225,6 +225,18 @@
"en": "Offers & Discount",
"ar": "العروض والخصومات"
},
"discount": {
"en": "Discount",
"ar": "خصم"
},
"offer-valid": {
"en": "Offer Valid",
"ar": "العرض صالح"
},
"expired": {
"en": "Offer Expired",
"ar": "انتهى العرض"
},
"not-now": {
"en": "not now",
"ar": "لاحقاً"
@ -361,9 +373,9 @@
"en": "Nationality",
"ar": "الجنسية"
},
"religion":{
"en":"Religion",
"ar":"الديانة"
"religion": {
"en": "Religion",
"ar": "الديانة"
},
"empty": {
"en": "Sorry no data avaiable",
@ -961,49 +973,49 @@
"en": "We appreciate you for completing the service of",
"ar": "نحن نقدر لك استكمال خدمة"
},
"basic-details":{
"en":"Basic Details",
"ar":"المعلومات الاساسية"
"basic-details": {
"en": "Basic Details",
"ar": "المعلومات الاساسية"
},
"full-name":{
"en":"Full Name",
"ar":"الاسم كامل"
"full-name": {
"en": "Full Name",
"ar": "الاسم كامل"
},
"marital-status":{
"en":"Marital Status",
"ar":"الاحالة الاجتماعية"
"marital-status": {
"en": "Marital Status",
"ar": "الاحالة الاجتماعية"
},
"civil-identity-number":{
"en":"Civil identity number",
"ar":"رقم الهوية المدنية"
"civil-identity-number": {
"en": "Civil identity number",
"ar": "رقم الهوية المدنية"
},
"effective-date":{
"en":"Effective Date",
"ar":"تاريخ الفعالية "
"effective-date": {
"en": "Effective Date",
"ar": "تاريخ الفعالية "
},
"gender":{
"en":"Gender",
"ar":"النوع"
"gender": {
"en": "Gender",
"ar": "النوع"
},
"education-level":{
"en":"Education Level",
"ar":"المستوى التعليمي"
"education-level": {
"en": "Education Level",
"ar": "المستوى التعليمي"
},
"main-address":{
"en":"Main Address",
"ar":"العنوان الرئيسي"
"main-address": {
"en": "Main Address",
"ar": "العنوان الرئيسي"
},
"correct-or-complete":{
"en":"correct or complete the current details",
"ar":"تعديل او اكمال التفاصيل الحالية"
"correct-or-complete": {
"en": "correct or complete the current details",
"ar": "تعديل او اكمال التفاصيل الحالية"
},
"new-info":{
"en":"enter new Information because of a real change to the current details (e.g because of a change in marital status)",
"ar":"أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية)"
"new-info": {
"en": "enter new Information because of a real change to the current details (e.g because of a change in marital status)",
"ar": "أدخل معلومات جديدة بسبب تغيير حقيقي في التفاصيل الحالية (على سبيل المثال بسبب تغيير في الحالة الاجتماعية)"
},
"type-of-change":{
"en":" Select the type of change you want to make.",
"ar":" حدد نوع التغيير الذي تريد القيام به."
"type-of-change": {
"en": " Select the type of change you want to make.",
"ar": " حدد نوع التغيير الذي تريد القيام به."
}
},
"home": {
@ -1295,61 +1307,61 @@
"en": "Profile Photo changed successfully ",
"ar": "تم تغيير الصورة الشخصية بنجاح"
},
"personal-informaion":{
"en":"Personal Informaion",
"ar":"المعلومات الشخصية"
"personal-informaion": {
"en": "Personal Informaion",
"ar": "المعلومات الشخصية"
},
"family-name":{
"en":"Family Name",
"ar":"اسم العائلة"
"family-name": {
"en": "Family Name",
"ar": "اسم العائلة"
},
"preferred-name":{
"en":"Preferred Name",
"ar":"الاسم المفضل"
"preferred-name": {
"en": "Preferred Name",
"ar": "الاسم المفضل"
},
"previous-family-name":{
"en":"Previous Family Name",
"ar":"اسم العائلة السابق"
"previous-family-name": {
"en": "Previous Family Name",
"ar": "اسم العائلة السابق"
},
"father-name":{
"en":"Father Name<",
"ar":"اسم الاب"
"father-name": {
"en": "Father Name<",
"ar": "اسم الاب"
},
"grand-father-name":{
"en":"GrandFather Name",
"ar":"اسم الجد"
"grand-father-name": {
"en": "GrandFather Name",
"ar": "اسم الجد"
},
"arabic-first-name":{
"en":"Arabic First Name",
"ar":"الاسم الاول بالعربي"
"arabic-first-name": {
"en": "Arabic First Name",
"ar": "الاسم الاول بالعربي"
},
"arabic-father-name":{
"en":"Arabic Father Name",
"ar":"اسم الاب بالعربي"
"arabic-father-name": {
"en": "Arabic Father Name",
"ar": "اسم الاب بالعربي"
},
"arabic-grand-father-name":{
"en":"Arabic GrandFather Name",
"ar":"اسم الجد بالعربي"
"arabic-grand-father-name": {
"en": "Arabic GrandFather Name",
"ar": "اسم الجد بالعربي"
},
"street":{
"en":"Street",
"ar":"شارع"
"street": {
"en": "Street",
"ar": "شارع"
},
"area":{
"en":"Area",
"ar":"المنطقة"
"area": {
"en": "Area",
"ar": "المنطقة"
},
"p-o-box":{
"en":"P.O Box",
"ar":"صندوق البريد"
"p-o-box": {
"en": "P.O Box",
"ar": "صندوق البريد"
},
"city":{
"en":"City",
"ar":"المدينة"
"city": {
"en": "City",
"ar": "المدينة"
},
"postal-code":{
"en":"Postal Code",
"ar":"الرمز البريدي"
"postal-code": {
"en": "Postal Code",
"ar": "الرمز البريدي"
}
},
"changePassword": {
@ -2945,6 +2957,10 @@
"en": "Item for sale",
"ar": "سلعه للبيع"
},
"related-offers": {
"en": "Related offers",
"ar": "العروض ذات الصلة"
},
"my-posted-ad": {
"en": "My Posted Ads",
"ar": "إعلاناتي المنشورة"

Loading…
Cancel
Save