mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Notificaion route for event aprovoal added
This commit is contained in:
@@ -68,6 +68,19 @@ const routes: Routes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'agenda',
|
||||
children: [
|
||||
{
|
||||
path:'evento',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.page').then(m => m.EventListPage)
|
||||
},
|
||||
{
|
||||
path:':eventId/:caller',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page').then(m => m.ApproveEventModalPage),
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'gabinete-digital',
|
||||
children: [
|
||||
|
||||
+26
-19
@@ -9,6 +9,7 @@ import { PublicationDetailPage } from '../../app/pages/publications/view-publica
|
||||
import { ViewPublicationsPage } from '../../app/pages/publications/view-publications/view-publications.page';
|
||||
import { ExpedienteDetailPage } from '../../app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'
|
||||
import { ViewEventPage } from '../../app/pages/agenda/view-event/view-event.page'
|
||||
import { ApproveEventModalPage } from '../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page'
|
||||
|
||||
import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -79,18 +80,7 @@ export class HomePage implements OnInit {
|
||||
//if (isAndroid && isPushNotification) {
|
||||
|
||||
// We schedule a LocalNotification 1 second later since Capacitor for Android doesn't show anything in this case
|
||||
LocalNotifications.schedule({
|
||||
notifications: [{
|
||||
title: notification.title,
|
||||
body: notification.body,
|
||||
id: new Date().getUTCMilliseconds(),
|
||||
schedule: {
|
||||
at: new Date(Date.now() + 1000)
|
||||
},
|
||||
extra: notification.data,
|
||||
channelId: 'pop-notifications'
|
||||
}]
|
||||
});
|
||||
console.log('Recived: ', notification)
|
||||
//}
|
||||
});
|
||||
|
||||
@@ -98,11 +88,11 @@ export class HomePage implements OnInit {
|
||||
PushNotifications.addListener(
|
||||
'pushNotificationActionPerformed',
|
||||
(notification: PushNotificationActionPerformed) => {
|
||||
let service = notification.notification.data.service;
|
||||
let object = notification.notification.data.object;
|
||||
let idObject = notification.notification.data.idObject;
|
||||
let service = notification.notification.data.Service;
|
||||
let object = notification.notification.data.Object;
|
||||
let idObject = notification.notification.data.IdObject;
|
||||
|
||||
console.log('Complete Object: ', notification )
|
||||
console.log('Complete Object: ', notification.notification )
|
||||
|
||||
console.log('Service: ', service);
|
||||
console.log('Object: ', object);
|
||||
@@ -129,14 +119,16 @@ export class HomePage implements OnInit {
|
||||
|
||||
service = "agenda" ? this.router.navigate(['/home/', service, idObject, 'home']) : */
|
||||
|
||||
if (service === "agenda") {
|
||||
if (service === "agenda" && object != "evento") {
|
||||
//this.router.navigate(['/home/', service, idObject, 'home']);
|
||||
this.viewEventDetail(idObject)
|
||||
} else if (service === "gabinete-digital" && object != "expediente") {
|
||||
} else if (service === "agenda" && object === "evento") {
|
||||
this.router.navigate(['/home/', service, idObject, 'home']);
|
||||
} else if (service === "gabinete-digital" && object != "expediente") {
|
||||
this.router.navigate(['/home/', service]);
|
||||
} else if (service === "gabinete-digital" && object === "expediente") {
|
||||
this.viewExpedientDetail(idObject)
|
||||
} else if (service === "accoes" && object === "accao") {
|
||||
} else if (service === "accoes" && object === "accao") {
|
||||
this.viewPublications(idObject)
|
||||
} else if (service === "accoes" && object === "publicacao") {
|
||||
this.viewPublicationDetail(idObject)
|
||||
@@ -199,6 +191,21 @@ export class HomePage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async openApproveModal(eventSerialNumber){
|
||||
const modal = await this.modalController.create({
|
||||
component: ApproveEventModalPage,
|
||||
componentProps:{
|
||||
serialNumber: eventSerialNumber,
|
||||
},
|
||||
cssClass: 'cal-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user