mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Refacturation of the notifications route
This commit is contained in:
+22
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user