This commit is contained in:
Peter Maquiran
2022-04-26 14:34:52 +01:00
parent 946401c4a2
commit adc80b6e3d
20 changed files with 49 additions and 50 deletions
-1
View File
@@ -75,7 +75,6 @@ export class UserSession {
}[]
UserName: string
Password: string
RochetChatUser: string
RochetChatUserId: string
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ;
LoginPreference: 'None' | 'Password' | 'Pin' | null;
+3 -3
View File
@@ -386,7 +386,7 @@ export class ChatPage implements OnInit {
})
this.storageservice.get('chatusers').then((users) => {
this.dmUsers = users.filter(data => data.username != SessionStore.user.RochetChatUser);
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
})
} else {
this.sqlservice.getAllChatRoom().then((rooms: any) => {
@@ -429,7 +429,7 @@ export class ChatPage implements OnInit {
chatusersArray.push(userListDB);
});
this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.RochetChatUser);
this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.UserName);
})
}
@@ -545,7 +545,7 @@ export class ChatPage implements OnInit {
})
this.storageservice.get('chatusers').then((users) => {
this.dmUsers = users.filter(data => data.username != SessionStore.user.RochetChatUser);
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
})
} else {
this.sqlservice.getAllChatRoom().then((rooms: any) => {
@@ -72,7 +72,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
}
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
@@ -66,7 +66,7 @@
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -102,7 +102,7 @@
</div> -->
<div *ngIf="msg.file && msg.delate == false">
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
<div class="title">
<ion-label>{{msg.u.name ?? ""}}</ion-label>
<span class="time">{{msg.duration}}</span>
@@ -124,7 +124,7 @@
</div>
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -171,7 +171,7 @@
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"></span>
</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -393,7 +393,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.chatService.getAllUsers().subscribe(res => {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.RochetChatUser);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
console.log(this.allUsers);
});
}
@@ -57,7 +57,7 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log('All users',res.users);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
@@ -61,7 +61,7 @@
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -74,7 +74,7 @@
<div *ngIf="msg.file && msg.delate == false">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.file.type != 'application/meeting'">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' *ngIf="msg.file.type != 'application/meeting'">
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg.duration}}</span>
@@ -93,7 +93,7 @@
</div>
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -150,7 +150,7 @@
</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
+1 -1
View File
@@ -536,7 +536,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName)
this.showLoader = false;
});
}
@@ -63,7 +63,7 @@ export class NewGroupPage implements OnInit {
}
async createGroup(){
console.log('NEW GROUP', SessionStore.user.RochetChatUser)
console.log('NEW GROUP', SessionStore.user.UserName)
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit {
let customFields = {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields);
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
else{
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields);
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
@@ -166,7 +166,7 @@ export class PublicationsPage implements OnInit {
this.addActionToDB(folder)
if (data.ActionType == "Evento") {
console.log('Evento', folder)
publicationsEventFolderList.push(folder);
}
else {
+1 -2
View File
@@ -128,7 +128,6 @@ export class AuthService {
}
session.Password = user.password
session.RochetChatUser = user.username.split('@')[0]
session.BasicAuthKey = user.BasicAuthKey
@@ -158,7 +157,7 @@ export class AuthService {
let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000);
let postData = {
"user": SessionStore.user.RochetChatUser,
"user": SessionStore.user.UserName,
"password": SessionStore.user.Password,
}
+2 -2
View File
@@ -171,7 +171,7 @@ export class MessageService {
} else if(uploadSuccessfully == false) {
this.errorUploadingAttachment = true
return new Promise((resolve, reject)=>{
return new Promise((resolve, reject) => {
reject(false)
})
@@ -182,7 +182,7 @@ export class MessageService {
}
async sendRequest(params) {
console.log(params)
if(params?.attachments) {
if(params?.attachments[0]?.image_url) {
delete params?.attachments[0]?.image_url
@@ -1,9 +1,9 @@
import { Injectable } from '@angular/core';
import { RoomService } from './room.service';
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { MessageService } from 'src/app/services/chat/message.service'
import { MessageService } from 'src/app/services/chat/message.service';
import { SessionStore } from 'src/app/store/session.service';
import { capitalizeTxt } from 'src/plugin/text'
import { capitalizeTxt } from 'src/plugin/text';
import { Rooms, Update as room } from 'src/app/models/chatMethod';
import { Storage } from '@ionic/storage';
import { Platform } from '@ionic/angular';
@@ -16,12 +16,11 @@ import { NfService } from 'src/app/services/chat/nf.service'
import { ChangeProfileService } from '../change-profile.service';
import { UserSession } from 'src/app/models/user.model';
import { AuthService } from '../auth.service';
import { ChatStorageService } from './chat-storage.service'
import { ChatMethodsService } from './chat-methods.service'
import { ChatStorageService } from './chat-storage.service';
import { ChatMethodsService } from './chat-methods.service';
import { AESEncrypt } from '../aesencrypt.service'
import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService} from 'src/app/services/network-service.service';
import { ro } from 'date-fns/locale';
@Injectable({
providedIn: 'root'
@@ -158,7 +158,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
}
this.users = this.contacts.sort((a,b) => {
@@ -188,7 +188,7 @@ export class GroupContactsPage implements OnInit {
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
}
else{
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
}
this.users = this.contacts.sort((a,b) => {
@@ -57,7 +57,7 @@
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -69,7 +69,7 @@
</div>
<div *ngIf="msg.file">
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
<div *ngIf="msg.file.type != 'application/meeting'">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
@@ -99,7 +99,7 @@
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -147,7 +147,7 @@
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"></span>
</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -73,8 +73,8 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log(res.users);
//this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
//this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
@@ -55,7 +55,8 @@
<ion-label *ngIf="msg.delate == false" class="flex-0">{{msg.msg}} </ion-label>
<ion-label *ngIf="msg.delate == true" class="flex-0">Apagou a mensagem</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -67,7 +68,7 @@
</div>
<div *ngIf="msg.file && msg.delate == false">
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}} max-width-45'
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45'
*ngIf="msg.file.type != 'application/meeting'">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
@@ -93,7 +94,8 @@
</ion-item>
</div>
<img *ngIf="msg.attachments[0].image_url" src={{msg.attachments[0].image_url}} alt="image">
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
@@ -148,7 +150,7 @@
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"></span>
</ion-label>
<ion-label class="float-status-all float-status" >
<ion-label class="float-status-all float-status" *ngIf="msg.u.username==sessionStore.user.UserName">
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
@@ -545,7 +545,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName)
this.showLoader = false;
});
}
@@ -105,11 +105,11 @@ export class NewGroupPage implements OnInit{
let customFields = {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields);
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
else{
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.RochetChatUser, customFields);
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
}
+6 -6
View File
@@ -21,12 +21,12 @@
export const environment = {
production: false,
apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
//apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
//apiChatUrl: 'https://www.tabularium.pt/api/v1/',
//apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
//apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
//apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
apiChatUrl: 'https://www.tabularium.pt/api/v1/',
apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
domain: 'gabinetedigital.local', //gabinetedigital.local
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local
defaultuserpwd: 'tabteste@006', //tabteste@006,