This commit is contained in:
2021-02-26 16:09:53 +01:00
1567 changed files with 517137 additions and 4836 deletions
+78 -79
View File
@@ -9,10 +9,18 @@ import { ExpedienteDetailPage } from '../../app/pages/gabinete-digital/expedient
import { ViewEventPage } from '../../app/pages/agenda/view-event/view-event.page'
import { ApproveEventModalPage } from '../../app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page';
<<<<<<< HEAD
import { Plugins, PushNotificationActionPerformed } from '@capacitor/core';
=======
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
>>>>>>> 942d9528e40c789acd71990ac4a7388602c16e67
import { Router } from '@angular/router';
<<<<<<< HEAD
const { PushNotifications, LocalNotificationAction } = Plugins;
=======
/* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */
>>>>>>> 942d9528e40c789acd71990ac4a7388602c16e67
@Component({
selector: 'app-home',
@@ -28,12 +36,16 @@ export class HomePage implements OnInit {
totalExpediente = 0;
profile: string;
<<<<<<< HEAD
windowsWidth = window.innerWidth;
constructor(private ngZone: 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,) { }
>>>>>>> 942d9528e40c789acd71990ac4a7388602c16e67
ngOnInit() {
//Initialize profile as mdgpr
/* //Initialize profile as mdgpr
let date = new Date();
date.setMonth(date.getMonth() + 1);
@@ -57,21 +69,6 @@ export class HomePage implements OnInit {
this.processesbackend.GetTasksList("Expediente", true).subscribe(result => {
this.totalExpediente = result;
});
/*
(PushNotifications as any).requestPermission().then(result => {
PushNotifications.register();
});
PushNotifications.addListener(
'registration',
(token: PushNotificationToken) => {
alert('Push registration success, token: ' + token.value);
console.log('FIREBASE: ', token.value)
this.storageService.store(this.username,token.value);
},
);
console.log(this.storageService.get(this.username)) */
PushNotifications.addListener('registrationError', (error: any) => {
alert('Error on registration: ' + JSON.stringify(error));
@@ -80,7 +77,7 @@ export class HomePage implements OnInit {
PushNotifications.addListener('pushNotificationReceived', notification => {
//const isPushNotification = !!notification.title || !!notification.body;
// if this is a push notification received when the app is in the foreground on Android
//if (isAndroid && isPushNotification) {
@@ -103,27 +100,6 @@ export class HomePage implements OnInit {
console.log('Object: ', object);
console.log('idObject: ', idObject);
/* if (service === "events") {
this.router.navigate(['/home/', service, idObject, 'home']);
} else if (service === "agenda") {
this.router.navigate(['/home/', service, idObject, 'home']);
} else if (service === "gabinete-digital" && object != "expediente") {*/
// this.router.navigate(['/home/', service]);
// }
//if (service != null) {
/*const routeValue = {
"agenda": this.router.navigate(['/home/', service, idObject, 'home']),
"gabinete-digital": this.router.navigate(['/home/', service]),
"accoes": this.viewExpedientDetail(idObject),
}
const route = routeValue[service] && object ;
service = "agenda" ? this.router.navigate(['/home/', service, idObject, 'home']) : */
if (service === "agenda") {
//this.router.navigate(['/home/', service, idObject, 'home']);
this.viewEventDetail(idObject)
@@ -132,7 +108,7 @@ export class HomePage implements OnInit {
this.viewExpedientDetail(idObject)
}
else if (service === "gabinete-digital" && object === "event-list") {
/* this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', idObject])}) */
// this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', idObject])})
this.openApproveModal(idObject);
}
else if (service === "accoes" && object === "accao") {
@@ -142,42 +118,11 @@ export class HomePage implements OnInit {
this.viewPublicationDetail(idObject)
}
/*switch (service) {
case "events":
this.router.navigate(['/home/', service, idObject, 'home']);
break;
case "agenda":
this.router.navigate(['/home/', service, idObject, 'home']);
break;
case "gabinete-digital":
this.router.navigate(['/home/', service]);
break;
case "gabinete-digital-expediente":
this.router.navigate(['/home/gabinete-digital/', object, idObject, 'home']);
break;
case "": {
if(publicationId && processId != null) {
this.viewPublicationDetail(publicationId,processId)
}
if (folder.ProcessId != null) {
this.viewPublications(folder)
}
}
default:
this.router.navigate(['/home/']);
}*/
},
);
); */
}
<<<<<<< HEAD
@@ -199,8 +144,43 @@ export class HomePage implements OnInit {
foreground: true,
}
]
=======
/* mobileFirstTest() {
this.zone.run(() => {
alert("Hello MobileFirst");
alert("Connecting to Server...");
>>>>>>> 942d9528e40c789acd71990ac4a7388602c16e67
});
}
WLAuthorizationManager.obtainAccessToken("").then(
(token) => {
console.log('--> pingMFP(): Success ', token);
this.zone.run(() => {
alert("Yay!");
alert("Connected to MobileFirst Server");
});
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
WLResourceRequest.GET
);
resourceRequest.setQueryParameter("name", "world");
resourceRequest.send().then(
(response) => {
// Will display "Hello world" in an alert dialog.
alert("Success: " + response.responseText);
},
(error) => {
alert("Failure: " + JSON.stringify(error));
}
);
}, (error) => {
console.log('--> pingMFP(): failure ', error.responseText);
this.zone.run(() => {
alert("Bummer...");
alert("Failed to connect to MobileFirst Server");
});
}
);
} */
async openApproveModal(eventSerialNumber){
const modal = await this.modalController.create({
@@ -231,12 +211,33 @@ export class HomePage implements OnInit {
modal.onDidDismiss();
}
async viewExpedientDetail(serialNumber:any) {
/* async viewExpedientDetail(serialNumber:any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: eventId,
},
cssClass: 'modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res) => {
if (res) {
console.log(res);
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
});
}
async viewExpedientDetail(serialNumber: any) {
console.log(this.profile);
console.log("Expediente id: ", serialNumber);
const modal = await this.modalController.create({
component: ExpedienteDetailPage,
componentProps:{
componentProps: {
serialNumber: serialNumber,
profile: this.profile,
},
@@ -245,7 +246,7 @@ export class HomePage implements OnInit {
});
await modal.present();
modal.onDidDismiss();
}
} */
@@ -263,8 +264,6 @@ export class HomePage implements OnInit {
}
async viewPublications(folderId) {
const modal = await this.modalController.create({
component: ViewPublicationsPage,
/* enterAnimation,