From cbc505e06f15ba74f9180b4cbc5fb05498a2ec42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Mon, 2 Jan 2023 14:54:50 +0100 Subject: [PATCH 1/2] uncommente notification code and senry --- src/app/app.module.ts | 38 +++++++++++++++---------------- src/app/pages/login/login.page.ts | 2 +- src/main.ts | 34 +++++++++++++-------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index dafcf857e..01b6fe907 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -69,35 +69,35 @@ import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; // The example is using Angular, Import '@sentry/vue' or '@sentry/react' when using a Sibling different than Angular. -/////123//// import * as SentrySibling from '@sentry/angular'; -/////123////import * as Sentry from '@sentry/capacitor'; + import * as SentrySibling from '@sentry/angular'; +import * as Sentry from '@sentry/capacitor'; // The example is using Angular, Import '@sentry/vue' or '@sentry/react' when using a Sibling different than Angular. // For automatic instrumentation (highly recommended) -/////123////import { Integration } from '@sentry/types'; -/////123////import { BrowserTracing } from '@sentry/tracing'; +import { Integration } from '@sentry/types'; +import { BrowserTracing } from '@sentry/tracing'; /* import { FCM } from '@ionic-native/fcm/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ //import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; -/////123//// Sentry.init( -/////123//// { -/////123//// dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', + Sentry.init( + { + dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', // To set your release and dist versions -/////123//// release: 'gabinetedigital@1.0.0', -/////123//// dist: '1', + release: 'gabinetedigital@1.0.0', + dist: '1', // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. -/////123//// tracesSampleRate: 1.0, -/////123//// integrations: [ -/////123//// new BrowserTracing({ -/////123//// tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], -/////123//// }) as Integration, -/////123//// ] -/////123//// }, + tracesSampleRate: 1.0, + integrations: [ + new BrowserTracing({ + tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], + }) as Integration, + ] + }, // Forward the init method to the sibling Framework. -/////123//// SentrySibling.init -/////123////); + SentrySibling.init +); @NgModule({ declarations: [AppComponent], entryComponents: [], @@ -145,7 +145,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ { provide: ErrorHandler, // Attach the Sentry ErrorHandler - /////123////useValue: SentrySibling.createErrorHandler(), + useValue: SentrySibling.createErrorHandler(), }, StatusBar, //SplashScreen, diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index c47615462..b1c0a8d4d 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -164,7 +164,7 @@ export class LoginPage implements OnInit { this.ChatSystemService.loadChat(); } - // this.getToken(); + this.getToken(); if(!this.platform.is('desktop') && !this.platform.is('mobileweb')) { if(this.sessionStore.hasPin) { diff --git a/src/main.ts b/src/main.ts index 0113ed61c..c65fee587 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,35 +8,35 @@ import { defineCustomElements } from '@ionic/pwa-elements/loader'; import "hammerjs"; // HAMMER TIME -/////123////import * as Sentry from '@sentry/capacitor'; +/* import * as Sentry from '@sentry/capacitor'; // The example is using Angular, Import '@sentry/vue' or '@sentry/react' when using a Sibling different than Angular. -/////123////import * as SentrySibling from '@sentry/angular'; +import * as SentrySibling from '@sentry/angular'; // For automatic instrumentation (highly recommended) -/////123//// import { Integration } from '@sentry/types'; -/////123//// import { BrowserTracing } from '@sentry/tracing'; + import { Integration } from '@sentry/types'; + import { BrowserTracing } from '@sentry/tracing'; */ if (environment.production) { enableProdMode(); } -/////123//// Sentry.init( -/////123//// { -/////123//// dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', +/* Sentry.init( + { + dsn: 'https://5b345a3ae70b4e4da463da65881b4aaa@o4504340905525248.ingest.sentry.io/4504345615794176', // To set your release and dist versions -/////123//// release: 'gabinetedigital@1.0.0', -/////123//// dist: '1', + release: 'gabinetedigital@1.0.0', + dist: '1', // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. -/////123//// integrations: [ -/////123//// new BrowserTracing({ -/////123//// tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], -/////123//// }) as Integration, -/////123//// ] -/////123//// }, + integrations: [ + new BrowserTracing({ + tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], + }) as Integration, + ] + }, // Forward the init method to the sibling Framework. -/////123//// SentrySibling.init -/////123////); + SentrySibling.init +); */ platformBrowserDynamic().bootstrapModule(AppModule) From c8bdcfce8e28e8557874cccb9cd6bb6310cac9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 4 Jan 2023 15:03:29 +0100 Subject: [PATCH 2/2] bugs solved --- src/app/modals/profile/profile.page.html | 3 +-- src/app/modals/profile/profile.page.ts | 7 ++++++- src/app/services/auth.service.ts | 7 ++++++- src/app/services/notifications.service.ts | 9 --------- src/app/shared/header/header.page.ts | 8 ++++++-- src/environments/environment.ts | 12 ++++++------ 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index 748cc3ee3..18f0967c8 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -51,8 +51,7 @@
- {{notificationdata.length}} novas notificações - 0 novas notificações + {{notificationStatus}} diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index bf6599285..11c007eb3 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -31,6 +31,7 @@ export class ProfilePage implements OnInit { location: "Gabinete"; isProfileOpen = false hideImage = false + notificationStatus = ''; constructor(private modalController: ModalController, private authService: AuthService, @@ -117,7 +118,11 @@ export class ProfilePage implements OnInit { }); this.notificationdata = this.DataArray }).catch((error) => { - console.error('storage getnotification: ',error) + if(!error) { + this.notificationStatus = this.notificationdata.length + " novas notificações"; + } else { + console.error('storage getnotification: ',error) + } }) /* await new Promise(resolve => setTimeout(resolve, 1000)); await this.getNotificationData(); */ diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index f063abba5..1a34a3900 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -225,7 +225,12 @@ export class AuthService { this.storageService.get(AuthConnstants.AUTH).then(res=>{ this.userData$.next(res); }).catch((error) => { - console.error('storage getuserdata',error) + if(!error) { + + } else { + console.error('storage getuserdata',error) + } + }); } diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index f929eb788..113818b1a 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -48,15 +48,6 @@ export class NotificationsService { /* private eventTriger: Events, */ /* private fcm: FCM */) { - this.storageService.get("Notifications").then((value) => { - - }).catch((error)=>{ - console.error('storage getnotification',error) - }).catch(() => { - - this.storageService.store("Notifications", []) - }) - } registerCallback(type: string, funx: Function, object: any = {}) { diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 89a71c923..a207e431e 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -80,9 +80,13 @@ export class HeaderPage implements OnInit { /* var data = JSON.parse(value); */ this.notificationLength = value.length; + }).catch((error) => { + if(!error) { + this.notificationLength = 0; + } else { + console.error('header storage get notification', error) + } }) - - } hideSearch() { diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 56998ebab..38917556a 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,15 +1,15 @@ import { versionData } from '../../version/git-version' export const environment = { // apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', - //apiURL: 'https://gd-api.oapr.gov.ao/api/', - apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/', + apiURL: 'https://gd-api.oapr.gov.ao/api/', + //apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/', // apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', // apiChatUrl: 'http://192.168.0.29:3000/api/v1/', // apiWsChatUrl: 'wss://192.168.0.29:3000/websocket', - //apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/', - //apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', - apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', - apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', + apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/', + apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', + /* apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', + apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', */ production: true, domain: 'paulo.pinto@gabinetedigital.local', defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto@gabinetedigital.local