2024-08-08 11:44:41 +01:00
|
|
|
<ion-header class="ion-no-border" >
|
2020-12-30 11:13:50 +01:00
|
|
|
<ion-toolbar class="header-toolbar">
|
|
|
|
|
<div class="main-header">
|
|
|
|
|
<div class="header-top">
|
2021-03-12 11:56:54 +01:00
|
|
|
<div class="left">
|
2021-04-11 07:05:39 +01:00
|
|
|
<button class="btn-no-color" (click)="close()">
|
2021-09-30 10:41:40 +01:00
|
|
|
<!-- <ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon> -->
|
2021-11-16 16:00:14 +01:00
|
|
|
<fa-icon icon="chevron-left" class="header-top-btn font-awesome-1"></fa-icon>
|
2021-04-11 07:05:39 +01:00
|
|
|
</button>
|
2021-03-12 11:56:54 +01:00
|
|
|
</div>
|
2021-09-30 08:43:49 +01:00
|
|
|
<div class="middle-container" *ngIf="!showMessageOptions">
|
2024-08-08 11:44:41 +01:00
|
|
|
<div class="middle" *ngIf="roomData$ | async as roomData">
|
|
|
|
|
<ion-label class="title">{{ roomData.roomName }}</ion-label>
|
|
|
|
|
<span *ngIf="roomStatus$ | async as roomStatus"><ion-icon *ngIf="roomStatus"
|
|
|
|
|
class="online" name="ellipse"></ion-icon></span>
|
2021-09-30 08:43:49 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-03-21 21:06:54 +01:00
|
|
|
|
2022-09-30 15:13:36 +01:00
|
|
|
<!-- <div (click)="ChatSystemService.getDmRoom(roomId).deleteAll()" >delete all</div> -->
|
2021-09-30 08:43:49 +01:00
|
|
|
<div class="middle-container-options" *ngIf="showMessageOptions">
|
2021-09-30 10:41:40 +01:00
|
|
|
<fa-icon (click)="deleteMessage(selectedMsgId)" icon="trash" class="middle-container-options-icons"></fa-icon>
|
2021-09-30 08:43:49 +01:00
|
|
|
<!-- <ion-icon name="trash"></ion-icon> -->
|
2020-12-30 11:13:50 +01:00
|
|
|
</div>
|
2021-08-20 15:08:36 +01:00
|
|
|
<div hidden class="right">
|
2021-04-11 07:05:39 +01:00
|
|
|
<button class="btn-no-color" (click)="openMessagesOptions()">
|
2023-11-14 12:04:31 +01:00
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
2022-03-21 13:33:57 +01:00
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
|
|
|
|
|
</ion-icon>
|
2021-04-11 07:05:39 +01:00
|
|
|
</button>
|
2021-07-23 14:43:51 +01:00
|
|
|
</div>
|
2020-12-30 11:13:50 +01:00
|
|
|
</div>
|
2021-04-07 15:59:27 +01:00
|
|
|
<div hidden class="header-bottom" (click)="addContacts()">
|
2020-12-30 11:13:50 +01:00
|
|
|
<div class="header-bottom-icon">
|
2022-03-21 13:33:57 +01:00
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/icon/icons-user.svg"></ion-icon>
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/icon/theme/gov/icons-user.svg"></ion-icon>
|
2020-12-30 11:13:50 +01:00
|
|
|
</div>
|
|
|
|
|
<div class="header-bottom-contacts">
|
|
|
|
|
<ion-label class="text-color-blue">Adicionar contacto</ion-label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</ion-toolbar>
|
|
|
|
|
</ion-header>
|
|
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<ion-content >
|
2022-07-04 16:45:44 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div class="messages height-100 width-100 d-flex flex-column" #scrollMe >
|
2023-09-28 11:12:39 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div
|
2024-08-14 15:29:16 +01:00
|
|
|
*ngFor="let message of messages1[roomId]" class="messages-list-item-wrapper"
|
2024-08-08 11:44:41 +01:00
|
|
|
[ngClass]="{'my-message': message.sender.wxUserId === sessionStore.user.UserId, 'other-message': message.sender.wxUserId !== sessionStore.user.UserId}"
|
|
|
|
|
>
|
|
|
|
|
<div class="message-container">
|
2022-04-13 21:54:31 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<div>
|
2024-08-13 10:52:35 +01:00
|
|
|
<div>
|
|
|
|
|
{{ message.message }}
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-08-16 11:26:31 +01:00
|
|
|
<div *ngFor="let attachment of message.attachments; let i = index">
|
|
|
|
|
<div *ngIf="attachment.source == MessageAttachmentFileSource.Webtrix">
|
2024-08-13 10:52:35 +01:00
|
|
|
|
|
|
|
|
<ion-icon src="assets/icon/webtrix.svg" class="file-icon font-25"></ion-icon>
|
2024-08-16 11:26:31 +01:00
|
|
|
<ion-label>{{ attachment.fileName}}</ion-label>
|
2024-08-13 10:52:35 +01:00
|
|
|
<!-- <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>
|
|
|
|
|
|
2024-08-16 11:26:31 +01:00
|
|
|
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Image">
|
|
|
|
|
<img src="{{attachment.safeFile}}">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="attachment.fileType == MessageAttachmentFileType.Audio">
|
|
|
|
|
<audio [src]="attachment.safeFile|safehtml" preload="metadata" class="flex-grow-1" controls controlsList="nodownload noplaybackrate"></audio>
|
|
|
|
|
</div>
|
2024-08-15 10:40:39 +01:00
|
|
|
|
2024-08-16 11:26:31 +01:00
|
|
|
<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>
|
2024-08-15 10:40:39 +01:00
|
|
|
</div>
|
|
|
|
|
|
2024-08-13 10:52:35 +01:00
|
|
|
</div>
|
2022-03-29 17:14:25 +01:00
|
|
|
|
2024-08-16 11:26:31 +01:00
|
|
|
</div>
|
|
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<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">
|
2024-08-13 10:52:35 +01:00
|
|
|
<button (click)="messageDelete(message)" class="menuButton">Apagar mensagem</button>
|
2024-08-08 11:44:41 +01:00
|
|
|
<button (click)="editMessage(message)" class="menuButton">Editar mensagem</button>
|
|
|
|
|
<button (click)="toggleEmojiPicker(message)" class="menuButton">Reagir mensagem</button>
|
|
|
|
|
</mat-menu>
|
2023-10-19 15:03:12 +01:00
|
|
|
</div>
|
2024-08-08 11:44:41 +01:00
|
|
|
|
2022-01-06 20:52:50 +01:00
|
|
|
</div>
|
2024-08-08 11:44:41 +01:00
|
|
|
|
2022-02-25 15:10:10 +01:00
|
|
|
</div>
|
2024-08-08 11:44:41 +01:00
|
|
|
<div style="text-align: end;">
|
2022-01-06 20:52:50 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div *ngIf="message.messageStatus != 'send'" style="font-size: .6875rem;">A enviar</div>
|
|
|
|
|
<div *ngIf="message.messageStatus == 'send'" style="font-size: .6875rem;">Enviado</div>
|
2023-09-11 21:57:14 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
</div>
|
2023-09-11 21:57:14 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<!-- 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>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- current emoji -->
|
|
|
|
|
<div>
|
|
|
|
|
<span *ngFor="let reaction of message.reactions" class="emoji-icon">
|
|
|
|
|
{{ reaction.reaction }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!--
|
|
|
|
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
|
|
|
|
<ion-fab-button *ngIf="scrollToBottomBtn" color="light" size="small">
|
|
|
|
|
<ion-icon name="chevron-down"></ion-icon>
|
|
|
|
|
</ion-fab-button>
|
|
|
|
|
</ion-fab> -->
|
2023-06-29 16:04:44 +01:00
|
|
|
|
2022-04-08 16:48:52 +01:00
|
|
|
|
2023-09-11 21:57:14 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<ion-fab horizontal="start" vertical="bottom" slot="fixed">
|
2022-03-29 17:14:25 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div #array>
|
2023-09-11 21:57:14 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
</div>
|
|
|
|
|
</ion-fab>
|
2023-09-11 21:57:14 +01:00
|
|
|
|
2022-01-06 20:52:50 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<!-- <div *ngIf="userTyping$?.typingList?.typingList">
|
2022-01-27 16:12:51 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div
|
|
|
|
|
*ngFor="let message of userTyping$.typingList.typingList " class="messages-list-item-wrapper"
|
|
|
|
|
>
|
|
|
|
|
{{ message.userName }}
|
2022-07-04 16:45:44 +01:00
|
|
|
</div>
|
2024-08-08 11:44:41 +01:00
|
|
|
</div>
|
|
|
|
|
-->
|
|
|
|
|
<!-- <div *ngIf="userTyping$" class="header-bottom-contacts" >
|
2022-07-04 16:45:44 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<div *ngFor="let typing of userTyping$; let i = index">
|
|
|
|
|
{{ typing.userName }}<div *ngIf="i < userTyping$.length - 1">, </div>
|
|
|
|
|
</div>
|
2020-12-30 11:13:50 +01:00
|
|
|
</div>
|
2024-08-08 11:44:41 +01:00
|
|
|
-->
|
|
|
|
|
|
2024-08-13 10:52:35 +01:00
|
|
|
</div>
|
2020-12-30 11:13:50 +01:00
|
|
|
</ion-content>
|
2021-03-29 16:01:58 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<ion-footer>
|
2022-02-24 15:32:23 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
<!-- <div class="typing" *ngIf="ChatSystemService.getDmRoom(roomId).otherUserType == true">
|
2022-09-30 15:13:36 +01:00
|
|
|
<ngx-letters-avatar [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30" [circular]="true"
|
2022-03-21 13:33:57 +01:00
|
|
|
fontFamily="Roboto"></ngx-letters-avatar>
|
2022-02-25 09:54:37 +01:00
|
|
|
está a escrever ...
|
2024-08-08 11:44:41 +01:00
|
|
|
</div> -->
|
2022-03-14 08:09:33 +01:00
|
|
|
<div class="width-100 pl-20 pr-20">
|
2022-03-04 18:46:56 +01:00
|
|
|
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
2022-03-21 13:33:57 +01:00
|
|
|
<audio [src]="audioRecorded" class="d-flex width-100 mt-10 mb-10" *ngIf="lastAudioRecorded" controls
|
|
|
|
|
controlsList="nodownload noplaybackrate"></audio>
|
2022-03-04 18:46:56 +01:00
|
|
|
</div>
|
2022-02-24 15:32:23 +01:00
|
|
|
|
2021-03-29 16:01:58 +01:00
|
|
|
<div class="container width-100 d-flex">
|
|
|
|
|
<div>
|
2022-03-04 18:46:56 +01:00
|
|
|
<button *ngIf="!recording && !lastAudioRecorded && allowTyping" class="btn-no-color" (click)="openChatOptions()">
|
2022-03-21 13:33:57 +01:00
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-options"
|
|
|
|
|
src="assets/images/icons-add.svg"></ion-icon>
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-options"
|
|
|
|
|
src="assets/images/theme/gov/icons-add.svg"></ion-icon>
|
2021-04-09 08:59:22 +01:00
|
|
|
</button>
|
2022-03-18 11:45:38 +01:00
|
|
|
<button *ngIf="recording || lastAudioRecorded || !allowTyping" class="btn-no-color" (click)="deleteRecording()">
|
2022-03-14 14:23:29 +01:00
|
|
|
<fa-icon class="icon-size-27" icon="trash"></fa-icon>
|
2022-03-04 14:51:08 +01:00
|
|
|
</button>
|
2021-03-29 16:01:58 +01:00
|
|
|
</div>
|
2022-03-14 14:23:29 +01:00
|
|
|
<div class="width-70 message-container">
|
2022-03-04 18:46:56 +01:00
|
|
|
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
2022-03-21 13:33:57 +01:00
|
|
|
<ion-textarea *ngIf="allowTyping" autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true"
|
|
|
|
|
placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1"
|
2024-08-08 11:44:41 +01:00
|
|
|
[(ngModel)]="textField"
|
|
|
|
|
(ionChange)="sendTyping()"></ion-textarea>
|
2022-03-04 18:46:56 +01:00
|
|
|
</div>
|
2022-03-14 14:23:29 +01:00
|
|
|
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
|
|
|
|
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
2022-03-21 13:33:57 +01:00
|
|
|
<ion-icon class="icon-size-45" name="stop-circle-outline" color="danger"></ion-icon>
|
2021-04-13 14:14:55 +01:00
|
|
|
</button>
|
2022-03-09 09:12:50 +01:00
|
|
|
</div>
|
2021-03-29 16:01:58 +01:00
|
|
|
</div>
|
|
|
|
|
<div>
|
2024-08-13 10:52:35 +01:00
|
|
|
<button #recordbtn *ngIf="textField == '' && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
2021-04-12 00:22:47 +01:00
|
|
|
</button>
|
2024-08-13 10:52:35 +01:00
|
|
|
<button *ngIf="textField != ''" class="btn-no-color" (click)="sendMessage()">
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
2021-04-12 00:22:47 +01:00
|
|
|
</button>
|
2024-08-13 10:52:35 +01:00
|
|
|
<button *ngIf="textField == '' && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
|
|
|
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
2021-04-09 08:59:22 +01:00
|
|
|
</button>
|
2021-03-29 16:01:58 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-11-19 10:28:22 +01:00
|
|
|
|
2024-08-08 11:44:41 +01:00
|
|
|
</ion-footer>
|