mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Direct Update working
This commit is contained in:
+13
-17
@@ -4,7 +4,7 @@ import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { EventsService } from '../services/events.service';
|
||||
import { Event } from '../models/event.model';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, AlertController } from '@ionic/angular';
|
||||
//import { AlertController } from 'ionic-angular';
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
|
||||
import { Router } from '@angular/router';
|
||||
@@ -25,7 +25,7 @@ export class HomePage implements OnInit {
|
||||
totalExpediente = 0;
|
||||
profile: string;
|
||||
|
||||
constructor(private zone: NgZone,private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController) {
|
||||
constructor(private zone: NgZone,private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController, public alertCtrl: AlertController) {
|
||||
|
||||
router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e)=>e.remove())
|
||||
@@ -135,6 +135,7 @@ export class HomePage implements OnInit {
|
||||
(response) => {
|
||||
// Will display "Hello world" in an alert dialog.
|
||||
alert("Success: " + response.responseText);
|
||||
|
||||
this.MFPushNotification()
|
||||
},
|
||||
(error) => {
|
||||
@@ -188,35 +189,30 @@ export class HomePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/* securityCheck() {
|
||||
securityCheck() {
|
||||
|
||||
var PincodeChallengeHandler = WL.Client.createSecurityCheckChallengeHandler("UserLogin");
|
||||
this.registerChallengeHandler(PincodeChallengeHandler);
|
||||
this.registerChallengeHandler();
|
||||
|
||||
}
|
||||
|
||||
registerChallengeHandler(PincodeChallengeHandler) {
|
||||
PincodeChallengeHandler = WL.Client.createSecurityCheckChallengeHandler("PinCodeAttempts");
|
||||
registerChallengeHandler() {
|
||||
alert('--> Pi called');
|
||||
let PincodeChallengeHandler = WL.Client.createSecurityCheckChallengeHandler("PinCodeAttempts");
|
||||
PincodeChallengeHandler.handleChallenge = ((challenge: any) => {
|
||||
console.log('--> PincodeChallengeHandler.handleChallenge called');
|
||||
alert('--> PincodeChallengeHandler.handleChallenge called');
|
||||
this.displayLoginChallenge(challenge, PincodeChallengeHandler);
|
||||
});
|
||||
}
|
||||
|
||||
displayLoginChallenge(response, PincodeChallengeHandler) {
|
||||
async 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',
|
||||
const prompt = await this.alertCtrl.create({
|
||||
header: 'MFP Gateway',
|
||||
message: msg,
|
||||
inputs: [
|
||||
{
|
||||
name: 'username',
|
||||
placeholder: 'please enter the name',
|
||||
type: 'clientid'
|
||||
},
|
||||
{
|
||||
name: 'pin',
|
||||
placeholder: 'please enter the pincode',
|
||||
@@ -245,7 +241,7 @@ export class HomePage implements OnInit {
|
||||
]
|
||||
});
|
||||
prompt.present();
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
function wlCommonInit() {
|
||||
|
||||
WLAuthorizationManager.obtainAccessToken()
|
||||
|
||||
.then(
|
||||
|
||||
function (accessToken) {
|
||||
alert('Index sucsse: ', accessToken)
|
||||
|
||||
},
|
||||
|
||||
function (error) {
|
||||
alert('Index error: ', error)
|
||||
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@ function wlCommonInit(){
|
||||
wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData, directUpdateContext) {
|
||||
// Create a dialog.
|
||||
navigator.notification.confirm(
|
||||
'Custom dialog body text',
|
||||
'Actualização Disponivel',
|
||||
// Handle dialog buttons.
|
||||
function(buttonIndex) {
|
||||
if (buttonIndex == 1) {
|
||||
@@ -14,8 +14,8 @@ function wlCommonInit(){
|
||||
wl_directUpdateChallengeHandler.submitFailure();
|
||||
}
|
||||
},
|
||||
'Custom dialog title text',
|
||||
['Update']
|
||||
'ctualização Disponivel',
|
||||
['Actualizar']
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
<base href="/" />
|
||||
|
||||
<script src="assets/js/index.js"></script>
|
||||
<script src="assets/js/wldirectudpate.js"></script>
|
||||
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-hight, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
|
||||
Reference in New Issue
Block a user