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 {
@Input() userInfo: any;
public userInfo: any;
public userJobName: any;
constructor(
public modalCtrl: ModalController,
@ -19,6 +19,7 @@ export class BusinessCardComponent implements OnInit {
) { }
ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo);
}

@ -475,11 +475,12 @@ export class ConfirmLoginComponent implements OnInit {
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);
if (isDigitalID) {
if (isDigitalID || isBusinessID) {
const sourceType = isDigitalID === true ? 'digitalID' : 'businessID';
this.button();
this.checkButtonType(buttonType);
this.checkButtonType(buttonType, sourceType);
}
else {
console.log(data);
@ -497,7 +498,7 @@ export class ConfirmLoginComponent implements OnInit {
}
}
checkButtonType(typeNumber) {
checkButtonType(typeNumber, sourceType) {
let buttonSelected;
this.buttons.forEach(element => {
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.checkAppUpdated();
}

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

@ -59,7 +59,7 @@
</ion-row>
<ion-row>
<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>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button>

@ -17,7 +17,6 @@ import { ButtonSettings } from '../button/models/button-settingsl';
import { Events, ModalController } from '@ionic/angular';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component";
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({
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));
// if (this.user && this.user.BusinessCardPrivilege) {
// this.showBusinessCard = true
// } else {
// this.showBusinessCard = false;
// }
if (this.user && this.user.BusinessCardPrivilege) {
this.showBusinessCard = true
} else {
this.showBusinessCard = false;
}
this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password");
@ -111,6 +110,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('userBusiness' + this.userBusiness);
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -236,7 +236,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
}
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();
}
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 { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({
selector: 'app-home',
@ -167,6 +168,7 @@ export class HomePage implements OnInit {
ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
let openBusinessCard = this.sharedData.getSharedData("loginWithBusinessIDButton", true);
this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');
@ -175,9 +177,11 @@ export class HomePage implements OnInit {
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
if (openDigitalIDCard === true) {
if (openDigitalIDCard) {
console.log("DONE");
this.openDigitalId();
} else if (openBusinessCard) {
this.openBusinessCard();
}
}
@ -787,6 +791,16 @@ export class HomePage implements OnInit {
});
return await modal.present();
}
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css'
});
return await modal.present();
}
itemForSale() {
this.common.navigateForward('/itemforsale/items');
}

Loading…
Cancel
Save