diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts
index 5cb942836..944d2eb15 100644
--- a/src/app/modals/profile/profile.page.ts
+++ b/src/app/modals/profile/profile.page.ts
@@ -1,7 +1,7 @@
///
///
-import { Component, OnInit,NgZone } from '@angular/core';
-import { Router,NavigationExtras } 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';
@@ -9,6 +9,7 @@ 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';
+import { NotificationsService } from '../../services/notifications.service';
@Component({
selector: 'app-profile',
@@ -30,6 +31,7 @@ export class ProfilePage implements OnInit {
private jsonstore: JsonStore,
private storageservice: StorageService,
private zone: NgZone,
+ private notificationservice: NotificationsService
) {
this.loggeduser = authService.ValidatedUser;
@@ -43,10 +45,11 @@ export class ProfilePage implements OnInit {
this.storageservice.get("Notifications").then((value) => {
var data = JSON.parse(value);
- data.forEach(element => {
+ data.forEach((element, i) => {
console.log("ARaaAA", element)
var payload = JSON.parse(element.payload)
let notificationObject = {
+ index: i,
alert: element.alert,
Service: payload.Service,
Object: payload.Object,
@@ -75,65 +78,72 @@ export class ProfilePage implements OnInit {
notImplemented() { }
- notificatinsRoutes = (Service,Object,IdObject,FolderId) => {
+ notificatinsRoutes = (index, 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']));
+ 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/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}));
+ 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']));
+ 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']));
+ this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));
}
else if (Service === "gabinete-digital" && Object === "despachos-pr") {
+ this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr',IdObject,'gabinete-digital']));
+ }
+ 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/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));
+ 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']));
+ this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital']));
}
+
+ const indexx = this.notificationdata.indexOf(index, 0);
+ if (indexx > -1) {
+ this.notificationdata.splice(index, 1);
+ console.log('This notificatio', this.notificationdata);
+ }
+
+ this.notificationservice.removeDepartment(index);
+ console.log('This notificatio 2', this.notificationdata);
+
+
+
}
logout() {
window.localStorage.clear();
- setTimeout(()=> {
+ setTimeout(() => {
this.router.navigateByUrl('/', { replaceUrl: true });
- },100)
-
+ }, 100)
+
}
checkState() {
diff --git a/src/app/models/dailyworktask.model.ts b/src/app/models/dailyworktask.model.ts
index d180b0d38..8844e0a6c 100644
--- a/src/app/models/dailyworktask.model.ts
+++ b/src/app/models/dailyworktask.model.ts
@@ -11,8 +11,6 @@ export class DailyWorkTask{
Status: string;
}
-
-
export class fullTask {
actions: null;
activityInstanceName: string;
@@ -67,7 +65,9 @@ export class fullTask {
workflowInstanceID: number
workflowName: string
}
+
export class tasksList extends fullTask{}
+
export class customTaskList {
SerialNumber: string
Folio : string
@@ -82,4 +82,5 @@ export class customTaskList {
activityInstanceName : string
Status : string
}
-export class customTask extends customTaskList{}
\ No newline at end of file
+
+export class customTask extends customTaskList{}
diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts
index 9c73230e9..c08b9e153 100644
--- a/src/app/pages/chat/messages/messages.page.ts
+++ b/src/app/pages/chat/messages/messages.page.ts
@@ -91,7 +91,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
} catch(err) { }
}
- sendMessage(){
+ sendMessage() {
let body = {
"message":
{
@@ -104,7 +104,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
this.message = "";
}
- loadMessages(){
+ loadMessages() {
this.showLoader = true;
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
/* console.log(res); */
@@ -113,7 +113,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
this.showLoader = false;
})
}
- getChatMembers(){
+ getChatMembers() {
this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res=> {
this.members = res['members'];
@@ -167,7 +167,7 @@ export class MessagesPage implements OnInit, AfterViewChecked {
return await popover.present();
}
- async serverLongPull(){
+ async serverLongPull() {
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
if (res == 502) {
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html
index 15f4d9475..b172277c5 100644
--- a/src/app/pages/gabinete-digital/gabinete-digital.page.html
+++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html
@@ -95,7 +95,7 @@
Todas as tarefas
-
{{count_all_processes}} Documentos
+
{{ totalDocumentStore.count }} Documentos
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
index ef67fbc35..3fb1fae68 100644
--- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts
+++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
@@ -18,6 +18,7 @@ import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
+import { TotalDocumentStore } from 'src/app/store/total-document.service';
@Component({
selector: 'app-gabinete-digital',
@@ -94,6 +95,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
pedidosstore = PedidosStore;
expedienteprstore = ExpedienteprStore;
despachoprstore = DespachosprStore;
+ totalDocumentStore = TotalDocumentStore
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
@@ -211,6 +213,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.allProcessesList.push(task);
this.allProcessesList = removeDuplicate( this.allProcessesList)
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
+
+ this.totalDocumentStore.resetCount( this.allProcessesList.length)
});
this.skeletonLoader = false;
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts
index 12f62751a..b872b042d 100644
--- a/src/app/pages/login/login.page.ts
+++ b/src/app/pages/login/login.page.ts
@@ -206,8 +206,6 @@ export class LoginPage implements OnInit {
this.localstoreService.set('UserData', userData)
-
-
this.localstoreService.set('PIN', encrypted)
this.router.navigate(['/home/events']);
diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts
index 4e5ee8bda..d253a06ed 100644
--- a/src/app/services/notifications.service.ts
+++ b/src/app/services/notifications.service.ts
@@ -165,6 +165,16 @@ export class NotificationsService {
}
+ removeDepartment(index): void {
+ /* this.DataArray[this.DataArray.findIndex(item => item.index == index)];
+ this.DataArray.splice( this.DataArray.findIndex(item => item.indexOf(index.to) === 'William'),1); */
+ const indexx = this.DataArray.indexOf(index, 0);
+ if (indexx > -1) {
+ this.DataArray.splice(index, 1);
+ console.log('This notificatio', this.DataArray);
+ }
+ }
+
async onReceviNotification() {
if(window['WLAuthorizationManager']) {
@@ -185,6 +195,7 @@ export class NotificationsService {
var notificationReceived = (message) => {
//this.jsonstore.createCollection('Notifications',message);
this.DataArray.push(message)
+ console.log("On ReceiveNotification", message)
this.storageService.store("Notifications",JSON.stringify(this.DataArray))
console.log(message);
@@ -196,7 +207,9 @@ export class NotificationsService {
if(message.actionName){
this.notificatinsRoutes(data);
} else {
- this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
+ /* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); */
+ //this.notificatinsRoutes(data);
+ console.log(data)
}
}
@@ -234,12 +247,7 @@ export class NotificationsService {
}
else if (data.Service === "gabinete-digital" && data.Object === "despachos-pr") {
- let navigationExtras: NavigationExtras = {
- queryParams: {
- "serialNumber": data.IdObject,
- }
- };
- this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras));
+ this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr',data.IdObject,'gabinete-digital']));
}
else if (data.Service === "accoes" && data.Object === "accao") {
this.zone.run(() => this.router.navigate(['/home/publications',data.IdObject]));
diff --git a/src/app/services/socket/synchro.service.spec.ts b/src/app/services/socket/synchro.service.spec.ts
new file mode 100644
index 000000000..61f099398
--- /dev/null
+++ b/src/app/services/socket/synchro.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { SynchroService } from './synchro.service';
+
+describe('SynchroService', () => {
+ let service: SynchroService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(SynchroService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/services/socket/synchro.service.ts b/src/app/services/socket/synchro.service.ts
new file mode 100644
index 000000000..7caea0a1a
--- /dev/null
+++ b/src/app/services/socket/synchro.service.ts
@@ -0,0 +1,74 @@
+import { Injectable } from '@angular/core';
+import { v4 as uuidv4 } from 'uuid'
+
+export interface wss{
+
+ url: string,
+ type: 'reflect' | 'emit'
+ header: {
+ id: string
+ bluePrint: string,
+ jwt: string
+ }
+
+}
+
+@Injectable({
+ providedIn: 'root'
+})
+export class SynchroService {
+ [x: string]: any;
+
+ private connection!: WebSocket;
+ private id: string = uuidv4();
+ public conected = false
+ private url: string = ''
+
+ constructor(){}
+
+ setUrl(wss:wss) {
+ this.url = `${wss.url}${wss.header.id}/${wss.header.jwt}/${wss.header.bluePrint}/${this.id}/`
+ }
+
+ connect() {
+
+ this.connection = new WebSocket(this.url);
+ // bind function
+ this.connection.onopen = this.onopen;
+ this.connection.onmessage = this.onmessage;
+ this.connection.onclose = this.onclose;
+ this.connection.onerror = this.onerror;
+ }
+
+ private onopen = () =>{
+ console.log('open ======================= welcome to socket server')
+ // this.connection.send(JSON.stringify({user:'user1'}));
+ }
+
+ public $send = (object: any) => {
+ let sendData = JSON.stringify(Object.assign({}, object));
+ this.connection.send(sendData);
+ }
+
+ private onmessage = async (event: any)=> {
+
+ }
+
+ private onclose=(event:any)=>{
+ setTimeout(() => {
+ if (event.wasClean) {
+ console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
+ } else {
+ // e.g. server process killed or network down
+ // event.code is usually 1006 in this case
+ console.log('[close] Connection died');
+ console.log('Reconnect')
+ this.connect()
+ }
+ }, 100);
+ }
+
+ private onerror=(event: any)=>{
+ console.log(`[error] ${event.message}`);
+ }
+}
diff --git a/src/app/services/storage.service.ts b/src/app/services/storage.service.ts
index ddf454338..95ba38c25 100644
--- a/src/app/services/storage.service.ts
+++ b/src/app/services/storage.service.ts
@@ -18,6 +18,12 @@ const { Storage } = Plugins; */
const ret = await this.storage.get(key).then((val) => { return val; });
return JSON.parse(unescape(atob(ret)));
}
+
+ async remove(key: string){
+ await this.storage.remove(key);
+ }
+
+
/*
// Get the value
async get(storageKey: string) {
diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
index ea9cbc679..9feb79e4b 100644
--- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
+++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
@@ -270,6 +270,7 @@ export class OptsExpedientePrPage implements OnInit {
taskAction: taskAction,
task: task,
profile: this.profile,
+ fulltask: this.fulltask,
},
cssClass: classs,
});
diff --git a/src/app/store/deplomas.service.ts b/src/app/store/deplomas.service.ts
index d91e5ac73..23794433a 100644
--- a/src/app/store/deplomas.service.ts
+++ b/src/app/store/deplomas.service.ts
@@ -75,6 +75,7 @@ export class DeplomasService {
}
saveDiplomasAssinadoList() {
+
setTimeout(()=>{
localstoreService.set(this.keyNameDiplomasAssinado,{
list: this._diplomasAssinadoList,
diff --git a/src/app/store/total-document.service.spec.ts b/src/app/store/total-document.service.spec.ts
new file mode 100644
index 000000000..587b2c9f7
--- /dev/null
+++ b/src/app/store/total-document.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { TotalDocumentService } from './total-document.service';
+
+describe('TotalDocumentService', () => {
+ let service: TotalDocumentService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(TotalDocumentService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/total-document.service.ts b/src/app/store/total-document.service.ts
new file mode 100644
index 000000000..bfab89865
--- /dev/null
+++ b/src/app/store/total-document.service.ts
@@ -0,0 +1,43 @@
+import { Injectable } from '@angular/core';
+import { localstoreService } from './localstore.service'
+import { AES, enc, SHA1 } from 'crypto-js'
+
+@Injectable({
+ providedIn: 'root'
+})
+export class TotalDocumentService {
+
+ private _count = 0
+ // local storage keyName
+ private keyName: string;
+
+ constructor() {
+ this.keyName = (SHA1(this.constructor.name)).toString()
+
+ setTimeout(()=> {
+ let restore = localstoreService.get(this.keyName, {})
+ this._count = restore.count || 0
+ }, 10)
+
+ }
+
+ get count() {
+ return this._count
+ }
+
+ resetCount(value) {
+ this._count = value
+ }
+
+ saveCount() {
+ setTimeout(()=> {
+ localstoreService.set(this.keyName, {
+ count: this._count
+ })
+ }, 10)
+ }
+
+}
+
+
+export let TotalDocumentStore = new TotalDocumentService()