mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Merge branch 'feature/fix-login' into develop
This commit is contained in:
@@ -18,7 +18,7 @@ export class LoginGuard implements CanActivate {
|
||||
canActivate(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||
this.router.navigate(['/home/events']);
|
||||
return false
|
||||
|
||||
@@ -46,7 +46,6 @@ export class ViewDocumentPage implements OnInit {
|
||||
|
||||
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=> {
|
||||
const link: string = res;
|
||||
console.log(res,' link!!!')
|
||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
||||
}, ()=>{
|
||||
this.close();
|
||||
|
||||
@@ -76,7 +76,7 @@ export class UserSession {
|
||||
UserName: string
|
||||
Password: string
|
||||
RochetChatUserId: string
|
||||
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ;
|
||||
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' | 'Administrador';
|
||||
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
||||
PIN: string
|
||||
Inactivity: boolean
|
||||
|
||||
@@ -224,8 +224,8 @@
|
||||
</app-group-contacts>
|
||||
|
||||
<app-group-messages
|
||||
*ngIf="showGroupMessages"
|
||||
[style.display]="showEmptyComponent ? 'flex' : 'none'"
|
||||
*ngIf="showGroupMessages && wsChatMethodsService.deleteRecently(roomId) == false"
|
||||
[style.display]="showEmptyComponent ? 'flex' : 'none'"
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
(openGroupContacts)="openGroupContactsPage($event)"
|
||||
|
||||
@@ -129,16 +129,6 @@ export class ChatPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/* let data = {
|
||||
status: "success",
|
||||
data: {
|
||||
userId: "CqYSKR5hrAumZihs7",
|
||||
authToken: "bvh5BH98Av5ShMnEW94Cwm1Hf-yHEHbl121ijq5Odc_sdvs"
|
||||
}
|
||||
}
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save() */
|
||||
// console.log(SessionStore.user.ChatData.data.authToken)
|
||||
this.chatService.refreshtoken();
|
||||
|
||||
this.segment = "Contactos";
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
<ion-content>
|
||||
<div (click)="handleClick()" class="messages" #scrollMe>
|
||||
<ion-list>
|
||||
<div class="messages-list-item-wrapper container-width-100"
|
||||
|
||||
<div class="messages-list-item-wrapper container-width-100"
|
||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
|
||||
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}'
|
||||
@@ -114,7 +114,7 @@
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
<span *ngIf="msg.file.type">
|
||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'" icon="file-word" class="word-icon"></fa-icon>
|
||||
@@ -127,8 +127,8 @@
|
||||
</ion-icon>
|
||||
</span>
|
||||
<ion-label class="file-title">{{file.title}}</ion-label>
|
||||
</div>
|
||||
<!-- <ion-progress-bar [type]="'indeterminate'" *ngIf="downloadLoader"></ion-progress-bar> -->
|
||||
</div>
|
||||
<!-- <ion-progress-bar [type]="'indeterminate'" *ngIf="downloadLoader"></ion-progress-bar> -->
|
||||
</div>
|
||||
</div>
|
||||
<div (click)="audioPreview(msg)" class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && !file.title_link">
|
||||
@@ -147,7 +147,7 @@
|
||||
<ion-label *ngIf="msg.file && msg.file != ''">
|
||||
<span *ngIf="file.description">{{file.description}}</span>
|
||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||
|
||||
|
||||
</ion-label>
|
||||
|
||||
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
|
||||
@@ -204,7 +204,7 @@
|
||||
Apagou a mensagem
|
||||
</div>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||
@@ -214,29 +214,6 @@
|
||||
|
||||
</ion-content>
|
||||
|
||||
<!-- <ion-footer>
|
||||
<ion-toolbar>
|
||||
<ion-row align-items-center class="row">
|
||||
<ion-col size="1">
|
||||
<ion-label class="ion-no-padding" lines="none">
|
||||
<ion-icon (click)="openChatOptions()" class="chat-icon-options" src="assets/icon/icons-chat-options.svg"></ion-icon>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size="9">
|
||||
<ion-item class="ion-no-padding type-message" lines="none">
|
||||
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-col>
|
||||
<ion-col size="2">
|
||||
<ion-label>
|
||||
<ion-icon (click)="sendMessage()" class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-toolbar>
|
||||
</ion-footer> -->
|
||||
|
||||
<ion-footer >
|
||||
|
||||
|
||||
|
||||
@@ -30,12 +30,14 @@
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div [ngSwitch]="segmentVista" class="overflow-y-auto">
|
||||
<!-- This is the list view -->
|
||||
<div *ngSwitchCase="'listview'">
|
||||
|
||||
|
||||
|
||||
<ion-item-sliding *ngIf="loadCount">
|
||||
<div class="listview" >
|
||||
<ion-list *ngIf="AllProcess">
|
||||
|
||||
@@ -159,9 +159,9 @@ export class GabineteDigitalPage implements OnInit {
|
||||
else {
|
||||
this.segmentVista = "boxview";
|
||||
}
|
||||
};
|
||||
this.checkRoutes();
|
||||
}
|
||||
|
||||
this.checkRoutes();
|
||||
}
|
||||
closeAllDesktopComponent() {
|
||||
this.desktopComponent = {
|
||||
@@ -208,8 +208,6 @@ export class GabineteDigitalPage implements OnInit {
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
this.loadAllProcesses();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
async loadAllProcesses() {
|
||||
@@ -257,7 +255,6 @@ export class GabineteDigitalPage implements OnInit {
|
||||
allprocess.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
|
||||
@@ -44,3 +44,5 @@
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +125,8 @@ export class AuthService {
|
||||
}
|
||||
else if(session.RoleID == 99999886) {
|
||||
session.Profile = 'General secretary'
|
||||
} else if (session.RoleID == 100000015) {
|
||||
session.Profile = 'Administrador'
|
||||
}
|
||||
|
||||
session.Password = user.password
|
||||
|
||||
@@ -42,6 +42,8 @@ export class WsChatMethodsService {
|
||||
sessionStore = SessionStore
|
||||
|
||||
loggedUser: any;
|
||||
|
||||
delete = []
|
||||
|
||||
constructor(
|
||||
private WsChatService: WsChatService,
|
||||
@@ -68,7 +70,7 @@ export class WsChatMethodsService {
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: ()=>{
|
||||
funx: () => {
|
||||
/**
|
||||
* @description when the phone is in the background for a long time it could disconnects from the socket then the socket reconnects automatically,
|
||||
* when the connection is lost the subscribe is also lost, so we have to subscribe again when reconnection is establish.
|
||||
@@ -363,10 +365,16 @@ export class WsChatMethodsService {
|
||||
|
||||
|
||||
deleteRoom(roomId) {
|
||||
|
||||
this.delete.push(roomId)
|
||||
delete this.group[roomId];
|
||||
this._group = this._group.filter((e)=> e.id != roomId);
|
||||
}
|
||||
|
||||
deleteRecently(roomId) {
|
||||
return this.delete.includes(roomId)
|
||||
}
|
||||
|
||||
roomExist(roomId) {
|
||||
return this.dm[roomId]?.id || this.group[roomId]?.id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user