mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add delete button
This commit is contained in:
@@ -7,6 +7,36 @@ import { v4 as uuidv4 } from 'uuid'
|
|||||||
import { UserTypingDTO } from '../../data/dto/typing/typingInputDTO';
|
import { UserTypingDTO } from '../../data/dto/typing/typingInputDTO';
|
||||||
import { MessageOutPutDataDTO } from '../../data/dto/message/messageOutputDTO';
|
import { MessageOutPutDataDTO } from '../../data/dto/message/messageOutputDTO';
|
||||||
|
|
||||||
|
|
||||||
|
var msgObj = {
|
||||||
|
roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
|
||||||
|
senderId:312,
|
||||||
|
message:"message enviada",
|
||||||
|
messageType:312,
|
||||||
|
canEdit:true,
|
||||||
|
oneShot:false,
|
||||||
|
requestId:"testing"
|
||||||
|
};
|
||||||
|
// var deletObj = {
|
||||||
|
// roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
|
||||||
|
// senderId:312,
|
||||||
|
// messageId:"message enviada",
|
||||||
|
// requestId:"testing"
|
||||||
|
// };
|
||||||
|
// var reactObj = {
|
||||||
|
// roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
|
||||||
|
// memberId:2,
|
||||||
|
// messageId:"e7074c10-4f92-458c-adb2-774ec2d42992",
|
||||||
|
// reaction:"reacted",
|
||||||
|
// requestId:"testingReaction"
|
||||||
|
// };
|
||||||
|
const typingObj = {
|
||||||
|
roomId: "53bc6471-c28e-42d0-aa72-f4e52221f16f",
|
||||||
|
userId: 312,
|
||||||
|
userName:"usertyping",
|
||||||
|
requestId:"testing"
|
||||||
|
};
|
||||||
|
|
||||||
export class SignalRConnection {
|
export class SignalRConnection {
|
||||||
|
|
||||||
private hubConnection: signalR.HubConnection;
|
private hubConnection: signalR.HubConnection;
|
||||||
@@ -76,7 +106,7 @@ export class SignalRConnection {
|
|||||||
if(this.connectionStateSubject.value == true) {
|
if(this.connectionStateSubject.value == true) {
|
||||||
|
|
||||||
console.log('join=================')
|
console.log('join=================')
|
||||||
this.hubConnection.invoke("Join", SessionStore.user.UserId, SessionStore.user.FullName);
|
this.hubConnection.invoke("Join", 312, SessionStore.user.FullName);
|
||||||
//this.hubConnection.invoke("Join", 105, "UserFirefox");
|
//this.hubConnection.invoke("Join", 105, "UserFirefox");
|
||||||
} else {
|
} else {
|
||||||
this.sendLaterSubject.next({method: 'SendMessage', args:["Join", 312, "Daniel"]})
|
this.sendLaterSubject.next({method: 'SendMessage', args:["Join", 312, "Daniel"]})
|
||||||
@@ -89,7 +119,7 @@ export class SignalRConnection {
|
|||||||
|
|
||||||
if(this.connectionStateSubject.value == true) {
|
if(this.connectionStateSubject.value == true) {
|
||||||
console.log('sendMessage', data)
|
console.log('sendMessage', data)
|
||||||
this.hubConnection.invoke("SendMessage", data)
|
this.hubConnection.invoke("SendMessage", msgObj)
|
||||||
|
|
||||||
this.messageSubject.pipe(
|
this.messageSubject.pipe(
|
||||||
filter((message: any) => data.requestId == message?.requestId),
|
filter((message: any) => data.requestId == message?.requestId),
|
||||||
@@ -116,12 +146,7 @@ export class SignalRConnection {
|
|||||||
console.log('send typing', data)
|
console.log('send typing', data)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.hubConnection.invoke("Typing", {
|
this.hubConnection.invoke("Typing", typingObj)
|
||||||
userName: data.UserName,
|
|
||||||
roomId: data.roomId,
|
|
||||||
userId: data.userId +'',
|
|
||||||
requestId
|
|
||||||
} as any)
|
|
||||||
|
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,21 @@
|
|||||||
<div
|
<div
|
||||||
*ngFor="let message of roomMessage$ | async" class="messages-list-item-wrapper"
|
*ngFor="let message of roomMessage$ | async" 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}">
|
||||||
{{ message.message }} == {{ message.id }}
|
<div class="message-wrapper">
|
||||||
|
{{ message.message }} == {{ message.id }}
|
||||||
|
|
||||||
|
<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)="deleteMessage()" class="menuButton">Apagar mensagem</button>
|
||||||
|
</mat-menu>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
|
|||||||
@@ -512,12 +512,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
deleteMessage(msgId: string, msg: MessageService) {
|
|
||||||
// this.ChatSystemService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async openViewDocumentModal(file: any) {
|
async openViewDocumentModal(file: any) {
|
||||||
let task = {
|
let task = {
|
||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
@@ -921,6 +915,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
deleteMessage() {}
|
||||||
|
|
||||||
async addFileToChat(types: typeof FileType[]) {
|
async addFileToChat(types: typeof FileType[]) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user