mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix message statud bag
This commit is contained in:
@@ -7,9 +7,7 @@ export class RoomService {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private RoomSocketRepositoryService: RoomSocketRepositoryService
|
private RoomSocketRepositoryService: RoomSocketRepositoryService
|
||||||
) {
|
) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.OnReceiveCreateRoom()
|
this.OnReceiveCreateRoom()
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class MessageToAsyncUIService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ import { RoomLocalRepository } from '../../data/repository/room/room-local-repos
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { Logger } from 'src/app/services/logger/main/service';
|
import { Logger } from 'src/app/services/logger/main/service';
|
||||||
import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -54,15 +55,17 @@ export class SyncAllRoomMessagesService {
|
|||||||
|
|
||||||
this.messageLocalDataSourceService.findOrUpdate(clone)
|
this.messageLocalDataSourceService.findOrUpdate(clone)
|
||||||
|
|
||||||
const me = message.info.find(e => e.memberId == SessionStore.user.UserId)
|
const me = message.info.find(e => e.memberId == SessionStore.user.UserId && typeof e.deliverAt == 'string' )
|
||||||
|
|
||||||
if(!me) {
|
if(!me) {
|
||||||
this.MessageSocketRepositoryService.sendDeliverAt({
|
this.MessageSocketRepositoryService.sendDeliverAt({
|
||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
roomId: message.roomId,
|
roomId: message.roomId,
|
||||||
requestId: "string"
|
requestId: uuidv4()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
tracing.addEvent('send delever roomId'+ room.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,14 +73,17 @@ export class SyncAllRoomMessagesService {
|
|||||||
let clone: MessageTable = message
|
let clone: MessageTable = message
|
||||||
clone.roomId = room.id
|
clone.roomId = room.id
|
||||||
|
|
||||||
const me = message.info.find(e => e.memberId == SessionStore.user.UserId)
|
const me = message.info.find(e => e.memberId == SessionStore.user.UserId && typeof e.deliverAt == 'string' )
|
||||||
if(!me) {
|
if(!me) {
|
||||||
this.MessageSocketRepositoryService.sendDeliverAt({
|
this.MessageSocketRepositoryService.sendDeliverAt({
|
||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
roomId: message.roomId,
|
roomId: message.roomId,
|
||||||
requestId: "string"
|
requestId: uuidv4()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
tracing.addEvent('send delever roomId'+ room.id)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ export class SignalRConnection {
|
|||||||
|
|
||||||
for(const method of methods) {
|
for(const method of methods) {
|
||||||
this.hubConnection.on(method, (message: any) => {
|
this.hubConnection.on(method, (message: any) => {
|
||||||
console.log({message})
|
|
||||||
this.messageSubject.next(message);
|
this.messageSubject.next(message);
|
||||||
this.sendDataSubject.next({
|
this.sendDataSubject.next({
|
||||||
method: method,
|
method: method,
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ const routes: Routes = [
|
|||||||
path: 'view-onces',
|
path: 'view-onces',
|
||||||
loadChildren: () => import('./modal/view-onces/view-onces.module').then( m => m.ViewOncesPageModule)
|
loadChildren: () => import('./modal/view-onces/view-onces.module').then( m => m.ViewOncesPageModule)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'room-info',
|
||||||
|
loadChildren: () => import('./modal/room-info/room-info.module').then( m => m.RoomInfoPageModule)
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|||||||
@@ -41,122 +41,122 @@
|
|||||||
|
|
||||||
<ion-content >
|
<ion-content >
|
||||||
|
|
||||||
<div class="messages height-100 width-100 d-flex flex-column" #scrollMe >
|
<div class="messages height-100 width-100 d-flex flex-column rotate-div" #scrollMe >
|
||||||
|
|
||||||
<div
|
<div
|
||||||
*ngFor="let message of messages1[roomId]; let messageIndex = index" class="messages-list-item-wrapper"
|
*ngFor="let message of messages1[roomId]; let messageIndex = index" class="messages-list-item-wrapper"
|
||||||
[ngClass]="{'my-message': message.sender.wxUserId === SessionStore.user.UserId, 'other-message': message.sender.wxUserId !== SessionStore.user.UserId}"
|
[ngClass]="{'my-message': message.sender.wxUserId === SessionStore.user.UserId, 'other-message': message.sender.wxUserId !== SessionStore.user.UserId}"
|
||||||
>
|
>
|
||||||
<div class="message-container">
|
<div class="message-container rotate-div">
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div>
|
|
||||||
<div>
|
<div>
|
||||||
{{ message.message }}
|
<div>
|
||||||
</div>
|
{{ message.message }}
|
||||||
|
|
||||||
<div *ngFor="let attachment of message.attachments; let i = index">
|
|
||||||
<div *ngIf="attachment.source == MessageAttachmentFileSource.Webtrix">
|
|
||||||
|
|
||||||
<ion-icon src="assets/icon/webtrix.svg" class="file-icon font-25"></ion-icon>
|
|
||||||
<ion-label>{{ attachment.fileName}}</ion-label>
|
|
||||||
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'default' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
|
||||||
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Image">
|
<div *ngFor="let attachment of message.attachments; let i = index">
|
||||||
|
<div *ngIf="attachment.source == MessageAttachmentFileSource.Webtrix">
|
||||||
|
|
||||||
<img
|
<ion-icon src="assets/icon/webtrix.svg" class="file-icon font-25"></ion-icon>
|
||||||
*ngIf="message.oneShot != true"
|
<ion-label>{{ attachment.fileName}}</ion-label>
|
||||||
[src]="attachment.safeFile"
|
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'default' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
(load)="onImageLoad(message, messageIndex)"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && attachment.type != 'webtrix' && !( msg.downloadLoader == true || msg.uploadingFile == true ) " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
(error)="onImageError()"
|
<ion-icon *ngIf="( msg.downloadLoader == true || msg.uploadingFile == true )" class="icon-download" src="assets/gif/theme/{{ThemeService.currentTheme}}/Blocks-loader.svg" slot="end"></ion-icon> -->
|
||||||
>
|
|
||||||
|
|
||||||
<div *ngIf="SessionStore.user.UserId == message.sender.wxUserId && message.oneShot == true">
|
|
||||||
Mandou uma mensagen com visualização única
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Image">
|
||||||
|
|
||||||
<div *ngIf="SessionStore.user.UserId != message.sender.wxUserId && message.oneShot == true">
|
<img
|
||||||
<!-- <div *ngIf="message.oneShot == true" class="cursor-pointer"> -->
|
*ngIf="message.oneShot != true"
|
||||||
<div (click)="viewOnce($event, message, i)">
|
[src]="attachment.safeFile"
|
||||||
Abrir a visualização única
|
(load)="onImageLoad(message, messageIndex)"
|
||||||
|
(error)="onImageError()"
|
||||||
|
>
|
||||||
|
|
||||||
|
<div *ngIf="SessionStore.user.UserId == message.sender.wxUserId && message.oneShot == true">
|
||||||
|
Mandou uma mensagen com visualização única
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div *ngIf="SessionStore.user.UserId != message.sender.wxUserId && message.oneShot == true">
|
||||||
|
<!-- <div *ngIf="message.oneShot == true" class="cursor-pointer"> -->
|
||||||
|
<div (click)="viewOnce($event, message, i)">
|
||||||
|
Abrir a visualização única
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Audio">
|
||||||
|
<audio [src]="attachment.safeFile|safehtml" preload="metadata" class="flex-grow-1" controls controlsList="nodownload noplaybackrate"></audio>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Doc">
|
||||||
|
<fa-icon *ngIf="attachment.mimeType == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
|
<fa-icon *ngIf="attachment.mimeType == 'application/word'" icon="file-word" class="word-icon">
|
||||||
|
</fa-icon>
|
||||||
|
<fa-icon *ngIf="attachment.mimeType == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<fa-icon
|
||||||
|
*ngIf="attachment.mimeType == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'"
|
||||||
|
icon="file-word" class="excel-icon"></fa-icon>
|
||||||
|
<ion-icon *ngIf="attachment.mimeType == 'application/webtrix'" src="assets/icon/webtrix.svg">
|
||||||
|
</ion-icon>
|
||||||
|
<ion-icon *ngIf="attachment.mimeType == 'application/meeting'" src="assets/icon/webtrix.svg">
|
||||||
|
</ion-icon>
|
||||||
|
|
||||||
|
<ion-label>{{ attachment.fileName}}</ion-label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Audio">
|
</div>
|
||||||
<audio [src]="attachment.safeFile|safehtml" preload="metadata" class="flex-grow-1" controls controlsList="nodownload noplaybackrate"></audio>
|
|
||||||
|
<div>
|
||||||
|
<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>
|
||||||
|
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
||||||
|
<button (click)="messageDelete(message)" class="menuButton">Apagar mensagem</button>
|
||||||
|
<button *ngIf="!message.hasAttachment" (click)="editMessage(message)" class="menuButton">Editar mensagem</button>
|
||||||
|
<button (click)="toggleEmojiPicker(message)" class="menuButton">Reagir mensagem</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Doc">
|
</div>
|
||||||
<fa-icon *ngIf="attachment.mimeType == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
|
||||||
<fa-icon *ngIf="attachment.mimeType == 'application/word'" icon="file-word" class="word-icon">
|
</div>
|
||||||
</fa-icon>
|
<div style="text-align: end;">
|
||||||
<fa-icon *ngIf="attachment.mimeType == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'" icon="file-word" class="word-icon"></fa-icon>
|
|
||||||
<fa-icon
|
<!-- <div *ngIf="messageStatus(message) == 'enviar'" style="font-size: .6875rem;">A enviar</div>
|
||||||
*ngIf="attachment.mimeType == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'"
|
<div *ngIf="messageStatus(message) == 'enviado'" style="font-size: .6875rem;">Enviado</div>
|
||||||
icon="file-word" class="excel-icon"></fa-icon>
|
<div *ngIf="messageStatus(message) == 'allReceived'" style="font-size: .6875rem;">allReceived</div>
|
||||||
<ion-icon *ngIf="attachment.mimeType == 'application/webtrix'" src="assets/icon/webtrix.svg">
|
<div *ngIf="messageStatus(message) == 'allViewed'" style="font-size: .6875rem;">allViewed</div>
|
||||||
</ion-icon>
|
-->
|
||||||
<ion-icon *ngIf="attachment.mimeType == 'application/meeting'" src="assets/icon/webtrix.svg">
|
|
||||||
</ion-icon>
|
<div *ngIf="totalMembers != 0">
|
||||||
|
<ion-icon *ngIf="messageStatus(message) == 'enviar'" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="messageStatus(message) == 'enviado'" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="messageStatus(message) == 'allReceived'" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="messageStatus(message) == 'allViewed'" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
|
||||||
<ion-label>{{ attachment.fileName}}</ion-label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<!-- Emoji Picker -->
|
||||||
<div class="message-item-options d-flex justify-content-end">
|
<div *ngIf="selectedMessage === message" class="emoji-picker" [ngStyle]="{'bottom': '0', 'right': '0'}">
|
||||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
<span *ngFor="let emoji of emojis" (click)="addReaction(message, emoji)" class="emoji-icon">
|
||||||
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
{{ emoji }}
|
||||||
<button (click)="messageDelete(message)" class="menuButton">Apagar mensagem</button>
|
</span>
|
||||||
<button *ngIf="!message.hasAttachment" (click)="editMessage(message)" class="menuButton">Editar mensagem</button>
|
|
||||||
<button (click)="toggleEmojiPicker(message)" class="menuButton">Reagir mensagem</button>
|
|
||||||
</mat-menu>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: end;">
|
<!-- current emoji -->
|
||||||
|
<div class="rotate-div">
|
||||||
<!-- <div *ngIf="messageStatus(message) == 'enviar'" style="font-size: .6875rem;">A enviar</div>
|
<span *ngFor="let reaction of message.reactions" class="emoji-icon">
|
||||||
<div *ngIf="messageStatus(message) == 'enviado'" style="font-size: .6875rem;">Enviado</div>
|
{{ reaction.reaction }}
|
||||||
<div *ngIf="messageStatus(message) == 'allReceived'" style="font-size: .6875rem;">allReceived</div>
|
|
||||||
<div *ngIf="messageStatus(message) == 'allViewed'" style="font-size: .6875rem;">allViewed</div>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div *ngIf="totalMembers != 0">
|
|
||||||
<ion-icon *ngIf="messageStatus(message) == 'enviar'" src="assets/images/clock-regular.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="messageStatus(message) == 'enviado'" src="assets/images/check-solid.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="messageStatus(message) == 'allReceived'" src="assets/images/check-double-solid.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="messageStatus(message) == 'allViewed'" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Emoji Picker -->
|
|
||||||
<div *ngIf="selectedMessage === message" class="emoji-picker" [ngStyle]="{'bottom': '0', 'right': '0'}">
|
|
||||||
<span *ngFor="let emoji of emojis" (click)="addReaction(message, emoji)" class="emoji-icon">
|
|
||||||
{{ emoji }}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- current emoji -->
|
|
||||||
<div>
|
|
||||||
<span *ngFor="let reaction of message.reactions" class="emoji-icon">
|
|
||||||
{{ reaction.reaction }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -494,4 +494,13 @@ ion-footer {
|
|||||||
|
|
||||||
img {}
|
img {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// .rotate-div {
|
||||||
|
// transform: rotate(180deg);
|
||||||
|
// -webkit-transform: rotate(180deg);
|
||||||
|
// -moz-transform: rotate(180deg);
|
||||||
|
// -ms-transform: rotate(180deg);
|
||||||
|
// -o-transform: rotate(180deg);
|
||||||
|
// }
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
roomType!: RoomType
|
roomType!: RoomType
|
||||||
RoomTypeEnum = RoomType
|
RoomTypeEnum = RoomType
|
||||||
|
|
||||||
@Input() roomId: string;
|
@Input() roomId: string;
|
||||||
@Input() showMessages: string;
|
@Input() showMessages: string;
|
||||||
|
|
||||||
@@ -147,6 +147,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
@ViewChild('imageModal') imageModal: TemplateRef<any>;
|
@ViewChild('imageModal') imageModal: TemplateRef<any>;
|
||||||
totalMembers = 0
|
totalMembers = 0
|
||||||
|
members: MemberTable[] = []
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
@@ -200,6 +201,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.roomMembers$ = this.MemberListLocalRepository.getRoomMemberByIdLive(this.roomId).pipe(
|
this.roomMembers$ = this.MemberListLocalRepository.getRoomMemberByIdLive(this.roomId).pipe(
|
||||||
tap((members) => {
|
tap((members) => {
|
||||||
this.totalMembers = members.length
|
this.totalMembers = members.length
|
||||||
|
this.members = members
|
||||||
for(const member of members) {
|
for(const member of members) {
|
||||||
if(member.wxUserId == SessionStore.user.UserId) {
|
if(member.wxUserId == SessionStore.user.UserId) {
|
||||||
this.isAdmin = member.isAdmin
|
this.isAdmin = member.isAdmin
|
||||||
@@ -210,7 +212,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
this.roomStatus$ = this.MemberListLocalRepository.allMemberOnline(this.roomId)
|
this.roomStatus$ = this.MemberListLocalRepository.allMemberOnline(this.roomId)
|
||||||
this.chatServiceService.getRoomById(this.roomId)
|
this.chatServiceService.getRoomById(this.roomId)
|
||||||
|
|
||||||
this.messageTypingSubject?.unsubscribe()
|
this.messageTypingSubject?.unsubscribe()
|
||||||
this.messageTypingSubject = this.userTypingLocalRepository.getUserTypingLiveByRoomId(this.roomId).subscribe((e) => {
|
this.messageTypingSubject = this.userTypingLocalRepository.getUserTypingLiveByRoomId(this.roomId).subscribe((e) => {
|
||||||
const arrayNames = e.filter((b)=> b.userId != SessionStore.user.UserId).map(e => e.userName)
|
const arrayNames = e.filter((b)=> b.userId != SessionStore.user.UserId).map(e => e.userName)
|
||||||
@@ -218,14 +220,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
const uniqueArray = [...new Set(arrayNames)];
|
const uniqueArray = [...new Set(arrayNames)];
|
||||||
|
|
||||||
console.log({uniqueArray})
|
|
||||||
|
|
||||||
if(uniqueArray.length >= 1) {
|
if(uniqueArray.length >= 1) {
|
||||||
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = uniqueArray + '...'
|
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = uniqueArray + '...'
|
||||||
} else {
|
} else {
|
||||||
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = ''
|
(this.myInputRef.nativeElement as HTMLDivElement).innerHTML = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
}) as any
|
}) as any
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
allViewed(message: MessageEntity) {
|
allViewed(message: MessageEntity) {
|
||||||
return message.info.filter(e => typeof e.readAt == 'string').length == this.totalMembers
|
const totalMembers = this.members.filter((e) => message.sender.wxUserId != e.wxUserId ).length
|
||||||
|
return message.info.filter(e => typeof e.readAt == 'string' && message.sender.wxUserId != e.memberId ).length == totalMembers
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMessages() {
|
async getMessages() {
|
||||||
@@ -258,9 +259,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.messages1[this.roomId] = []
|
this.messages1[this.roomId] = []
|
||||||
this.messages1[this.roomId] = messages
|
this.messages1[this.roomId] = messages
|
||||||
|
|
||||||
if(messages.length >= 1) {
|
// if(messages.length >= 1) {
|
||||||
this.messages1[this.roomId].push(LastMessage)
|
// this.messages1[this.roomId].push(LastMessage)
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.loadAttachment()
|
this.loadAttachment()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -1001,7 +1002,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
await alert.present();
|
await alert.present();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
<br *ngIf="showLoader">
|
<br *ngIf="showLoader">
|
||||||
|
<button (click)="details()" class="btn-cancel" shape="round">Detalhes</button>
|
||||||
<button *ngIf="isAdmin" (click)="addUser()" class="btn-cancel" shape="round">Adicionar</button>
|
<button *ngIf="isAdmin" (click)="addUser()" class="btn-cancel" shape="round">Adicionar</button>
|
||||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round">Sair do Grupo</button>
|
<button (click)="leaveGroup()" class="btn-cancel" shape="round">Sair do Grupo</button>
|
||||||
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" style="min-width: 192px;">Alterar
|
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" style="min-width: 192px;">Alterar
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { ZodError } from 'zod';
|
|||||||
import { isHttpResponse } from 'src/app/services/http.service';
|
import { isHttpResponse } from 'src/app/services/http.service';
|
||||||
|
|
||||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
||||||
|
import { RoomInfoPage } from '../room-info/room-info.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-chat-popover',
|
selector: 'app-chat-popover',
|
||||||
@@ -112,7 +113,7 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
//Delete
|
//Delete
|
||||||
async deleteGroup() {
|
async deleteGroup() {
|
||||||
this.showLoader = true
|
this.showLoader = true
|
||||||
|
|
||||||
const result = await this.ChatServiceService.deleteRoomById(this.roomId)
|
const result = await this.ChatServiceService.deleteRoomById(this.roomId)
|
||||||
|
|
||||||
|
|
||||||
@@ -144,4 +145,23 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
this.close('addUser');
|
this.close('addUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async details() {
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: RoomInfoPage,
|
||||||
|
cssClass: 'modal-aside',
|
||||||
|
backdropDismiss: true,
|
||||||
|
componentProps: {
|
||||||
|
roomId: this.roomId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((res)=>{
|
||||||
|
if(res.data == 'success') {
|
||||||
|
this.leaveGroup();
|
||||||
|
//this.ChatSystemService.hidingRoom(this.roomId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { RoomInfoPage } from './room-info.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: RoomInfoPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class RoomInfoPageRoutingModule {}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { RoomInfoPageRoutingModule } from './room-info-routing.module';
|
||||||
|
|
||||||
|
import { RoomInfoPage } from './room-info.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
RoomInfoPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [RoomInfoPage]
|
||||||
|
})
|
||||||
|
export class RoomInfoPageModule {}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title class="title" *ngIf="roomData$ | async as roomData"> Nome do grupo {{ roomData.roomName }}</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content class="px-20">
|
||||||
|
|
||||||
|
<div> Membros: </div>
|
||||||
|
|
||||||
|
<ion-list class="header-bottom-contacts" *ngIf="roomMembers$ | async as memberList">
|
||||||
|
<div *ngFor="let user of memberList; let i = index">
|
||||||
|
<div class="py-10">
|
||||||
|
{{ user.wxFullName }} <span *ngIf="user.isAdmin">(admin do group)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-list>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { RoomInfoPage } from './room-info.page';
|
||||||
|
|
||||||
|
describe('RoomInfoPage', () => {
|
||||||
|
let component: RoomInfoPage;
|
||||||
|
let fixture: ComponentFixture<RoomInfoPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ RoomInfoPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(RoomInfoPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { MemberTable } from 'src/app/module/chat/infra/database/dexie/schema/members';
|
||||||
|
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member-list-local-repository.service'
|
||||||
|
import { Observable as DexieObservable } from 'Dexie';
|
||||||
|
import { RoomTable } from 'src/app/module/chat/infra/database/dexie/schema/room';
|
||||||
|
import { RoomLocalRepository } from 'src/app/module/chat/data/repository/room/room-local-repository.service'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-room-info',
|
||||||
|
templateUrl: './room-info.page.html',
|
||||||
|
styleUrls: ['./room-info.page.scss'],
|
||||||
|
})
|
||||||
|
export class RoomInfoPage implements OnInit {
|
||||||
|
|
||||||
|
roomId:string;
|
||||||
|
roomMembers$: Observable<MemberTable[] | undefined>
|
||||||
|
roomData$: DexieObservable<RoomTable | undefined>
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private navParams: NavParams,
|
||||||
|
private MemberListLocalRepository: MemberListLocalRepository,
|
||||||
|
private RoomLocalRepository: RoomLocalRepository,
|
||||||
|
) {
|
||||||
|
this.roomId = this.navParams.get('roomId');
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
// this.roomMessage$ = this.messageRepositoryService.getItemsLive(this.roomId)
|
||||||
|
this.roomMembers$ = this.MemberListLocalRepository.getRoomMemberByIdLive(this.roomId).pipe()
|
||||||
|
this.roomData$ = this.RoomLocalRepository.getRoomByIdLive(this.roomId)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -383,6 +383,22 @@ $app-theme: mat-light-theme(
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-aside::part(content), .modal-aside .modal-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
height: 90%;
|
||||||
|
max-width: 100%;
|
||||||
|
border-radius: 0 0 25px 25px;
|
||||||
|
-webkit-border-radius: 0 0 25px 25px;
|
||||||
|
-moz-border-radius: 0 0 25px 25px;
|
||||||
|
-ms-border-radius: 0 0 25px 25px;
|
||||||
|
-o-border-radius: 0 0 25px 25px;
|
||||||
|
max-width: 400px;
|
||||||
|
width: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.exp-options .popover-content {
|
.exp-options .popover-content {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user