diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 6e13d2471..e157b893e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -151,7 +151,7 @@

Todas as tarefas

{{ getAllProcessCount }} Documentos

- +
@@ -159,7 +159,7 @@

Eventos para Aprovação

{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} Documentos

- +
@@ -222,6 +222,32 @@

Pedidos de Deferimento

{{pedidosstore.countdeferimento}} Documentos

+ +
+
+
+ + + +
+
+

Despacho do Presidente da República

+

Despachos criados por mim

+

{{ despachoprstore.count }} Documentos

+
+
+
+ +
+
+ + + +
+

Diplomas por Validar

+

Diplomas por Assinar

+

{{ deplomasStore.deplomasReviewCount }} Documentos

+
@@ -237,6 +263,17 @@
+
+
+ + + +
+

Diplomas assinados PR

+

Diplomas

+

{{ deplomasStore.countDiplomasAssinadoListCount }} Documentos

+
+
@@ -313,6 +350,7 @@
+ @@ -332,10 +370,15 @@
+
+ + +
+
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 7c8f64857..787d027a4 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -131,7 +131,8 @@ export class LoginPage implements OnInit { this.ChatSystemService.loadChat(); } - + + this.changeProfileService.runLogin(); this.getToken(); SessionStore.setInativity(true); diff --git a/src/app/services/attachments.service.ts b/src/app/services/attachments.service.ts index 85b91a87c..fd67ce1ee 100644 --- a/src/app/services/attachments.service.ts +++ b/src/app/services/attachments.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Attachment, EventAttachment } from '../models/attachment.model'; +import { Attachment } from '../models/attachment.model'; import { Observable } from 'rxjs'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { environment } from 'src/environments/environment'; @@ -7,6 +7,7 @@ import { LoginUserRespose } from '../models/user.model'; import { SessionStore } from '../store/session.service'; import { File } from '@ionic-native/file/ngx'; import { Platform } from '@ionic/angular'; +import { ChangeProfileService } from './change-profile.service'; @Injectable({ providedIn: 'root' @@ -16,11 +17,29 @@ export class AttachmentsService { loggeduser: LoginUserRespose; headers: HttpHeaders; - constructor(private http: HttpClient, private platform: Platform, private file: File) { + constructor( + private http: HttpClient, + private platform: Platform, + private file: File, + private changeProfileService: ChangeProfileService) { + + this.changeProfileService.registerCallback(() => { + this.loggeduser = SessionStore.user + this.headers = new HttpHeaders(); + + this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey); + }) + this.changeProfileService.registerLoginCallback(() => { + this.loggeduser = SessionStore.user + this.headers = new HttpHeaders(); + + this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey); + }) + this.loggeduser = SessionStore.user this.headers = new HttpHeaders(); - this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey); + } uploadFile(formData:any) { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 4b5cf4e4d..5fa183863 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -223,6 +223,7 @@ export class AuthService { SessionStore.setInativity(false) SessionStore.setUrlBeforeInactivity(this.router.url); setTimeout(() => { + // alert('logout') this.router.navigateByUrl('/', { replaceUrl: true }); }, 100) diff --git a/src/app/services/change-profile.service.ts b/src/app/services/change-profile.service.ts index 9d1cdf3e7..8563e21ce 100644 --- a/src/app/services/change-profile.service.ts +++ b/src/app/services/change-profile.service.ts @@ -12,6 +12,12 @@ export class ChangeProfileService { id: string }[] = [] + + callbacksLogin: { + funx: Function + id: string + }[] = [] + constructor() { } @@ -23,6 +29,15 @@ export class ChangeProfileService { return id; } + + registerLoginCallback(funx: Function, object: any = {} ) { + + const id = uuidv4() + this.callbacksLogin.push({funx, id}) + + return id; + } + deleteCallback(id) { this.callbacks.forEach((e, index)=> { if(e.id == id) { @@ -38,5 +53,11 @@ export class ChangeProfileService { e.funx() }) } + + runLogin() { + this.callbacksLogin.forEach((e, index)=> { + e.funx() + }) + } }