Refacturation of the notifications route

This commit is contained in:
Eudes Inácio
2021-02-03 15:13:23 +01:00
parent ee949e5a41
commit 71bc6f9dcc
599 changed files with 172410 additions and 74251 deletions
+22 -17
View File
@@ -13,7 +13,7 @@ import { Plugins, PushNotification, PushNotificationToken, PushNotificationActio
import { Router } from '@angular/router';
import { MethodCall } from '@angular/compiler';
const { PushNotifications, LocalNotifications } = Plugins;
const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins;
@Component({
selector: 'app-home',
@@ -74,7 +74,7 @@ export class HomePage implements OnInit {
'pushNotificationReceived',
(notification: PushNotification) => {
//alert('Push received: ' + JSON.stringify(notification));
//this.localNotificationPresent(notification);
this.localNotificationPresent(notification);
},
);
@@ -92,28 +92,30 @@ export class HomePage implements OnInit {
console.log('FOLDER PROCESS', folder.ProcessId)
if (service != null) {
//if (service != null) {
if (service === "events") {
if (service === "agenda") {
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") {
} 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") {
this.viewPublications(idObject)
} else if (service === "accoes" && object === "publicacao") {
this.viewPublicationDetail(idObject)
}
} else {
/*} else {
if (processId || publicationId != null) {
this.viewPublicationDetail(processId, publicationId)
this.viewPublicationDetail(idObject)
}
if (notification.notification.data.folder.ProcessId != null) {
this.viewPublications(folder)
this.viewPublications(idObject)
}
}
}*/
@@ -152,6 +154,8 @@ export class HomePage implements OnInit {
async localNotificationPresent(notification) {
LocalNotificationAction.
LocalNotifications.schedule({
notifications: [
{
@@ -162,7 +166,8 @@ export class HomePage implements OnInit {
sound: null,
attachments: null,
actionTypeId: "",
extra: null
extra: null,
foreground: true,
}
]
});
@@ -190,12 +195,11 @@ export class HomePage implements OnInit {
async viewPublicationDetail(processId: string, publicationId: string) {
async viewPublicationDetail(folderId) {
const modal = await this.modalController.create({
component: PublicationDetailPage,
componentProps: {
publicationId: publicationId,
folderId: processId,
folderId: folderId,
},
cssClass: 'publication-detail',
backdropDismiss: false
@@ -204,14 +208,15 @@ export class HomePage implements OnInit {
modal.onDidDismiss();
}
async viewPublications(folder) {
async viewPublications(folderId) {
const modal = await this.modalController.create({
component: ViewPublicationsPage,
/* enterAnimation,
leaveAnimation, */
componentProps: {
item: folder,
item: folderId,
},
cssClass: 'new-action',
backdropDismiss: false