diff --git a/config.xml b/config.xml index fc70cef4e..12eabcd1d 100644 --- a/config.xml +++ b/config.xml @@ -134,7 +134,7 @@ 0 - 8.0.0.00-20210308-063916 + 8.0.0.00-20210214-154410 diff --git a/package-lock.json b/package-lock.json index 2f5db9be5..88a50acfd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2039,21 +2039,6 @@ } } }, - "@ionic-native/fcm": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@ionic-native/fcm/-/fcm-5.32.0.tgz", - "integrity": "sha512-6BU5cbxILHe3LmL82qwTl80BCaDzZvkd2svQm3CQgwBrBuzzccYd4iSqpdkHXyLkb49fIRa22r3apc7EJ72cFg==", - "requires": { - "@types/cordova": "^0.0.34" - }, - "dependencies": { - "@types/cordova": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", - "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" - } - } - }, "@ionic-native/file": { "version": "5.31.1", "resolved": "https://registry.npmjs.org/@ionic-native/file/-/file-5.31.1.tgz", @@ -5761,12 +5746,20 @@ "dev": true }, "cordova-plugin-fcm-with-dependecy-updated": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.8.0.tgz", - "integrity": "sha512-p2pbY1oqQ2UDbaWOWA2z84uMXmdDGYmK2O+mrufj1bZyoFodt7WqrtiB9oDnUuSSinMrdNFrupiWEDMSBSNVeQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.2.0.tgz", + "integrity": "sha512-Iv1gOeoQ4l/1ztBLemgLOCS4iaVemHezfpa5/X+iqS4apfvUVLJ47Vw6KO7deBO2d2ElvrGZ2ayZX7j3uhtsRw==", "dev": true, "requires": { - "typescript": "^4.1.3" + "typescript": "^3.9.6" + }, + "dependencies": { + "typescript": { + "version": "3.9.9", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", + "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", + "dev": true + } } }, "cordova-plugin-filepath": { @@ -11863,14 +11856,14 @@ } }, "plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", "dev": true, "requires": { - "base64-js": "^1.2.3", + "base64-js": "^1.5.1", "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" + "xmldom": "^0.5.0" } }, "pnp-webpack-plugin": { @@ -17969,9 +17962,9 @@ "dev": true }, "xmldom": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", - "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", "dev": true }, "xmlhttprequest-ssl": { diff --git a/package.json b/package.json index cbe0e9b78..4811311de 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "@fullcalendar/interaction": "^5.3.0", "@ionic-native/camera": "^5.31.1", "@ionic-native/core": "^5.0.7", - "@ionic-native/fcm": "^5.32.0", "@ionic-native/file": "^5.30.0", "@ionic-native/file-path": "^5.30.0", "@ionic-native/http": "^5.31.1", @@ -84,7 +83,7 @@ "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-compat": "^1.2.0", "cordova-plugin-device": "^2.0.2", - "cordova-plugin-fcm-with-dependecy-updated": "^7.8.0", + "cordova-plugin-fcm-with-dependecy-updated": "^7.2.0", "cordova-plugin-inappbrowser": "^4.0.0", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^4.2.1", @@ -121,12 +120,10 @@ "cordova-plugin-androidx": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-fcm-with-dependecy-updated": { - "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher", - "ANDROID_FCM_VERSION": "21.0.0", - "ANDROID_FIREBASE_BOM_VERSION": "26.0.0", - "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4", - "ANDROID_GRADLE_TOOLS_VERSION": "4.1.0", - "IOS_FIREBASE_MESSAGING_VERSION": "~> 7.4.0" + "ANDROID_FCM_VERSION": "19.0.0", + "ANDROID_GRADLE_TOOLS_VERSION": "3.5.3", + "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.3", + "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher" } }, "platforms": [ @@ -141,4 +138,4 @@ "url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/resources/android/icon/drawable-hdpi-icon.png b/resources/android/icon/drawable-hdpi-icon.png index 05d953939..c1b57bca3 100644 Binary files a/resources/android/icon/drawable-hdpi-icon.png and b/resources/android/icon/drawable-hdpi-icon.png differ diff --git a/resources/android/icon/drawable-ldpi-icon.png b/resources/android/icon/drawable-ldpi-icon.png index 74a5391bc..e0f874f6c 100644 Binary files a/resources/android/icon/drawable-ldpi-icon.png and b/resources/android/icon/drawable-ldpi-icon.png differ diff --git a/resources/android/icon/drawable-mdpi-icon.png b/resources/android/icon/drawable-mdpi-icon.png index c34391965..d4289493f 100644 Binary files a/resources/android/icon/drawable-mdpi-icon.png and b/resources/android/icon/drawable-mdpi-icon.png differ diff --git a/resources/android/icon/drawable-xhdpi-icon.png b/resources/android/icon/drawable-xhdpi-icon.png index 1d76d5249..bf3725ba7 100644 Binary files a/resources/android/icon/drawable-xhdpi-icon.png and b/resources/android/icon/drawable-xhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxhdpi-icon.png b/resources/android/icon/drawable-xxhdpi-icon.png index 7fb3bb824..cdc1340ae 100644 Binary files a/resources/android/icon/drawable-xxhdpi-icon.png and b/resources/android/icon/drawable-xxhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxxhdpi-icon.png b/resources/android/icon/drawable-xxxhdpi-icon.png index 97f8b550b..b9183ea93 100644 Binary files a/resources/android/icon/drawable-xxxhdpi-icon.png and b/resources/android/icon/drawable-xxxhdpi-icon.png differ diff --git a/resources/android/splash/drawable-land-hdpi-screen.png b/resources/android/splash/drawable-land-hdpi-screen.png index 74abe28ea..444dc39ab 100644 Binary files a/resources/android/splash/drawable-land-hdpi-screen.png and b/resources/android/splash/drawable-land-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-ldpi-screen.png b/resources/android/splash/drawable-land-ldpi-screen.png index b224ba8c8..80409d7bd 100644 Binary files a/resources/android/splash/drawable-land-ldpi-screen.png and b/resources/android/splash/drawable-land-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-land-mdpi-screen.png b/resources/android/splash/drawable-land-mdpi-screen.png index f18770eb1..f9342e83a 100644 Binary files a/resources/android/splash/drawable-land-mdpi-screen.png and b/resources/android/splash/drawable-land-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xhdpi-screen.png b/resources/android/splash/drawable-land-xhdpi-screen.png index 76eab0d72..d7936aa71 100644 Binary files a/resources/android/splash/drawable-land-xhdpi-screen.png and b/resources/android/splash/drawable-land-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxhdpi-screen.png b/resources/android/splash/drawable-land-xxhdpi-screen.png index b15925df5..63a3b921a 100644 Binary files a/resources/android/splash/drawable-land-xxhdpi-screen.png and b/resources/android/splash/drawable-land-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxxhdpi-screen.png b/resources/android/splash/drawable-land-xxxhdpi-screen.png index 4b22b8b59..22ec1444a 100644 Binary files a/resources/android/splash/drawable-land-xxxhdpi-screen.png and b/resources/android/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-hdpi-screen.png b/resources/android/splash/drawable-port-hdpi-screen.png index c0c981b97..a6b455ddf 100644 Binary files a/resources/android/splash/drawable-port-hdpi-screen.png and b/resources/android/splash/drawable-port-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-ldpi-screen.png b/resources/android/splash/drawable-port-ldpi-screen.png index dfba93219..e1f6c084c 100644 Binary files a/resources/android/splash/drawable-port-ldpi-screen.png and b/resources/android/splash/drawable-port-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-port-mdpi-screen.png b/resources/android/splash/drawable-port-mdpi-screen.png index e5129fd04..f65e1fb76 100644 Binary files a/resources/android/splash/drawable-port-mdpi-screen.png and b/resources/android/splash/drawable-port-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xhdpi-screen.png b/resources/android/splash/drawable-port-xhdpi-screen.png index 14ec839e8..bee833117 100644 Binary files a/resources/android/splash/drawable-port-xhdpi-screen.png and b/resources/android/splash/drawable-port-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxhdpi-screen.png b/resources/android/splash/drawable-port-xxhdpi-screen.png index 4df256fbf..2f9421671 100644 Binary files a/resources/android/splash/drawable-port-xxhdpi-screen.png and b/resources/android/splash/drawable-port-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxxhdpi-screen.png b/resources/android/splash/drawable-port-xxxhdpi-screen.png index 53f97f9d9..0295c0138 100644 Binary files a/resources/android/splash/drawable-port-xxxhdpi-screen.png and b/resources/android/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3cc61ca02..80c561595 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -29,7 +29,7 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MessagesPage } from './pages/chat/messages/messages.page'; -import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx' +import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @NgModule({ diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 6af927624..86e8b92b3 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -10,7 +10,7 @@ - Agenda + Agenda diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 67e5fd7ab..42181215b 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -1,19 +1,20 @@ -/// +// import { Component, OnInit, NgZone } from '@angular/core'; import { EventsService } from '../services/events.service'; import { Event } from '../models/event.model'; import { ProcessesService } from '../services/processes.service'; -import { ModalController, AlertController, AnimationController } from '@ionic/angular'; +import { NotificationsService } from '../services/notifications.service'; +import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; //import { AlertController } from 'ionic-angular'; /* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed, Modals } from '@capacitor/core'; */ import { Router } from '@angular/router'; -//import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; +import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; import { ViewEventPage } from '../pages/agenda/view-event/view-event.page'; -import { ApproveEventModalPage } from '../pages/agenda/approve-event-modal/approve-event-modal.page'; import { ExpedienteDetailPage } from '../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page'; -import { PublicationDetailPage } from '../pages/publications/publication-detail/publication-detail.page'; import { ViewPublicationsPage } from '../pages/publications/view-publications/view-publications.page'; +import { ApproveEventModalPage } from '../pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page'; +import { PublicationDetailPage } from '../pages/publications/view-publications/publication-detail/publication-detail.page'; /* const { PushNotifications, LocalNotifications, LocalNotificationAction } = Plugins; */ @@ -58,8 +59,10 @@ export class HomePage implements OnInit { private router: Router, private modalController: ModalController, public modalCtrl: AlertController, - //private fcm: FCM, - private animationController: AnimationController,) { + private fcm: FCM, + private animationController: AnimationController, + private notificatinsservice: NotificationsService, + private platform: Platform) { router.events.subscribe((val) => { document.querySelectorAll('ion-modal').forEach((e) => e.remove()) @@ -75,103 +78,77 @@ export class HomePage implements OnInit { //Add a test //this.pushCordova(); - //Initialize profile as mdgpr - - let date = new Date(); - date.setMonth(date.getMonth() + 1); - let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); - let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59"; - - this.profile = "mdgpr"; - if (this.profile == "mdgpr") { - this.eventService.getAllMdEvents(start, end).subscribe(res => { - this.eventsList = res; - this.totalEvent = this.eventsList.length; - }); - } - else { - this.eventService.getAllPrEvents(start, end).subscribe(res => { - this.eventsList = res; - this.totalEvent = this.eventsList.length; - }); - - } - this.processesbackend.GetTasksList("Expediente", true).subscribe(result => { - this.totalExpediente = result; - }); - - + //Initialize profile as mdgpr + + let date = new Date(); + date.setMonth(date.getMonth() + 1); + let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); + let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59"; + + this.profile = "mdgpr"; + if (this.profile == "mdgpr") { + this.eventService.getAllMdEvents(start, end).subscribe(res => { + this.eventsList = res; + this.totalEvent = this.eventsList.length; + }); + } + else { + this.eventService.getAllPrEvents(start, end).subscribe(res => { + this.eventsList = res; + this.totalEvent = this.eventsList.length; + }); + + } + } + pushCordova() { -/* - this.fcm.onNotification().subscribe(data => { - this.viewEventDetail(data.idObject) - if (data.click_action) { - console.log("Received in background: ", data); - if (data.service === "agenda") { - //this.router.navigate(['/home/', service, idObject, 'home']); - this.viewEventDetail(data.idObject) - } - else if (data.service === "gabinete-digital" && data.object === "expediente") { - this.viewExpedientDetail(data.idObject) - } - else if (data.service === "gabinete-digital" && data.object === "event-list") { - // this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', idObject])}) - this.openApproveModal(data.idObject); - } - else if (data.service === "accoes" && data.object === "accao") { - //this.viewPublications(data.idObject) - alert(data.idObject) - } - else if (data.service === "accoes" && data.object === "publicacao") { - this.viewPublicationDetail(data.idObject) - } + if(this.platform.is('desktop')) { + console.log('Notifications not supported') + } else { - } else { - console.log("Received in foreground: ", data); - if (data.service === "agenda") { - //this.router.navigate(['/home/', service, idObject, 'home']); - this.viewEventDetail(data.idObject) - } - else if (data.service === "gabinete-digital" && data.object === "expediente") { - this.viewExpedientDetail(data.idObject) - } - else if (data.service === "gabinete-digital" && data.object === "event-list") { - // this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', idObject])}) - this.openApproveModal(data.idObject); - } - else if (data.service === "accoes" && data.object === "accao") { - this.viewPublications(data.idObject) - } - else if (data.service === "accoes" && data.object === "publicacao") { - this.viewPublicationDetail(data.idObject) - } - }; - }); + this.fcm.onNotification().subscribe(data => { + this.viewEventDetail(data.IdObject) + if (data.wasTapped === true) { + console.log("Received in background: ", data); + + if (data.Service === "agenda") { + //this.router.navigate(['/home/', service, IdObject, 'home']); + this.viewEventDetail(data.IdObject) + } + else if (data.Service === "gabinete-digital" && data.Object === "expediente") { + console.log('expediante 1') + this.viewExpedientDetail(data.IdObject) + } + else if (data.Service === "gabinete-digital" && data.Object === "event-list") { + // this.ngZone.run(() => {this.router.navigate(['/home/gabinete-digital/event-list', IdObject])}) + this.openApproveModal(data.IdObject); + } + else if (data.Service === "accoes" && data.Object === "accao") { + this.viewPublications(data.IdObject) + alert(data.IdObject) + } + else if (data.Service === "accoes" && data.Object === "publicacao") { + this.viewPublicationDetail(data.IdObject) + } + + } else { + console.log("Received in foreground: ", data); + + console.log(data.Service) + console.log(data.Object) + console.log(data.IdObject) + + }; + }); + } - this.fcm.onTokenRefresh().subscribe(token => { - // Register your new token in your back-end if you want - // backend.registerToken(token); - }); - - this.ubscribeToTopic() - this.getToken() */ + } - /* ubscribeToTopic() { - this.fcm.subscribeToTopic('enappd'); - } - getToken() { - this.fcm.getToken().then(token => { - console.log('token: ', token) - // Register your new token in your back-end if you want - // backend.registerToken(token); - }); - } */ - async viewEventDetail(eventId: any) { console.log(this.profile); @@ -192,17 +169,25 @@ export class HomePage implements OnInit { }); } - async openApproveModal(eventSerialNumber) { + async openApproveModal(eventSerialNumber){ + let classs; + if( window.innerWidth <= 1024){ + classs = 'cal-modal modal modal-desktop' + } else { + classs = 'gabinete-digital-mobile-modal-to-Desktop' + } + const modal = await this.modalController.create({ component: ApproveEventModalPage, - componentProps: { + componentProps:{ serialNumber: eventSerialNumber, }, - cssClass: 'cal-modal', + cssClass: 'event-list', backdropDismiss: false }); await modal.present(); + modal.onDidDismiss(); } @@ -213,14 +198,14 @@ export class HomePage implements OnInit { } else { classs = 'modal modal-desktop showAsideOptions' } - /* console.log(this.profile); - console.log(serialNumber); */ - + console.log(this.profile); + console.log(serialNumber); + console.log('expediante 2') const modal = await this.modalController.create({ component: ExpedienteDetailPage, componentProps: { serialNumber: serialNumber, - profile: this.profile, + profile: "MDGPR", }, cssClass: classs, }); @@ -244,7 +229,7 @@ export class HomePage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(() => { - //this.getPublications(); + }); } diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 35448c226..c5c899c6f 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -863,26 +863,29 @@ export class AgendaPage implements OnInit { selectFirstEventOfTheDay(){ setTimeout(()=>{ + + if(this.eventSelectedDate.toLocaleDateString('en-US') != (new Date()).toLocaleDateString('en-US')){ + let sortedDate = this.eventSource.sort((a,b) =>{ + return (b.startTime) -(a.startTime); + }); - let sortedDate = this.eventSource.sort((a,b) =>{ - return (b.startTime) -(a.startTime); - }); - - - let filterDate = sortedDate.filter((e) => { - return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US'); - }); - - const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours(); - - const scrollContainer = document.querySelector('.timeline-wrapper'); - - scrollContainer.scroll({ - top: firstEventStartHours*60, - left: 0, - behavior: 'smooth' - }) + + let filterDate = sortedDate.filter((e) => { + return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US'); + }); + + const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours(); + + const scrollContainer = document.querySelector('.timeline-wrapper'); + scrollContainer.scroll({ + top: firstEventStartHours*60, + left: 0, + behavior: 'smooth' + }) + + } + }, 500); } @@ -1147,8 +1150,6 @@ export class AgendaPage implements OnInit { this.postEvent = false; } - - async changeSegment(segments: "Combinado" | "Pessoal" | "Oficial") { this.segment = segments; @@ -1159,5 +1160,4 @@ export class AgendaPage implements OnInit { } } - } \ No newline at end of file diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index 20af874a9..f70564f5a 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -109,20 +109,13 @@ export class ViewEventPage implements OnInit { async editEventDetail() { - let classs; - if( window.innerWidth <= 800){ - classs = 'modal' - } else { - classs = 'modal modal-desktop' - } - const modal = await this.modalController.create({ component: EditEventPage, componentProps: { eventId: this.loadedEvent.EventId, profile: this.profile, }, - cssClass: classs, + cssClass: 'modal modal-desktop', }); } @@ -131,7 +124,7 @@ export class ViewEventPage implements OnInit { let classs; if( window.innerWidth <= 800){ - classs = 'modal' + classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' } @@ -151,6 +144,7 @@ export class ViewEventPage implements OnInit { if(res){ setTimeout(() => { /* this.loadEvent(); */ + this.loadEvent() this.getAttachments(); }, 250); this.isEventEdited = true; diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 5fbd40203..743f2003a 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -100,7 +100,11 @@ - + diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 7fd4f2720..29b743bda 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -113,6 +113,9 @@ export class ChatPage implements OnInit { this.showGroupContacts=false; console.log('All components closed!'); } + showEmptyContainer(){ + this.showEmptyComponent=true; + } openGroupContactsPage(data){ console.log(data); this.groupRoomId = data; diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index b15fd0816..d5e3e9cda 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -134,26 +134,27 @@ export class GroupMessagesPage implements OnInit { this.message = ""; } - async openOptions(ev: any) { - const popover = await this.popoverController.create({ + async openOptions() { + console.log('OK'); + const modal = await this.modalController.create({ component: ChatPopoverPage, cssClass: 'chat-popover', - event: ev, componentProps: { - room: this.room, + roomId: this.roomId, }, - translucent: true }); - await popover.present(); - popover.onDidDismiss().then(res=>{ + await modal.present(); + modal.onDidDismiss().then(res=>{ + console.log('OK2'); + console.log(res); - if(res.data){ + /* if(res.data ==){ this.roomName = res.data.name.split('-').join(' '); console.log(this.roomName); this.getRoomInfo(); - /* this.modalController.dismiss(); */ - }; + //this.modalController.dismiss(); + }; */ }); } 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 c4ff82d22..a24365d5f 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 @@ -28,12 +28,11 @@ export class EventListPage implements OnInit { private modalController: ModalController, private router: Router, private navParams: NavParams, - ) { } + ) { } ngOnInit() { this.profile = this.navParams.get('profile'); - console.log(this.profile); - + /* console.log(this.navParams.get('md')); */ if(this.profile == "mdgpr"){ this.profile = 'MDGPR' @@ -53,7 +52,7 @@ export class EventListPage implements OnInit { window.onresize = (event) => { // if not mobile remove all component - if( window.innerWidth <= 1024){ + if( window.innerWidth <= 800){ this.modalController.dismiss(); } }; @@ -73,21 +72,15 @@ export class EventListPage implements OnInit { }); } - async openApproveModal(eventSerialNumber){ - let classs; - if( window.innerWidth <= 1024){ - classs = 'cal-modal modal modal-desktop' - } else { - classs = 'gabinete-digital-mobile-modal-to-Desktop' - } + const modal = await this.modalController.create({ component: ApproveEventModalPage, componentProps:{ serialNumber: eventSerialNumber, }, - cssClass: 'event-list', + cssClass: 'event-list cal-modal modal modal-desktop', backdropDismiss: false }); diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html index b416942c5..123b90ad5 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.html @@ -61,7 +61,7 @@ -
+
@@ -82,7 +82,7 @@ -
+
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts index a7709d154..8ff977153 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts @@ -113,6 +113,7 @@ export class ExpedientTaskModalPage implements OnInit { } saveTask(){ + let attendees = this.taskParticipants.concat(this.taskParticipantsCc); attendees = attendees.map(function(val) { return { @@ -120,6 +121,7 @@ export class ExpedientTaskModalPage implements OnInit { UserType: val.IsRequired?"I": "CC" }; }) + if(this.taskParticipants.length > 0){ switch (this.taskType){ case '0': @@ -185,7 +187,10 @@ export class ExpedientTaskModalPage implements OnInit { this.adding = "intervenient"; this.contacts = this.taskParticipants; - if(window.innerWidth <=1024){ + if(window.innerWidth <=800){ + + this.showAttendees=false; + const modal = await this.modalController.create({ component: AddParticipantsModalPage, componentProps: { @@ -214,7 +219,7 @@ export class ExpedientTaskModalPage implements OnInit { console.log(this.postData); }); } else { - + this.showAttendees=true } } @@ -223,7 +228,9 @@ export class ExpedientTaskModalPage implements OnInit { this.adding = "CC"; this.contacts = this.taskParticipantsCc; - if(window.innerWidth <=1024){ + if(window.innerWidth <=800){ + this.showAttendees=false; + const modal = await this.modalController.create({ component: AddParticipantsCcModalPage, componentProps: { @@ -251,6 +258,8 @@ export class ExpedientTaskModalPage implements OnInit { this.postData.UsersSelected = this.participants; console.log(this.postData); }); + } else { + this.showAttendees=true } } 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 0faf5dfbb..14b9fca6b 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 @@ -141,7 +141,7 @@ export class ExpedienteDetailPage implements OnInit { //this.modalController.dismiss(); let classs; if( window.innerWidth <= 800){ - classs = 'modal' + classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' } @@ -193,7 +193,7 @@ export class ExpedienteDetailPage implements OnInit { async openBookMeetingModal(task: any) { let classs; if( window.innerWidth <= 800){ - classs = 'book-meeting-modal' + classs = 'book-meeting-modal modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' } diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts index 1363d9c4d..a6f019fbc 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts @@ -65,14 +65,7 @@ export class ExpedientePage implements OnInit { } async viewExpedientDetail(serialNumber:any) { - console.log(this.profile); - let classs; - if( window.innerWidth <= 800){ - classs = 'modal modal-desktop' - } else { - classs = 'gabinete-digital-mobile-modal-to-Desktop' - } const modal = await this.modalController.create({ component: ExpedienteDetailPage, @@ -80,7 +73,7 @@ export class ExpedientePage implements OnInit { serialNumber: serialNumber, profile: this.profile, }, - cssClass: classs, + cssClass: 'modal modal-desktop', backdropDismiss: false }); await modal.present(); diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 14273edd9..e0357154b 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -20,7 +20,7 @@
-
+
@@ -28,7 +28,7 @@

{{count_ev_md+count_ev_pr}} Documentos

-
+
@@ -36,7 +36,7 @@

{{count_exp_dailywork}} Documentos

-
+
@@ -44,21 +44,24 @@

Pendentes

- Documentos

-
+ +

Pedidos de Parecer

- Documentos

-
+ +

Pedidos de Deferimento

- Documentos

-
+ +
@@ -66,15 +69,15 @@

- Documentos

- -
+

Expediente Presidente

- Documentos

-
+ +
@@ -82,9 +85,7 @@

- Documentos

- - -
+
@@ -95,7 +96,8 @@
-
+ +
@@ -107,14 +109,16 @@
-
+

Diplomas assinaldos PR

- Documentos

+
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index 3a3b9b069..0b5a60046 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -345,3 +345,9 @@ ion-content{ width: 25%; } } + + +.active { + border: 1px solid green; + box-sizing: border-box; +} \ No newline at end of file diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index a7eacfcb0..34ad0b2c6 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -12,6 +12,7 @@ import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; templateUrl: './gabinete-digital.page.html', styleUrls: ['./gabinete-digital.page.scss'], }) + export class GabineteDigitalPage implements OnInit { segment:string; @@ -27,11 +28,13 @@ export class GabineteDigitalPage implements OnInit { count_ev_pr=0; count_ev_md=0; + selectedElement = ""; desktopComponent: any = { showEventList: false, showExpediente : false } + showEventsToApprove = false; showEmptyContainer = false; showExpedients = true; @@ -46,17 +49,15 @@ export class GabineteDigitalPage implements OnInit { private alertService: AlertService, private activatedRoute: ActivatedRoute, private router: Router, - ) { + ) { window.onresize = (event) => { // if not mobile remove all component if( window.innerWidth <= 1024){ this.modalController.dismiss(); } - this.adjastModalHeight(); - }; - this.adjastModalHeight(); + }; this.activatedRoute.queryParams.subscribe(params => { if(params["show"]){ @@ -69,24 +70,6 @@ export class GabineteDigitalPage implements OnInit { } - adjastModalHeight(){ - setTimeout(() => { - if( window.innerWidth <= 1366){ - - document.querySelectorAll('.gabinete-digital-mobile-modal-to-Desktop').forEach(e=>{ - console.log('adjast width') - e.setAttribute('style',`height:${window.innerHeight - (74 + 57)}px`) - }) - } else if( window.innerWidth >= 1366){ - document.querySelectorAll('.gabinete-digital-mobile-modal-to-Desktop').forEach(e=>{ - console.log('adjast width') - e.setAttribute('style',`height:${window.innerHeight - (74)}px`) - }) - } - }, 200); - - - } closeAllDesktopComponent(){ this.desktopComponent = { @@ -94,6 +77,7 @@ export class GabineteDigitalPage implements OnInit { showExpediente: false } } + ngOnInit() { //Initialize profile as mdgpr this.profile = "MDGPR"; @@ -178,22 +162,13 @@ this.processesbackend.GetActionsList().subscribe(res=>{ async openEventsToApproveList(profile:any){ this.closeAllDesktopComponent(); - - let classs; - if( window.innerWidth <= 800){ - classs = 'modal' - } else { - classs = 'gabinete-digital-mobile-modal-to-Desktop' - } - //if( window.innerWidth <= 1024){ - this.adjastModalHeight(); const modal = await this.modalController.create({ component: EventListPage, componentProps:{ profile: profile, }, - cssClass: classs, + cssClass: 'modal modal-desktop', backdropDismiss: false }); await modal.present(); @@ -203,6 +178,7 @@ this.processesbackend.GetActionsList().subscribe(res=>{ //} } + openExpedientListPage(){ this.closeAllDesktopComponents(); if( window.innerWidth <= 1024){ @@ -212,6 +188,7 @@ this.processesbackend.GetActionsList().subscribe(res=>{ this.showExpedients = true; } } + openExpedientPage(data){ console.log(data); @@ -224,24 +201,18 @@ this.processesbackend.GetActionsList().subscribe(res=>{ this.showExpedientDetail = true; } } + async openExpedientList(){ this.closeAllDesktopComponent(); - let classs; - if( window.innerWidth <= 1024){ - classs = 'modal' - } else { - classs = 'gabinete-digital-mobile-modal-to-Desktop' - } //if( window.innerWidth <= 1024){ - this.adjastModalHeight(); const modal = await this.modalController.create({ component: ExpedientePage, componentProps:{ profile: this.profile, }, - cssClass: classs, + cssClass: 'modal modal-desktop', backdropDismiss: false }); await modal.present(); diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 697c9f9e7..3e288ecf2 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -11,6 +11,7 @@ import { PhotoService } from 'src/app/services/photo.service'; import { NotificationsService } from 'src/app/services/notifications.service'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Token } from '../../models/token.model'; +import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; /* import { Plugins, PushNotification, PushNotificationToken, PushNotificationActionPerformed } from '@capacitor/core'; @@ -38,7 +39,8 @@ export class LoginPage implements OnInit { private storageService: StorageService, private toastService: ToastService, private photoService: PhotoService, - public alertController: AlertController) { } + public alertController: AlertController, + private fcm: FCM) { } ngOnInit() { @@ -78,40 +80,9 @@ export class LoginPage implements OnInit { }); } - /* storeUserIdANdToken() { - - (PushNotifications as any).requestPermission().then(result => { - PushNotifications.register(); - }); - - PushNotifications.addListener( - 'registration', - (token: PushNotificationToken) => { - console.log('FIREBASE TOKEN', token.value) - this.storageService.store(this.username, token.value); - this.storageService.get(this.username).then(value => { - console.log('STORAGE TOKEN', value) - this.storageService.get(AuthConnstants.USER).then(res => { - console.log('USERID', res); - const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' }; - const body = { - UserId: res, - TokenId: token.value, - Status: 1, - Service: 1 - }; - - this.http.post('https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/notifications/token', body, { headers }).subscribe(data => { - console.log('TOKEN USER MIDLE', data); - }) - }); - - }); - - }, - ); - - }; */ + getToken() { + this.notificatinsservice.getAndpostToken(this.username); + } async Login() { @@ -127,7 +98,7 @@ export class LoginPage implements OnInit { } if (await this.authService.login(this.userattempt)) { this.loginRocketChat(); - //this.storeUserIdANdToken(); + this.getToken(); this.router.navigate(['/home/events']); } diff --git a/src/app/pages/publications/new-action/new-action.page.html b/src/app/pages/publications/new-action/new-action.page.html index 5a8ff7e6d..1b6d8c16a 100644 --- a/src/app/pages/publications/new-action/new-action.page.html +++ b/src/app/pages/publications/new-action/new-action.page.html @@ -1,18 +1,3 @@ - - -
- - -
- -
-
-
-
diff --git a/src/app/pages/publications/new-action/new-action.page.scss b/src/app/pages/publications/new-action/new-action.page.scss index 0afd7e02b..3235d1aa2 100644 --- a/src/app/pages/publications/new-action/new-action.page.scss +++ b/src/app/pages/publications/new-action/new-action.page.scss @@ -14,7 +14,6 @@ ion-toolbar{ border-width: 0 !important; } .div-top-header{ - width: 400px; margin: 0 auto; background-color: #0782c9; overflow: auto; @@ -41,7 +40,6 @@ ion-toolbar{ margin-right: 10px; } .content-top{ - width: 344px; background: #f3f2f2; height: 20px; margin: 0 auto; @@ -60,7 +58,6 @@ ion-toolbar{ overflow: auto; } .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -79,7 +76,6 @@ font-size: 25px; overflow: auto; } .ion-item-container{ - width: 360px; margin: 15px auto; border: 1px solid #ebebeb; border-radius: 5px; @@ -92,8 +88,8 @@ font-size: 25px; overflow: auto; } .ion-item-class-2{ - width: 360px; margin: 0px auto; + display: flex; } .ion-icon-class{ width: 45px; @@ -101,24 +97,23 @@ font-size: 25px; float: left; padding: 10px; font-size: 25px; + } .ion-input-class{ - width: 315px; height: auto; border: 1px solid #ebebeb; border-radius: 5px; padding-left: 5px; padding-right: 10px; - float: left; + flex: 1; } .ion-textarea-class{ - width: 315px; height: auto; border: 1px solid #ebebeb; border-radius: 5px; padding-left: 5px; padding-right: 10px; - float: left; + flex: 1; } .ion-input-class-no-height{ border: 1px solid #ebebeb; diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index 2afd16c36..bdb7963d1 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -1,18 +1,4 @@ - - -
- - -
- -
-
-
-
+
diff --git a/src/app/pages/publications/new-publication/new-publication.page.scss b/src/app/pages/publications/new-publication/new-publication.page.scss index b4b9d9880..c4a9f8a30 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.scss +++ b/src/app/pages/publications/new-publication/new-publication.page.scss @@ -14,7 +14,6 @@ ion-toolbar{ border-width: 0 !important; } .div-top-header{ - width: 400px; margin: 0 auto; background-color: #0782c9; overflow: auto; @@ -41,7 +40,6 @@ ion-toolbar{ margin-right: 10px; } .content-top{ - width: 344px; background: #f3f2f2; height: 20px; margin: 0 auto; @@ -60,7 +58,6 @@ ion-toolbar{ overflow: auto; } .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -79,7 +76,6 @@ font-size: 25px; overflow: auto; } .ion-item-container{ - width: 360px; margin: 15px auto; border: 1px solid #ebebeb; border-radius: 5px; @@ -92,8 +88,8 @@ font-size: 25px; overflow: auto; } .ion-item-class-2{ - width: 360px; margin: 0px auto; + display: flex; } .ion-icon-class{ width: 45px; @@ -109,7 +105,7 @@ font-size: 25px; border-radius: 5px; padding-left: 5px; padding-right: 10px; - float: left; + flex: 1; } .ion-input-class-no-height{ border: 1px solid #ebebeb; 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 502a47b0c..976e8c80d 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -81,7 +81,7 @@ export class NewPublicationPage implements OnInit { this.capturedImage = imageData; this.capturedImageTitle = new Date().getTime() + '.jpeg'; }, (err) => { - console.log(err); + /* console.log(err); */ }); } @@ -102,7 +102,7 @@ export class NewPublicationPage implements OnInit { this.capturedImage = imageData; this.capturedImageTitle = new Date().getTime() + '.jpeg'; }, (err) => { - console.log(err); + /* console.log(err); */ }); } @@ -139,8 +139,8 @@ export class NewPublicationPage implements OnInit { FileBase64: this.publication.FileBase64, FileExtension: 'jpeg', } - console.log('Edit - keep image'); - console.log(this.publication); + /* console.log('Edit - keep image'); + console.log(this.publication); */ this.publications.UpdatePublication(this.publication.ProcessId, this.publication); this.close(); } @@ -159,8 +159,8 @@ export class NewPublicationPage implements OnInit { FileExtension: 'jpeg', } - console.log('Create'); - console.log(this.publication); + /* console.log('Create'); + console.log(this.publication); */ this.publications.CreatePublication(this.folderId, this.publication); this.close(); } diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.html b/src/app/pages/publications/publication-detail/publication-detail.page.html index e937f9f16..bfc55cfb7 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.html +++ b/src/app/pages/publications/publication-detail/publication-detail.page.html @@ -1,21 +1,6 @@ - - -
- - -
- -
-
-
-
+ -
diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.scss b/src/app/pages/publications/publication-detail/publication-detail.page.scss index dd3f55ae5..3230c6d73 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.scss +++ b/src/app/pages/publications/publication-detail/publication-detail.page.scss @@ -10,7 +10,6 @@ border-width: 0 !important; } .div-top-header{ - width: 400px; margin: 0 auto; background-color: #0782c9; overflow: auto; @@ -37,7 +36,6 @@ margin-right: 10px; } .content-top{ - width: 344px; background: #f3f2f2; height: 20px; margin: 0 auto; @@ -55,7 +53,6 @@ overflow: auto; } .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -67,7 +64,6 @@ overflow: auto; } .div-title{ - width: 270px; /* padding: 0!important; */ float: left; margin: 2.5px 0 0 5px; @@ -88,7 +84,6 @@ object-fit: cover; } .post-description{ - width: 360px; margin: 0 auto; margin-bottom: 35px; } \ No newline at end of file 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 6e564f5d5..cb93c0fd7 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -94,7 +94,7 @@ export class PublicationDetailPage implements OnInit { publicationType: publicationType, publication: this.publication, }, - cssClass: 'new-publication', + cssClass: 'new-publication modal modal-desktop', backdropDismiss: false }); await modal.present(); diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index d9004521b..8517bb29c 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -16,9 +16,9 @@
-
-
- Acções Presidenciais +
+
+ Acções Presidenciais