mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
comment all capacitor code
This commit is contained in:
@@ -11,11 +11,11 @@ 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';
|
||||
|
||||
import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core';
|
||||
/* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */
|
||||
import { Router } from '@angular/router';
|
||||
import { MethodCall } from '@angular/compiler';
|
||||
|
||||
const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins;
|
||||
/* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -34,7 +34,7 @@ export class HomePage implements OnInit {
|
||||
constructor(private ngZone: NgZone,private eventService: EventsService, private processesbackend: ProcessesService, private router: Router, private modalController: ModalController,) { }
|
||||
|
||||
ngOnInit() {
|
||||
//Initialize profile as mdgpr
|
||||
/* //Initialize profile as mdgpr
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
@@ -58,21 +58,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));
|
||||
@@ -104,27 +89,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)
|
||||
@@ -133,7 +97,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") {
|
||||
@@ -143,61 +107,8 @@ 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/']);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
async localNotificationPresent(notification) {
|
||||
|
||||
LocalNotificationAction.
|
||||
|
||||
LocalNotifications.schedule({
|
||||
notifications: [
|
||||
{
|
||||
title: notification.title,
|
||||
body: notification.body,
|
||||
id: 1,
|
||||
schedule: { at: new Date(Date.now() + 1000) },
|
||||
sound: null,
|
||||
attachments: null,
|
||||
actionTypeId: "",
|
||||
extra: null,
|
||||
foreground: true,
|
||||
}
|
||||
]
|
||||
});
|
||||
); */
|
||||
}
|
||||
|
||||
async openApproveModal(eventSerialNumber){
|
||||
|
||||
Reference in New Issue
Block a user