diff --git a/config.xml b/config.xml index 991279066..513107f45 100644 --- a/config.xml +++ b/config.xml @@ -3,7 +3,7 @@ gabinete digital An awesome Ionic/Cordova app. Ionic Framework Team - + @@ -94,6 +94,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package.json b/package.json index 7ed2ff043..f5052ffa4 100644 --- a/package.json +++ b/package.json @@ -163,7 +163,8 @@ "cordova-plugin-androidx": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-fingerprint-aio": {}, - "cordova-plugin-mfp-push": {} + "cordova-plugin-mfp-push": {}, + "cordova-plugin-mfp-jsonstore": {} }, "platforms": [ "browser", @@ -177,4 +178,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 c1b57bca3..d36c1a33e 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 e0f874f6c..23cb8318e 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 d4289493f..2797056eb 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 bf3725ba7..a681d641b 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 cdc1340ae..75f41540d 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 b9183ea93..df3b5433c 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/icon.png b/resources/icon.png index bee77667f..73421fb35 100644 Binary files a/resources/icon.png and b/resources/icon.png differ diff --git a/resources/ios/icon/icon-1024.png b/resources/ios/icon/icon-1024.png index be633f451..c619d8e75 100644 Binary files a/resources/ios/icon/icon-1024.png and b/resources/ios/icon/icon-1024.png differ diff --git a/resources/ios/icon/icon-108@2x.png b/resources/ios/icon/icon-108@2x.png index 13759969b..04f0f563a 100644 Binary files a/resources/ios/icon/icon-108@2x.png and b/resources/ios/icon/icon-108@2x.png differ diff --git a/resources/ios/icon/icon-20.png b/resources/ios/icon/icon-20.png index 08993e093..453048a95 100644 Binary files a/resources/ios/icon/icon-20.png and b/resources/ios/icon/icon-20.png differ diff --git a/resources/ios/icon/icon-20@2x.png b/resources/ios/icon/icon-20@2x.png index acbecd2cb..eea3ae852 100644 Binary files a/resources/ios/icon/icon-20@2x.png and b/resources/ios/icon/icon-20@2x.png differ diff --git a/resources/ios/icon/icon-20@3x.png b/resources/ios/icon/icon-20@3x.png index 00de715c2..84435429a 100644 Binary files a/resources/ios/icon/icon-20@3x.png and b/resources/ios/icon/icon-20@3x.png differ diff --git a/resources/ios/icon/icon-24@2x.png b/resources/ios/icon/icon-24@2x.png index 4b455d317..3afda17cb 100644 Binary files a/resources/ios/icon/icon-24@2x.png and b/resources/ios/icon/icon-24@2x.png differ diff --git a/resources/ios/icon/icon-27.5@2x.png b/resources/ios/icon/icon-27.5@2x.png index c623f279e..2a008b620 100644 Binary files a/resources/ios/icon/icon-27.5@2x.png and b/resources/ios/icon/icon-27.5@2x.png differ diff --git a/resources/ios/icon/icon-29.png b/resources/ios/icon/icon-29.png index 8a55da53c..37af28b99 100644 Binary files a/resources/ios/icon/icon-29.png and b/resources/ios/icon/icon-29.png differ diff --git a/resources/ios/icon/icon-29@2x.png b/resources/ios/icon/icon-29@2x.png index 185277b1a..d02a64dc9 100644 Binary files a/resources/ios/icon/icon-29@2x.png and b/resources/ios/icon/icon-29@2x.png differ diff --git a/resources/ios/icon/icon-29@3x.png b/resources/ios/icon/icon-29@3x.png index 3393f844d..5cfa1c607 100644 Binary files a/resources/ios/icon/icon-29@3x.png and b/resources/ios/icon/icon-29@3x.png differ diff --git a/resources/ios/icon/icon-40.png b/resources/ios/icon/icon-40.png index acbecd2cb..eea3ae852 100644 Binary files a/resources/ios/icon/icon-40.png and b/resources/ios/icon/icon-40.png differ diff --git a/resources/ios/icon/icon-40@2x.png b/resources/ios/icon/icon-40@2x.png index 61d82a739..0ba5b9fbb 100644 Binary files a/resources/ios/icon/icon-40@2x.png and b/resources/ios/icon/icon-40@2x.png differ diff --git a/resources/ios/icon/icon-40@3x.png b/resources/ios/icon/icon-40@3x.png index cc349ded1..34b618c11 100644 Binary files a/resources/ios/icon/icon-40@3x.png and b/resources/ios/icon/icon-40@3x.png differ diff --git a/resources/ios/icon/icon-44@2x.png b/resources/ios/icon/icon-44@2x.png index 00a2ff3d6..3b8d7bc59 100644 Binary files a/resources/ios/icon/icon-44@2x.png and b/resources/ios/icon/icon-44@2x.png differ diff --git a/resources/ios/icon/icon-50.png b/resources/ios/icon/icon-50.png index 9e9a5c1f5..e26f7f90e 100644 Binary files a/resources/ios/icon/icon-50.png and b/resources/ios/icon/icon-50.png differ diff --git a/resources/ios/icon/icon-50@2x.png b/resources/ios/icon/icon-50@2x.png index fe547b126..ae68b8add 100644 Binary files a/resources/ios/icon/icon-50@2x.png and b/resources/ios/icon/icon-50@2x.png differ diff --git a/resources/ios/icon/icon-60.png b/resources/ios/icon/icon-60.png index 00de715c2..84435429a 100644 Binary files a/resources/ios/icon/icon-60.png and b/resources/ios/icon/icon-60.png differ diff --git a/resources/ios/icon/icon-60@2x.png b/resources/ios/icon/icon-60@2x.png index cc349ded1..34b618c11 100644 Binary files a/resources/ios/icon/icon-60@2x.png and b/resources/ios/icon/icon-60@2x.png differ diff --git a/resources/ios/icon/icon-60@3x.png b/resources/ios/icon/icon-60@3x.png index 389882810..452e79a7a 100644 Binary files a/resources/ios/icon/icon-60@3x.png and b/resources/ios/icon/icon-60@3x.png differ diff --git a/resources/ios/icon/icon-72.png b/resources/ios/icon/icon-72.png index 3f84fc1b2..ae9301214 100644 Binary files a/resources/ios/icon/icon-72.png and b/resources/ios/icon/icon-72.png differ diff --git a/resources/ios/icon/icon-72@2x.png b/resources/ios/icon/icon-72@2x.png index 391b4af13..afdd5a300 100644 Binary files a/resources/ios/icon/icon-72@2x.png and b/resources/ios/icon/icon-72@2x.png differ diff --git a/resources/ios/icon/icon-76.png b/resources/ios/icon/icon-76.png index 971034a67..0c19d592e 100644 Binary files a/resources/ios/icon/icon-76.png and b/resources/ios/icon/icon-76.png differ diff --git a/resources/ios/icon/icon-76@2x.png b/resources/ios/icon/icon-76@2x.png index b538930a7..9184cb092 100644 Binary files a/resources/ios/icon/icon-76@2x.png and b/resources/ios/icon/icon-76@2x.png differ diff --git a/resources/ios/icon/icon-83.5@2x.png b/resources/ios/icon/icon-83.5@2x.png index 5f8dbb2f6..8fbbb403c 100644 Binary files a/resources/ios/icon/icon-83.5@2x.png and b/resources/ios/icon/icon-83.5@2x.png differ diff --git a/resources/ios/icon/icon-86@2x.png b/resources/ios/icon/icon-86@2x.png index 9798fc2d9..d0b44a134 100644 Binary files a/resources/ios/icon/icon-86@2x.png and b/resources/ios/icon/icon-86@2x.png differ diff --git a/resources/ios/icon/icon-98@2x.png b/resources/ios/icon/icon-98@2x.png index 5ebd9db69..9ea049cb3 100644 Binary files a/resources/ios/icon/icon-98@2x.png and b/resources/ios/icon/icon-98@2x.png differ diff --git a/resources/ios/icon/icon.png b/resources/ios/icon/icon.png index a90d46c82..b31598cfa 100644 Binary files a/resources/ios/icon/icon.png and b/resources/ios/icon/icon.png differ diff --git a/resources/ios/icon/icon@2x.png b/resources/ios/icon/icon@2x.png index 946c6cefe..065666648 100644 Binary files a/resources/ios/icon/icon@2x.png and b/resources/ios/icon/icon@2x.png differ diff --git a/resources/ios/splash/Default-1792h~iphone.png b/resources/ios/splash/Default-1792h~iphone.png index 359246b4f..ca4f8a3ef 100644 Binary files a/resources/ios/splash/Default-1792h~iphone.png and b/resources/ios/splash/Default-1792h~iphone.png differ diff --git a/resources/ios/splash/Default-2436h.png b/resources/ios/splash/Default-2436h.png index bdbeb9dad..f2bb1268a 100644 Binary files a/resources/ios/splash/Default-2436h.png and b/resources/ios/splash/Default-2436h.png differ diff --git a/resources/ios/splash/Default-2688h~iphone.png b/resources/ios/splash/Default-2688h~iphone.png index 161134be3..608c12203 100644 Binary files a/resources/ios/splash/Default-2688h~iphone.png and b/resources/ios/splash/Default-2688h~iphone.png differ diff --git a/resources/ios/splash/Default-568h@2x~iphone.png b/resources/ios/splash/Default-568h@2x~iphone.png index 5e9edf63f..320164ea9 100644 Binary files a/resources/ios/splash/Default-568h@2x~iphone.png and b/resources/ios/splash/Default-568h@2x~iphone.png differ diff --git a/resources/ios/splash/Default-667h.png b/resources/ios/splash/Default-667h.png index 2843fb37a..a366a7a4e 100644 Binary files a/resources/ios/splash/Default-667h.png and b/resources/ios/splash/Default-667h.png differ diff --git a/resources/ios/splash/Default-736h.png b/resources/ios/splash/Default-736h.png index 21f2d4239..b0c43db31 100644 Binary files a/resources/ios/splash/Default-736h.png and b/resources/ios/splash/Default-736h.png differ diff --git a/resources/ios/splash/Default-Landscape-1792h~iphone.png b/resources/ios/splash/Default-Landscape-1792h~iphone.png index 58394bf06..04f4dde48 100644 Binary files a/resources/ios/splash/Default-Landscape-1792h~iphone.png and b/resources/ios/splash/Default-Landscape-1792h~iphone.png differ diff --git a/resources/ios/splash/Default-Landscape-2436h.png b/resources/ios/splash/Default-Landscape-2436h.png index 763ae78df..7afe8645e 100644 Binary files a/resources/ios/splash/Default-Landscape-2436h.png and b/resources/ios/splash/Default-Landscape-2436h.png differ diff --git a/resources/ios/splash/Default-Landscape-2688h~iphone.png b/resources/ios/splash/Default-Landscape-2688h~iphone.png index 36828a6d5..9f1bad33d 100644 Binary files a/resources/ios/splash/Default-Landscape-2688h~iphone.png and b/resources/ios/splash/Default-Landscape-2688h~iphone.png differ diff --git a/resources/ios/splash/Default-Landscape-736h.png b/resources/ios/splash/Default-Landscape-736h.png index 9c069f7cc..95fa6931c 100644 Binary files a/resources/ios/splash/Default-Landscape-736h.png and b/resources/ios/splash/Default-Landscape-736h.png differ diff --git a/resources/ios/splash/Default-Landscape@2x~ipad.png b/resources/ios/splash/Default-Landscape@2x~ipad.png index 35407a901..6bcebee94 100644 Binary files a/resources/ios/splash/Default-Landscape@2x~ipad.png and b/resources/ios/splash/Default-Landscape@2x~ipad.png differ diff --git a/resources/ios/splash/Default-Landscape@~ipadpro.png b/resources/ios/splash/Default-Landscape@~ipadpro.png index 75de9e0ed..28edd89da 100644 Binary files a/resources/ios/splash/Default-Landscape@~ipadpro.png and b/resources/ios/splash/Default-Landscape@~ipadpro.png differ diff --git a/resources/ios/splash/Default-Landscape~ipad.png b/resources/ios/splash/Default-Landscape~ipad.png index b74bbf69b..d479faee8 100644 Binary files a/resources/ios/splash/Default-Landscape~ipad.png and b/resources/ios/splash/Default-Landscape~ipad.png differ diff --git a/resources/ios/splash/Default-Portrait@2x~ipad.png b/resources/ios/splash/Default-Portrait@2x~ipad.png index d0c33f786..0d99e371e 100644 Binary files a/resources/ios/splash/Default-Portrait@2x~ipad.png and b/resources/ios/splash/Default-Portrait@2x~ipad.png differ diff --git a/resources/ios/splash/Default-Portrait@~ipadpro.png b/resources/ios/splash/Default-Portrait@~ipadpro.png index 363dd1c82..d131a50cf 100644 Binary files a/resources/ios/splash/Default-Portrait@~ipadpro.png and b/resources/ios/splash/Default-Portrait@~ipadpro.png differ diff --git a/resources/ios/splash/Default-Portrait~ipad.png b/resources/ios/splash/Default-Portrait~ipad.png index aad1debb1..d761be588 100644 Binary files a/resources/ios/splash/Default-Portrait~ipad.png and b/resources/ios/splash/Default-Portrait~ipad.png differ diff --git a/resources/ios/splash/Default@2x~iphone.png b/resources/ios/splash/Default@2x~iphone.png index f0f16ef9b..9641adcd8 100644 Binary files a/resources/ios/splash/Default@2x~iphone.png and b/resources/ios/splash/Default@2x~iphone.png differ diff --git a/resources/ios/splash/Default@2x~universal~anyany.png b/resources/ios/splash/Default@2x~universal~anyany.png index c8fcc8f1d..b45dc269f 100644 Binary files a/resources/ios/splash/Default@2x~universal~anyany.png and b/resources/ios/splash/Default@2x~universal~anyany.png differ diff --git a/resources/ios/splash/Default~iphone.png b/resources/ios/splash/Default~iphone.png index e5129fd04..f65e1fb76 100644 Binary files a/resources/ios/splash/Default~iphone.png and b/resources/ios/splash/Default~iphone.png differ diff --git a/src/app/OtherService/document-counter.service.spec.ts b/src/app/OtherService/document-counter.service.spec.ts new file mode 100644 index 000000000..bc3c0f89e --- /dev/null +++ b/src/app/OtherService/document-counter.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { DocumentCounterService } from './document-counter.service'; + +describe('DocumentCounterService', () => { + let service: DocumentCounterService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(DocumentCounterService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/OtherService/document-counter.service.ts b/src/app/OtherService/document-counter.service.ts new file mode 100644 index 000000000..c350c9521 --- /dev/null +++ b/src/app/OtherService/document-counter.service.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { DespachoStore } from 'src/app/store/despacho-store.service'; +import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service'; +import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; +import { PendentesStore } from 'src/app/store/pendestes-store.service'; +import { PedidosStore } from 'src/app/store/pedidos-store.service'; +import { ExpedienteprStore } from 'src/app/store/expedientepr-store.service'; +import { DespachosprStore } from 'src/app/store/despachospr-store.service'; + + +@Injectable({ + providedIn: 'root' +}) +export class DocumentCounterService { + + expedienteGbStore = ExpedienteGdStore; + pendentesStore = PendentesStore; + despachoStore = DespachoStore; + eventoAprovacaoStore = EventoAprovacaoStore; + pedidosStore = PedidosStore; + expedientePrStore = ExpedienteprStore; + despachoPrStore = DespachosprStore; + + constructor() { } + + // falta a contagem dos deplomas + get mdTotalDocument() { + return this.despachoStore.count + this.expedienteGbStore.count + this.pedidosStore.countdeferimento + + this.pedidosStore.countparecer + this.expedientePrStore.count + this.despachoPrStore.count + this.pendentesStore.count + + this.eventoAprovacaoStore.count + } + + get prTotalDocument() { + return 0 + } +} diff --git a/src/app/Rules/despacho-md.service.spec.ts b/src/app/Rules/despacho.service.spec.ts similarity index 52% rename from src/app/Rules/despacho-md.service.spec.ts rename to src/app/Rules/despacho.service.spec.ts index b7121436c..20bf69044 100644 --- a/src/app/Rules/despacho-md.service.spec.ts +++ b/src/app/Rules/despacho.service.spec.ts @@ -1,13 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { DespachoMdService } from './despacho-md.service'; +import { DespachoService } from './despacho.service'; -describe('DespachoMdService', () => { - let service: DespachoMdService; +describe('DespachoService', () => { + let service: DespachoService; beforeEach(() => { TestBed.configureTestingModule({}); - service = TestBed.inject(DespachoMdService); + service = TestBed.inject(DespachoService); }); it('should be created', () => { diff --git a/src/app/Rules/despacho-md.service.ts b/src/app/Rules/despacho.service.ts similarity index 95% rename from src/app/Rules/despacho-md.service.ts rename to src/app/Rules/despacho.service.ts index e4d9b9448..6f97c8ad4 100644 --- a/src/app/Rules/despacho-md.service.ts +++ b/src/app/Rules/despacho.service.ts @@ -1,12 +1,10 @@ import { Injectable } from '@angular/core'; import { ProcessesService } from '../services/processes.service'; - @Injectable({ providedIn: 'root' }) -export class DespachoMdService { - +export class DespachoService { /** * @description para terminar o * 95 - signfica @@ -16,10 +14,10 @@ export class DespachoMdService { action: "Arquivo" | "Reencaminhar" - constructor( + constructor( private processes: ProcessesService, - ) { } - + ) { } + arquivar(note:string, documents:any, serialnumber) { let body = { @@ -34,7 +32,7 @@ export class DespachoMdService { return this.processes.CompleteTask(body) } - + reencaminhar(note:string, documents:any, serialnumber) { let body = { @@ -49,7 +47,7 @@ export class DespachoMdService { return this.processes.CompleteTask(body) } - + executado(note:string, documents:any , serialnumber) { let body = { @@ -64,10 +62,9 @@ export class DespachoMdService { return this.processes.CompleteTask(body) } - + sendExpedienteToPending(serialnumber) { return this.processes.SetTaskToPending(serialnumber) } - } diff --git a/src/app/Rules/user.service.spec.ts b/src/app/Rules/user.service.spec.ts new file mode 100644 index 000000000..3f804c9fd --- /dev/null +++ b/src/app/Rules/user.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { UserService } from './user.service'; + +describe('UserService', () => { + let service: UserService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(UserService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/Rules/user.service.ts b/src/app/Rules/user.service.ts new file mode 100644 index 000000000..172eeb441 --- /dev/null +++ b/src/app/Rules/user.service.ts @@ -0,0 +1,12 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + constructor() { } + + changeProfilePicture(){} + +} diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 53a891609..876b3cbc1 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -15,7 +15,8 @@ - {{totalExpediente}} + {{documentCounterService.mdTotalDocument}} + 0 Gabinete diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b0b25c3e9..86a1beb01 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -8,9 +8,12 @@ import { Event } from '../models/event.model'; import { ProcessesService } from '../services/processes.service'; import { NotificationsService } from '../services/notifications.service'; import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; -import { NavigationExtras,Router,ActivatedRoute } from '@angular/router'; +import { NavigationExtras, Router, ActivatedRoute } from '@angular/router'; import { ToastService } from '../services/toast.service'; import { ToDayEventStorage } from '../store/to-day-event-storage.service'; +import { DocumentCounterService } from 'src/app/OtherService/document-counter.service' +import { PermissionService } from '../OtherService/permission.service'; + // import * as Sentry from "@sentry/browser"; // import { Integrations } from "@sentry/tracing"; @@ -68,7 +71,9 @@ export class HomePage implements OnInit { public modalCtrl: AlertController, private notificatinsservice: NotificationsService, private platform: Platform, - private activeroute: ActivatedRoute) { + private activeroute: ActivatedRoute, + public documentCounterService: DocumentCounterService, + public p: PermissionService) { this.router.events.subscribe((val) => { document.querySelectorAll('ion-modal').forEach((e: any) => e.remove()) @@ -81,47 +86,48 @@ export class HomePage implements OnInit { } ngOnInit() { - console.log('Active route ',this.router.url) - if(this.platform.is('desktop') || this.platform.is('mobileweb')) { + + console.log('Active route ', this.router.url) + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { console.log('Notifications not supported') } else { - /* this.mobilefirstConnect(); - this.notificatinsservice.onReceviNotification(); */ + this.mobilefirstConnect(); + this.notificatinsservice.getAndpostToken2(); + this.notificatinsservice.onReceviNotification(); } } mobilefirstConnect() { - //try { - window['WLAuthorizationManager'].obtainAccessToken("").then( (token) => { - console.log('MobileFirst Server connect: Success ' + token); + window['WLAuthorizationManager'].obtainAccessToken("").then((token) => { - var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/", - WLResourceRequest.GET - ); + console.log('MobileFirst Server connect: Success ' + token); - resourceRequest.setQueryParameter("name", "world"); - resourceRequest.send().then( - (response) => { - // Will display "Hello world" in an alert dialog. - console.log("Connect with JavaAdapter Success: " + response.responseText); - //this.MFPushNotification(); - }, - (error) => { - alert("Connect with JavaAdapter Failure: " + JSON.stringify(error)); - } - ); - }, (error) => { - console.log('MobileFirst Server connect: failure ' + error.responseText); - console.log(JSON.stringify(error)) - /* this.zone.run(() => { - alert("Bummer..."); - alert("Failed to connect to MobileFirst Server"); - }); */ - }); - //} catch {} + var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/", + WLResourceRequest.GET + ); + + resourceRequest.setQueryParameter("name", "world"); + resourceRequest.send().then( + (response) => { + // Will display "Hello world" in an alert dialog. + console.log("Connect with JavaAdapter Success: " + response.responseText); + //this.MFPushNotification(); + }, + (error) => { + alert("Connect with JavaAdapter Failure: " + JSON.stringify(error)); + } + ); + }, (error) => { + console.log('MobileFirst Server connect: failure ' + error.responseText); + console.log(JSON.stringify(error)) + /* this.zone.run(() => { + alert("Bummer..."); + alert("Failed to connect to MobileFirst Server"); + }); */ + }); } diff --git a/src/app/modals/document-detail/document-detail.page.html b/src/app/modals/document-detail/document-detail.page.html index 1aa5a94b5..0d44315f1 100644 --- a/src/app/modals/document-detail/document-detail.page.html +++ b/src/app/modals/document-detail/document-detail.page.html @@ -3,10 +3,10 @@
-
+
- {{LoadedDocument.Subject}} + {{LoadedDocument.Assunto}}
@@ -18,7 +18,7 @@
-

{{customDate}}{{LoadedDocument.Type}}

+

{{customDate}}{{LoadedDocument.Nature}}

@@ -43,7 +43,7 @@ -

{{LoadedDocument.Subject}}

+

{{LoadedDocument.Assunto}}

diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index 658e7d63f..dd54dc350 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -6,6 +6,8 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page'; import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page'; +import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document'; +import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; @Component({ selector: 'app-document-detail', @@ -23,6 +25,9 @@ export class DocumentDetailPage implements OnInit { applicationId:string; LoadedDocument:any = null; + folder: SearchFolder + document: FromSearchDocument + constructor( private navParams: NavParams, private modalController: ModalController, @@ -57,7 +62,6 @@ export class DocumentDetailPage implements OnInit { const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const browser = this.iab.create(url,"_blank"); browser.show(); - }); } @@ -75,30 +79,33 @@ export class DocumentDetailPage implements OnInit { // efetuar despacho async openExpedientActionsModal( taskAction: any) { - let task; + let task: ExpedientTaskModalPageNavParamsTask + + let document: FromSearchDocument = this.LoadedDocument + let folder: SearchFolder = this.LoadedDocument if(this.LoadedDocument.ApplicationID == 361) { task = { - serialNumber: this.LoadedDocument.DispatchNumber, - taskStartDate: this.LoadedDocument.DateDispatch, + serialNumber: folder.DispatchNumber, + taskStartDate: folder.DateDispatch, isEvent: true, workflowInstanceDataFields: { - FsId: this.LoadedDocument.ApplicationID, + FsId: folder.ApplicationID || folder.ApplicationId, FolderID: null, - DocId: this.LoadedDocument.DispatchNumber, - Subject: this.LoadedDocument.Assunto + DocId: folder.DispatchNumber, + Subject: folder.Assunto }, } - } else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) { + } else if (document.ApplicationID == 8 || document.ApplicationId == 8) { task = { - serialNumber: this.LoadedDocument.DocId, - taskStartDate: this.LoadedDocument.DocDate, + serialNumber: document.DocId, + taskStartDate: document.DocDate, isEvent: true, workflowInstanceDataFields: { - FsId: this.LoadedDocument.ApplicationID || this.LoadedDocument.ApplicationId, + FsId: document.ApplicationID || document.ApplicationId, FolderID: null, - DocId: this.LoadedDocument.DocId, - Subject: this.LoadedDocument.Assunto + DocId: document.DocId || document.DocID, + Subject: document.Assunto } } } @@ -124,34 +131,35 @@ export class DocumentDetailPage implements OnInit { async openBookMeetingModal() { + let document: FromSearchDocument = this.LoadedDocument + let folder: SearchFolder = this.LoadedDocument let task; - if(this.LoadedDocument.ApplicationID == 361) { + if(folder.ApplicationID == 361) { task = { - serialNumber: this.LoadedDocument.DispatchNumber, - taskStartDate: this.LoadedDocument.DateDispatch, + serialNumber: folder.DispatchNumber, + taskStartDate: folder.DateDispatch, isEvent: true, - Folio: this.LoadedDocument.Assunto, - FsId: this.LoadedDocument.ApplicationID, + Folio: folder.Assunto, + FsId: folder.ApplicationID, workflowInstanceDataFields: { - FsId: this.LoadedDocument.ApplicationID, + FsId: folder.ApplicationID, FolderID: null, - DocId: this.LoadedDocument.DispatchNumber, - Subject: this.LoadedDocument.Assunto + DocId: folder.DispatchNumber, + Subject: folder.Assunto }, } - } else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) { + } else if (document.ApplicationID == 8 || document.ApplicationId == 8) { task = { - serialNumber: this.LoadedDocument.SourceId, - taskStartDate: this.LoadedDocument.CreateDate, + taskStartDate: document.DocDate, isEvent: true, - Folio: this.LoadedDocument.Assunto, - FsId: this.LoadedDocument.ApplicationID, + Folio: document.Assunto, + FsId: document.ApplicationID, workflowInstanceDataFields: { - FsId: this.LoadedDocument.ApplicationID, + FsId: document.ApplicationID || document.ApplicationId, FolderID: null, - DocId: this.LoadedDocument.SourceId, - Subject: this.LoadedDocument.SourceName + DocId: document.DocID || document.DocId, + Subject: document.Assunto } } } diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index 825aae9a5..684a4282d 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -30,39 +30,29 @@
- 2 novas notificações + {{notificationdata.length}} novas notificações -
+
- + + +
-

08:00

-

09:00

+

{{item.dateInit}}

+

{{item.dateEnd}}

-

Luanda | Palácio Presidencial

-

Almoço de Família

+

{{item.Location}}

+

{{item.alert}}

-
-
-
- -
-
-

28-07-21

-

09:00

-
-
-

Relatório FMI

-

Luanda | Palácio Presidencial

-
-
-
diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 91bfb4fd2..c35035314 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -1,5 +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'; @@ -8,6 +10,8 @@ import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page'; import { PinPage } from 'src/app/shared/pin/pin.page'; import { LocalstoreService } from 'src/app/store/localstore.service'; import { EditProfilePage } from './edit-profile/edit-profile.page'; +import { JsonStore } from '../../services/jsonStore.service'; +import { StorageService } from '../../services/storage.service'; @Component({ selector: 'app-profile', @@ -18,14 +22,18 @@ export class ProfilePage implements OnInit { loggeduser: User; userLoginPreference = '' + notificationdata: any[]; + DataArray: Array = []; - constructor(private modalController:ModalController, + constructor(private modalController: ModalController, private authService: AuthService, private animationController: AnimationController, private router: Router, private localstoreService: LocalstoreService, - private toastService: ToastService, - ) { + private jsonstore: JsonStore, + private storageservice: StorageService, + private zone: NgZone, + ) { this.loggeduser = authService.ValidatedUser; @@ -34,25 +42,103 @@ export class ProfilePage implements OnInit { this.checkState() } - ngOnInit() {} + ngOnInit() { + this.storageservice.get("Notifications").then((value) => { + + var data = JSON.parse(value); + data.forEach(element => { + console.log("ARaaAA", element) + var payload = JSON.parse(element.payload) + let notificationObject = { + alert: element.alert, + Service: payload.Service, + Object: payload.Object, + IdObject: payload.IdObject, + FolderId: payload.FolderId, + desc: payload.desc, + dateInit: payload.dateInit, + dateEnd: payload.dateEnd, + Location: payload.Location, + TypeAgenda: payload.TypeAgenda, + Status: payload.Status + } + + this.DataArray.push(notificationObject) + }); + this.notificationdata = this.DataArray + console.log("Notificaaa", this.notificationdata) + }) + console.log("Notificaaa", this.notificationdata) + + } close() { this.modalController.dismiss(); } - notImplemented(){} + 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() { - const loader = this.toastService.loading(); + //const loader = this.toastService.loading(); // clear local storage window.localStorage.clear(); - setTimeout(()=>{ - //window.location.pathname = '/'; - //location.reload(); - this.router.navigate(['/']); - }, 1000); - loader.remove(); + setTimeout(() => { + window.location.pathname = '/' + location.reload(); + }, 1000) } @@ -63,7 +149,7 @@ export class ProfilePage implements OnInit { if (userData.hasOwnProperty('loginPreference')) { this.userLoginPreference = userData.loginPreference } else { - this.userLoginPreference = '' + this.userLoginPreference = '' } } diff --git a/src/app/models/CallMeeting.ts b/src/app/models/CallMeeting.ts index f20edc151..42bed156f 100644 --- a/src/app/models/CallMeeting.ts +++ b/src/app/models/CallMeeting.ts @@ -10,17 +10,17 @@ export class Attachments { export class DocumentSetUpMeeting { EventProcess: { - "SerialNumber"?: "sample string 1", + "SerialNumber"?: string, "Body": string, "Location": string, "Subject": string, - "StartDate"?: "2021-07-28T13:22:55.031857+01:00", - "EndDate"?: "2021-07-28T13:22:55.031857+01:00", - "ReviewUserComment"?: "sample string 7", - "MDName"?: "sample string 8", - "MDEmail"?: "sample string 9", + "StartDate"?: string, + "EndDate"?: string, + "ReviewUserComment"?: string, + "MDName"?: string, + "MDEmail"?: string, "IsAllDayEvent"?: boolean, - "Status"?: "sample string 11", + "Status"?: string, "EventType"?: string, "IsRecurring": boolean, "ParticipantsList"?: EventPerson[], @@ -30,7 +30,7 @@ export class DocumentSetUpMeeting { "Day"?: 1, "DayOfWeek"?: 0, "Month"?: 1, - "LastOccurrence"?: "2021-07-28T13:22:55.031857+01:00" + "LastOccurrence"?: string } } diff --git a/src/app/models/ExpedientTaskModalPage.ts b/src/app/models/ExpedientTaskModalPage.ts new file mode 100644 index 000000000..de198d6a1 --- /dev/null +++ b/src/app/models/ExpedientTaskModalPage.ts @@ -0,0 +1,17 @@ + + +export class ExpedientTaskModalPageNavParamsTask { + serialNumber: any + taskStartDate: string + isEvent: boolean + workflowInstanceDataFields: { + FsId: any, + FolderID: string, + DocId: any, + DocID?: any + Subject: string, + DispatchNumber?: any + } +} + +export class task extends ExpedientTaskModalPageNavParamsTask {} \ No newline at end of file diff --git a/src/app/models/search-document.ts b/src/app/models/search-document.ts index 7c2ae38f6..809db238e 100644 --- a/src/app/models/search-document.ts +++ b/src/app/models/search-document.ts @@ -1,5 +1,4 @@ export class SearchDocument { - ApplicationType: number | string; Assunto: string; Data: string; @@ -9,3 +8,40 @@ export class SearchDocument { Id: string; appName?: string; } + +export class FromSearchDocument { + ApplicationId: number + ApplicationID: number + Assunto: string + DocDate: string + DocId: number + DocID?: number + Sender: string + SenderId: number +} + + +export class SearchFolder { + ApplicationID: number + ApplicationId: number + Assunto:string + DateDispatch: string + DispatchNumber: string + Docs: string + Documents: { + Assunto: string + DocDate: string + DocId: number + DocNumber: string + Sender: string + }[] + DocumentsTotal: 2 + IntervenerList: string[] + Interveners: string + Nature:string + Sender: null | string + SenderId: null | string + Status: string + folderId: number +} + diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index bde1071bf..736ecbf38 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -129,7 +129,7 @@ - diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index f187c8671..451b33e31 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -82,8 +82,6 @@ export class AgendaPage implements OnInit { /* List of events of our calendar */ eventSource : eventSource[] = [] - - /* The title of the calendar */ viewTitle: string; @@ -173,7 +171,7 @@ export class AgendaPage implements OnInit { this.loggeduser = authService.ValidatedUser; - this.calendarHeight = "317px"; + this.calendarHeight = "320px"; this.showCalendar = true; this.timelineDate = momentG(new Date(),'dd MMMM yyyy'); @@ -590,7 +588,6 @@ export class AgendaPage implements OnInit { if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => { - this.calendarService.removeRange(startTime, endTime, 'md') const eventsList = res.filter(data => data.CalendarName == "Oficial"); 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 0bfb85dd1..7832ff11c 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -15,8 +15,7 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page'; import { AddNotePage } from 'src/app/modals/add-note/add-note.page'; import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page'; import { ToastService } from 'src/app/services/toast.service'; -import { DespachoMdService } from 'src/app/Rules/despacho-md.service' -import { NavigationService } from 'src/app/services/navigation.service'; +import { DespachoService } from 'src/app/Rules/despacho.service' import { Location } from '@angular/common' @Component({ @@ -47,14 +46,10 @@ export class DespachoPage implements OnInit { private events: EventsService, private menu: MenuController, private modalController: ModalController, - private alertService: AlertService, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, - private router: Router, - private animationController: AnimationController, private toastService: ToastService, - private despachoMdService: DespachoMdService, - private navigationService: NavigationService, + private despachoService: DespachoService, private location: Location ) { @@ -205,7 +200,7 @@ export class DespachoPage implements OnInit { const loader = this.toastService.loading() try { - await this.despachoMdService.executado(note, documents, this.serialnumber) + await this.despachoService.executado(note, documents, this.serialnumber) this.toastService.successMessage('Processo criado') this.close(); } catch(error) { @@ -301,7 +296,7 @@ export class DespachoPage implements OnInit { async sendExpedienteToPending() { - this.despachoMdService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{ + this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{ this.goBack(); this.toastService.successMessage('Processo enviado para despacho') }, 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 ce699f4a7..ba65238dd 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 @@ -19,6 +19,7 @@ import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.pag import { FormControl, FormGroup, Validators } from '@angular/forms'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; +import { task } from 'src/app/models/ExpedientTaskModalPage'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -49,7 +50,7 @@ export class ExpedientTaskModalPage implements OnInit { 'Solicitar Deferimento' ]; taskType:string; - task: any; + task: task; taskParticipants: any = []; taskParticipantsCc: any = []; diff --git a/src/app/services/jsonStore.service.spec.ts b/src/app/services/jsonStore.service.spec.ts new file mode 100644 index 000000000..ed030373c --- /dev/null +++ b/src/app/services/jsonStore.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { JsonStore } from './jsonStore.service'; + +describe('JsonStore', () => { + let service: JsonStore; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(JsonStore); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/jsonStore.service.ts b/src/app/services/jsonStore.service.ts new file mode 100644 index 000000000..59a25bd7b --- /dev/null +++ b/src/app/services/jsonStore.service.ts @@ -0,0 +1,130 @@ +/// +/// +import { Injectable } from "@angular/core"; + +@Injectable({ + providedIn: 'root' +}) + +export class JsonStore { + + createCollection(name, data) { + + var collectionName = name; + var addOptions = { + // Mark data as dirty (true = yes, false = no), default true. + markDirty: true + }; + + var JSONStoreCollections = {}; + JSONStoreCollections[collectionName] = {}; + JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; + + WL.JSONStore.init(JSONStoreCollections) + + .then(function () { + WL.Logger.debug('Init done'); + console.log('Init done'); + return WL.JSONStore.get(collectionName).add(data, addOptions); + + }).fail(function (err) { + WL.Logger.error(err); + console.log(err) + }); + + } + + getCollection(collectionName) { + + var allOptions = { + // Returns a maximum of 10 documents, default no limit. + limit: 10, + // Skip 0 documents, default no offset. + offset: 0, + // Search fields to return, default: ['_id', 'json']. + filter: ['UserId', 'json'], + // How to sort the returned values, default no sort.}] + }; + + var JSONStoreCollections = {}; + JSONStoreCollections[collectionName] = {}; + JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; + + WL.JSONStore.init(JSONStoreCollections) + .then(function () { + WL.Logger.debug('Find all colletion data'); + console.log('Find all colletion data'); + + + }).fail(function (err) { + WL.Logger.error(err); + console.log("JsonStore getColletion error ",err) + }); + + const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => { + console.log('Find all colletion data', value); + return JSON.parse(value); + }); + + + return data + + //return notificationData + } + + getColletionById(collectionName, value) { + + var query = { UserId: value }; + + var allOptions = { + // Returns a maximum of 10 documents, default no limit. + limit: 10, + // Skip 0 documents, default no offset. + offset: 0, + // Search fields to return, default: ['_id', 'json']. + filter: ['UserId', 'json'], + // How to sort the returned values, default no sort.}] + }; + + var JSONStoreCollections = {}; + JSONStoreCollections[collectionName] = {}; + JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; + + WL.JSONStore.init(JSONStoreCollections) + .then(function () { + WL.Logger.debug('Find colletion data by id'); + console.log('Find colletion data by id'); + + return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => { + console.log('Find colletion data by id', value); + }); + }).fail(function (err) { + WL.Logger.error(err); + console.log(err) + }); + + } + + replaceDocument(collectionName: string, document: any) { + /* var document = { Example of how identify the document to replace + _id: 1, json: {name: 'chevy', age: 23} + }; */ + var options = {}; + + WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) { + console.log("JsonStore replace document sucess: ", numberOfDocsReplaced) + }).fail(function (error) { + console.log("JsonStore replace document error: ", error) + }); + } + + removeDocument(collectionName: any,query: any,) { + /* var query = { _id: 1 }; Exemple of query*/ + var options = { exact: true }; + WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) { + console.log("JsonStore remove document sucess: ", numberOfDocsRemoved) + }).fail(function (error) { + console.log("JsonStore remove document erro: ", error) + }); + } +} \ No newline at end of file diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index b7c75972d..a08e0a10f 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -12,6 +12,7 @@ import { ModalController, AlertController, AnimationController, Platform } from import { NavigationExtras,Router } from '@angular/router'; import { ToastService } from '../services/toast.service'; import { Optional } from '@angular/core'; +import { JsonStore } from './jsonStore.service'; @Injectable({ providedIn: 'root' @@ -20,6 +21,7 @@ export class NotificationsService { adding: "intervenient" | "CC" = "intervenient"; folderId: string; + DataArray: Array = []; constructor( private http: HttpClient, @@ -31,7 +33,8 @@ export class NotificationsService { private router: Router, private toastService: ToastService, private zone: NgZone, - private activeroute: ActivatedRoute) { } + private activeroute: ActivatedRoute, + private jsonstore: JsonStore) { } getTokenByUserIdAndId(user, userID) { const geturl = environment.apiURL + 'notifications/user/' + userID; @@ -40,6 +43,7 @@ export class NotificationsService { } getAndpostToken(username) { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { console.log('Notifications not supported') } else { @@ -94,6 +98,62 @@ export class NotificationsService { } + getAndpostToken2() { + + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + console.log('Notifications not supported') + } else { + + const geturl = environment.apiURL + 'notifications/token'; + + window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then( + (token) => { + console.log('Push Notification: Success ' + token); + + window['MFPPush'].initialize( + function (successResponse) { + console.log("Push notification Successfully Service intialized: " + successResponse); + }, + function (failureResponse) { + console.log("Push notification failure Service intialized: " + failureResponse); + } + ); + + window['MFPPush'].registerDevice(null, (successResponse) => { + console.log("Successfully registered: " + JSON.stringify(successResponse)); + console.log('token: ', successResponse.deviceId) + /* this.storageService.store(username, successResponse.deviceId); + 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': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' }; + const body = { + UserId: res.UserId, + TokenId: successResponse.deviceId, + Status: 1, + Service: 1 + }; + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + console.log('TOKEN USER MIDLE', data); + }) + }); + + }); */ + }, + function (failureResponse) { + console.log("Successfully failue: " + JSON.stringify(failureResponse)); + } + ); + }, (error) => { + console.log('Push notification recived: failure ' + error.responseText); + console.log(JSON.stringify(error)); + } + ); + } + + } + async onReceviNotification() { window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then( (token) => { @@ -109,6 +169,10 @@ export class NotificationsService { } ); var notificationReceived = (message) => { + //this.jsonstore.createCollection('Notifications',message); + this.DataArray.push(message) + this.storageService.store("Notifications",JSON.stringify(this.DataArray)) + console.log(message); var data = JSON.parse(message.payload); console.log(data.Service); diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index 0a8e7c9a2..fdef4a5bd 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -422,10 +422,8 @@ export class EditEventPage implements OnInit { this.loadedEventAttachments[index]['remove'] = true } - } - async getDoc() { const modal = await this.modalController.create({ diff --git a/src/app/shared/agenda/event-list/event-list.page.html b/src/app/shared/agenda/event-list/event-list.page.html index 4ef5768c6..348467823 100644 --- a/src/app/shared/agenda/event-list/event-list.page.html +++ b/src/app/shared/agenda/event-list/event-list.page.html @@ -27,7 +27,7 @@ -
+
diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index efd3fe72d..648b20441 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -56,7 +56,7 @@ - diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 74584bf7c..9a329fe88 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -139,7 +139,7 @@ export class HeaderPage implements OnInit { window['dynamicSearch'](this.searchSubject) } - async basicSearch(){ + async basicSearch() { window['searchTriger']() } } diff --git a/src/app/store/despacho-store.service.ts b/src/app/store/despacho-store.service.ts index 796a82529..9282a06fd 100644 --- a/src/app/store/despacho-store.service.ts +++ b/src/app/store/despacho-store.service.ts @@ -20,8 +20,8 @@ export class DespachoStoreService { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 }, 10) } @@ -36,20 +36,21 @@ export class DespachoStoreService { set count(value: number) { this._count = value + this.save() } reset(eventsList: any) { this._list = eventsList this.count = this._list.length - this.save(this._list) + this.save() } - private save(eventsList: any) { + private save() { setTimeout(()=>{ localstoreService.set(this.keyName,{ - eventsList, - count: this._list.length + list: this._list, + count: this._count }) }, 10) diff --git a/src/app/store/despachos-page-store.service.ts b/src/app/store/despachos-page-store.service.ts index 61f6bcfdb..a1f027eb5 100644 --- a/src/app/store/despachos-page-store.service.ts +++ b/src/app/store/despachos-page-store.service.ts @@ -20,8 +20,8 @@ export class DespachosPageStoreService { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 }, 10) } @@ -35,23 +35,23 @@ export class DespachosPageStoreService { } set count(value) { this._count = value + this.save() } reset(eventsList: any) { this._list = eventsList this.count = this._list.length - this.save(this._list) + this.save() } - private save(eventsList: any) { - setTimeout(()=>{ + private save() { + setTimeout(()=> { localstoreService.set(this.keyName,{ - eventsList, - count: this._list.length + list: this._list, + count: this._count }) }, 10) - } } diff --git a/src/app/store/despachospr-store.service.ts b/src/app/store/despachospr-store.service.ts index 132fc1117..09a345fb6 100644 --- a/src/app/store/despachospr-store.service.ts +++ b/src/app/store/despachospr-store.service.ts @@ -20,8 +20,8 @@ constructor() { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 }, 10) } @@ -30,25 +30,24 @@ get list() { return this._list || [] } -get count() { - return this._count -} +get count() { return this._count } set count(value: number) { this._count = value + this.save() } reset(eventsList: any) { this._list = eventsList this.count = this._list.length - this.save(this._list) + this.save() } -private save(eventsList: any) { +private save() { setTimeout(()=>{ localstoreService.set(this.keyName,{ - eventsList, - count: this._list + list: this._list, + count:this._count }) }, 10) diff --git a/src/app/store/eventoaprovacao-store.service.ts b/src/app/store/eventoaprovacao-store.service.ts index 3bd1e8b8c..c8745e4b8 100644 --- a/src/app/store/eventoaprovacao-store.service.ts +++ b/src/app/store/eventoaprovacao-store.service.ts @@ -8,12 +8,14 @@ import { AES, enc, SHA1 } from 'crypto-js' export class EventoaprovacaoStoreService { // main data - private _listpr: Event[] = [] - private _listmd: Event[] = [] + private _listPr: any[] = [] + private _listMd: any[] = [] // local storage keyName private keyNamemd: string; private keyNamepr: string; private _count = 0 + _countPr = 0 + _countMd = 0 constructor() { @@ -22,59 +24,67 @@ export class EventoaprovacaoStoreService { setTimeout(()=>{ - let restoremd = localstoreService.get(this.keyNamemd, {}) - let restorepr = localstoreService.get(this.keyNamepr, {}) + let restoreMd = localstoreService.get(this.keyNamemd, {}) + let restorePr = localstoreService.get(this.keyNamepr, {}) - this._listpr = restorepr.eventsListpr || [] - this._listmd = restoremd.eventsListmd || [] - this._count = this._listpr.length + this._listmd.length || 0 + this._listPr = restorePr.lisMd || [] + this._listMd = restoreMd.listPr || [] + this._countMd = parseInt(restoreMd.countListMd) || 0 + this._countPr = parseInt(restoreMd.countListPr) || 0 + this._count = (this._countMd + this._countPr) || 0 }, 10) } - get listpr() { - return this._listpr - } - - get listmd() { - return this._listmd - } + get listpr() { return this._listPr } + get listmd() { return this._listMd } - get count() { - return this._count - } - + get count() { return this._count } set count(value: number) { this._count = value } - resetpr(eventsList: any) { - this._listpr = eventsList + get countPr() { return this._countPr } + set countPr (value) { + this._countPr = value + } - this.count = this._listmd.length + this.listpr.length - this.savepr(this._listpr) + get countMd() { return this._countMd } + set countMd (value) { + this._countMd = value + } + + resetpr(eventsList: any) { + this._listPr = eventsList + + this.countPr = this._listPr.length + this.count = this.countPr + this.countMd + + this.savePr() } resetmd(eventsList: any) { - this._listmd = eventsList + this._listMd = eventsList - this.count = this._listmd.length + this.listpr.length - this.savemd(this._listmd) + this.countMd = this._listMd.length + this.count = this.countPr + this.countMd + this.saveMd() } - private savemd(eventsListmd: any) { + private saveMd() { setTimeout(()=>{ localstoreService.set(this.keyNamemd,{ - eventsListmd, + lisMd: this._listMd, + countListMd: this._countMd }) }, 10) } - - private savepr(eventsListpr: any) { + private savePr() { setTimeout(()=>{ localstoreService.set(this.keyNamepr,{ - eventsListpr, + listPr: this._listPr, + countListPr: this._countPr }) }, 10) diff --git a/src/app/store/expediente-storage-service.service.ts b/src/app/store/expediente-storage-service.service.ts index 36214cb1c..1fa536bce 100644 --- a/src/app/store/expediente-storage-service.service.ts +++ b/src/app/store/expediente-storage-service.service.ts @@ -37,20 +37,21 @@ class ExpedienteStorageServiceService { } set count(value: number) { this._count = value + this.save() } reset(list: any) { this._list = list this.count = this._list.length - this.save(this._list) + this.save() } - private save(list: any) { + private save() { setTimeout(()=>{ localstoreService.set(this.keyName, { - list: list, - count: this.count + list: this._list, + count: this._count }) }, 10) } diff --git a/src/app/store/expedientegd-store.service.ts b/src/app/store/expedientegd-store.service.ts index 6167db1ba..c139f8096 100644 --- a/src/app/store/expedientegd-store.service.ts +++ b/src/app/store/expedientegd-store.service.ts @@ -17,10 +17,10 @@ export class ExpedientegdStoreService { this.keyName = (SHA1(this.constructor.name)).toString() - setTimeout(()=>{ + setTimeout(()=> { let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 }, 10) } @@ -33,19 +33,21 @@ export class ExpedientegdStoreService { } set count(value: number) { this._count = value + this.save() } reset(eventsList: any) { this._list = eventsList this.count = this._list.length - this.save(this._list) + this.save() } - private save(eventsList: any) { + private save() { setTimeout(()=>{ localstoreService.set(this.keyName,{ - eventsList, + list: this._list, + count: this._count }) }, 10) diff --git a/src/app/store/expedientepr-store.service.ts b/src/app/store/expedientepr-store.service.ts index 5446e54f7..860730f03 100644 --- a/src/app/store/expedientepr-store.service.ts +++ b/src/app/store/expedientepr-store.service.ts @@ -6,51 +6,48 @@ import { AES, enc, SHA1 } from 'crypto-js' providedIn: 'root' }) export class ExpedienteprStoreService { -// main data -private _list: [] = [] -// local storage keyName -private keyName: string; -private _count = 0 + // main data + private _list: [] = [] + // local storage keyName + private keyName: string; + private _count = 0 -constructor() { + constructor() { - this.keyName = (SHA1(this.constructor.name)).toString() - - - setTimeout(()=>{ - let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 - }, 10) + this.keyName = (SHA1(this.constructor.name)).toString() + + setTimeout(()=>{ + let restore = localstoreService.get(this.keyName, {}) + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 + }, 10) -} + } -get list() { - return this._list || [] -} + get list() { return this._list || [] } -get count() { - return this._count -} -set count(value: number) { - this._count = value -} + get count() { return this._count } + set count(value: number) { + this._count = value + this.save() + } -reset(eventsList: any) { - this._list = eventsList + reset(eventsList: any) { + this._list = eventsList - this.count = this._list.length - this.save(this._list) -} + this.count = this._list.length + this.save() + } -private save(eventsList: any) { - setTimeout(()=>{ - localstoreService.set(this.keyName,{ - eventsList, - }) - }, 10) - -} + private save() { + setTimeout(()=>{ + localstoreService.set(this.keyName,{ + list: this._list, + count: this._count + }) + }, 10) + + } } diff --git a/src/app/store/localstore.service.ts b/src/app/store/localstore.service.ts index 63635fad8..72cc56608 100644 --- a/src/app/store/localstore.service.ts +++ b/src/app/store/localstore.service.ts @@ -6,7 +6,7 @@ import { AES, enc, SHA1 } from 'crypto-js' }) export class LocalstoreService { - private prefix = 'v13-' + private prefix = 'v14-' constructor() { @@ -59,18 +59,16 @@ export class LocalstoreService { export const localstoreService = new LocalstoreService() +// // Create WebSocket connection. +// const socket = new WebSocket('ws://localhost:8080'); +// // Listen for messages +// socket.addEventListener('message', function (event) { +// console.log('Message from server ', event.data); // Message from server mobile first é fraco -/* // Create WebSocket connection. -const socket = new WebSocket('ws://localhost:8080'); +// var p = Promise.resolve(event.data); +// p.then(function(v) { +// console.log(v); // mobile first é fraco +// }); -// Listen for messages -socket.addEventListener('message', function (event) { - console.log('Message from server ', event.data); // Message from server mobile first é fraco - - var p = Promise.resolve(event.data); - p.then(function(v) { - console.log(v); // mobile first é fraco - }); - -}); */ +// }); diff --git a/src/app/store/pedidos-store.service.ts b/src/app/store/pedidos-store.service.ts index 877184fba..d9225cd3c 100644 --- a/src/app/store/pedidos-store.service.ts +++ b/src/app/store/pedidos-store.service.ts @@ -7,86 +7,89 @@ import { AES, enc, SHA1 } from 'crypto-js' }) export class PedidosStoreService { - private _listparecer: Event[] = [] - private _listdeferimento: Event[] = [] + private _listParecer: Event[] = [] + private _listDeferimento: Event[] = [] // local storage keyName private keyNameparecer: string; private keyNamedeferiemnto: string; private _countparecer = 0 - private _countdeferiemnto = 0 + private _countDeferiemnto = 0 constructor() { this.keyNameparecer = (SHA1(this.constructor.name+"parecer")).toString() this.keyNamedeferiemnto = (SHA1(this.constructor.name+"deferimneto")).toString() - setTimeout(()=>{ - let restoreparecer = localstoreService.get(this.keyNameparecer, {}) - let restoredeferimento = localstoreService.get(this.keyNamedeferiemnto, {}) + let restoreParecer = localstoreService.get(this.keyNameparecer, {}) + let restoreDeferimento = localstoreService.get(this.keyNamedeferiemnto, {}) - this._listparecer = restoredeferimento.eventsListdeferimento || [] - this._listdeferimento = restoreparecer.eventsListparecer || [] - this._countparecer = this._listparecer.length || 0 - this._countdeferiemnto = this._listdeferimento.length || 0 + this._listParecer = restoreDeferimento.listDeferimento || [] + this._listDeferimento = restoreParecer.listParecer || [] + this._countparecer = parseInt(restoreParecer.count) || 0 + this._countDeferiemnto = parseInt(restoreDeferimento.count) || 0 }, 10) } get listparecer() { - return this._listparecer + return this._listParecer } get listdeferimento() { - return this._listdeferimento - } + return this._listDeferimento + } + get countparecer() { return this._countparecer } set countparecer(value: number) { this._countparecer = value + this.saveParecer() } get countdeferimento() { - return this._countdeferiemnto + return this._countDeferiemnto } set countdeferimento(value: number ) { - this._countdeferiemnto = value + this._countDeferiemnto = value + this.saveDeferimento() } resetparecer(eventsList: any) { - this._listparecer = eventsList + this._listParecer = eventsList - this.countparecer = this._listparecer.length - this.savedeferimento(this._listparecer) + this.countparecer = this._listParecer.length + this.saveDeferimento() } - resetdeferimento(eventsList: any) { - this._listdeferimento = eventsList + resetdeferimento(list: any) { + this._listDeferimento = list - this.countdeferimento =this._listdeferimento.length - this.saveparecer(this._listdeferimento) - } - private saveparecer(eventsListparecer: any) { + this.countdeferimento =this._listDeferimento.length + this.saveParecer() + } + + private saveParecer() { setTimeout(()=>{ localstoreService.set(this.keyNameparecer,{ - eventsListparecer, - count: this._listparecer, + listParecer: this._listParecer, + count: this._countparecer, }) }, 10) } - private savedeferimento(eventsListdeferimento: any) { - setTimeout(()=>{ - localstoreService.set(this.keyNamedeferiemnto,{ - eventsListdeferimento, - count: this._listdeferimento, - }) - }, 10) - - } + private saveDeferimento() { + setTimeout(()=>{ + localstoreService.set(this.keyNamedeferiemnto,{ + listDeferimento: this._listParecer, + count: this._countDeferiemnto, + }) + }, 10) + + } } diff --git a/src/app/store/pendestes-store.service.ts b/src/app/store/pendestes-store.service.ts index 798b2c151..0603f80b3 100644 --- a/src/app/store/pendestes-store.service.ts +++ b/src/app/store/pendestes-store.service.ts @@ -8,52 +8,53 @@ import { AES, enc, SHA1 } from 'crypto-js' export class PendestesStoreService { // main data -private _list = [] -// local storage keyName -private keyName: string; -private _count = 0 + private _list = [] + // local storage keyName + private keyName: string; + private _count = 0 -constructor() { + constructor() { - this.keyName = (SHA1(this.constructor.name)).toString() + this.keyName = (SHA1(this.constructor.name)).toString() + + + setTimeout(()=>{ + let restore = localstoreService.get(this.keyName, {}) + this._list = restore.list || [] + this._count = parseInt(restore.count) || 0 + }, 10) + + } - - setTimeout(()=>{ - let restore = localstoreService.get(this.keyName, {}) - this._list = restore.eventsList || [] - this._count = this._list.length || 0 - }, 10) + get list() { + return this._list + } -} + get count() { + return this._count + this.save() + } + set count(value) { + this._count = value + } -get list() { - return this._list -} -get count() { - return this._count -} -set count(value) { - this._count = value -} + reset(eventsList: any) { + this._list = eventsList -reset(eventsList: any) { - this._list = eventsList + this.count = this._list.length + this.save() + } - this.count = this._list.length - this.save(this._list) -} - -private save(eventsList: any) { - setTimeout(()=>{ - localstoreService.set(this.keyName,{ - eventsList, - count: this._list.length - }) - }, 10) - -} + private save() { + setTimeout(()=>{ + localstoreService.set(this.keyName,{ + list: this._list, + count: this._list.length + }) + }, 10) + + } } export const PendentesStore = new PendestesStoreService() - diff --git a/src/app/store/presidential-actions-store.service.ts b/src/app/store/presidential-actions-store.service.ts index 9e48b54f5..1d6dff817 100644 --- a/src/app/store/presidential-actions-store.service.ts +++ b/src/app/store/presidential-actions-store.service.ts @@ -17,9 +17,9 @@ export class PresidentialActionsStoreService { this.keyName = (SHA1(this.constructor.name+ 'presidentialActions/local')).toString() - setTimeout(()=>{ + setTimeout(()=>{ let restore = localstoreService.get(this.keyName, []) - this._list = restore + this._list = restore.list }, 10) } @@ -36,7 +36,9 @@ export class PresidentialActionsStoreService { private save(list: Publication[]) { setTimeout(()=> { - localstoreService.set(this.keyName, list) + localstoreService.set(this.keyName, { + list: this._list + }) }, 10) } diff --git a/src/app/store/publication-event-folder.service.ts b/src/app/store/publication-event-folder.service.ts index 9c5d229ed..caefad462 100644 --- a/src/app/store/publication-event-folder.service.ts +++ b/src/app/store/publication-event-folder.service.ts @@ -18,7 +18,7 @@ export class PublicationEventFolderService { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, []) - this._list = restore + this._list = restore.list }, 10) } @@ -30,12 +30,14 @@ export class PublicationEventFolderService { reset(list: PublicationFolder[]) { this._list = list - this.save(this._list) + this.save() } - private save(list: PublicationFolder[]) { + private save() { setTimeout(()=> { - localstoreService.set(this.keyName, list) + localstoreService.set(this.keyName, { + list: this._list + }) }, 10) } } diff --git a/src/app/store/publication-list.service.ts b/src/app/store/publication-list.service.ts index cd507450b..816798a22 100644 --- a/src/app/store/publication-list.service.ts +++ b/src/app/store/publication-list.service.ts @@ -19,7 +19,7 @@ export class PublicationListService { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, []) - this._document = restore + this._document = restore.document }, 10) } @@ -36,7 +36,9 @@ export class PublicationListService { this._document[folderId] = document setTimeout(()=> { - localstoreService.set(this.keyName, this._document) + localstoreService.set(this.keyName, { + document: this._document + }) }, 100) } diff --git a/src/app/store/publication-travel-folder.service.ts b/src/app/store/publication-travel-folder.service.ts index 7bd4dadaa..6497f0c93 100644 --- a/src/app/store/publication-travel-folder.service.ts +++ b/src/app/store/publication-travel-folder.service.ts @@ -20,7 +20,7 @@ export class PublicationTravelFolderService { setTimeout(()=>{ let restore = localstoreService.get(this.keyName, []) - this._list = restore + this._list = restore.list }, 10) } @@ -37,7 +37,9 @@ export class PublicationTravelFolderService { private save(list: PublicationFolder[]) { setTimeout(()=> { - localstoreService.set(this.keyName, list) + localstoreService.set(this.keyName, { + list: this._list + }) }, 10) } } diff --git a/src/app/store/to-day-event-storage.service.ts b/src/app/store/to-day-event-storage.service.ts index c28c671a5..70f1fa2ad 100644 --- a/src/app/store/to-day-event-storage.service.ts +++ b/src/app/store/to-day-event-storage.service.ts @@ -20,10 +20,10 @@ export class ToDayEventStorageService { this.keyName = (SHA1(this.constructor.name+ 'home/eventSource')).toString() - setTimeout(() => { + setTimeout(() => { let restore = localstoreService.get(this.keyName, {}) this._eventsList = restore.eventsList || [] - this._count = this._eventsList.length || 0 + this._count = parseInt(restore.count) || 0 }, 10) } @@ -36,19 +36,20 @@ export class ToDayEventStorageService { } set count(value: number) { this._count = value + this.save() } reset(eventsList: Event[]) { this._eventsList = eventsList this.count = this._eventsList.length - this.save(this._eventsList) + this.save() } - private save(eventsList: Event[]) { + private save() { setTimeout(()=>{ localstoreService.set(this.keyName,{ - eventsList, + eventsList :this._eventsList, count: this._eventsList }) }, 10) diff --git a/src/global.scss b/src/global.scss index 8dd6649de..53ef6a9f6 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1071,6 +1071,7 @@ ngx-mat-datetime-content{ } +// Agenda show event from two profile @media only screen and (max-width: 767px) { .calendar-segment-mdgpr:not(.calendar-segment-pr-force) { .calendar-pr-event-type-Oficial {