fixed business card issue

MOHEMM-Q3-DEV-LATEST
umasoodch 4 years ago
parent 67089be74f
commit ff95ad7c36

@ -10,7 +10,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
}) })
export class BusinessCardComponent implements OnInit { export class BusinessCardComponent implements OnInit {
@Input() userInfo: any; public userInfo: any;
public userJobName: any; public userJobName: any;
constructor( constructor(
public modalCtrl: ModalController, public modalCtrl: ModalController,
@ -19,6 +19,7 @@ export class BusinessCardComponent implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo); console.log(this.userInfo);
} }

@ -475,11 +475,12 @@ export class ConfirmLoginComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
checkAccess(el: any, isDigitalID = false, buttonType?) { checkAccess(el: any, isDigitalID = false, buttonType?, isBusinessID = false,) {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
if (isDigitalID) { if (isDigitalID || isBusinessID) {
const sourceType = isDigitalID === true ? 'digitalID' : 'businessID';
this.button(); this.button();
this.checkButtonType(buttonType); this.checkButtonType(buttonType, sourceType);
} }
else { else {
console.log(data); console.log(data);
@ -497,7 +498,7 @@ export class ConfirmLoginComponent implements OnInit {
} }
} }
checkButtonType(typeNumber) { checkButtonType(typeNumber, sourceType) {
let buttonSelected; let buttonSelected;
this.buttons.forEach(element => { this.buttons.forEach(element => {
element.forEach(elementValue => { element.forEach(elementValue => {
@ -508,7 +509,11 @@ export class ConfirmLoginComponent implements OnInit {
} }
}); });
}); });
this.sharedData.setSharedData(true, "loginWithDigitalIDButton"); if (sourceType === 'digitalID') {
this.sharedData.setSharedData(true, "loginWithDigitalIDButton");
} else {
this.sharedData.setSharedData(true, "loginWithBusinessIDButton");
}
this.loginType = buttonSelected; this.loginType = buttonSelected;
this.checkAppUpdated(); this.checkAppUpdated();
} }

@ -142,7 +142,7 @@ export class AuthenticationService {
} else { } else {
mobileType = 'android'; mobileType = 'android';
} }
request.VersionID = 3.1; request.VersionID = 3.2;
request.Channel = 31; request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType; request.MobileType = mobileType;

@ -59,7 +59,7 @@
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-button *ngIf="userBusiness?.show_business && showBusinessCard" class="button-digital-id" (click)="openBusinessCard()"> <ion-button *ngIf="showBusinessCard" class="button-digital-id" (click)="loginWithBusinessCard()">
<p style="color: black;">{{ts.trPK('general','business-card')}}</p> <p style="color: black;">{{ts.trPK('general','business-card')}}</p>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png"> <img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button> </ion-button>

@ -17,7 +17,6 @@ import { ButtonSettings } from '../button/models/button-settingsl';
import { Events, ModalController } from '@ionic/angular'; import { Events, ModalController } from '@ionic/angular';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component"; import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component";
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({ @Component({
selector: "welcome-login", selector: "welcome-login",
@ -97,11 +96,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
console.log( "this.user in welcome login"+ JSON.stringify(this.user)); console.log( "this.user in welcome login"+ JSON.stringify(this.user));
// if (this.user && this.user.BusinessCardPrivilege) { if (this.user && this.user.BusinessCardPrivilege) {
// this.showBusinessCard = true this.showBusinessCard = true
// } else { } else {
// this.showBusinessCard = false; this.showBusinessCard = false;
// } }
this.userName = localStorage.getItem("user"); this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password");
@ -111,6 +110,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.lastLoginDate= localStorage.getItem("login-at"); this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info')); this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('userBusiness' + this.userBusiness);
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false); // this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -236,7 +236,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
} }
loginWithDigitalID(){ loginWithDigitalID(){
this.confimLogin.checkAccess(this.logintype, true, this.logintype); this.confimLogin.checkAccess(this.logintype, true, this.logintype, false);
}
loginWithBusinessCard() {
this.confimLogin.checkAccess(this.logintype, false, this.logintype, true);
} }
@ -261,16 +265,4 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
return await modal.present(); return await modal.present();
} }
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.userBusiness
}
});
return await modal.present();
}
} }

@ -40,6 +40,7 @@ import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'
import { NFC, Ndef } from "@ionic-native/nfc/ngx" import { NFC, Ndef } from "@ionic-native/nfc/ngx"
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component'; import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -167,6 +168,7 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true); let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
let openBusinessCard = this.sharedData.getSharedData("loginWithBusinessIDButton", true);
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header'); this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule'); this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');
@ -175,9 +177,11 @@ export class HomePage implements OnInit {
this.events.subscribe('getNotCount', badge => { this.events.subscribe('getNotCount', badge => {
this.notBadge = badge; this.notBadge = badge;
}); });
if (openDigitalIDCard === true) { if (openDigitalIDCard) {
console.log("DONE"); console.log("DONE");
this.openDigitalId(); this.openDigitalId();
} else if (openBusinessCard) {
this.openBusinessCard();
} }
} }
@ -787,6 +791,16 @@ export class HomePage implements OnInit {
}); });
return await modal.present(); return await modal.present();
} }
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css'
});
return await modal.present();
}
itemForSale() { itemForSale() {
this.common.navigateForward('/itemforsale/items'); this.common.navigateForward('/itemforsale/items');
} }

Loading…
Cancel
Save