mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
pull amde
This commit is contained in:
@@ -87,7 +87,7 @@ import { LoggingInterceptorService } from './services/logging-interceptor.servic
|
|||||||
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
||||||
import '@teamhive/capacitor-video-recorder';
|
import '@teamhive/capacitor-video-recorder';
|
||||||
import { tokenInterceptor } from './interceptors/token.interceptors';
|
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 { InputFilterDirective } from './services/directives/input-filter.directive';
|
||||||
import { VisibilityDirective } from './services/directives/visibility.directive';
|
import { VisibilityDirective } from './services/directives/visibility.directive';
|
||||||
@@ -217,8 +217,9 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
DocumentViewer,
|
DocumentViewer,
|
||||||
FFMpeg,
|
FFMpeg,
|
||||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||||
|
chatTokenInterceptor,
|
||||||
tokenInterceptor,
|
tokenInterceptor,
|
||||||
/* ChatTokenInterceptor */
|
|
||||||
|
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
HttpInterceptor,
|
HttpInterceptor,
|
||||||
HttpRequest,
|
HttpRequest,
|
||||||
HttpHandler,
|
HttpHandler,
|
||||||
HttpEvent,
|
HttpEvent,
|
||||||
HttpErrorResponse,
|
HttpErrorResponse,
|
||||||
HTTP_INTERCEPTORS,
|
HTTP_INTERCEPTORS,
|
||||||
HttpHeaders,
|
HttpHeaders,
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
import { Observable, throwError, BehaviorSubject } from 'rxjs';
|
import { Observable, throwError, BehaviorSubject } from 'rxjs';
|
||||||
import { catchError, switchMap, filter, take } from 'rxjs/operators';
|
import { catchError, switchMap, filter, take } from 'rxjs/operators';
|
||||||
@@ -15,138 +15,158 @@ import { Router } from '@angular/router';
|
|||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
import { environment } from "src/environments/environment";
|
import { environment } from "src/environments/environment";
|
||||||
import { PermissionService } from '../services/permission.service';
|
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';
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ChatTokenInterceptor implements HttpInterceptor {
|
export class ChatTokenInterceptor implements HttpInterceptor {
|
||||||
private isRefreshing = false;
|
private isRefreshing = false;
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
options: any;
|
options: any;
|
||||||
private refreshTokenSubject: BehaviorSubject<any> = new BehaviorSubject<any>(
|
private refreshChatTokenSubject: BehaviorSubject<any> = new BehaviorSubject<any>(
|
||||||
null
|
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<any>,
|
|
||||||
next: HttpHandler
|
|
||||||
): Observable<HttpEvent<any>> {
|
|
||||||
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 shouldExcludeDomain(request: HttpRequest<any>): boolean {
|
|
||||||
const url = request.url.toLowerCase();
|
|
||||||
return !url.includes(this.excludedDomain.toLowerCase());
|
|
||||||
}
|
|
||||||
|
|
||||||
private handle401Error(
|
|
||||||
request: HttpRequest<any>,
|
|
||||||
next: HttpHandler
|
|
||||||
): Observable<HttpEvent<any>> {
|
|
||||||
if (!this.isRefreshing) {
|
|
||||||
this.isRefreshing = true;
|
|
||||||
this.refreshTokenSubject.next(null);
|
|
||||||
|
|
||||||
return this.refreshToken().pipe(
|
|
||||||
switchMap((token: any) => {
|
|
||||||
this.isRefreshing = false;
|
|
||||||
|
|
||||||
let data = {
|
private excludedDomains = ['Login',environment.apiURL];// Add other domains as needed
|
||||||
status: token['status'],
|
|
||||||
data: {
|
constructor(private http: HttpClient, private router: Router, private p: PermissionService, private NetworkServiceService: NetworkServiceService,
|
||||||
userId: token['data'].userId,
|
private RochetChatConnectorService: RochetChatConnectorService) { }
|
||||||
authToken: token['data'].authToken
|
|
||||||
}
|
intercept(
|
||||||
|
request: HttpRequest<any>,
|
||||||
|
next: HttpHandler
|
||||||
|
): Observable<HttpEvent<any>> {
|
||||||
|
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()
|
|
||||||
|
|
||||||
|
return next.handle(request).pipe(
|
||||||
|
catchError((error) => {
|
||||||
this.refreshTokenSubject.next(token.Authorization);
|
if (error instanceof HttpErrorResponse && error.status === 401) {
|
||||||
return next.handle(this.addToken(request, token.Authorization));
|
return this.handle401Error(request, next);
|
||||||
})
|
} else {
|
||||||
);
|
return throwError(error);
|
||||||
} else {
|
}
|
||||||
return this.refreshTokenSubject.pipe(
|
})
|
||||||
filter((token) => token != null),
|
);
|
||||||
take(1),
|
|
||||||
switchMap((jwt) => {
|
|
||||||
return next.handle(this.addToken(request, jwt));
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private shouldExcludeDomain(request: HttpRequest<any>): boolean {
|
||||||
private addToken(request: HttpRequest<any>, token: string) {
|
const url = request.url.toLowerCase();
|
||||||
return request.clone({
|
return this.excludedDomains.some((domain) => url.includes(domain.toLowerCase()));
|
||||||
/* setHeaders: {
|
}
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
}, */
|
private handle401Error(
|
||||||
});
|
request: HttpRequest<any>,
|
||||||
}
|
next: HttpHandler
|
||||||
|
): Observable<HttpEvent<any>> {
|
||||||
private refreshToken(): Observable<any> {
|
if (!this.isRefreshing) {
|
||||||
return this.http
|
this.isRefreshing = true;
|
||||||
.get<any>(environment.apiURL + 'UserAuthentication/RegenereChatToken', {
|
this.refreshChatTokenSubject.next(null);
|
||||||
/* refreshToken: SessionStore.user.RefreshToken, */
|
|
||||||
})
|
return this.refreshToken().pipe(
|
||||||
.pipe(
|
switchMap((token: any) => {
|
||||||
catchError((error) => {
|
this.isRefreshing = false;
|
||||||
// Handle token refresh failure
|
|
||||||
console.log('ChatToken refresh failed:', error);
|
let data = {
|
||||||
return throwError(error);
|
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.refreshChatTokenSubject.next(token.Authorization);
|
||||||
this.headers = new HttpHeaders();;
|
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)) {
|
private addToken(request: HttpRequest<any>, token: string) {
|
||||||
//
|
let headers = new HttpHeaders();
|
||||||
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 = {
|
console.log('X-User-Id', SessionStore.user.ChatData.data.userId)
|
||||||
headers: this.headers,
|
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<any>, token: string) {
|
||||||
|
return request.clone({
|
||||||
|
setHeaders: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} */
|
||||||
|
|
||||||
|
private refreshToken(): Observable<any> {
|
||||||
|
return this.http
|
||||||
|
.get<any>(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,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: ChatTokenInterceptor,
|
useClass: ChatTokenInterceptor,
|
||||||
multi: true
|
multi: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -119,12 +119,13 @@ export class TokenInterceptor implements HttpInterceptor {
|
|||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
window.location.pathname = '/auth'
|
window.location.pathname = '/auth'
|
||||||
} else {
|
} 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(() =>{
|
this.router.navigateByUrl('/auth', { replaceUrl: true }).then(() =>{
|
||||||
if(SessionStore.user.Authorization){
|
if(pathBeforeGoOut != "/auth") {
|
||||||
this.httpErrorHandle.httpsSucessMessagge('sessonExpired')
|
this.httpErrorHandle.httpsSucessMessagge('sessonExpired')
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return of(false);
|
return of(false);
|
||||||
|
|||||||
@@ -242,7 +242,6 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||||
|
|
||||||
<div *ngIf="event.startMany && !event.middle" class="time-start labelb">Início</div>
|
<div *ngIf="event.startMany && !event.middle" class="time-start labelb">Início</div>
|
||||||
<div *ngIf="event.endMany && !event.middle " class="time-end labelb">Fim</div>
|
<div *ngIf="event.endMany && !event.middle " class="time-end labelb">Fim</div>
|
||||||
|
|
||||||
@@ -254,8 +253,17 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="schedule-time" *ngIf="event.event.IsAllDayEvent">
|
<div class="schedule-time" *ngIf="event.event.IsAllDayEvent">
|
||||||
<div class="time-start">Todo </div>
|
|
||||||
<div class="time-end text-center">o dia</div>
|
<div *ngIf="event.middle" class="time-start">Todo </div>
|
||||||
|
<div *ngIf="event.middle" class="time-end text-center">o dia</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div *ngIf="!event.middle && !(event.endMany && !event.middle)" class="time-start">Todo </div>
|
||||||
|
<div *ngIf="!event.middle && !(event.endMany && !event.middle)" class="time-end text-center">o dia </div>
|
||||||
|
|
||||||
|
<div *ngIf="event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
|
||||||
|
<div *ngIf="event.endMany && !event.middle" class="time-end"> {{event.event.EndDate | date: 'HH:mm'}} </div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="schedule-details">
|
<div class="schedule-details">
|
||||||
<div class="description">
|
<div class="description">
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
|||||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { Plugins } from '@capacitor/core';
|
import { Plugins } from '@capacitor/core';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
const { App } = Plugins;
|
const { App } = Plugins;
|
||||||
|
|
||||||
@@ -128,6 +130,7 @@ export class ChatPage implements OnInit {
|
|||||||
private RochetChatConnectorService: RochetChatConnectorService,
|
private RochetChatConnectorService: RochetChatConnectorService,
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.headers = new HttpHeaders();;
|
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() {
|
ngOnDestroy() {
|
||||||
// this.setStatus('offline');
|
// this.setStatus('offline');
|
||||||
this.routerSubscription?.unsubscribe();
|
this.routerSubscription?.unsubscribe();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<ion-toolbar class="header-toolbar">
|
<ion-toolbar class="header-toolbar">
|
||||||
<div class="main-header">
|
<div class="main-header" *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
<div class="header-top">
|
<div class="header-top">
|
||||||
<!-- <app-btn-modal-dismiss></app-btn-modal-dismiss> -->
|
<!-- <app-btn-modal-dismiss></app-btn-modal-dismiss> -->
|
||||||
<div class="left">
|
<div class="left">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
<ion-content>
|
<ion-content *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
|
|
||||||
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
|
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
|
||||||
<div class="welcome-text">
|
<div class="welcome-text">
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
|
|
||||||
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
||||||
<ngx-letters-avatar *ngIf="showAvatar" [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30"
|
<ngx-letters-avatar *ngIf="showAvatar" [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30"
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import { FileValidatorService } from "src/app/services/file/file-validator.servi
|
|||||||
import { sanitize } from "sanitize-filename-ts";
|
import { sanitize } from "sanitize-filename-ts";
|
||||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
templateUrl: './group-messages.page.html',
|
templateUrl: './group-messages.page.html',
|
||||||
@@ -109,7 +108,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private file: File,
|
private file: File,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
this.ChatSystemService.getUser()
|
this.ChatSystemService.getUser()
|
||||||
|
|
||||||
@@ -138,6 +138,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
try {
|
try {
|
||||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||||
@@ -145,6 +147,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||||
|
|
||||||
|
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.open()
|
this.open()
|
||||||
@@ -152,6 +157,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection page')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.loggedUser = this.loggedUserChat;
|
this.loggedUser = this.loggedUserChat;
|
||||||
|
|||||||
@@ -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 { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { sanitize } from "sanitize-filename-ts";
|
import { sanitize } from "sanitize-filename-ts";
|
||||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
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 fileOpener: FileOpener,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public RochetChatConnectorService: RochetChatConnectorService,
|
public RochetChatConnectorService: RochetChatConnectorService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -141,6 +143,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
||||||
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollToBottomClicked()
|
this.scrollToBottomClicked()
|
||||||
@@ -148,8 +154,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
//alert(error)
|
//alert(error)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection page')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -209,7 +209,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-bottom-detail d-flex align-items-center">
|
<div class="item-bottom-detail d-flex align-items-center">
|
||||||
<div class="item-workflow">
|
<div class="item-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-date">
|
<div class="item-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm'
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm'
|
||||||
@@ -647,7 +647,7 @@
|
|||||||
TaskService.pedidosstore.listParecerCount.length}} correspondência nova</span>
|
TaskService.pedidosstore.listParecerCount.length}} correspondência nova</span>
|
||||||
</p>
|
</p>
|
||||||
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">
|
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">
|
||||||
Pedidos de Parecer solicitados por mim <br>
|
Parecer solicitados por mim <br>
|
||||||
<span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length >=2">{{
|
<span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length >=2">{{
|
||||||
TaskService.pedidosstore.listParecerCount.length}} correspondências novas</span>
|
TaskService.pedidosstore.listParecerCount.length}} correspondências novas</span>
|
||||||
<span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length ==1">{{
|
<span class="new-task-count" *ngIf="TaskService.pedidosstore.listParecerCount.length ==1">{{
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -144,9 +144,18 @@ export class LoginPage implements OnInit {
|
|||||||
|
|
||||||
if (attempt.ChatData) {
|
if (attempt.ChatData) {
|
||||||
|
|
||||||
await this.authService.loginToChatWs();
|
try {
|
||||||
this.ChatService.setheader()
|
|
||||||
this.ChatSystemService.loadChat();
|
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) {
|
if (attempt.ChatData) {
|
||||||
await this.authService.loginToChatWs();
|
await this.authService.loginToChatWs();
|
||||||
this.ChatService.setheader();
|
this.ChatService.setheader();
|
||||||
this.ChatSystemService.loadChat();
|
|
||||||
}
|
}
|
||||||
this.storageService.remove("Notifications")
|
this.storageService.remove("Notifications")
|
||||||
this.getToken();
|
this.getToken();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
|
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
|
||||||
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
|
name="image" ngDefaultControl [src]="seleted.FileBase64"
|
||||||
(click)="imageSize(capturedImage)" style="height: 69px;"></ion-img>
|
(click)="imageSize(capturedImage)" style="height: 69px;"></ion-img>
|
||||||
|
|
||||||
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
|
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
|
||||||
|
|||||||
@@ -758,7 +758,7 @@ console.log(stringGerada);
|
|||||||
this.shareContentAndroid(resultUrl,FileExtension)
|
this.shareContentAndroid(resultUrl,FileExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||||
let fileObject;
|
let fileObject;
|
||||||
try {
|
try {
|
||||||
@@ -809,7 +809,7 @@ console.log(stringGerada);
|
|||||||
} else {
|
} else {
|
||||||
window["sharedContent"] = null
|
window["sharedContent"] = null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async recordevideoIos(fullPath) {
|
async recordevideoIos(fullPath) {
|
||||||
@@ -854,7 +854,7 @@ console.log(stringGerada);
|
|||||||
.catch((erro) => console.error('read converted video erro ', erro));
|
.catch((erro) => console.error('read converted video erro ', erro));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('record video ios erro, ', error)
|
console.log('record video ios erro, ', error)
|
||||||
}
|
}
|
||||||
@@ -906,7 +906,7 @@ console.log(stringGerada);
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: content.data,
|
FileBase64: 'data:image/jpeg;base64,' + content.data,
|
||||||
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
||||||
OriginalFileName: 'image'
|
OriginalFileName: 'image'
|
||||||
}
|
}
|
||||||
@@ -915,18 +915,18 @@ console.log(stringGerada);
|
|||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
})
|
})
|
||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gerarStringAleatoria() {
|
gerarStringAleatoria() {
|
||||||
const caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
const caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||||
let stringAleatoria = '';
|
let stringAleatoria = '';
|
||||||
|
|
||||||
for (let i = 0; i < 4; i++) {
|
for (let i = 0; i < 4; i++) {
|
||||||
const indiceAleatorio = Math.floor(Math.random() * caracteres.length);
|
const indiceAleatorio = Math.floor(Math.random() * caracteres.length);
|
||||||
stringAleatoria += caracteres.charAt(indiceAleatorio);
|
stringAleatoria += caracteres.charAt(indiceAleatorio);
|
||||||
}
|
}
|
||||||
|
|
||||||
return stringAleatoria;
|
return stringAleatoria;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,23 +944,23 @@ console.log(stringGerada);
|
|||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
}
|
||||||
console.log('shared base', content.data)
|
console.log('shared base', content.data)
|
||||||
|
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error shared filesystem', error)
|
console.log('error shared filesystem', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||||
const directory = await Filesystem.getUri({
|
const directory = await Filesystem.getUri({
|
||||||
directory: Directory.Cache,
|
directory: Directory.Cache,
|
||||||
path: '',
|
path: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
let fileObject ={};
|
let fileObject ={};
|
||||||
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(() => {
|
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(() => {
|
||||||
Filesystem.readFile({ path: `${directory.uri}output.mp4`})
|
Filesystem.readFile({ path: `${directory.uri}output.mp4`})
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
console.log(content.data)
|
console.log(content.data)
|
||||||
this.filecontent = true;
|
this.filecontent = true;
|
||||||
@@ -991,8 +991,8 @@ console.log(stringGerada);
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('record video ios erro, ', error)
|
console.log('record video ios erro, ', error)
|
||||||
}
|
}
|
||||||
@@ -1005,7 +1005,7 @@ console.log(stringGerada);
|
|||||||
try {
|
try {
|
||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
FileBase64: 'data:image/jpeg;base64,' +this.removeTextBeforeSlash(content.data, ','),
|
||||||
FileExtension: FileExtension,
|
FileExtension: FileExtension,
|
||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { PublicationVideoManagerService } from "src/app/services/publication/pub
|
|||||||
import { StopvideoService } from "src/app/services/stopvideo.service"
|
import { StopvideoService } from "src/app/services/stopvideo.service"
|
||||||
import { Result } from 'neverthrow';
|
import { Result } from 'neverthrow';
|
||||||
import { App } from '@capacitor/app';
|
import { App } from '@capacitor/app';
|
||||||
|
import { ActiveTabService } from 'src/app/services/active-tab.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-publications',
|
selector: 'app-view-publications',
|
||||||
templateUrl: './view-publications.page.html',
|
templateUrl: './view-publications.page.html',
|
||||||
@@ -69,7 +70,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
public checkFileType: checkFileTypeService,
|
public checkFileType: checkFileTypeService,
|
||||||
private publicationVideoManagerService: PublicationVideoManagerService,
|
private publicationVideoManagerService: PublicationVideoManagerService,
|
||||||
public stopvideoService: StopvideoService,
|
public stopvideoService: StopvideoService,
|
||||||
private platform: Platform,) {
|
private platform: Platform,
|
||||||
|
public activeTabService: ActiveTabService) {
|
||||||
|
|
||||||
|
|
||||||
/* this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement) */
|
/* this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement) */
|
||||||
@@ -118,6 +120,13 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// console.log(this.publicationFolderService.publicationList[this.folderId])
|
// console.log(this.publicationFolderService.publicationList[this.folderId])
|
||||||
|
|
||||||
|
setTimeout(()=> {
|
||||||
|
|
||||||
|
this.doRefresh({})
|
||||||
|
|
||||||
|
}, 1500)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ export class ActiveTabService {
|
|||||||
gabineteDetails: false
|
gabineteDetails: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePublications = () => {}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public HeaderSettingsService: HeaderSettingsService) {
|
public HeaderSettingsService: HeaderSettingsService) {
|
||||||
@@ -47,6 +49,13 @@ export class ActiveTabService {
|
|||||||
|
|
||||||
} else if (pathName.startsWith('/home/publications')) {
|
} else if (pathName.startsWith('/home/publications')) {
|
||||||
this.pages.publication = true
|
this.pages.publication = true
|
||||||
|
if(pathName.includes("/publications/")) {
|
||||||
|
if(this.updatePublications) {
|
||||||
|
this.updatePublications()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else if (pathName.startsWith('/home/chat')) {
|
} else if (pathName.startsWith('/home/chat')) {
|
||||||
this.pages.chat = true
|
this.pages.chat = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ export class ListBoxService {
|
|||||||
// object[momentG(new Date(e.start), 'MMMM yyyy')].push(e)
|
// object[momentG(new Date(e.start), 'MMMM yyyy')].push(e)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// console.log({object})
|
|
||||||
|
|
||||||
// const daysStringNum = Object.keys(object).reverse()
|
// const daysStringNum = Object.keys(object).reverse()
|
||||||
|
|
||||||
// const daysObject = {}
|
// const daysObject = {}
|
||||||
@@ -77,13 +75,8 @@ export class ListBoxService {
|
|||||||
// daysObject[day] = object[day]
|
// daysObject[day] = object[day]
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// console.log({daysObject})
|
|
||||||
|
|
||||||
|
|
||||||
return this.display(newStracture, selectedDate).year
|
return this.display(newStracture, selectedDate).year
|
||||||
|
|
||||||
// console.log({daysObject})
|
|
||||||
|
|
||||||
// const daysStringNum = Object.keys(daysObject)
|
// const daysStringNum = Object.keys(daysObject)
|
||||||
|
|
||||||
// for(const day of daysStringNum) {
|
// for(const day of daysStringNum) {
|
||||||
@@ -105,6 +98,8 @@ export class ListBoxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
display(list: CustomCalendarEvent[], selectedDate) {
|
display(list: CustomCalendarEvent[], selectedDate) {
|
||||||
|
|
||||||
|
|
||||||
let days = {};
|
let days = {};
|
||||||
const year: Year[] = []
|
const year: Year[] = []
|
||||||
|
|
||||||
@@ -171,14 +166,14 @@ export class ListBoxService {
|
|||||||
// last push
|
// last push
|
||||||
const EndEvent = this.transForm(cloneEvent, {startMany: false, endMany: true, middle: false})
|
const EndEvent = this.transForm(cloneEvent, {startMany: false, endMany: true, middle: false})
|
||||||
if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) {
|
if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) {
|
||||||
days[otherDays].push(EndEvent) ; this.push(cloneEvent, year)
|
days[otherDays].push(EndEvent) ; this.push(EndEvent, year)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const EndEvent = this.transForm(cloneEvent, {startMany: false,endMany: true, middle: true})
|
const EndEvent = this.transForm(cloneEvent, {startMany: false,endMany: true, middle: true})
|
||||||
if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) {
|
if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) {
|
||||||
days[otherDays].push(EndEvent) ; this.push(cloneEvent, year)
|
days[otherDays].push(EndEvent) ; this.push(EndEvent, year)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ export class AuthService {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
if (SessionStore.user.ChatData?.data) {
|
if (SessionStore.user.ChatData?.data) {
|
||||||
|
this.RochetChatConnectorService.logout();
|
||||||
this.RochetChatConnectorService.connect();
|
this.RochetChatConnectorService.connect();
|
||||||
this.RochetChatConnectorService.login().then((message: any) => {
|
this.RochetChatConnectorService.login().then((message: any) => {
|
||||||
console.log('Chat login', message)
|
console.log('Chat login', message)
|
||||||
@@ -190,6 +191,7 @@ export class AuthService {
|
|||||||
SessionStore.user.RochetChatUserId = message.result.id
|
SessionStore.user.RochetChatUserId = message.result.id
|
||||||
SessionStore.save()
|
SessionStore.save()
|
||||||
|
|
||||||
|
this.ChatSystemService.loadChat()
|
||||||
this.RochetChatConnectorService.setStatus('online')
|
this.RochetChatConnectorService.setStatus('online')
|
||||||
window['RochetChatConnectorService'] = this.RochetChatConnectorService
|
window['RochetChatConnectorService'] = this.RochetChatConnectorService
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -199,7 +201,14 @@ export class AuthService {
|
|||||||
|
|
||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
// console.error(SessionStore.user.ChatData, 'web socket login',error)
|
console.error(SessionStore.user.ChatData, 'web socket login', error)
|
||||||
|
|
||||||
|
if(window.location.pathname.includes('/home/')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loginToChatWs();
|
||||||
|
}, 4000)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +342,7 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshToken() {
|
refreshToken() {
|
||||||
|
|
||||||
return this.http
|
return this.http
|
||||||
.put<any>(environment.apiURL + "UserAuthentication/RefreshToken", {
|
.put<any>(environment.apiURL + "UserAuthentication/RefreshToken", {
|
||||||
refreshToken: SessionStore.user.RefreshToken,
|
refreshToken: SessionStore.user.RefreshToken,
|
||||||
|
|||||||
@@ -392,61 +392,6 @@ export class ChatService {
|
|||||||
|
|
||||||
async refreshtoken() {
|
async refreshtoken() {
|
||||||
|
|
||||||
if(this.headers && SessionStore.user.ChatData) {
|
|
||||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
|
||||||
let options = {
|
|
||||||
headers: this.headers
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
let res = await this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).toPromise();
|
|
||||||
|
|
||||||
let data = {
|
|
||||||
status: res['status'],
|
|
||||||
data: {
|
|
||||||
userId: res['data'].userId,
|
|
||||||
authToken: res['data'].authToken
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SessionStore.user.ChatData = data
|
|
||||||
SessionStore.save()
|
|
||||||
this.setheader()
|
|
||||||
this.timerEventTriggerDateLastUpdate = new Date();
|
|
||||||
} catch (error) {
|
|
||||||
|
|
||||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Offline) {
|
|
||||||
this.RochetChatConnectorService.registerCallback({
|
|
||||||
requestId: 'refreshtoken',
|
|
||||||
type: 'reConnect',
|
|
||||||
funx: async () => {
|
|
||||||
|
|
||||||
this.resetTimer();
|
|
||||||
await this.refreshtoken();
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if(SessionStore.user.Authorization != '') {
|
|
||||||
setTimeout(async () => {
|
|
||||||
this.resetTimer();
|
|
||||||
await this.refreshtoken();
|
|
||||||
}, 60000)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if(!SessionStore.user.ChatData) {
|
|
||||||
// do nothing
|
|
||||||
} else if (!this.headers) {
|
|
||||||
this.setheader()
|
|
||||||
this.refreshtoken()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export class ChatSystemService {
|
|||||||
loadingUsers = false
|
loadingUsers = false
|
||||||
|
|
||||||
onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true })
|
onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true })
|
||||||
|
private mainChangeDetector: Function = () => {}
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -66,7 +67,7 @@ export class ChatSystemService {
|
|||||||
private AttachmentsService: AttachmentsService,
|
private AttachmentsService: AttachmentsService,
|
||||||
private NetworkServiceService: NetworkServiceService,
|
private NetworkServiceService: NetworkServiceService,
|
||||||
private ViewedMessageService: ViewedMessageService,
|
private ViewedMessageService: ViewedMessageService,
|
||||||
private notificationService: NotificationsService
|
private notificationService: NotificationsService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
@@ -148,9 +149,15 @@ export class ChatSystemService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch(error) {}
|
} catch(error) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
setMainChangeDetector(x:Function) {
|
||||||
|
this.mainChangeDetector = x
|
||||||
|
}
|
||||||
|
|
||||||
|
runMainChangeDetector() {
|
||||||
|
console.log("change")
|
||||||
|
// this.mainChangeDetector()
|
||||||
}
|
}
|
||||||
|
|
||||||
loadChat() {
|
loadChat() {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { ChatSystemService } from './chat-system.service';
|
|||||||
import { ViewedMessageService } from './viewed-message.service'
|
import { ViewedMessageService } from './viewed-message.service'
|
||||||
import * as FIFOProcessQueue from 'fifo-process-queue';
|
import * as FIFOProcessQueue from 'fifo-process-queue';
|
||||||
import { NotificationsService } from '../notifications.service';
|
import { NotificationsService } from '../notifications.service';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -84,6 +85,7 @@ export class RoomService {
|
|||||||
|
|
||||||
sortRoomList = () => { }
|
sortRoomList = () => { }
|
||||||
chatServiceDeleteRoom = (roomId) => { }
|
chatServiceDeleteRoom = (roomId) => { }
|
||||||
|
private changeDetector: Function = () => {}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public RochetChatConnectorService: RochetChatConnectorService,
|
public RochetChatConnectorService: RochetChatConnectorService,
|
||||||
@@ -190,6 +192,11 @@ export class RoomService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setChangeDetector(x:Function) {
|
||||||
|
console.log("set change detector")
|
||||||
|
this.changeDetector = x
|
||||||
|
}
|
||||||
|
|
||||||
get online() {
|
get online() {
|
||||||
|
|
||||||
if (!this.isGroup) {
|
if (!this.isGroup) {
|
||||||
@@ -372,8 +379,6 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.messageUnread = true
|
this.messageUnread = true
|
||||||
|
|
||||||
// this.sortRoomList()
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollDown()
|
this.scrollDown()
|
||||||
}, 50)
|
}, 50)
|
||||||
@@ -386,6 +391,7 @@ export class RoomService {
|
|||||||
this.name = ChatMessage.msg
|
this.name = ChatMessage.msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this.changeDetector()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
done()
|
done()
|
||||||
}, 5)
|
}, 5)
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ import { notificationObject } from '../models/notifications';
|
|||||||
import { Capacitor } from '@capacitor/core';
|
import { Capacitor } from '@capacitor/core';
|
||||||
import { AngularFireMessaging } from '@angular/fire/messaging';
|
import { AngularFireMessaging } from '@angular/fire/messaging';
|
||||||
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
||||||
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
import { FCM } from '@capacitor-community/fcm';
|
import { FCM } from '@capacitor-community/fcm';
|
||||||
|
import { ChatSystemService } from './chat/chat-system.service';
|
||||||
|
import {ChatController} from 'src/app/controller/chat'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -42,6 +43,8 @@ export class NotificationsService {
|
|||||||
notificationReceived: EventEmitter<void> = new EventEmitter<void>();
|
notificationReceived: EventEmitter<void> = new EventEmitter<void>();
|
||||||
token = ''
|
token = ''
|
||||||
|
|
||||||
|
ChatController = ChatController
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
@@ -82,7 +85,7 @@ export class NotificationsService {
|
|||||||
}) .catch((error) => {
|
}) .catch((error) => {
|
||||||
console.log("Register device error", error)
|
console.log("Register device error", error)
|
||||||
})
|
})
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Granted permission error", error)
|
console.log("Granted permission error", error)
|
||||||
}
|
}
|
||||||
@@ -199,6 +202,7 @@ export class NotificationsService {
|
|||||||
this.active = true
|
this.active = true
|
||||||
console.log('NOtification Listener', notification)
|
console.log('NOtification Listener', notification)
|
||||||
this.storenotification(notification)
|
this.storenotification(notification)
|
||||||
|
this.chatNotification(notification)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -206,11 +210,13 @@ export class NotificationsService {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.afMessaging.messages.subscribe((notification) => {
|
this.afMessaging.messages.subscribe((notification) => {
|
||||||
|
console.log(notification)
|
||||||
this.storenotification(notification)
|
this.storenotification(notification)
|
||||||
this.notificationReceived.emit();
|
this.notificationReceived.emit();
|
||||||
this.eventtrigger.publishSomeData({
|
this.eventtrigger.publishSomeData({
|
||||||
notification: "recive"
|
notification: "recive"
|
||||||
})
|
})
|
||||||
|
this.chatNotification(notification)
|
||||||
// Handle the received message, e.g., show a notification
|
// Handle the received message, e.g., show a notification
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -393,4 +399,13 @@ export class NotificationsService {
|
|||||||
// })()
|
// })()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
chatNotification(_notification) {
|
||||||
|
const notification = this.NotificationHolderService.stractureNotificationObject(_notification)
|
||||||
|
|
||||||
|
if (notification?.notification?.data?.Service === "chat" || notification?.Service === "chat") {
|
||||||
|
this.ChatController.ChatSystemService.runMainChangeDetector()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,32 +390,32 @@ export class ObjectMergeNotification{
|
|||||||
watchCount = 0
|
watchCount = 0
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.socket.onDisconnectCallback(()=> {
|
// this.socket.onDisconnectCallback(()=> {
|
||||||
console.log("run watch")
|
// console.log("run watch")
|
||||||
this.runWatch = true
|
// this.runWatch = true
|
||||||
this.watch()
|
// this.watch()
|
||||||
})
|
// })
|
||||||
|
|
||||||
this.socket.onConnectCallback(()=> {
|
// this.socket.onConnectCallback(()=> {
|
||||||
|
|
||||||
console.log("open trigger")
|
// console.log("open trigger")
|
||||||
this.runWatch = false
|
// this.runWatch = false
|
||||||
})
|
// })
|
||||||
|
|
||||||
this.socket.subscribe((data: socketResponse) => {
|
// this.socket.subscribe((data: socketResponse) => {
|
||||||
if(data.IsCompleted == true) {
|
// if(data.IsCompleted == true) {
|
||||||
console.log("==================!!!====================")
|
// console.log("==================!!!====================")
|
||||||
try {
|
// try {
|
||||||
this.callbacks[data.Guid](data)
|
// this.callbacks[data.Guid](data)
|
||||||
delete this.callbacks[data.Guid]
|
// delete this.callbacks[data.Guid]
|
||||||
} catch (error) {}
|
// } catch (error) {}
|
||||||
} else {
|
// } else {
|
||||||
console.log("else", data)
|
// console.log("else", data)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
this.socket.connect();
|
// this.socket.connect();
|
||||||
this.watch()
|
// this.watch()
|
||||||
}
|
}
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
templateUrl: './group-messages.page.html',
|
templateUrl: './group-messages.page.html',
|
||||||
@@ -46,7 +46,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
documents: SearchList[] = [];
|
documents: SearchList[] = [];
|
||||||
|
|
||||||
room: any = new Array();
|
room: any = new Array();
|
||||||
roomName: any;
|
|
||||||
members: any;
|
members: any;
|
||||||
|
|
||||||
capturedImage: any;
|
capturedImage: any;
|
||||||
@@ -58,8 +57,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
scrollToBottomBtn = false;
|
scrollToBottomBtn = false;
|
||||||
roomCountDownDate: string;
|
|
||||||
roomCountDownTime: string;
|
|
||||||
isAdmin = false;
|
isAdmin = false;
|
||||||
|
|
||||||
@Input() roomId: string;
|
@Input() roomId: string;
|
||||||
@@ -106,14 +103,13 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.ChatSystemService.getUser()
|
this.ChatSystemService.getUser()
|
||||||
this.loggedUserChat = SessionStore.user.ChatData['data'];
|
this.loggedUserChat = SessionStore.user.ChatData['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
this.roomCountDownDate = "";
|
|
||||||
this.roomCountDownTime = "";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@@ -124,7 +120,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||||
|
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
this.showAvatar = false
|
this.showAvatar = false
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -136,6 +134,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection shared')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loggedUser = this.loggedUserChat;
|
this.loggedUser = this.loggedUserChat;
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
@@ -151,10 +155,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
return this.timeService.showDateDuration(start);
|
return this.timeService.showDateDuration(start);
|
||||||
}
|
}
|
||||||
|
|
||||||
countDownDate() {
|
|
||||||
return this.timeService.countDownDateTimer(this.roomCountDownDate, this.roomId);
|
|
||||||
}
|
|
||||||
|
|
||||||
setStatus(status: string) {
|
setStatus(status: string) {
|
||||||
let body = {
|
let body = {
|
||||||
message: '',
|
message: '',
|
||||||
@@ -377,28 +377,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||||
}
|
}
|
||||||
|
|
||||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
|
||||||
this.room = room['room'];
|
|
||||||
if (this.room.name) {
|
|
||||||
try {
|
|
||||||
this.roomName = this.room.name.split('-').join(' ');
|
|
||||||
} catch (error) {
|
|
||||||
this.roomName = this.room.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
|
|
||||||
this.isAdmin = true
|
|
||||||
} else {
|
|
||||||
this.isAdmin = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.room.customFields.countDownDate) {
|
|
||||||
this.roomCountDownDate = this.room.customFields.countDownDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.getGroupContacts(this.room);
|
this.getGroupContacts(this.room);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,14 +514,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(res?.data?.name) {
|
|
||||||
try {
|
|
||||||
this.roomName = res.data.name.split('-').join(' ');
|
|
||||||
} catch (error) {
|
|
||||||
this.roomName = res.data.name
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
|||||||
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@@ -123,7 +124,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
// update
|
// update
|
||||||
this.checkAudioPermission()
|
this.checkAudioPermission()
|
||||||
@@ -138,6 +140,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
|
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId)
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
|
|
||||||
this.showAvatar = false
|
this.showAvatar = false
|
||||||
|
|
||||||
|
|
||||||
@@ -154,6 +161,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection shared')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async ChatMessageDebuggingPage() {
|
async ChatMessageDebuggingPage() {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-bottom-detail d-flex align-items-center">
|
<div class="item-bottom-detail d-flex align-items-center">
|
||||||
<div class="item-workflow">
|
<div class="item-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-date">
|
<div class="item-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="d-flex mt-10 activity-instanceName" ><span class="label">{{ task.activityInstanceName }}</span></p>
|
<p class="d-flex mt-10 activity-instanceName" ><span class="label">{{ task.WorkflowName }}</span></p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label">{{task.activityInstanceName}}</span>
|
<span class="label">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label mr-10">{{task.activityInstanceName}}</span>
|
<span class="label mr-10">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="exp-middle-detail">
|
<div class="exp-middle-detail">
|
||||||
<div class="exp-workflow">
|
<div class="exp-workflow">
|
||||||
<span class="label mr-10">{{task.activityInstanceName}}</span>
|
<span class="label mr-10">{{task.WorkflowName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-date">
|
<div class="exp-date">
|
||||||
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
<ion-label>{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
|
||||||
|
|||||||
@@ -43,6 +43,16 @@ export class HeaderPage implements OnInit {
|
|||||||
notificationCount: number = 0;
|
notificationCount: number = 0;
|
||||||
profilePicture = "";
|
profilePicture = "";
|
||||||
|
|
||||||
|
hideHeader = false
|
||||||
|
|
||||||
|
|
||||||
|
hideHeaderValidation() {
|
||||||
|
const result = this.HeaderSettingsService.hideHeader && this.ActiveTabService.pages.gabineteDetails
|
||||||
|
if(result != this.hideHeader) {
|
||||||
|
this.hideHeader = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
|||||||
@@ -64,18 +64,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
|
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
|
||||||
name="image" ngDefaultControl [src]="seleted.url" style="height: 69px;"></ion-img>
|
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.Base64" style="height: 69px;"></ion-img>
|
||||||
|
|
||||||
<video class="sdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkDesktop() == true" width="70" height="70"
|
<video class="sdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkDesktop() == true" width="70" height="70"
|
||||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||||
<source type="video/mp4" [src]="seleted.url">
|
<source type="video/mp4" [src]="seleted.url">
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
<video class="sdfsdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkTableDivice() == true" width="70" height="70"
|
|
||||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
|
||||||
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.Base64">
|
|
||||||
</video>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -402,6 +402,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
let time = new Date()
|
let time = new Date()
|
||||||
if (this.publicationFormMV.form.Files.length >= 1) {
|
if (this.publicationFormMV.form.Files.length >= 1) {
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
const upload = await this.publicationFormMV.uploadVideosFiles()
|
const upload = await this.publicationFormMV.uploadVideosFiles()
|
||||||
|
|
||||||
@@ -410,8 +411,10 @@ export class NewPublicationPage implements OnInit {
|
|||||||
if(e.FileType == 'video' && e.blobFile && e.toUpload) {
|
if(e.FileType == 'video' && e.blobFile && e.toUpload) {
|
||||||
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
|
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
|
||||||
e.FileExtension = "mp4"
|
e.FileExtension = "mp4"
|
||||||
e.Base64 = ""
|
e.Base64 = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return e
|
return e
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -420,7 +423,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
const publication: any = Object.assign({}, this.publicationFormMV.form)
|
const publication: any = Object.assign({}, this.publicationFormMV.form)
|
||||||
|
|
||||||
publication.Files = publication.Files.map( (e:PublicationAttachmentEntity) => ({
|
publication.Files = publication.Files.map( (e:PublicationAttachmentEntity) => ({
|
||||||
FileBase64: e.url,
|
FileBase64: e.Base64,
|
||||||
FileExtension: e.FileExtension,
|
FileExtension: e.FileExtension,
|
||||||
OriginalFileName: e.OriginalFileName || 'foto'
|
OriginalFileName: e.OriginalFileName || 'foto'
|
||||||
}))
|
}))
|
||||||
@@ -428,7 +431,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
publication.DocumentId = null;
|
publication.DocumentId = null;
|
||||||
publication.ProcessId = this.folderId
|
publication.ProcessId = this.folderId
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
addNotification(notification) {
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ import { environment as doneITProd } from './suport/doneIt'
|
|||||||
import { DevDev } from './suport/dev'
|
import { DevDev } from './suport/dev'
|
||||||
|
|
||||||
|
|
||||||
export const environment: Environment = oaprProd;
|
export const environment: Environment = DevDev;
|
||||||
|
|||||||
Reference in New Issue
Block a user