diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e9d6f4b08..9b80a69cc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -87,7 +87,7 @@ import { LoggingInterceptorService } from './services/logging-interceptor.servic import { PopupQuestionPipe } from './modals/popup-question.pipe'; import '@teamhive/capacitor-video-recorder'; import { tokenInterceptor } from './interceptors/token.interceptors'; -import { ChatTokenInterceptor } from './interceptors/chatToken.interceptor'; +import { chatTokenInterceptor } from './interceptors/chatToken.interceptor'; import { InputFilterDirective } from './services/directives/input-filter.directive'; import { VisibilityDirective } from './services/directives/visibility.directive'; @@ -217,8 +217,9 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ DocumentViewer, FFMpeg, { provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true }, + chatTokenInterceptor, tokenInterceptor, - /* ChatTokenInterceptor */ + ], bootstrap: [AppComponent], diff --git a/src/app/interceptors/chatToken.interceptor.ts b/src/app/interceptors/chatToken.interceptor.ts index c1929a01e..974b7d783 100644 --- a/src/app/interceptors/chatToken.interceptor.ts +++ b/src/app/interceptors/chatToken.interceptor.ts @@ -1,12 +1,12 @@ import { Injectable } from '@angular/core'; import { - HttpInterceptor, - HttpRequest, - HttpHandler, - HttpEvent, - HttpErrorResponse, - HTTP_INTERCEPTORS, - HttpHeaders, + HttpInterceptor, + HttpRequest, + HttpHandler, + HttpEvent, + HttpErrorResponse, + HTTP_INTERCEPTORS, + HttpHeaders, } from '@angular/common/http'; import { Observable, throwError, BehaviorSubject } from 'rxjs'; import { catchError, switchMap, filter, take } from 'rxjs/operators'; @@ -15,138 +15,158 @@ import { Router } from '@angular/router'; import { SessionStore } from '../store/session.service'; import { environment } from "src/environments/environment"; import { PermissionService } from '../services/permission.service'; -import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service'; +import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service'; import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; - + @Injectable() export class ChatTokenInterceptor implements HttpInterceptor { - private isRefreshing = false; - headers: HttpHeaders; - options: any; - private refreshTokenSubject: BehaviorSubject = new BehaviorSubject( - null - ); - - private excludedDomain = 'https://gdchat-dev.dyndns.info';// Add other domains as needed - - constructor(private http: HttpClient, private router: Router,private p: PermissionService,private NetworkServiceService: NetworkServiceService, - private RochetChatConnectorService: RochetChatConnectorService) {} - - intercept( - request: HttpRequest, - next: HttpHandler - ): Observable> { - if (this.shouldExcludeDomain(request)) { - return next.handle(request); - } - - return next.handle(request).pipe( - catchError((error) => { - if (error instanceof HttpErrorResponse && error.status === 401) { - return this.handle401Error(request, next); - } else { - return throwError(error); - } - }) + private isRefreshing = false; + headers: HttpHeaders; + options: any; + private refreshChatTokenSubject: BehaviorSubject = new BehaviorSubject( + null ); - } - - private shouldExcludeDomain(request: HttpRequest): boolean { - const url = request.url.toLowerCase(); - return !url.includes(this.excludedDomain.toLowerCase()); - } - - private handle401Error( - request: HttpRequest, - next: HttpHandler - ): Observable> { - if (!this.isRefreshing) { - this.isRefreshing = true; - this.refreshTokenSubject.next(null); - - return this.refreshToken().pipe( - switchMap((token: any) => { - this.isRefreshing = false; - let data = { - status: token['status'], - data: { - userId: token['data'].userId, - authToken: token['data'].authToken - } + private excludedDomains = ['Login',environment.apiURL];// Add other domains as needed + + constructor(private http: HttpClient, private router: Router, private p: PermissionService, private NetworkServiceService: NetworkServiceService, + private RochetChatConnectorService: RochetChatConnectorService) { } + + intercept( + request: HttpRequest, + next: HttpHandler + ): Observable> { + if (this.shouldExcludeDomain(request)) { + return next.handle(request); + } + + if (SessionStore.user.Authorization) { + request = this.addToken(request, SessionStore.user.Authorization); } - SessionStore.user.ChatData = data - SessionStore.save() - this.setheader() - - - this.refreshTokenSubject.next(token.Authorization); - return next.handle(this.addToken(request, token.Authorization)); - }) - ); - } else { - return this.refreshTokenSubject.pipe( - filter((token) => token != null), - take(1), - switchMap((jwt) => { - return next.handle(this.addToken(request, jwt)); - }) - ); + return next.handle(request).pipe( + catchError((error) => { + if (error instanceof HttpErrorResponse && error.status === 401) { + return this.handle401Error(request, next); + } else { + return throwError(error); + } + }) + ); } - } - - private addToken(request: HttpRequest, token: string) { - return request.clone({ - /* setHeaders: { - Authorization: `Bearer ${token}`, - }, */ - }); - } - - private refreshToken(): Observable { - return this.http - .get(environment.apiURL + 'UserAuthentication/RegenereChatToken', { - /* refreshToken: SessionStore.user.RefreshToken, */ - }) - .pipe( - catchError((error) => { - // Handle token refresh failure - console.log('ChatToken refresh failed:', error); - return throwError(error); - }) - ); - } - + + private shouldExcludeDomain(request: HttpRequest): boolean { + const url = request.url.toLowerCase(); + return this.excludedDomains.some((domain) => url.includes(domain.toLowerCase())); + } + + private handle401Error( + request: HttpRequest, + next: HttpHandler + ): Observable> { + if (!this.isRefreshing) { + this.isRefreshing = true; + this.refreshChatTokenSubject.next(null); + + return this.refreshToken().pipe( + switchMap((token: any) => { + this.isRefreshing = false; + + let data = { + status: token['status'], + data: { + userId: token['data'].userId, + authToken: token['data'].authToken + } + } + SessionStore.user.ChatData = data + SessionStore.save() + /* this.setheader() */ - setheader() { - try { - if (this.p.userPermission(this.p.permissionList.Chat.access) && SessionStore.user.ChatData) { - this.headers = new HttpHeaders();; + this.refreshChatTokenSubject.next(token.Authorization); + return next.handle(this.addToken(request, token.Authorization)); + }) + ); + } else { + return this.refreshChatTokenSubject.pipe( + filter((token) => token != null), + take(1), + switchMap((jwt) => { + return next.handle(this.addToken(request, jwt)); + }) + ); + } + } - if (this.p.userPermission(this.p.permissionList.Chat.access)) { - // - this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); - this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); - this.options = { - headers: this.headers, - }; + private addToken(request: HttpRequest, token: string) { + let headers = new HttpHeaders(); + + + console.log('X-User-Id', SessionStore.user.ChatData.data.userId) + console.log('X-Auth-Token', SessionStore.user.ChatData.data.authToken) + headers = headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); + headers = headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); + + return request.clone({ + setHeaders: { + Authorization: `Bearer ${token}`, + ...headers.keys().reduce((acc, key) => ({ ...acc, [key]: headers.get(key) }), {}), + }, + }); + } + + /* private addToken(request: HttpRequest, token: string) { + return request.clone({ + setHeaders: { + Authorization: `Bearer ${token}`, + }, + }); + } */ + + private refreshToken(): Observable { + return this.http + .get(environment.apiURL + 'UserAuthentication/RegenereChatToken', { + /* refreshToken: SessionStore.user.RefreshToken, */ + }) + .pipe( + catchError((error) => { + // Handle token refresh failure + console.log('ChatToken refresh failed:', error); + return throwError(error); + }) + ); + } + + + + setheader() { + try { + + if (this.p.userPermission(this.p.permissionList.Chat.access) && SessionStore.user.ChatData) { + this.headers = new HttpHeaders();; + + if (this.p.userPermission(this.p.permissionList.Chat.access)) { + // + this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); + this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); + this.options = { + headers: this.headers, + }; + + } + } + } catch (error) { } - } - } catch (error) { - } - } } - - - -export const tokenInterceptor = { + + + +export const chatTokenInterceptor = { provide: HTTP_INTERCEPTORS, useClass: ChatTokenInterceptor, multi: true - }; - \ No newline at end of file +}; diff --git a/src/app/interceptors/token.interceptors.ts b/src/app/interceptors/token.interceptors.ts index 23ca06a7c..b0916499f 100644 --- a/src/app/interceptors/token.interceptors.ts +++ b/src/app/interceptors/token.interceptors.ts @@ -119,12 +119,13 @@ export class TokenInterceptor implements HttpInterceptor { if (environment.production) { window.location.pathname = '/auth' } else { - /* const pathBeforeGoOut = window.location.pathname */ + const pathBeforeGoOut = window.location.pathname + console.log('Before auth',window.location.pathname) this.router.navigateByUrl('/auth', { replaceUrl: true }).then(() =>{ - if(SessionStore.user.Authorization){ + if(pathBeforeGoOut != "/auth") { this.httpErrorHandle.httpsSucessMessagge('sessonExpired') } - + }) } return of(false); diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index aa03c4cd4..5e11c7fc5 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -242,7 +242,6 @@ >
-
InĂ­cio
Fim
@@ -254,8 +253,17 @@
-
Todo
-
o dia
+ +
Todo
+
o dia
+ + +
Todo
+
o dia
+ +
{{event.event.StartDate | date: 'HH:mm'}}
+
{{event.event.EndDate | date: 'HH:mm'}}
+
diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 4fe27b30a..e0e210b80 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -32,6 +32,8 @@ import { EventTrigger } from 'src/app/services/eventTrigger.service'; import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; import { RouteService } from 'src/app/services/route.service'; import { Plugins } from '@capacitor/core'; +import { ChangeDetectorRef } from '@angular/core'; + const { App } = Plugins; @@ -128,6 +130,7 @@ export class ChatPage implements OnInit { private RochetChatConnectorService: RochetChatConnectorService, private zone: NgZone, public RouteService: RouteService, + private ChangeDetectorRef: ChangeDetectorRef ) { this.headers = new HttpHeaders();; @@ -175,8 +178,18 @@ export class ChatPage implements OnInit { } }); + this.ChatSystemService.setMainChangeDetector(()=> { + this.changeDetector() + }) + } + changeDetector = () => { + console.log('run detection') + this.ChangeDetectorRef.detectChanges() + } + + ngOnDestroy() { // this.setStatus('offline'); this.routerSubscription?.unsubscribe(); diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 86a3a4b28..295800e6f 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -1,6 +1,6 @@ -
+
@@ -45,7 +45,7 @@ - +
@@ -277,7 +277,7 @@ - +
{ + this.changeDetector() + }) } catch (error) { setTimeout(() => { this.open() @@ -152,6 +157,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } } + + changeDetector = () => { + console.log('run detection page') + this.ChangeDetectorRef.detectChanges() + } + ngOnInit() { this.loggedUser = this.loggedUserChat; diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 8990525c5..756bcb752 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -36,6 +36,7 @@ import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-co import { FileValidatorService } from "src/app/services/file/file-validator.service" import { sanitize } from "sanitize-filename-ts"; import { FilePicker } from '@capawesome/capacitor-file-picker'; +import { ChangeDetectorRef } from '@angular/core'; @@ -122,7 +123,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { private fileOpener: FileOpener, private router: Router, public RochetChatConnectorService: RochetChatConnectorService, - private FileValidatorService: FileValidatorService + private FileValidatorService: FileValidatorService, + private ChangeDetectorRef: ChangeDetectorRef ) { try { @@ -141,6 +143,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.ChatSystemService.getDmRoom(this.roomId).loadHistory({}) this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked this.ChatSystemService.openRoom(this.roomId) + this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> { + + this.changeDetector() + }) setTimeout(() => { this.scrollToBottomClicked() @@ -148,8 +154,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } catch (error) { //alert(error) } + } - + changeDetector = () => { + console.log('run detection page') + this.ChangeDetectorRef.detectChanges() } ngOnInit() { diff --git a/src/app/pages/gabinete-digital/despachos/despachos.page.html b/src/app/pages/gabinete-digital/despachos/despachos.page.html index 3efac5be7..3905b5788 100644 --- a/src/app/pages/gabinete-digital/despachos/despachos.page.html +++ b/src/app/pages/gabinete-digital/despachos/despachos.page.html @@ -95,7 +95,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html b/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html index 599547d08..20fccfc7a 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html @@ -99,7 +99,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html b/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html index fd37bd992..5abddef6e 100644 --- a/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html @@ -87,7 +87,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -165,7 +165,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas/diplomas.page.html b/src/app/pages/gabinete-digital/diplomas/diplomas.page.html index bb9b1beb9..23734c01e 100644 --- a/src/app/pages/gabinete-digital/diplomas/diplomas.page.html +++ b/src/app/pages/gabinete-digital/diplomas/diplomas.page.html @@ -55,7 +55,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -125,7 +125,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.html b/src/app/pages/gabinete-digital/expediente/expediente.page.html index 5637f8be3..2689461dc 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.html @@ -102,7 +102,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 9c0d83882..cb8b6e45c 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -209,7 +209,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' @@ -647,7 +647,7 @@ TaskService.pedidosstore.listParecerCount.length}} correspondĂȘncia nova

- Pedidos de Parecer solicitados por mim
+ Parecer solicitados por mim
{{ TaskService.pedidosstore.listParecerCount.length}} correspondĂȘncias novas {{ diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.html b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html index 9a7d4288b..90a7e586d 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html @@ -121,7 +121,7 @@

- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -160,7 +160,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 471a0e1a6..ce39c08b8 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -144,9 +144,18 @@ export class LoginPage implements OnInit { if (attempt.ChatData) { - await this.authService.loginToChatWs(); - this.ChatService.setheader() - this.ChatSystemService.loadChat(); + try { + + await MessageModel.deleteAll(); + await DeleteMessageModel.deleteAll(); + this.ChatSystemService.clearChat(); + this.NotificationHolderService.clear() + await this.authService.loginToChatWs(); + this.ChatService.setheader() + + } catch(error) { + console.log("faild to clear chat") + } } @@ -181,7 +190,6 @@ export class LoginPage implements OnInit { if (attempt.ChatData) { await this.authService.loginToChatWs(); this.ChatService.setheader(); - this.ChatSystemService.loadChat(); } this.storageService.remove("Notifications") this.getToken(); diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index a091392c3..9ea946437 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -40,7 +40,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html index 97888f2ad..27463642c 100644 --- a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html +++ b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html @@ -91,7 +91,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html index 5af7322d7..65b3b4e67 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html @@ -128,7 +128,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html index f729bd008..2c2a8e879 100644 --- a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html +++ b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html @@ -40,7 +40,7 @@
-

{{ task.activityInstanceName }}

+

{{ task.WorkflowName }}

diff --git a/src/app/shared/gabinete-digital/generic/task-list/task-list.page.html b/src/app/shared/gabinete-digital/generic/task-list/task-list.page.html index fe37e9924..323f7b434 100644 --- a/src/app/shared/gabinete-digital/generic/task-list/task-list.page.html +++ b/src/app/shared/gabinete-digital/generic/task-list/task-list.page.html @@ -29,7 +29,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html index 779ab3065..49000d6ce 100644 --- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html +++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html @@ -136,7 +136,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -175,7 +175,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index a64e8061a..820d5c56c 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -43,6 +43,16 @@ export class HeaderPage implements OnInit { notificationCount: number = 0; profilePicture = ""; + hideHeader = false + + + hideHeaderValidation() { + const result = this.HeaderSettingsService.hideHeader && this.ActiveTabService.pages.gabineteDetails + if(result != this.hideHeader) { + this.hideHeader = true + } + } + constructor( private router: Router, diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html index db13dc81e..b6bc54cf9 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -64,18 +64,13 @@
+ name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.Base64" style="height: 69px;"> - -
diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index effa8a82c..a5795a5f7 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -402,6 +402,7 @@ export class NewPublicationPage implements OnInit { let time = new Date() if (this.publicationFormMV.form.Files.length >= 1) { + const loader = this.toastService.loading() const upload = await this.publicationFormMV.uploadVideosFiles() @@ -410,8 +411,10 @@ export class NewPublicationPage implements OnInit { if(e.FileType == 'video' && e.blobFile && e.toUpload) { e.OriginalFileName = e.chucksManager.path.replace(".mp4", "") e.FileExtension = "mp4" - e.Base64 = "" + e.Base64 = '' } + + return e }) @@ -420,7 +423,7 @@ export class NewPublicationPage implements OnInit { const publication: any = Object.assign({}, this.publicationFormMV.form) publication.Files = publication.Files.map( (e:PublicationAttachmentEntity) => ({ - FileBase64: e.url, + FileBase64: e.Base64, FileExtension: e.FileExtension, OriginalFileName: e.OriginalFileName || 'foto' })) @@ -428,7 +431,7 @@ export class NewPublicationPage implements OnInit { publication.DocumentId = null; publication.ProcessId = this.folderId - const loader = this.toastService.loading() + try { diff --git a/src/app/store/notification-holder.service.ts b/src/app/store/notification-holder.service.ts index 4748c0d5a..6d8c80049 100644 --- a/src/app/store/notification-holder.service.ts +++ b/src/app/store/notification-holder.service.ts @@ -114,6 +114,74 @@ export class NotificationHolderService { } + stractureNotificationObject(notification) { + const element = notification + let notificationObject; + + if (element.notification) { + + notificationObject = { + id: notification?.id || uuidv4(), + title: element.notification.title, + Service: element.data.Service, + Object: element.data.Object, + IdObject: element.data.IdObject, + FolderId: element.data.FolderId, + body: element.notification.body, + dateInit: this.getFormatedTime(element.data.dateInit), + dateEnd: this.getFormatedTime(element.data.dateEnd), + Location: element.data.Location, + TypeAgenda: element.data.TypeAgenda, + Role: element.data.Role, + Status: element.data.Status, + read: false, + } + + } else if (element.data) { + notificationObject = { + id: notification?.id || uuidv4(), + title: element.title, + Service: element.data.Service, + Object: element.data.Object, + IdObject: element.data.IdObject, + FolderId: element.data.FolderId, + body: element.body, + dateInit: this.getFormatedTime(element.data.dateInit), + dateEnd: this.getFormatedTime(element.data.dateEnd), + Location: element.data.Location, + TypeAgenda: element.data.TypeAgenda, + Role: element.data.Role, + Status: element.data.Status, + read: false, + } + + } else { + { + notificationObject = { + id: notification?.id || uuidv4(), + FolderId: element.FolderId, + IdObject: element.IdObject, + Location: element.Location, + Object: element.Object, + Role: element.Role, + Service: element.Service, + Status: element.Status, + TypeAgenda: element.TypeAgenda, + body: element.body, + dateEnd: element.dateEnd, + dateInit: element.dateInit, + index: element.index, + title: element.title, + read: false, + } + } + } + + notificationObject.hashCode = (SHA1(notification)).toString() + + return notificationObject + } + addNotification(notification) { diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 1b55290ea..2536052bb 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,4 +4,4 @@ import { environment as doneITProd } from './suport/doneIt' import { DevDev } from './suport/dev' -export const environment: Environment = oaprProd; +export const environment: Environment = DevDev;