diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index e357617fb..defa0d664 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -33,11 +33,14 @@ {{notificationdata.length}} novas notificações
+ *ngFor = "let item of notificationdata; let i = index" + (click)="notificatinsRoutes(item.Service,item.Object,item.IdObject,item.FolderId)" + >
+

{{item.dateInit}}

diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 2e9669a8d..a7e5a3a73 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -1,7 +1,7 @@ /// /// -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Component, OnInit,NgZone } from '@angular/core'; +import { Router,NavigationExtras } from '@angular/router'; import { AnimationController, ModalController } from '@ionic/angular'; import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; @@ -30,7 +30,8 @@ export class ProfilePage implements OnInit { private router: Router, private localstoreService: LocalstoreService, private jsonstore: JsonStore, - private storageservice: StorageService + private storageservice: StorageService, + private zone: NgZone, ) { this.loggeduser = authService.ValidatedUser; @@ -76,6 +77,58 @@ export class ProfilePage implements OnInit { notImplemented() { } + notificatinsRoutes = (Service,Object,IdObject,FolderId) => { + if (Service === "agenda") { + this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda'])); + } + else if (Service === "gabinete-digital" && Object === "expediente") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',IdObject,'gabinete-digital'])); + } + else if (Service === "gabinete-digital" && Object === "event-list") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'gabinete-digital'])); + }else if (Service === "gabinete-digital" && Object === "despachos") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',IdObject,'gabinete-digital'],{replaceUrl: true})); + } + else if (Service === "gabinete-digital" && Object === "parecer") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital'])); + } + else if (Service === "gabinete-digital" && Object === "deferimento") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',IdObject,'gabinete-digital'])); + } + else if (Service === "gabinete-digital" && Object === "despachos-pr") { + + let navigationExtras: NavigationExtras = { + queryParams: { + "serialNumber": IdObject, + } + }; + this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras)); + } + else if (Service === "accoes" && Object === "accao") { + this.zone.run(() => this.router.navigate(['/home/publications',IdObject])); + } + else if (Service === "accoes" && Object === "publicacao") { + this.zone.run(() => this.router.navigate(['/home/publications/view-publications',FolderId,IdObject])); + } + else if (Service === "gabinete-digital" && Object === "diplomas") { + this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital'])); + } + else if (Service === "gabinete-digital" && Object === "diplomas-assinar") { + let navigationExtras: NavigationExtras = { + queryParams: { + "serialNumber": IdObject, + } + }; + this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras)); + } + else if (Service === "gabinete-digital" && Object === "expedientes-pr") { + this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/expedientes-pr',IdObject,'gabinete-digital'])); + } + } + logout() { // clear local storage window.localStorage.clear();