Custom Ui direct update

This commit is contained in:
Eudes Inácio
2021-04-07 09:13:07 +01:00
parent a84fdfee68
commit 116db6e8d3
6 changed files with 125 additions and 4 deletions
+63
View File
@@ -5,6 +5,7 @@ import { EventsService } from '../services/events.service';
import { Event } from '../models/event.model';
import { ProcessesService } from '../services/processes.service';
import { ModalController } from '@ionic/angular';
//import { AlertController } from 'ionic-angular';
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
import { Router } from '@angular/router';
@@ -33,6 +34,7 @@ export class HomePage implements OnInit {
}
ngOnInit() {
//this.securityCheck()
this.mobileFirstTest()
/* //Initialize profile as mdgpr
@@ -186,6 +188,67 @@ export class HomePage implements OnInit {
}
/* securityCheck() {
var PincodeChallengeHandler = WL.Client.createSecurityCheckChallengeHandler("UserLogin");
this.registerChallengeHandler(PincodeChallengeHandler);
}
registerChallengeHandler(PincodeChallengeHandler) {
PincodeChallengeHandler = WL.Client.createSecurityCheckChallengeHandler("PinCodeAttempts");
PincodeChallengeHandler.handleChallenge = ((challenge: any) => {
console.log('--> PincodeChallengeHandler.handleChallenge called');
this.displayLoginChallenge(challenge, PincodeChallengeHandler);
});
}
displayLoginChallenge(response, PincodeChallengeHandler) {
if (response.errorMsg) {
var msg = response.errorMsg + ' <br> Remaining attempts: ' + response.remainingAttempts;
console.log('--> displayLoginChallenge ERROR: ' + msg);
}
let prompt = this.alertCtrl.create({
title: 'MFP Gateway',
message: msg,
inputs: [
{
name: 'username',
placeholder: 'please enter the name',
type: 'clientid'
},
{
name: 'pin',
placeholder: 'please enter the pincode',
type: 'password'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('PincodeChallengeHandler: Cancel clicked');
PincodeChallengeHandler.Cancel();
prompt.dismiss();
return false
}
},
{
text: 'Ok',
handler: data => {
console.log('PincodeChallengeHandler', data.username);
PincodeChallengeHandler.submitChallengeAnswer(data);
}
}
]
});
prompt.present();
} */
/* async openApproveModal(eventSerialNumber){
const modal = await this.modalController.create({
component: ApproveEventModalPage,