{{msg.u.name}} criou esta reunião
De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}
diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts
index cfacfe5cd..7a37e6a84 100644
--- a/src/app/pages/chat/messages/messages.page.ts
+++ b/src/app/pages/chat/messages/messages.page.ts
@@ -367,10 +367,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
- else {
- let fullUrl = "https://www.tabularium.pt" + url;
- this.fileService.viewDocumentByUrl(fullUrl);
- }
}
docIndex(index: number) {
diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts
index d295e2e60..56971f1d4 100644
--- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts
+++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts
@@ -23,6 +23,7 @@ import { Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-despacho-pr',
@@ -60,7 +61,8 @@ export class DespachoPrPage implements OnInit {
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private platform: Platform,
- public ThemeService: ThemeService
+ public ThemeService: ThemeService,
+ private RouteService: RouteService
) {
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
@@ -99,7 +101,7 @@ export class DespachoPrPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
}
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts
index 92edda048..7eec5849f 100644
--- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts
+++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts
@@ -23,6 +23,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { Platform } from '@ionic/angular';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
@@ -57,7 +58,7 @@ export class DespachoPage implements OnInit {
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private despachoService: DespachoService,
- private location: Location,
+ private RouteService: RouteService,
public p: PermissionService,
private sqliteservice: SqliteService,
private platform: Platform,
@@ -97,7 +98,7 @@ export class DespachoPage implements OnInit {
goBack() {
//this.navigationService.back()
- this.location.back();
+ this.RouteService.goBack();
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
// if (window.innerWidth < 801) {
@@ -173,7 +174,7 @@ export class DespachoPage implements OnInit {
try {
this.goBack()
} catch (e) {
- this.location.back();
+ this.RouteService.goBack();
}
this.toastService.badRequest('Processo não encontrado')
}
diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts
index e4eb59fc6..25f82ab0f 100644
--- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts
+++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts
@@ -10,6 +10,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-diploma-assinar',
@@ -39,7 +40,7 @@ export class DiplomaAssinarPage implements OnInit {
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
- private location: Location,
+ private RouteService: RouteService,
public ThemeService: ThemeService
) {
this.activatedRoute.paramMap.subscribe(params => {
@@ -59,7 +60,7 @@ export class DiplomaAssinarPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
}
async openOptions(taskAction?: any) {
diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts
index 914df88d3..108167cf0 100644
--- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts
+++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts
@@ -16,6 +16,7 @@ import { Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
@@ -47,7 +48,7 @@ export class DiplomaPage implements OnInit {
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
- private location: Location,
+ private RouteService: RouteService,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private platform: Platform,
@@ -76,7 +77,7 @@ export class DiplomaPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
/* if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
if (window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts
index c1d208921..96efa78ed 100644
--- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts
+++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts
@@ -18,7 +18,7 @@ import { BackgroundService } from '../../../../services/background.service';
import { Platform } from '@ionic/angular';
import { ThemeService } from 'src/app/services/theme.service'
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
-
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-approve-event',
@@ -58,7 +58,7 @@ export class ApproveEventPage implements OnInit {
private iab: InAppBrowser,
private animationController: AnimationController,
private toastService: ToastService,
- private location: Location,
+ private RouteService: RouteService,
private sqliteservice: SqliteService,
private platform: Platform,
private backgroundservice: BackgroundService,
@@ -94,7 +94,7 @@ export class ApproveEventPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
/* let navigationExtras: NavigationExtras = {
queryParams: {
"eventos": true,
diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts
index 9344d7087..d4c6f126d 100644
--- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts
+++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts
@@ -13,6 +13,7 @@ import { BackgroundService } from '../../../services/background.service';
import { Platform } from '@ionic/angular';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-event-list',
@@ -44,7 +45,8 @@ export class EventListPage implements OnInit {
private platform: Platform,
private sortService: SortService,
private backgroundservice: BackgroundService,
- public ThemeService: ThemeService
+ public ThemeService: ThemeService,
+ private RouteService: RouteService
) { }
ngOnInit() {
@@ -216,7 +218,7 @@ export class EventListPage implements OnInit {
// this.router.navigate(['/home/gabinete-digital']);
// }
- this.location.back()
+ this.RouteService.goBack()
}
diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
index 7152230da..c1a167d21 100644
--- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts
@@ -32,6 +32,7 @@ import { Platform } from '@ionic/angular';
import { BackgroundService } from 'src/app/services/background.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { DataService } from 'src/app/services/data.service';
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-expediente-detail',
@@ -71,7 +72,7 @@ export class ExpedienteDetailPage implements OnInit {
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
- private location: Location,
+ private RouteService: RouteService,
private attachmentsService: AttachmentsService,
public p: PermissionService,
private taskService: TaskService,
@@ -269,7 +270,7 @@ export class ExpedienteDetailPage implements OnInit {
goBack() {
- this.location.back();
+ this.RouteService.goBack();
/* if(this.task.Status == "Pending" && this.caller != 'events'){
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
index a23d40c14..2fb23be15 100644
--- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
+++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
@@ -21,6 +21,7 @@ import { Location } from '@angular/common';
import { AttachmentList } from 'src/app/models/Excludetask';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-expediente-pr',
@@ -58,7 +59,7 @@ export class ExpedientePrPage implements OnInit {
private animationController: AnimationController,
private toastService: ToastService,
private attachmentsService: AttachmentsService,
- private location: Location,
+ private RouteService: RouteService,
public ThemeService: ThemeService
) {
@@ -94,7 +95,7 @@ export class ExpedientePrPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
/* if(this.task.Status == "Pending" && this.caller != 'events'){
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
index 9ce1fd431..4be65aa5a 100644
--- a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
+++ b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
@@ -13,6 +13,7 @@ import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-expedientes-pr',
@@ -40,7 +41,7 @@ export class ExpedientesPrPage implements OnInit {
private alertService: AlertService,
private authService: AuthService,
private router: Router,
- private location: Location,
+ private RouteService: RouteService,
public ThemeService: ThemeService,
private sortService: SortService,
) {
@@ -131,7 +132,7 @@ export class ExpedientesPrPage implements OnInit {
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
- this.location.back();
+ this.RouteService.goBack();
}
diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts
index a06ecb331..0152cfd80 100644
--- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts
+++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts
@@ -28,7 +28,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
import { ThemeService } from 'src/app/services/theme.service'
import { DataService } from 'src/app/services/data.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
-
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-pedido',
@@ -63,7 +63,7 @@ export class PedidoPage implements OnInit {
private animationController: AnimationController,
private toastService: ToastService,
public p: PermissionService,
- private location: Location,
+ private RouteService: RouteService,
private pedidoService: PedidoService,
private sqliteservice: SqliteService,
private backgroundservices: BackgroundService,
@@ -670,7 +670,7 @@ export class PedidoPage implements OnInit {
}
goBack() {
- this.location.back();
+ this.RouteService.goBack();
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
// if (window.innerWidth <= 700) {
// this.router.navigate(['/home/gabinete-digital/pendentes']);
diff --git a/src/app/pages/publications/new-publication/convertBlobToBase64.worker.js b/src/app/pages/publications/new-publication/convertBlobToBase64.worker.js
new file mode 100644
index 000000000..62fc746e8
--- /dev/null
+++ b/src/app/pages/publications/new-publication/convertBlobToBase64.worker.js
@@ -0,0 +1,13 @@
+convertBlobToBase64 = (blob) => new Promise((resolve, reject) => {
+ const reader = new FileReader;
+ reader.onerror = reject;
+ reader.onload = () => {
+ resolve(reader.result);
+ };
+ reader.readAsDataURL(blob);
+});
+
+onmessage = async function(oEvent) {
+ const result = await convertBlobToBase64(oEvent.data);
+ postMessage(result);
+};
\ No newline at end of file
diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts
index 7c4620165..5d562fdde 100644
--- a/src/app/pages/publications/new-publication/new-publication.page.ts
+++ b/src/app/pages/publications/new-publication/new-publication.page.ts
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
-import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular';
+import { ModalController, NavParams, Platform, LoadingController, PopoverController } from '@ionic/angular';
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
@@ -20,6 +20,7 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera
import { Filesystem, Directory } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress";
+import { PreviewerPage } from 'src/app/modals/previewer/previewer.page';
const IMAGE_DIR = 'stored-images';
interface LocalFile {
@@ -74,9 +75,11 @@ export class NewPublicationPage implements OnInit {
imgResultBeforeCompress: string;
imgResultAfterCompress: string;
+ convertBlobToBase64Worker;
constructor(
private modalController: ModalController,
+ private popoverController: PopoverController,
public photoService: PhotoService,
private navParams: NavParams,
private publications: PublicationsService,
@@ -92,6 +95,10 @@ export class NewPublicationPage implements OnInit {
this.publicationType = this.navParams.get('publicationType');
this.folderId = this.navParams.get('folderId');
this.publicationTitle = 'Nova Publicação';
+
+
+ this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url));
+
}
ngOnInit() {
@@ -106,25 +113,28 @@ export class NewPublicationPage implements OnInit {
// this.takePicture();
}
+ imageUrl;
+
async takePicture() {
+
const capturedImage = await Camera.getPhoto({
quality: 90,
// allowEditing: true,
resultType: CameraResultType.Uri,
source: CameraSource.Camera
});
+
const response = await fetch(capturedImage.webPath!);
+ this.imageUrl = capturedImage.webPath
const blob = await response.blob();
- this.photos.unshift({
- filepath: "soon...",
- webviewPath: capturedImage.webPath
- });
- this.capturedImage = await this.convertBlobToBase64(blob);
- this.capturedImageTitle = new Date().getTime() + '.jpeg';
- //console.log(this.capturedImage);
- }
+ this.convertBlobToBase64Worker.postMessage(blob);
+ this.convertBlobToBase64Worker.onmessage = async (oEvent)=> {
+ this.capturedImage = oEvent.data
+
+ }
+ }
imageSize(image) {
var canvas = document.createElement('canvas');
diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts
index 57f5da6c1..17681b2cc 100644
--- a/src/app/pages/publications/publication-detail/publication-detail.page.ts
+++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts
@@ -9,7 +9,7 @@ import { Location } from '@angular/common';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
-
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-publication-detail',
@@ -28,7 +28,7 @@ export class PublicationDetailPage implements OnInit {
private publications:PublicationsService,
private animationController: AnimationController,
private toastService: ToastService,
- private location: Location,
+ private RouteService: RouteService,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService ) {
@@ -88,7 +88,7 @@ export class PublicationDetailPage implements OnInit {
}
close() {
- this.location.back()
+ this.RouteService.goBack()
}
diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
index 7fb0feba0..15afbe6e2 100644
--- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
+++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
@@ -9,7 +9,7 @@ import { NewPublicationPage } from '../../new-publication/new-publication.page';
import { Location } from '@angular/common';
import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
-
+import { RouteService } from 'src/app/services/route.service';
@Component({
selector: 'app-publication-detail',
@@ -30,7 +30,7 @@ export class PublicationDetailPage implements OnInit {
private toastService: ToastService,
private activatedRoute: ActivatedRoute,
private router: Router,
- private location: Location,
+ private RouteService: RouteService,
public ThemeService: ThemeService
) {
@@ -100,7 +100,7 @@ export class PublicationDetailPage implements OnInit {
this.close()
} else {
// alert('go back')
- this.location.back();
+ this.RouteService.goBack();
}
}
diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html
index e30d9294a..10a12fac7 100644
--- a/src/app/pages/search/search.page.html
+++ b/src/app/pages/search/search.page.html
@@ -177,10 +177,10 @@
-
-
-
{
if (event instanceof NavigationEnd) {
this.history.push(event.urlAfterRedirects)
diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts
index d05b89b07..f2c3d780d 100644
--- a/src/app/services/notifications.service.ts
+++ b/src/app/services/notifications.service.ts
@@ -80,92 +80,92 @@ export class NotificationsService {
}
getTokenByUserIdAndId(user, userID) {
- const geturl = environment.apiURL + 'notifications/user/' + userID;
+ // const geturl = environment.apiURL + 'notifications/user/' + userID;
- return this.http.get(`${geturl}`);
+ // return this.http.get(`${geturl}`);
}
requestPermissions() {
- PushNotifications.requestPermissions().then(result => {
- if (result.receive === 'granted') {
- // Register with Apple / Google to receive push via APNS/FCM
- PushNotifications.register();
- } else {
- // Show some error
- }
- });
+ // PushNotifications.requestPermissions().then(result => {
+ // if (result.receive === 'granted') {
+ // // Register with Apple / Google to receive push via APNS/FCM
+ // PushNotifications.register();
+ // } else {
+ // // Show some error
+ // }
+ // });
}
getAndpostToken(username) {
- if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
- console.log('Notifications not supported')
- } else {
- const geturl = environment.apiURL + 'notifications/token';
- PushNotifications.addListener('registration',
- (token: Token) => {
- console.log('token: ', token.value)
- this.storageService.store(username, token.value);
- this.storageService.get(username).then(value => {
- console.log('STORAGE TOKEN', value)
- this.storageService.get(AuthConnstants.USER).then(res => {
- console.log('USERID', res);
- const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
- const body = {
- UserId: res.UserId,
- TokenId: token.value,
- Status: 1,
- Service: 1
- };
+ // if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
+ // console.log('Notifications not supported')
+ // } else {
+ // const geturl = environment.apiURL + 'notifications/token';
+ // PushNotifications.addListener('registration',
+ // (token: Token) => {
+ // console.log('token: ', token.value)
+ // this.storageService.store(username, token.value);
+ // this.storageService.get(username).then(value => {
+ // console.log('STORAGE TOKEN', value)
+ // this.storageService.get(AuthConnstants.USER).then(res => {
+ // console.log('USERID', res);
+ // const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
+ // const body = {
+ // UserId: res.UserId,
+ // TokenId: token.value,
+ // Status: 1,
+ // Service: 1
+ // };
- this.http.post(`${geturl}`, body, { headers }).subscribe(data => {
- console.log('TOKEN USER MIDLE', data);
- }, (error) => {
- console.log('Post token to backend', error)
- })
- });
+ // this.http.post(`${geturl}`, body, { headers }).subscribe(data => {
+ // console.log('TOKEN USER MIDLE', data);
+ // }, (error) => {
+ // console.log('Post token to backend', error)
+ // })
+ // });
- });
- }
- );
- }
+ // });
+ // }
+ // );
+ // }
}
registrationError() {
- PushNotifications.addListener('registrationError',
- (error: any) => {
- console.log('Error on registration: ' + JSON.stringify(error));
- }
- );
+ // PushNotifications.addListener('registrationError',
+ // (error: any) => {
+ // console.log('Error on registration: ' + JSON.stringify(error));
+ // }
+ // );
}
onReciveForeground() {
- PushNotifications.addListener('pushNotificationReceived',
- (notification: PushNotificationSchema) => {
- console.log('Push received: ' + JSON.stringify(notification));
- this.DataArray.push(notification)
- console.log("On ReceiveNotification", this.DataArray)
- this.storageService.store("Notifications", this.DataArray)
- this.eventtrigger.publishSomeData({
- notification: "recive"
- })
- }
- );
+ // PushNotifications.addListener('pushNotificationReceived',
+ // (notification: PushNotificationSchema) => {
+ // console.log('Push received: ' + JSON.stringify(notification));
+ // this.DataArray.push(notification)
+ // console.log("On ReceiveNotification", this.DataArray)
+ // this.storageService.store("Notifications", this.DataArray)
+ // this.eventtrigger.publishSomeData({
+ // notification: "recive"
+ // })
+ // }
+ // );
}
onReciveBackground() {
- PushNotifications.addListener('pushNotificationActionPerformed',
- (notification: ActionPerformed) => {
- console.log('Push action performed: ' + JSON.stringify(notification));
- /* this.DataArray.push(notification.notification)
- console.log("On ReceiveNotification", this.DataArray)
- this.storageService.store("Notifications", this.DataArray)
- this.eventtrigger.publishSomeData({
- notification: "recive"
- }) */
- this.notificatinsRoutes(notification)
- }
- );
+ // PushNotifications.addListener('pushNotificationActionPerformed',
+ // (notification: ActionPerformed) => {
+ // console.log('Push action performed: ' + JSON.stringify(notification));
+ // /* this.DataArray.push(notification.notification)
+ // console.log("On ReceiveNotification", this.DataArray)
+ // this.storageService.store("Notifications", this.DataArray)
+ // this.eventtrigger.publishSomeData({
+ // notification: "recive"
+ // }) */
+ // this.notificatinsRoutes(notification)
+ // }
+ // );
}
tempClearArray() {
@@ -175,51 +175,51 @@ export class NotificationsService {
notificatinsRoutes = (notification) => {
- console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
+ // console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
- if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
- console.log("Id Lenght", notification.notification.data.IdObject.length)
- this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
- //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
- this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
+ // if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
+ // console.log("Id Lenght", notification.notification.data.IdObject.length)
+ // this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
+ // //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
+ // this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
- } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
+ // } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
- this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
- }
- else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
- this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
+ // this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
+ // }
+ // else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
+ // this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
- }
- else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
- this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
- }
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
+ // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
+ // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
+ // }
}
diff --git a/src/app/services/route.service.spec.ts b/src/app/services/route.service.spec.ts
new file mode 100644
index 000000000..521b710d6
--- /dev/null
+++ b/src/app/services/route.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { RouteService } from './route.service';
+
+describe('RouteService', () => {
+ let service: RouteService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(RouteService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/services/route.service.ts b/src/app/services/route.service.ts
new file mode 100644
index 000000000..d1531e0e6
--- /dev/null
+++ b/src/app/services/route.service.ts
@@ -0,0 +1,52 @@
+import { Injectable } from '@angular/core';
+import { NavigationEnd, Router, NavigationStart } from '@angular/router';
+
+
+@Injectable({
+ providedIn: 'root'
+})
+export class RouteService {
+
+ history: any = [];
+ isGoBack = false;
+
+ constructor(
+ private router: Router,
+ ) {
+ this.router.events.forEach((event) => {
+ if (event instanceof NavigationEnd) {
+
+ const lastRoute = this.history.slice(-1)
+
+ if(event.url != lastRoute) {
+ this.history.push(event.url)
+ }
+
+ }
+ });
+
+ window['RouteService'] = this
+
+ }
+
+ /**
+ * @param url [string] incase no history to go back
+ * @param option [Object] some options to the url
+ */
+ goBack(url = null, option: object = {}) {
+ if(this.history.length >= 2) {
+ this.history.pop();
+ const goTo = this.history.pop();
+ this.isGoBack = true;
+ this.router.navigate([goTo]);
+ } else if(url) {
+ this.goTo({url})
+ }
+
+ }
+
+ goTo({url}) {
+ this.router.navigate([url]);
+ }
+
+}
diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html
index b7ecf060c..d7e9a5d7f 100644
--- a/src/app/shared/agenda/new-event/new-event.page.html
+++ b/src/app/shared/agenda/new-event/new-event.page.html
@@ -29,6 +29,30 @@