mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
remove expired room
This commit is contained in:
@@ -11,10 +11,6 @@ const routes: Routes = [
|
||||
path: 'new-group',
|
||||
loadChildren: () => import('./modal/new-group/new-group.module').then( m => m.NewGroupPageModule)
|
||||
},
|
||||
{
|
||||
path: 'group-messages',
|
||||
loadChildren: () => import('./modal/group-messages/group-messages.module').then( m => m.GroupMessagesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'messages',
|
||||
outlet:'message',
|
||||
@@ -28,14 +24,6 @@ const routes: Routes = [
|
||||
path: 'chat-options-popover',
|
||||
loadChildren:() => import('./modal/chat-options-popover/chat-options-popover.module').then( m => m.ChatOptionsPopoverPageModule)
|
||||
},
|
||||
{
|
||||
path: 'chat-debugging',
|
||||
loadChildren: () => import('./modal/chat-debugging/chat-debugging.module').then( m => m.ChatDebuggingPageModule)
|
||||
},
|
||||
{
|
||||
path: 'chat-message-debugging',
|
||||
loadChildren: () => import('./modal/chat-message-debugging/chat-message-debugging.module').then( m => m.ChatMessageDebuggingPageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-chat',
|
||||
loadChildren: () => import('./component/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
||||
|
||||
@@ -15,8 +15,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { EmptyChatPageModule } from './component/empty-chat/empty-chat.module';
|
||||
import { EditGroupPageModule } from './component/edit-group/edit-group.module';
|
||||
import { GroupContactsPageModule } from './component/group-messages/group-contacts/group-contacts.module';
|
||||
import { GroupMessagesPageModule } from './component/group-messages/group-messages.module';
|
||||
import { GroupContactsPageModule } from './component/group-contacts/group-contacts.module';
|
||||
import { MessagesPageModule } from './component/messages/messages.module';
|
||||
import { ContactsPageModule } from './component/contacts/contacts.module';
|
||||
import { NewGroupPageModule } from './component/new-group/new-group.module';
|
||||
@@ -35,7 +34,6 @@ import { BoldLocalRepository } from 'src/app/module/chat/data/repository/bold/bo
|
||||
RouterModule,
|
||||
MessagesPageModule,
|
||||
ContactsPageModule,
|
||||
GroupMessagesPageModule,
|
||||
NewGroupPageModule,
|
||||
EditGroupPageModule,
|
||||
GroupContactsPageModule,
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { GroupMessagesPage } from './modal/group-messages/group-messages.page';
|
||||
import { ContactsPage } from './modal/./messages/contacts/contacts.page';
|
||||
import { MessagesPage } from './modal/./messages/messages.page';
|
||||
import { INewGroupModalOutPut, NewGroupPage } from './modal/./new-group/new-group.page';
|
||||
@@ -551,22 +550,4 @@ export class ChatPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async openGroupMessagesModal(roomId: any) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
cssClass: 'modal modal-desktop isGroupChatOpened',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(() => {
|
||||
// this.ChatSystemService.currentRoom.roomLeave()
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import { ContactsPageRoutingModule } from './contacts-routing.module';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { BtnSeguintePageModule } from 'src/app/shared/btn-seguinte/btn-seguinte.module';
|
||||
import { FilterPipe } from 'src/app/pipes/filter.pipe';
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -16,9 +17,9 @@ import { BtnSeguintePageModule } from 'src/app/shared/btn-seguinte/btn-seguinte.
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ContactsPageRoutingModule,
|
||||
BtnSeguintePageModule,
|
||||
PipesModule,
|
||||
],
|
||||
declarations: [ContactsPage],
|
||||
exports: [ContactsPage]
|
||||
exports: [ContactsPage],
|
||||
declarations: [ContactsPage]
|
||||
})
|
||||
export class ContactsPageModule {}
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
.back-icon{
|
||||
width: 37px;
|
||||
float: left;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
|
||||
|
||||
}
|
||||
.div-title{
|
||||
width: 221px;
|
||||
@@ -56,7 +56,7 @@
|
||||
--padding-bottom:0 !important;
|
||||
--padding-start:0 !important;
|
||||
--padding-end:0 !important;
|
||||
|
||||
|
||||
.search{
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 5px 20px 5px 20px;
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ ion-content{
|
||||
width: rem(30);
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
.detele-item-icon ion-icon{
|
||||
font-size: rem(20) !important;
|
||||
}
|
||||
@@ -127,13 +127,13 @@ ion-content{
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
font-size: rem(15);
|
||||
margin: 10px 0 10px 0;
|
||||
padding:5px 0 5px 20px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.item-checkbox{
|
||||
@@ -180,4 +180,4 @@ ion-content{
|
||||
button {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { GroupMessagesPage } from '../group-messages/group-messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||
|
||||
+2
-10
@@ -80,11 +80,10 @@ export class GroupContactsPage implements OnInit {
|
||||
async loadUsers() {
|
||||
|
||||
const getallChatUsers = await this.contactsRepositoryService.getUsers()
|
||||
const getRoomById = await this.chatServiceService.getRoomById(this.roomId)
|
||||
|
||||
console.log({getallChatUsers, getRoomById})
|
||||
// console.log({getallChatUsers, getRoomById})
|
||||
|
||||
if(getallChatUsers.isOk() && getRoomById.isOk()) {
|
||||
if(getallChatUsers.isOk()) {
|
||||
|
||||
this.allChatUsers = getallChatUsers.value.data.result.sort((a,b) => {
|
||||
if(a.wxFullName < b.wxFullName) {
|
||||
@@ -128,13 +127,6 @@ export class GroupContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (getRoomById.isErr() && getRoomById.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getRoomById.error)
|
||||
} else if (getallChatUsers.isErr() && getallChatUsers.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getallChatUsers.error)
|
||||
} else if (getRoomById.isErr() ) {
|
||||
console.log(getRoomById.error)
|
||||
} else if (getallChatUsers.isErr() ) {
|
||||
console.log(getallChatUsers.error)
|
||||
} else {
|
||||
@@ -1,21 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GroupMessagesPage
|
||||
},
|
||||
{
|
||||
path: 'group-contacts',
|
||||
loadChildren: () => import('./group-contacts/group-contacts.module').then( m => m.GroupContactsPageModule)
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
@@ -1,36 +0,0 @@
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupMessagesPageRoutingModule } from './group-messages-routing.module';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||
import { ChatPopoverPageModule } from '../../modal/chat-popover/chat-popover.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
FontAwesomeModule,
|
||||
ChatPopoverPageModule,
|
||||
GroupMessagesPageRoutingModule,
|
||||
MatMenuModule,
|
||||
LettersAvatarModule,
|
||||
PipesModule,
|
||||
//
|
||||
],
|
||||
exports: [GroupMessagesPage],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
declarations: [GroupMessagesPage]
|
||||
})
|
||||
export class GroupMessagesPageModule {}
|
||||
@@ -1,350 +0,0 @@
|
||||
@import '~src/function.scss';
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
|
||||
.main-header{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow:auto;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
//transform: translate3d(0, 1px, 0);
|
||||
|
||||
.header-top{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
width:calc(100% - 77px);
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
.right{
|
||||
padding: 0!important;
|
||||
float: right;
|
||||
font-size: rem(25);
|
||||
color: #0782c9;
|
||||
margin: 5px 0 0 0;
|
||||
}
|
||||
}
|
||||
.header-bottom{
|
||||
width: 98%;
|
||||
overflow: auto;
|
||||
|
||||
.header-bottom-icon{
|
||||
width: rem(30);
|
||||
font-size: rem(25);
|
||||
float: left;
|
||||
padding: 2px;
|
||||
|
||||
}
|
||||
.header-bottom-contacts{
|
||||
width: calc(100% - 40px);
|
||||
font-size: rem(15);
|
||||
color: #797979;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
margin: 1px;
|
||||
|
||||
.contacts-list{
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: rem(25);
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
float: left;
|
||||
}
|
||||
.div-icon{
|
||||
width: rem(40);
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-delete-recording{
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
ion-content{
|
||||
.welcome-text{
|
||||
/* width: 322px; */
|
||||
//width: em(422px);
|
||||
background: #ebebeb;
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #797979;
|
||||
padding: 10px;
|
||||
margin: 0 auto !important;
|
||||
line-height: 1.2rem;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.info-text{
|
||||
/* width: 322px; */
|
||||
width: em(422px);
|
||||
background: var(--chat-alert-msg-color);
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
}
|
||||
.info-text-leave{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
padding: 10px;
|
||||
background: #e0e9ee;
|
||||
border-radius: 8px;
|
||||
margin: 10px auto;
|
||||
color: #797979 !important;
|
||||
font-size: rem(13) !important;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
|
||||
.info-text-leave ion-label{
|
||||
font-size: rem(13) !important;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.info-meeting{
|
||||
/* width: 322px; */
|
||||
width: em(422px);
|
||||
background: var(--chat-alert-msg-color);
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
|
||||
.info-meeting-small{
|
||||
font-size: rem(10);
|
||||
font-style: italic;
|
||||
}
|
||||
.info-meeting-medium{
|
||||
font-size: rem(12);
|
||||
}
|
||||
.info-meeting-normal{
|
||||
font-weight: 700;
|
||||
}
|
||||
.info-meeting-normal:hover{
|
||||
text-decoration: underline;
|
||||
color: #0782c9;
|
||||
}
|
||||
}
|
||||
.messages{
|
||||
font-size: rem(13);
|
||||
font-family: Roboto;
|
||||
overflow: auto;
|
||||
|
||||
//set scroll do bottom
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
word-wrap: break-word;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
.incoming-true, .incoming-false{
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.incoming-true{
|
||||
margin: 10px 75px 10px 20px;
|
||||
background: #ebebeb;
|
||||
float: left;
|
||||
}
|
||||
.container-width-100{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
.incoming-false{
|
||||
margin: 10px 20px 10px 75px;
|
||||
background: var(--chat-incoming-msg-color);
|
||||
float: right;
|
||||
}
|
||||
.title{
|
||||
display: inline;
|
||||
color: var(--title-text-color);
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
|
||||
.time{
|
||||
color: #797979;
|
||||
text-align: right;
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.message{
|
||||
.message-attachments{
|
||||
.file{
|
||||
align-items: center;
|
||||
|
||||
.file-details{
|
||||
width: 100%;
|
||||
|
||||
.file-title{
|
||||
color: #000;
|
||||
text-decoration: underline;
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
.file-title:hover{
|
||||
color: #0782c9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ion-footer{
|
||||
padding-top: 7.5px;
|
||||
padding-bottom: 7.5px;
|
||||
|
||||
.container{
|
||||
justify-content: center;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.chat-icon-options{
|
||||
display:block !important;
|
||||
font-size: rem(35);
|
||||
float: right !important;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.chat-icon-send{
|
||||
font-size: rem(45);
|
||||
margin: 0 auto;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.type-message{
|
||||
display: flex;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 25px;
|
||||
padding-left: 15px;
|
||||
margin: 0 15px 0 75px;
|
||||
align-items: center;
|
||||
overflow: auto;
|
||||
|
||||
ion-textarea{
|
||||
margin: 0 !important;
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-send{
|
||||
padding-right: 20px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.typing {
|
||||
position: relative;
|
||||
top: -25px;
|
||||
height: 0px;
|
||||
left: 0px;
|
||||
margin-left: 22px;
|
||||
display: flex;
|
||||
font-size: rem(12);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.typing ngx-letters-avatar {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
.float-status{
|
||||
position: relative !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
}
|
||||
|
||||
.float-status-image{
|
||||
position: relative !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
top: -15px;
|
||||
}
|
||||
|
||||
.float-status-webtrix {
|
||||
position: relative !important;
|
||||
top: 0px !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
}
|
||||
|
||||
.float-status-all {
|
||||
font-size: 10pt !important;
|
||||
}
|
||||
|
||||
|
||||
.try {
|
||||
color: red;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
.dateLabel {
|
||||
background: #ebebeb !important;
|
||||
float: unset !important;
|
||||
margin: 0px auto !important;
|
||||
width: 111px !important;
|
||||
text-align: center;
|
||||
margin-top: 10px !important;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.lido,
|
||||
.enviado {
|
||||
font-size: rem(11);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
describe('GroupMessagesPage', () => {
|
||||
let component: GroupMessagesPage;
|
||||
let fixture: ComponentFixture<GroupMessagesPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupMessagesPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GroupMessagesPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ContactsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ContactsPageRoutingModule {}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ContactsPageRoutingModule } from './contacts-routing.module';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { FilterPipe } from 'src/app/pipes/filter.pipe';
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ContactsPageRoutingModule,
|
||||
PipesModule,
|
||||
],
|
||||
exports: [ContactsPage],
|
||||
declarations: [ContactsPage]
|
||||
})
|
||||
export class ContactsPageModule {}
|
||||
@@ -1,49 +0,0 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="back-icon cursor-pointer" (click)="close()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<!-- Desktop -->
|
||||
<ion-label class="title">Nova Conversa</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar class="toolbar-search">
|
||||
<div class="search">
|
||||
<ion-searchbar search-icon="undefined" debounce="500" (ionChange)="onChange($event)" placeholder="Pesquisar por contacto" ></ion-searchbar>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<!-- <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> -->
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<div class="main-content">
|
||||
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
|
||||
<ion-virtual-scroll [items]="userList" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{ header }}</ion-label>
|
||||
</div>
|
||||
|
||||
<div (click)="openMessagesPage(user.wxFullName, user.wxUserId)" *virtualItem="let user" class="item-user cursor-pointer">
|
||||
<p>{{ user.wxFullName }}</p>
|
||||
<span class="icon">
|
||||
<ion-icon [class]="user.status" slot="end" name="ellipse"></ion-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</ion-virtual-scroll>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@@ -1,136 +0,0 @@
|
||||
@import '~src/function.scss';
|
||||
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
|
||||
.main-header{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.div-icon{
|
||||
width: rem(40);
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.back-icon{
|
||||
width: 37px;
|
||||
float: left;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
.div-title{
|
||||
width: 221px;
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
.title{
|
||||
font-size: rem(25);
|
||||
}
|
||||
}
|
||||
}
|
||||
.toolbar-search{
|
||||
--padding-top:0 !important;
|
||||
--padding-bottom:0 !important;
|
||||
--padding-start:0 !important;
|
||||
--padding-end:0 !important;
|
||||
|
||||
.search{
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 5px 20px 5px 20px;
|
||||
border-radius: 5px;
|
||||
height: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.search ion-searchbar{
|
||||
/* border: 1px solid green; */
|
||||
width: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
--border-radius: 5px;
|
||||
--box-shadow: none;
|
||||
overflow: hidden;
|
||||
--icon-color:var( --font-awesome);
|
||||
}
|
||||
|
||||
}
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
.main-content{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
padding: 0 0 0 0;
|
||||
overflow:auto;
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
font-size: rem(15);
|
||||
margin: 10px 0 10px 0;
|
||||
padding:5px 0 5px 20px;
|
||||
|
||||
}
|
||||
|
||||
.item-user{
|
||||
display: flex;
|
||||
margin: 10px 20px 10px 20px !important;
|
||||
overflow: auto;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-user p{
|
||||
display: block;
|
||||
margin: 0 !important;
|
||||
width: 90%;
|
||||
font-size: rem(15);
|
||||
color: var(--title-text-color);
|
||||
float: left;
|
||||
}
|
||||
.item-user .icon{
|
||||
width: 10%;
|
||||
font-size: rem(10);
|
||||
display: block;
|
||||
text-align: right;
|
||||
overflow: auto;
|
||||
}
|
||||
.online{
|
||||
color:#99e47b;
|
||||
}
|
||||
.offline{
|
||||
color:#cbced1;
|
||||
}
|
||||
.away{
|
||||
color:#ffd21f;
|
||||
}
|
||||
.invisible{
|
||||
color:#cbced1;
|
||||
}
|
||||
.busy{
|
||||
color:#f5455c;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
|
||||
describe('ContactsPage', () => {
|
||||
let component: ContactsPage;
|
||||
let fixture: ComponentFixture<ContactsPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ContactsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ContactsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,203 +0,0 @@
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { MessagesPage } from '../messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
||||
|
||||
|
||||
class UserToSelect {
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-contacts',
|
||||
templateUrl: './contacts.page.html',
|
||||
styleUrls: ['./contacts.page.scss'],
|
||||
})
|
||||
export class ContactsPage implements OnInit {
|
||||
loggedUser: any;
|
||||
|
||||
headers: HttpHeaders;
|
||||
options: any;
|
||||
textSearch: string;
|
||||
room: any;
|
||||
dm: any;
|
||||
sessionStore = SessionStore
|
||||
loading = false
|
||||
@Input() roomId: string;
|
||||
|
||||
@Output() openMessage: EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() emptyTextDescriptionOpen: EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() backToChat: EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() closeAllDesktopComponents: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
userList: UserContacts[];
|
||||
originalUserList: any[] = [];
|
||||
|
||||
CoolList = []
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public ThemeService: ThemeService,
|
||||
// public ChatSystemService: ChatSystemService,
|
||||
private contactsRepositoryService: ContactRepositoryService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private toastService: ToastService,
|
||||
private ChatServiceService: ChatServiceService
|
||||
) {
|
||||
this.loggedUser = SessionStore.user.ChatData['data'];
|
||||
this.textSearch = "";
|
||||
this.dm = null;
|
||||
this.room = null;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
this.loadUsers();
|
||||
}
|
||||
|
||||
onChange(event) {
|
||||
this.textSearch = event.detail.value.toLowerCase();
|
||||
this.userList = this.originalUserList.filter((e) => {
|
||||
const username = e.wxFullName.toLowerCase();
|
||||
return username.includes(this.textSearch);
|
||||
});
|
||||
|
||||
this.userList.sort((a, b) => a.wxFullName.toLowerCase().localeCompare(b.wxFullName.toLowerCase()));
|
||||
}
|
||||
|
||||
openMessagesPage(username: string, wxUserId: number) {
|
||||
this.createRoom(username, wxUserId);
|
||||
/* if (window.innerWidth < 701) {
|
||||
this.createRoom(username);
|
||||
}
|
||||
else {
|
||||
let body = {
|
||||
username: username,
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
this.chatService.createRoom(body).subscribe(res => {
|
||||
this.room = res['room'];
|
||||
|
||||
this.ChatSystemService.getAllRooms(() => {
|
||||
this.openMessage.emit(this.room._id);
|
||||
|
||||
this.loading = false
|
||||
}, this.room._id);
|
||||
|
||||
}, () => {
|
||||
this.loading = false
|
||||
});
|
||||
}*/
|
||||
}
|
||||
|
||||
async loadUsers() {
|
||||
try {
|
||||
let users = await this.contactsRepositoryService.getUsers();
|
||||
if (users.isOk()) {
|
||||
const userData = users.value.data.result;
|
||||
console.log(userData)
|
||||
this.originalUserList = userData;
|
||||
this.userList = [...this.originalUserList];
|
||||
this.userList.sort((a, b) => a.wxFullName.toLowerCase().localeCompare(b.wxFullName.toLowerCase()));
|
||||
console.log('User data loaded successfully:', this.originalUserList);
|
||||
} else {
|
||||
console.error('Failed to fetch users:', users.error);
|
||||
}
|
||||
this.loading = false;
|
||||
} catch (error) {
|
||||
console.error('Error loading users', error);
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
separateLetter(record, recordIndex, records) {
|
||||
const normalize = (str) => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
||||
|
||||
if (recordIndex == 0) {
|
||||
return normalize(record.wxFullName[0]).toUpperCase();
|
||||
}
|
||||
|
||||
let firstPrev = normalize(records[recordIndex - 1].wxFullName[0]).toUpperCase();
|
||||
let firstCurrent = normalize(record.wxFullName[0]).toUpperCase();
|
||||
|
||||
if (firstPrev !== firstCurrent) {
|
||||
return firstCurrent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
}
|
||||
|
||||
close() {
|
||||
if (this.roomId) {
|
||||
this.backToChat.emit({ roomId: this.roomId });
|
||||
} else {
|
||||
this.closeAllDesktopComponents.emit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clicked() {
|
||||
|
||||
}
|
||||
|
||||
async createRoom(username: string, wxUserId: number) {
|
||||
const result = await this.ChatServiceService.createRoom({
|
||||
roomName: username,
|
||||
createdBy: SessionStore.user.UserId,
|
||||
roomType: 0,
|
||||
expirationDate: null,
|
||||
members: [wxUserId]
|
||||
})
|
||||
|
||||
|
||||
console.log(result)
|
||||
|
||||
if(result.isOk()) {
|
||||
await this.ChatServiceService.getRoomById(result.value.id);
|
||||
this.openMessage.emit(result.value.id);
|
||||
|
||||
} else if(result.error instanceof HttpErrorResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(result.error)
|
||||
} else {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error)
|
||||
}
|
||||
/* this.chatService.createRoom(body).subscribe(res => {
|
||||
|
||||
this.room = res['room'];
|
||||
this.openMessagesModal(this.room._id);
|
||||
this.ChatSystemService.getAllRooms()
|
||||
}); */
|
||||
}
|
||||
|
||||
async openMessagesModal(roomId: any) {
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: MessagesPage,
|
||||
cssClass: 'modal modal-desktop isMessagesChatOpened',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
});
|
||||
|
||||
modal.onDidDismiss();
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { MessagesPage } from './messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: MessagesPage
|
||||
},
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { MessagesPage } from './messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: MessagesPage
|
||||
},
|
||||
{
|
||||
path: 'contacts',
|
||||
path: 'contacts',
|
||||
loadChildren: () => import('../contacts/contacts.module').then( m => m.ContactsPageModule)
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class MessagesPageRoutingModule {}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<!-- <button (click)="ChatMessageDebuggingPage()">Dev</button> -->
|
||||
<span *ngIf="roomStatus$ | async as roomStatus"><ion-icon *ngIf="roomStatus" class="online" name="ellipse"></ion-icon></span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="right" *ngIf="roomType == RoomTypeEnum.Group">
|
||||
<button title="Menu" class="btn-no-color" (click)="_openMessagesOptions()" >
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
|
||||
|
||||
@@ -223,7 +223,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
setTimeout(() => {
|
||||
this.subscribeToChanges()
|
||||
}, 500)
|
||||
}, 500);
|
||||
|
||||
})
|
||||
}
|
||||
@@ -243,6 +243,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
subscribeToChanges() {
|
||||
|
||||
this.listenToIncomingMessage();
|
||||
this.listenToDeleteMessage();
|
||||
this.listenToUpdateMessage();
|
||||
@@ -281,7 +282,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
removeBold() {
|
||||
if(!this.room?.local) {
|
||||
this.chatServiceService.removeBoldFromRoom({roomId: this.room.$id})
|
||||
this.chatServiceService.removeBoldFromRoom({roomId: this.room.id})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +330,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.date = {}
|
||||
const allMessage = [];
|
||||
|
||||
console.time("mappingTime");
|
||||
//console.time("mappingTime");
|
||||
const sortMessages = messages.value.sort((a, b) => new Date(a.sentAt).getTime() - new Date(b.sentAt).getTime())
|
||||
|
||||
for(const message of sortMessages) {
|
||||
@@ -342,12 +343,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
allMessage.push(new MessageViewModal(message))
|
||||
}
|
||||
console.timeEnd("mappingTime");
|
||||
//console.timeEnd("mappingTime");
|
||||
this.messages1[this.room.$id]
|
||||
this.messages1[this.room.$id] = allMessage
|
||||
|
||||
|
||||
|
||||
// if(messages.length >= 1) {
|
||||
// this.messages1[this.room.$id].push(LastMessage)
|
||||
// }
|
||||
@@ -451,7 +450,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
roomId: this.room.id
|
||||
})
|
||||
} else {
|
||||
console.log('no need', message )
|
||||
// console.log('no need', message )
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -491,7 +490,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
}
|
||||
|
||||
//this.sendReadMessage()
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
roomId: this.room.id
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -535,7 +539,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
listenToUpdateMessage() {
|
||||
this.messageUpdateSubject?.unsubscribe();
|
||||
|
||||
console.log('liste to update')
|
||||
// console.log('liste to update')
|
||||
this.messageUpdateSubject = this.chatServiceService.listenToUpdateMessage(this.room.id).subscribe((updateMessage) => {
|
||||
|
||||
const index = this.messages1[this.room.$id].findIndex(e => e?.id === updateMessage.id); // Use triple equals for comparison
|
||||
@@ -829,14 +833,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
if(message.isOk() && this.room.local == IDBoolean.true) {
|
||||
this.room.local = IDBoolean.false;
|
||||
|
||||
// console.log('enter')
|
||||
// await this.chatServiceService.roomSetLocalToFalseById({
|
||||
// $roomId: this.room.$id,
|
||||
// roomId: message.value.roomId
|
||||
// })
|
||||
console.log('enter')
|
||||
await this.chatServiceService.roomSetLocalToFalseById({
|
||||
$roomId: this.room.$id,
|
||||
roomId: message.value.roomId
|
||||
})
|
||||
|
||||
this.room.id = message.value.roomId
|
||||
// this.subscribeToChanges()
|
||||
this.subscribeToChanges()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatDebuggingPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatDebuggingPageRoutingModule {}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatDebuggingPageRoutingModule } from './chat-debugging-routing.module';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatDebuggingPageRoutingModule
|
||||
],
|
||||
declarations: [ChatDebuggingPage]
|
||||
})
|
||||
export class ChatDebuggingPageModule {}
|
||||
@@ -1,9 +0,0 @@
|
||||
<!-- <ion-content>
|
||||
<ul>
|
||||
<li>Chat login</li>
|
||||
<li>Chat user list {{ ChatSystemService.users | json }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li *ngFor="let room of ChatSystemService._dm">chat Name: {{room.name}}; subcribe: {{room.status.receive.message}}; </li>
|
||||
</ul>
|
||||
</ion-content> -->
|
||||
@@ -1,24 +0,0 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
describe('ChatDebuggingPage', () => {
|
||||
let component: ChatDebuggingPage;
|
||||
let fixture: ComponentFixture<ChatDebuggingPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatDebuggingPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatDebuggingPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-debugging',
|
||||
templateUrl: './chat-debugging.page.html',
|
||||
styleUrls: ['./chat-debugging.page.scss'],
|
||||
})
|
||||
export class ChatDebuggingPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
// public ChatSystemService: ChatSystemService
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatMessageDebuggingPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatMessageDebuggingPageRoutingModule {}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatMessageDebuggingPageRoutingModule } from './chat-message-debugging-routing.module';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatMessageDebuggingPageRoutingModule
|
||||
],
|
||||
declarations: [ChatMessageDebuggingPage]
|
||||
})
|
||||
export class ChatMessageDebuggingPageModule {}
|
||||
@@ -1,10 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>chatMessageDebugging</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<button (click)="loadHistory()">Load History</button>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
describe('ChatMessageDebuggingPage', () => {
|
||||
let component: ChatMessageDebuggingPage;
|
||||
let fixture: ComponentFixture<ChatMessageDebuggingPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatMessageDebuggingPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatMessageDebuggingPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-message-debugging',
|
||||
templateUrl: './chat-message-debugging.page.html',
|
||||
styleUrls: ['./chat-message-debugging.page.scss'],
|
||||
})
|
||||
export class ChatMessageDebuggingPage implements OnInit {
|
||||
|
||||
roomId: string
|
||||
|
||||
constructor(
|
||||
// public ChatSystemService: ChatSystemService,
|
||||
private navParams: NavParams
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.roomId = this.navParams.get('roomId')
|
||||
|
||||
|
||||
}
|
||||
|
||||
loadHistory() {
|
||||
// this.ChatSystemService.getDmRoom(this.roomId).loadHistory({});
|
||||
}
|
||||
|
||||
}
|
||||
+1
-11
@@ -85,11 +85,8 @@ export class GroupContactsPage implements OnInit {
|
||||
async loadUsers() {
|
||||
|
||||
const getallChatUsers = await this.contactsRepositoryService.getUsers()
|
||||
const getRoomById = await this.chatServiceService.getRoomById(this.roomId)
|
||||
|
||||
console.log({getallChatUsers, getRoomById})
|
||||
|
||||
if(getallChatUsers.isOk() && getRoomById.isOk()) {
|
||||
if(getallChatUsers.isOk()) {
|
||||
|
||||
this.allChatUsers = getallChatUsers.value.data.result.sort((a,b) => {
|
||||
if(a.wxFullName < b.wxFullName) {
|
||||
@@ -133,15 +130,8 @@ export class GroupContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (getRoomById.isErr() && getRoomById.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getRoomById.error)
|
||||
} else if (getallChatUsers.isErr() && getallChatUsers.error instanceof HttpResponse) {
|
||||
this.httpErrorHandle.httpStatusHandle(getallChatUsers.error)
|
||||
} else if (getRoomById.isErr() ) {
|
||||
console.log(getRoomById.error)
|
||||
} else if (getallChatUsers.isErr() ) {
|
||||
console.log(getallChatUsers.error)
|
||||
} else {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GroupMessagesPage
|
||||
},
|
||||
{
|
||||
path: 'group-contacts',
|
||||
loadChildren: () => import('./group-contacts/group-contacts.module').then( m => m.GroupContactsPageModule)
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
@@ -1,36 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupMessagesPageRoutingModule } from './group-messages-routing.module';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { ChatPopoverPageModule } from '../chat-popover/chat-popover.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
FontAwesomeModule,
|
||||
IonicModule,
|
||||
GroupMessagesPageRoutingModule,
|
||||
ChatPopoverPageModule,
|
||||
BtnModalDismissPageModule,
|
||||
LettersAvatarModule,
|
||||
PipesModule,
|
||||
/* ImageCropperModule,
|
||||
AngularCropperjsModule */
|
||||
|
||||
],
|
||||
declarations: [GroupMessagesPage]
|
||||
})
|
||||
export class GroupMessagesPageModule {}
|
||||
@@ -1,441 +0,0 @@
|
||||
@import '~src/function.scss';
|
||||
|
||||
.header-toolbar {
|
||||
--background: transparent;
|
||||
--opacity: 1;
|
||||
|
||||
.main-header {
|
||||
width: 100%;
|
||||
/* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color: #000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.header-top {
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
|
||||
.left {
|
||||
width: fit-content;
|
||||
float: left;
|
||||
//font-size: rem(35);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.middle-container {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
height: auto;
|
||||
width: calc(100% - 47px);
|
||||
float: left;
|
||||
|
||||
/* white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important; */
|
||||
|
||||
.middle {
|
||||
width: 100%;
|
||||
padding: 0 !important;
|
||||
margin: 0 0 0 10px;
|
||||
font-size: rem(25);
|
||||
}
|
||||
}
|
||||
|
||||
.middle-container-options {
|
||||
padding: 0 !important;
|
||||
float: left;
|
||||
width: calc(100% - 67px);
|
||||
text-align: right;
|
||||
|
||||
.middle-container-options-icons {
|
||||
color: #0782c9;
|
||||
font-size: rem(23);
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
padding: 0 !important;
|
||||
float: right;
|
||||
font-size: rem(25);
|
||||
color: #0782c9;
|
||||
}
|
||||
|
||||
.header-top-btn {
|
||||
background: transparent;
|
||||
font-size: rem(25) !important;
|
||||
font-weight: 100 !important;
|
||||
/* color: #0782c9; */
|
||||
color: #42b9fe;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.header-bottom {
|
||||
padding-left: 10px;
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
|
||||
.header-bottom-icon {
|
||||
width: rem(30);
|
||||
font-size: rem(25);
|
||||
float: left;
|
||||
padding: 2px;
|
||||
|
||||
}
|
||||
|
||||
.header-bottom-contacts {
|
||||
width: calc(100% - 40px);
|
||||
font-size: rem(15);
|
||||
color: #797979;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
margin: 1px;
|
||||
|
||||
.contacts-list {
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.div-icon {
|
||||
width: rem(40);
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.div-icon ion-icon {
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ion-content {
|
||||
.welcome-text {
|
||||
/* width: 322px; */
|
||||
width: em(422px);
|
||||
background: #ebebeb;
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #797979;
|
||||
padding: 10px;
|
||||
margin: 0 auto !important;
|
||||
line-height: 1.2rem;
|
||||
// margin: 20px 39px 25px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
height: auto;
|
||||
background: var(--chat-alert-msg-color);
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.info-text-leave {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: fit-content;
|
||||
padding: 10px;
|
||||
background: #e0e9ee;
|
||||
border-radius: 8px;
|
||||
margin: 10px auto;
|
||||
color: #797979 !important;
|
||||
font-size: rem(13) !important;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
|
||||
.info-text-leave ion-label {
|
||||
font-size: rem(13) !important;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.messages {
|
||||
font-size: rem(13);
|
||||
font-family: Roboto;
|
||||
overflow: auto;
|
||||
|
||||
//set scroll do bottom
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
word-wrap: break-word;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
.messages-list-item-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.messages-list-item-wrapper-active {
|
||||
background: #e6f6ff75 !important;
|
||||
}
|
||||
|
||||
.message-container {
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
.incoming-true,
|
||||
.incoming-false {
|
||||
width: 305px;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.incoming-true {
|
||||
margin: 10px 35px 10px 20px;
|
||||
background: #ebebeb;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
.incoming-false {
|
||||
margin: 10px 20px 10px 35px;
|
||||
background: var(--chat-incoming-msg-color);
|
||||
float: right;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: var(--title-text-color);
|
||||
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
|
||||
.time {
|
||||
color: #797979;
|
||||
text-align: right;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.online {
|
||||
color: #99e47b !important;
|
||||
}
|
||||
|
||||
.offline {
|
||||
color: #cbced1 !important;
|
||||
}
|
||||
|
||||
.away {
|
||||
color: #ffd21f !important;
|
||||
}
|
||||
|
||||
.invisible {
|
||||
color: #cbced1 !important;
|
||||
}
|
||||
|
||||
.busy {
|
||||
color: #f5455c !important;
|
||||
}
|
||||
}
|
||||
|
||||
.info-meeting {
|
||||
/* width: 322px; */
|
||||
width: em(422);
|
||||
background: var(--chat-alert-msg-color);
|
||||
text-align: center;
|
||||
font-size: rem(13);
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
|
||||
.info-meeting-small {
|
||||
font-size: rem(10);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.info-meeting-medium {
|
||||
font-size: rem(12);
|
||||
}
|
||||
|
||||
.info-meeting-normal {
|
||||
color: #0782c9;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.info-meeting-normal:hover {
|
||||
text-decoration: underline;
|
||||
color: #0782c9;
|
||||
}
|
||||
}
|
||||
|
||||
ion-footer {
|
||||
padding-top: 7.5px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.container {
|
||||
justify-content: center;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
|
||||
.message-box {
|
||||
margin: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.chat-icon-options {
|
||||
display: block !important;
|
||||
font-size: rem(35);
|
||||
float: right !important;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.chat-icon-send {
|
||||
font-size: rem(40);
|
||||
margin: 0 auto;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.type-message {
|
||||
display: flex;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 25px;
|
||||
padding-left: 15px;
|
||||
align-items: center;
|
||||
|
||||
overflow: auto;
|
||||
|
||||
ion-textarea {
|
||||
margin: 0 !important;
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.preview-slides {
|
||||
margin-top: 20%;
|
||||
background: #e6e6e6;
|
||||
|
||||
img {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.transparent-modal {
|
||||
.modal-wrapper {
|
||||
--background: rgba(44, 39, 45, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.image-slide,
|
||||
.image-card {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.image-card {
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
height: 200%;
|
||||
width: 100%;
|
||||
background: black;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
|
||||
.typing {
|
||||
position: relative;
|
||||
top: -25px;
|
||||
height: 0px;
|
||||
left: 0px;
|
||||
margin-left: 22px;
|
||||
display: flex;
|
||||
font-size: rem(12);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.typing ngx-letters-avatar {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
.float-status {
|
||||
position: relative !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
}
|
||||
|
||||
.float-status-image {
|
||||
position: relative !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
top: -15px;
|
||||
}
|
||||
|
||||
.float-status-webtrix {
|
||||
position: relative !important;
|
||||
top: 0px !important;
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: self-end;
|
||||
}
|
||||
|
||||
.float-status-all {
|
||||
font-size: rem(13) !important;
|
||||
}
|
||||
|
||||
.try {
|
||||
color: red;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.font-40-rem {
|
||||
font-size: 2.5rem !important;
|
||||
}
|
||||
|
||||
|
||||
.dateLabel {
|
||||
background: #ebebeb !important;
|
||||
float: unset !important;
|
||||
margin: 0px auto !important;
|
||||
width: 111px;
|
||||
text-align: center;
|
||||
margin-top: 10px !important;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
describe('GroupMessagesPage', () => {
|
||||
let component: GroupMessagesPage;
|
||||
let fixture: ComponentFixture<GroupMessagesPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupMessagesPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GroupMessagesPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -161,7 +161,7 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss({});
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
async select(user: UserContacts) {
|
||||
|
||||
@@ -44,9 +44,9 @@ import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { FileSystemMobileService } from 'src/app/infra/file-system/mobile/file-system-mobile.service';
|
||||
import { RoomViewModel } from '../../store/model/room';
|
||||
import { RoomStore } from '../../store/roomStore'
|
||||
import { GroupContactsPage, IGroupContactsPageOutPutSchema } from '../group-messages/group-contacts/group-contacts.page';
|
||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||
import { imageMimeTypes } from 'src/app/utils/allowedImageExtension';
|
||||
import { GroupContactsPage, IGroupContactsPageOutPutSchema } from '../group-contacts/group-contacts.page';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ContactsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ContactsPageRoutingModule {}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ContactsPageRoutingModule } from './contacts-routing.module';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
import { BtnSeguintePageModule } from 'src/app/shared/btn-seguinte/btn-seguinte.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
|
||||
ContactsPageRoutingModule,
|
||||
BtnSeguintePageModule,
|
||||
],
|
||||
declarations: [ContactsPage]
|
||||
})
|
||||
export class ContactsPageModule {}
|
||||
@@ -1,57 +0,0 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content width-100">
|
||||
<div class="back-icon">
|
||||
<button class="btn-no-color cursor-pointer" (click)="close()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Contactos</ion-label>
|
||||
</div>
|
||||
<app-btn-seguinte (click)="groupMessages()" class="cursor-pointer"></app-btn-seguinte>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar class="toolbar-search">
|
||||
<div class="search">
|
||||
<ion-searchbar search-icon="undefined" (ionChange)="onChange($event)" placeholder="Pesquisar por contacto" ></ion-searchbar>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-content">
|
||||
|
||||
<!-- <ion-list>
|
||||
<ion-item *ngFor="let user of searchedItem">
|
||||
{{user.name}}
|
||||
</ion-item>
|
||||
</ion-list> -->
|
||||
|
||||
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
</div>
|
||||
|
||||
<div *virtualItem="let user" class="item-checkbox">
|
||||
<ion-checkbox color="primary"></ion-checkbox>
|
||||
<p>{{user.first}} {{user.last}}</p>
|
||||
<ion-icon name="ellipse"></ion-icon>
|
||||
</div>
|
||||
|
||||
</ion-virtual-scroll>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
|
||||
@import '~src/function.scss';
|
||||
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.div-icon{
|
||||
width: rem(40);
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.back-icon{
|
||||
width: 37px;
|
||||
float: left;
|
||||
font-size: rem(35);
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
.div-title{
|
||||
width: 221px;
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
.title{
|
||||
font-size: rem(25);
|
||||
}
|
||||
}
|
||||
}
|
||||
.toolbar-search{
|
||||
--padding-top:0 !important;
|
||||
--padding-bottom:0 !important;
|
||||
--padding-start:0 !important;
|
||||
--padding-end:0 !important;
|
||||
|
||||
.search{
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 5px 20px 5px 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.search ion-searchbar{
|
||||
/* border: 1px solid green; */
|
||||
width: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
--border-radius: 5px;
|
||||
--box-shadow: none;
|
||||
overflow: auto;
|
||||
--icon-color:var(--title-text-color);
|
||||
}
|
||||
|
||||
}
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
.main-content{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 0 0 0 0;
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
font-size: rem(15);
|
||||
margin: 10px 0 10px 0;
|
||||
padding:5px 0 5px 20px;
|
||||
|
||||
}
|
||||
|
||||
.item-checkbox{
|
||||
display: flex;
|
||||
margin: 10px 20px 10px 20px !important;
|
||||
overflow: auto;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.item-checkbox ion-checkbox{
|
||||
--border-color: var(--title-text-color);
|
||||
--background-checked:var(--title-text-color);
|
||||
float: left;
|
||||
}
|
||||
|
||||
.item-checkbox p{
|
||||
display: block;
|
||||
margin: 0 !important;
|
||||
width: 330px;
|
||||
padding-left: 10px;
|
||||
font-size: rem(15);
|
||||
color: var(--title-text-color);
|
||||
float: left;
|
||||
}
|
||||
.item-checkbox ion-icon{
|
||||
font-size: rem(10);
|
||||
float: left;
|
||||
color:#99e47b;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ContactsPage } from './contacts.page';
|
||||
|
||||
describe('ContactsPage', () => {
|
||||
let component: ContactsPage;
|
||||
let fixture: ComponentFixture<ContactsPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ContactsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ContactsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,120 +0,0 @@
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { GroupMessagesPage } from '../../group-messages/group-messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-contacts',
|
||||
templateUrl: './contacts.page.html',
|
||||
styleUrls: ['./contacts.page.scss'],
|
||||
})
|
||||
export class ContactsPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
users = [];
|
||||
|
||||
contact: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
|
||||
|
||||
headers: HttpHeaders;
|
||||
options:any;
|
||||
|
||||
contacts = [
|
||||
{
|
||||
first: 'Ana',
|
||||
last: 'Manuel',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Abdullah',
|
||||
last: 'Hill',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Batur',
|
||||
last: 'Oymen',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Bianca',
|
||||
last: 'Costa',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Zaya',
|
||||
last: 'Mary',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Tiago',
|
||||
last: 'Kayaya',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
}
|
||||
];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public ThemeService: ThemeService
|
||||
)
|
||||
{ }
|
||||
|
||||
ngOnInit() {
|
||||
this.loadUsers();
|
||||
|
||||
}
|
||||
|
||||
loadUsers(){
|
||||
|
||||
this.users = this.contacts.sort((a,b) => {
|
||||
if(a.first < b.first){
|
||||
return -1;
|
||||
}
|
||||
if(a.first > b.first){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
separateLetter(record, recordIndex, records){
|
||||
|
||||
if(recordIndex == 0){
|
||||
return record.first[0];
|
||||
}
|
||||
|
||||
let first_prev = records[recordIndex - 1].first[0];
|
||||
let first_current = record.first[0];
|
||||
|
||||
if(first_prev != first_current){
|
||||
return first_current;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
doRefresh(event){
|
||||
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
onChange(event){
|
||||
|
||||
}
|
||||
clicked(){
|
||||
|
||||
|
||||
}
|
||||
async groupMessages(){
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
componentProps: {},
|
||||
cssClass: 'contacts',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
modal.onDidDismiss();
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,10 +7,6 @@ const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: NewGroupPage
|
||||
},
|
||||
{
|
||||
path: 'contacts',
|
||||
loadChildren: () => import('./contacts/contacts.module').then( m => m.ContactsPageModule)
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
|
||||
import { GroupContactsPage, IGroupContactsPageOutPutSchema } from '../group-messages/group-contacts/group-contacts.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -10,6 +9,7 @@ import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.serv
|
||||
import { UDate } from 'src/app/utils/date';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { z } from 'zod';
|
||||
import { GroupContactsPage, IGroupContactsPageOutPutSchema } from '../group-contacts/group-contacts.page';
|
||||
|
||||
|
||||
const NewGroupModalOutPutSchema = z.object({
|
||||
@@ -25,7 +25,8 @@ export type INewGroupModalOutPut = z.infer<typeof NewGroupModalOutPutSchema>
|
||||
export class NewGroupPage implements OnInit {
|
||||
isGroupCreated: boolean;
|
||||
showLoader: boolean;
|
||||
displayDuration: any;
|
||||
expirationDate: Date = null;
|
||||
displayDuration = ''
|
||||
showDuration: boolean;
|
||||
selectedDuration = ['', '', ''];
|
||||
thedate: any;
|
||||
@@ -70,7 +71,7 @@ export class NewGroupPage implements OnInit {
|
||||
roomName: this.groupName,
|
||||
createdBy: SessionStore.user.UserId,
|
||||
roomType: 0,
|
||||
expirationDate: this.displayDuration?.toISOString() ? UDate.GetDateWithTimeZone(this.displayDuration) : null,
|
||||
expirationDate: this.expirationDate?.toISOString() ? UDate.GetDateWithTimeZone(this.expirationDate) : null,
|
||||
members: []
|
||||
})
|
||||
|
||||
@@ -130,10 +131,10 @@ export class NewGroupPage implements OnInit {
|
||||
{
|
||||
text: 'Ok',
|
||||
cssClass: 'btn-cancel',
|
||||
handler: (value: any) => {
|
||||
handler:(value:any)=>{
|
||||
|
||||
let now = new Date();
|
||||
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
|
||||
this.expirationDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds())
|
||||
|
||||
this.selectedDuration = [
|
||||
value.days.value,
|
||||
@@ -141,41 +142,41 @@ export class NewGroupPage implements OnInit {
|
||||
value.minutes.value,
|
||||
]
|
||||
|
||||
if (value.days.value != null && value.hours.value != null && value.minutes.value != null) {
|
||||
if (value.days.value > 0) {
|
||||
if (value.days.value == 1) {
|
||||
if (value.hours.value == 1) {
|
||||
this.displayDuration = value.days.value + " day " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
|
||||
if(value.days.value > 0){
|
||||
if(value.days.value == 1){
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.days.value + " day " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else {
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
else{
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (value.hours.value == 1) {
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
else{
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else {
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
else{
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (value.hours.value == 1) {
|
||||
else{
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else {
|
||||
else{
|
||||
this.displayDuration = value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<ion-toolbar>
|
||||
<ion-title class="title" *ngIf="roomData$ | async as roomData"> {{ roomData.roomName }}</ion-title>
|
||||
</ion-toolbar>
|
||||
<div class="btn-close d-flex cursor-pointer pr-20" >
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon"
|
||||
<div class="btn-close d-flex cursor-pointer pr-20 align-center" >
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon font-30-em"
|
||||
src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon"
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-30-em"
|
||||
src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="icon"
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="icon font-30-em"
|
||||
src="assets/images/theme/{{ThemeService.currentTheme}}/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -178,7 +178,7 @@ export class RoomStore {
|
||||
listenToUpdateMessage() {
|
||||
this.messageUpdateSubject?.unsubscribe();
|
||||
|
||||
console.log('liste to update')
|
||||
// console.log('liste to update')
|
||||
this.messageUpdateSubject = this.chatServiceService.listenToUpdateMessage(this.room.id).subscribe((updateMessage) => {
|
||||
|
||||
const index = this.messages1[this.room.$id].findIndex(e => e?.id === updateMessage.id); // Use triple equals for comparison
|
||||
@@ -225,7 +225,12 @@ export class RoomStore {
|
||||
}
|
||||
}
|
||||
|
||||
this.sendReadMessage()
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
roomId: this.room.id
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -241,7 +246,7 @@ export class RoomStore {
|
||||
|
||||
removeBold() {
|
||||
if(!this.room?.local) {
|
||||
this.chatServiceService.removeBoldFromRoom({roomId: this.room.$id})
|
||||
this.chatServiceService.removeBoldFromRoom({roomId: this.room.id})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +284,7 @@ export class RoomStore {
|
||||
this.date = {}
|
||||
const allMessage = [];
|
||||
|
||||
console.time("mappingTime");
|
||||
//console.time("mappingTime");
|
||||
const sortMessages = messages.value.sort((a, b) => new Date(a.sentAt).getTime() - new Date(b.sentAt).getTime())
|
||||
|
||||
for(const message of sortMessages) {
|
||||
@@ -292,7 +297,7 @@ export class RoomStore {
|
||||
|
||||
allMessage.push(new MessageViewModal(message))
|
||||
}
|
||||
console.timeEnd("mappingTime");
|
||||
//console.timeEnd("mappingTime");
|
||||
this.messages1[this.room.$id]
|
||||
this.messages1[this.room.$id] = allMessage
|
||||
|
||||
@@ -351,7 +356,7 @@ export class RoomStore {
|
||||
roomId: this.room.id
|
||||
})
|
||||
} else {
|
||||
console.log('no need', message )
|
||||
// console.log('no need', message )
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,14 +422,14 @@ export class RoomStore {
|
||||
if(message.isOk() && this.room.local == IDBoolean.true) {
|
||||
this.room.local = IDBoolean.false;
|
||||
|
||||
// console.log('enter')
|
||||
// await this.chatServiceService.roomSetLocalToFalseById({
|
||||
// $roomId: this.room.$id,
|
||||
// roomId: message.value.roomId
|
||||
// })
|
||||
console.log('enter')
|
||||
await this.chatServiceService.roomSetLocalToFalseById({
|
||||
$roomId: this.room.$id,
|
||||
roomId: message.value.roomId
|
||||
})
|
||||
|
||||
this.room.id = message.value.roomId
|
||||
// this.subscribeToChanges()
|
||||
this.subscribeToChanges()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user