Files
doneit-web/src/app/pages/chat/chat.page.html
T
Peter Maquiran 6fc91a9973 fix alignment
2024-03-11 16:34:50 +01:00

300 lines
19 KiB
HTML

<ion-content class="height-100 container-wrapper">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content d-flex height-100 border-t-radius viewport-font-size">
<!-- Aside left -->
<div class="aside-wrapper d-flex flex-column flex-grow-1">
<!-- <p class="text-center mt-0 aside-title px-20">Chat</p> -->
<ion-progress-bar type="indeterminate" *ngIf="ChatSystemService.loadingWholeList"></ion-progress-bar>
<div class="title-content">
<div class="div-title">
<ion-label class="title font-25-em">Chat</ion-label>
</div>
<div class="div-icon">
<!-- <button (click)="openChatDebuggingPageModal()" title="Nova Conversa Individual" class="btn-no-color font-12">
Dev
</button> -->
<button title="Nova Conversa Individual" class="btn-no-color" (click)="openContactsPage()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src="assets/images/theme/gov/icons-chat-new-conversation.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-new-conversation.svg"></ion-icon>
</button>
<button title="Novo Grupo" class="btn-no-color" (click)="openNewGroupPage()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src="assets/images/theme/gov/icons-chat-new-group.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-new-group.svg" ></ion-icon>
</button>
</div>
</div>
<ion-toolbar [class.block-button]="showNewEvent || showNewGroup || showContacts">
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
<ion-segment-button value="Contactos" class="font-14-em">
Conversas
</ion-segment-button>
<ion-segment-button value="Grupos" class="font-14-em">
Grupos
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<div class=" aside overflow-y-auto d-flex flex-wrap flex-grow-1">
<div class="width-100" [ngSwitch]="segment">
<ion-list *ngSwitchCase="'Contactos'">
<ion-item-sliding>
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
*ngFor="let room of ChatSystemService._dm"
[class.item-active]="room.id == idSelected">
<div class="item-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && room.id != idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && room.id == idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-chat-40-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' && room.id != idSelected " class="icon" slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' && room.id == idSelected " class="icon" slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-chat-40-hover.svg"></ion-icon>
</div>
<div [class.highlight]="room.id =='cjFv5XfreKz5j3fWW'"
(click)="openMessagesPage(room.id)"
class="item-content flex-grow-1 cursor-pointer"><!-- (click)="openMessages(dm)" -->
<div class="item-title-time">
<div class="item-title" [class.item-title-active]="room.id == idSelected">
<ion-label >
<span >
<div >
<div class="font-15-em" [class.bold-message]="room.messageUnread == true">
{{room.name}}
</div>
</div>
</span>
</ion-label>
</div>
<div class="item-date font-13-em" [class.item-date-active]="room.id == idSelected">{{room.duration}}</div>
</div>
<div *ngIf="room.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="room.id ==idSelected">
<div class="item-message font-13-em add-ellipsis white-space-nowrap" *ngIf="room.otherUserType == false"> {{room.lastMessage.msg}} </div>
<div class="font-13-em" *ngIf="room.otherUserType == true">está escrever ...</div>
<div class="item-files add-ellipsis" *ngIf="room.lastMessage.file">
<fa-icon *ngIf="room.lastMessage.file.type != 'application/meeting' && room.lastMessage.file.type != 'application/audio' && room.lastMessage.file.type != 'application/img'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="room.id == idSelected"></fa-icon>
<fa-icon *ngIf="room.lastMessage.file.type == 'application/audio'" icon="file-audio" class="file-icon" [class.set-active-item-font-to-white]="room.id == idSelected"></fa-icon>
<span *ngIf="room.lastMessage.file.type == 'application/audio'" class="item-files-title font-13-em"> audio </span>
<fa-icon *ngIf="room.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="room.id == idSelected"></fa-icon>
<span *ngIf="room.lastMessage.file.type != 'application/audio' && room.lastMessage.attachments" class="item-files-title font-13-em add-ellipsis"> {{ room.lastMessage.attachments[0].title }}</span>
<fa-icon *ngIf="room.lastMessage.file.type == 'application/img' " icon="image" class="file-icon" [class.set-active-item-font-to-white]="room.id == idSelected"></fa-icon>
</div>
<div class="item-files" *ngIf="room.attachments">
<div *ngIf="room.value.lastMessage.attachments[0].image_url">
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="room.id == idSelected"></fa-icon>
<span class="font-13-em"> Fotografia</span>
</div>
</div>
</div>
</div>
</div>
</ion-item-sliding>
<ion-item-sliding *ngIf="ChatSystemService.loadingWholeList == true && ChatSystemService._dm.length == 0">
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-chat-grey.svg"></ion-icon></div>
<div class="item-content flex-grow-1 cursor-pointer">
<div class="item-title-time">
<div class="item-title font-15-em"><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></div>
<div class="item-date"><ion-skeleton-text animated></ion-skeleton-text></div>
</div>
<div class="item-description d-flex align-items-center">
<fa-icon icon="file-alt" class="file-icon"></fa-icon>
<ion-skeleton-text animated style="width: 95%; margin-left:5%"></ion-skeleton-text>
</div>
</div>
</div>
</ion-item-sliding>
</ion-list>
<ion-list *ngSwitchCase="'Grupos'">
<ion-item-sliding >
<div *ngFor="let group of ChatSystemService._group"
[class.item-active]="group.id ==idSelected"
class="item item-hover d-flex">
<div class="item-icon">
<!-- <ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon> -->
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && group.id != idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-group-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && group.id == idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-group-chat-40-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' && group.id != idSelected " class="icon" slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-group-chat-40.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' && group.id == idSelected " class="icon" slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-chat-group-chat-40-hover.svg"></ion-icon>
</div>
<div (click)="openGroupMessagesPage(group.id)" class="item-content flex-grow-1 cursor-pointer">
<div class="item-title-time">
<div class="item-title add-ellipsis" [class.item-title-active]="group.id ==idSelected">
<p class="font-15-em add-ellipsis mb-0 white-space-nowrap" [class.bold-message]="group.messageUnread == true">{{group.name.split('-').join(' ')}}</p>
</div>
<div class="item-date font-13-em" [class.item-date-active]="group.id ==idSelected" *ngIf="group.lastMessage && !group.customFields.countDownDate">{{group.duration }}</div>
<div class="item-date font-13-em" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{group.countDownTime }}</div>
</div>
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.id ==idSelected">
<div class="item-message font-13-em add-ellipsis white-space-nowrap" *ngIf="group.otherUserType == false">{{group.lastMessage.u.name}} <span *ngIf="group.lastMessage.u.name">:</span> {{group.lastMessage.msg}} </div>
<div class="font-13-em" *ngIf="group.otherUserType == true">{{group.userThatIsTyping}} está escrever ...</div>
<div class="item-files add-ellipsis" *ngIf="group.lastMessage.file">
<fa-icon *ngIf="group.lastMessage.file.type != 'application/meeting' && group.lastMessage.file.type != 'application/audio' && group.lastMessage.file.type != 'application/img'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
<fa-icon *ngIf="group.lastMessage.file.type == 'application/audio'" icon="file-audio" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
<span *ngIf="group.lastMessage.file.type == 'application/audio'" class="item-files-title font-13-em"> audio </span>
<fa-icon *ngIf="group.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
<span *ngIf="group.lastMessage.file.type != 'application/audio' && group.lastMessage.attachments" class="item-files-title font-13-em add-ellipsis"> {{ group.lastMessage.attachments[0].title }}</span>
<fa-icon *ngIf="group.lastMessage.file.type == 'application/img' " icon="image" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
</div>
<div class="item-files" *ngIf="group.attachments">
<div *ngIf="group.value.lastMessage.attachments[0].image_url">
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
<span class="font-13-em"> Fotografia</span>
</div>
</div>
</div>
</div>
</div>
</ion-item-sliding>
<ion-item-sliding *ngIf="ChatSystemService.loadingWholeList == true && ChatSystemService._group.length == 0">
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-group-chat-grey.svg"></ion-icon></div>
<div class="item-content flex-grow-1 cursor-pointer">
<div class="item-title-time">
<div class="item-title"><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></div>
<div class="item-date"><ion-skeleton-text animated></ion-skeleton-text></div>
</div>
<div class="item-description d-flex align-items-center">
<fa-icon icon="file-alt" class="file-icon"></fa-icon>
<ion-skeleton-text animated style="width: 95%; margin-left:5%"></ion-skeleton-text>
</div>
</div>
</div>
</ion-item-sliding>
</ion-list>
</div>
<!-- <button (click)="sendMsg()" style="height: 41px;">Send message</button> -->
</div>
</div>
<!-- Aside right -->
<div class="aside-content d-none flex-column height-100">
<app-empty-chat [texto]="emptyTextDescription"
class="height-100 flex-column"
[style.display]="showEmptyComponent && !showContacts && !showNewGroup && !showEditGroup && !showGroupContacts && !showGroupMessages && !showNewEvent ? 'flex' : 'none'"
#messagecontainer>
</app-empty-chat>
<app-messages class=" height-100 flex-column"
*ngIf="showMessages"
[style.display]="showMessages ? 'flex' : 'none'"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(showEmptyContainer)="showEmptyContainer()"
(showEmptyContainer)="showEmptyContainer()"
(openNewEventPage)="openNewEventPage($event)"
[style.display]="showMessages ? 'flex' : 'none'"
[roomId]="roomId"
[showMessages]="showMessages" #messagecontainer>
</app-messages>
<app-contacts
(openMessage)="openMessagesPage($event)"
(backToChat)="backToChat($event)"
(emptyTextDescriptionOpen)="emptyTextDescriptionOpen()"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
*ngIf="showContacts"
[roomId]="roomId"
[style.display]="showContacts ? 'flex' : 'none'"
class=" height-100 flex-column">
</app-contacts>
<!-- <app-contacts
(openMessage)="openMessagesPage($event)"
(backToChat)="backToChat($event)"
(emptyTextDescriptionOpen)="emptyTextDescriptionOpen()"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
*ngIf="showContacts"
[roomId]="roomId"
[style.display]="showContacts ? 'flex' : 'none'"
class=" height-100 flex-column">
</app-contacts> -->
<app-new-group
(addGroupMessage)="openGroupContactsPage($event)"
[roomId]="roomId"
(backToChat)="backToChat($event)"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
*ngIf="showNewGroup"
class=" height-100 flex-column d-flex">
</app-new-group>
<app-edit-group [roomId]="roomId"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(openGroupMessage)="openGroupMessagesPage($event)"
*ngIf="showEditGroup"
[style.display]="showEditGroup ? 'flex' : 'none'"
class="height-100 flex-column">
</app-edit-group>
<app-group-contacts
(openGroupMessage)="openGroupMessagesPage($event)"
*ngIf="showGroupContacts"
[style.display]="showGroupContacts ? 'flex' : 'none'"
[roomId]="groupRoomId" class=" height-100 flex-column"
(backToChat)="backToChat($event)"
>
</app-group-contacts>
<app-group-messages
*ngIf="showGroupMessages && ChatSystemService.deleteRecently(roomId) == false"
[style.display]="showEmptyComponent ? 'flex' : 'none'"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(showEmptyContainer)="showEmptyContainer()"
(openGroupContacts)="openGroupContactsPage($event)"
(openEditGroupPage)="openEditGroupPage($event)"
(openNewEventPage)="openNewEventPage($event)"
(getGroups)="getGroups($event)"
[style.display]="showGroupMessages ? 'flex' : 'none'"
class=" height-100 flex-column"
[roomId]="roomId" #messagecontainer>
</app-group-messages>
<app-new-event
*ngIf="showNewEvent"
[profile]=""
[roomId]="groupRoomId"
[selectedSegment]=segment
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[selectedDate]="eventSelectedDate"
[eventAttendees]="contacts"
(onAddEvent)="closeNewEventComponentAndOpenChat($event)"
(openAttendeesComponent)="openAttendeesComponent($event)"
(backToChat)="backToChat($event)"
[style.display]="showNewEvent ? 'flex' : 'none'"
class=" height-100 flex-column">
</app-new-event>
<app-attendee-modal
[adding]="adding"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
(closeComponent)="openNewEventPage()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(setContact)="setContact($event)"
[style.display]="showAttendees ? 'flex' : 'none'"
[footer]="true"
class=" height-100 flex-column">
</app-attendee-modal>
</div>
</div>
</ion-content>