Files
doneit-web/src/app/pages/chat/chat.page.html
T

262 lines
15 KiB
HTML
Raw Normal View History

2021-03-04 18:50:26 +01:00
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
2020-09-10 09:48:37 +01:00
<ion-content class="height-100 container-wrapper">
2021-08-19 18:54:50 +01:00
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
2022-01-12 12:04:28 +01:00
<ion-progress-bar type="indeterminate" *ngIf="wsChatService.loadingWholeList"></ion-progress-bar>
2021-01-27 16:01:49 +01:00
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
2021-11-16 16:00:14 +01:00
<div class="main-content d-flex height-100 border-t-radius">
2021-03-05 11:58:59 +01:00
<!-- Aside left -->
2021-07-30 13:49:31 +01:00
<div class="aside-wrapper d-flex flex-column flex-grow-1">
2021-03-05 16:43:07 +01:00
<!-- <p class="text-center mt-0 aside-title px-20">Chat</p> -->
<div class="title-content">
<div class="div-title">
<ion-label class="title">Chat</ion-label>
</div>
<div class="div-icon">
2021-04-09 08:59:22 +01:00
<button class="btn-no-color" (click)="openContactsPage()">
2021-11-16 16:00:14 +01:00
<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>
2021-04-09 08:59:22 +01:00
</button>
<button class="btn-no-color" (click)="openNewGroupPage()">
2021-11-16 16:00:14 +01:00
<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>
2021-04-09 08:59:22 +01:00
</button>
2021-08-19 18:54:50 +01:00
<button *ngIf="hideRefreshBtn" class="btn-no-color" (click)="refreshing()">
2021-11-16 16:00:14 +01:00
<ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
2021-04-09 09:31:01 +01:00
</button>
2021-03-05 16:43:07 +01:00
</div>
</div>
<ion-toolbar>
2021-03-04 15:24:47 +01:00
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
<ion-segment-button value="Contactos">
Conversas
</ion-segment-button>
<ion-segment-button value="Grupos">
Grupos
</ion-segment-button>
</ion-segment>
</ion-toolbar>
2021-07-26 22:51:13 +01:00
<div class=" aside overflow-y-auto d-flex flex-wrap flex-grow-1">
2021-03-05 11:58:59 +01:00
<div class="width-100" [ngSwitch]="segment">
2021-03-04 15:24:47 +01:00
<ion-list *ngSwitchCase="'Contactos'">
2022-01-11 13:03:43 +01:00
<ion-item-sliding>
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
2022-01-12 11:52:05 +01:00
*ngFor="let room of wsChatService.individual | keyvalue"
2022-01-11 13:03:43 +01:00
[class.item-active]="room.value.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.value.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.value.id == idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-chat-40-hover.svg"></ion-icon>
</div>
<div [class.highlight]="room.value.id =='cjFv5XfreKz5j3fWW'"
(click)="openMessagesPage(room.value.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.value.id == idSelected">
<ion-label >
<span >
<div >
<div >
{{room.value.name}}
2021-08-19 18:54:50 +01:00
</div>
2022-01-11 13:03:43 +01:00
</div>
</span>
</ion-label>
2021-03-04 15:24:47 +01:00
</div>
2022-01-11 20:56:21 +01:00
<div class="item-date" [class.item-date-active]="room.value.id == idSelected">{{room.value.duration}}</div>
2022-01-11 13:03:43 +01:00
</div>
<div *ngIf="room.value.lastMessage" class="item-description" [class.item-description-active]="room.value.id == idSelected">
<ion-label *ngIf="room.value.lastMessage">{{room.value.lastMessage.msg}}</ion-label>
<ion-label *ngIf="room.value.lastMessage.file">
<fa-icon *ngIf="room.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
<fa-icon *ngIf="room.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
<span> {{room.value.lastMessage.file.name || room.value.lastMessage.file.subject }}</span>
</ion-label>
<ion-label *ngIf="room.value.lastMessage.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.value.id == idSelected"></fa-icon>
<span> Fotografia</span>
</div>
</ion-label>
2021-03-04 15:24:47 +01:00
</div>
2021-07-27 00:01:38 +01:00
</div>
2022-01-11 13:03:43 +01:00
</div>
</ion-item-sliding>
2022-01-12 11:52:05 +01:00
<ion-item-sliding *ngIf=" wsChatService.individualCount < 1">
2022-01-11 13:03:43 +01:00
<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"><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>
2021-12-17 16:54:18 +01:00
</div>
</div>
2022-01-11 13:03:43 +01:00
</div>
</ion-item-sliding>
2021-03-04 15:24:47 +01:00
</ion-list>
2021-09-07 15:19:56 +01:00
<ion-list *ngSwitchCase="'Grupos'">
2021-12-17 16:54:18 +01:00
<ion-item-sliding *ngIf="!showLoader">
2021-07-27 00:01:38 +01:00
<div *ngFor="let group of allGroups"
[class.item-active]="group._id ==idSelected"
2021-09-01 09:38:05 +01:00
class="item item-hover d-flex">
2021-03-04 15:24:47 +01:00
<div class="item-icon">
2021-11-16 16:00:14 +01:00
<!-- <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>
2021-03-04 15:24:47 +01:00
</div>
2021-07-27 00:01:38 +01:00
<div
2021-11-16 16:00:14 +01:00
(click)="openGroupMessagesPage(group._id)" class="item-content flex-grow-1 cursor-pointer">
2021-03-04 15:24:47 +01:00
<div class="item-title-time">
2021-07-27 00:01:38 +01:00
<div class="item-title" [class.item-title-active]="group._id ==idSelected">
2021-03-04 15:24:47 +01:00
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
</div>
2021-11-16 16:00:14 +01:00
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage && !group.customFields.countDownDate">{{showDateDuration(group._updatedAt)}}</div>
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.customFields.countDownDate">{{countDownDate(group.customFields.countDownDate, group._id)}}</div>
2021-03-04 15:24:47 +01:00
</div>
2021-10-08 15:37:24 +01:00
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected">
2021-09-27 12:09:33 +01:00
<div class="item-message">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
2021-12-27 16:04:05 +01:00
<div class="item-files add-ellipsis" *ngIf="group.lastMessage.file">
<fa-icon *ngIf="group.lastMessage.file.type != 'application/meeting'" 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/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
<span class="item-files-title"> {{group.lastMessage.file.name || group.lastMessage.file.subject}}</span>
2021-09-27 12:09:33 +01:00
</div>
<div class="item-files" *ngIf="group.lastMessage.attachments">
<div *ngIf="group.lastMessage.attachments[0].image_url">
2021-09-27 12:23:00 +01:00
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
2021-09-27 12:09:33 +01:00
<span> Fotografia</span>
</div>
</div>
2021-03-04 15:24:47 +01:00
</div>
</div>
2021-07-22 17:11:41 +01:00
</div>
2021-03-04 15:24:47 +01:00
</ion-item-sliding>
2021-12-17 16:54:18 +01:00
<ion-item-sliding *ngIf="showLoader || allGroups.length < 1">
<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>
2021-03-04 15:24:47 +01:00
</ion-list>
</div>
2021-12-17 16:54:18 +01:00
2021-07-22 17:11:41 +01:00
<!-- <button (click)="sendMsg()" style="height: 41px;">Send message</button> -->
2021-03-04 15:24:47 +01:00
</div>
</div>
2021-03-05 11:58:59 +01:00
<!-- Aside right -->
2021-03-11 16:21:09 +01:00
<div class="aside-content d-none flex-column height-100">
2021-07-22 17:11:41 +01:00
<app-empty-chat [texto]="emptyTextDescription"
class="height-100 flex-column"
2021-07-16 21:17:34 +01:00
[style.display]="showEmptyComponent ? 'flex' : 'none'"
#messagecontainer>
2021-04-16 11:25:10 +01:00
</app-empty-chat>
2021-07-22 17:11:41 +01:00
<app-messages class=" height-100 flex-column"
2021-07-26 12:12:59 +01:00
*ngIf="showMessages"
[style.display]="showMessages ? 'flex' : 'none'"
2021-07-26 13:01:13 +01:00
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(showEmptyContainer)="showEmptyContainer()"
2021-08-20 11:58:28 +01:00
(showEmptyContainer)="showEmptyContainer()"
(openNewEventPage)="openNewEventPage($event)"
2021-08-30 18:56:37 +01:00
(getDirectMessages)="getDirectMessages($event)"
2021-07-26 13:01:13 +01:00
[style.display]="showMessages ? 'flex' : 'none'"
2021-07-26 19:31:19 +01:00
[roomId]="roomId"
[showMessages]="showMessages" #messagecontainer>
2021-07-26 22:51:13 +01:00
2021-04-16 11:25:10 +01:00
</app-messages>
2021-08-18 16:40:58 +01:00
2021-07-22 17:11:41 +01:00
<app-contacts
(openMessage)="openMessagesPage($event)"
2021-07-26 12:12:59 +01:00
*ngIf="showContacts"
2021-07-16 21:17:34 +01:00
[style.display]="showContacts ? 'flex' : 'none'"
class=" height-100 flex-column">
2021-04-16 11:25:10 +01:00
</app-contacts>
2021-08-18 16:40:58 +01:00
2021-07-22 17:11:41 +01:00
<app-new-group
(addGroupMessage)="openGroupContactsPage($event)"
2021-07-16 21:17:34 +01:00
[style.display]="showNewGroup ? 'flex' : 'none'"
class=" height-100 flex-column">
2021-04-16 11:25:10 +01:00
</app-new-group>
2021-08-18 16:40:58 +01:00
2021-04-16 11:25:10 +01:00
<app-edit-group [roomId]="roomId"
(closeAllDesktopComponents)="closeAllDesktopComponents()"
2021-07-16 21:17:34 +01:00
(openGroupMessage)="openGroupMessagesPage($event)"
2021-07-26 12:12:59 +01:00
*ngIf="showEditGroup"
2021-07-16 21:17:34 +01:00
[style.display]="showEditGroup ? 'flex' : 'none'"
class="height-100 flex-column">
2021-04-16 11:25:10 +01:00
</app-edit-group>
2021-08-18 16:40:58 +01:00
2021-07-22 17:11:41 +01:00
<app-group-contacts
(openGroupMessage)="openGroupMessagesPage($event)"
2021-07-26 12:12:59 +01:00
*ngIf="showGroupContacts"
2021-07-16 21:17:34 +01:00
[style.display]="showGroupContacts ? 'flex' : 'none'"
2021-07-22 17:11:41 +01:00
[roomId]="groupRoomId" class=" height-100 flex-column"
2021-07-16 21:17:34 +01:00
>
2021-04-16 11:25:10 +01:00
</app-group-contacts>
2021-08-18 16:40:58 +01:00
2021-04-15 23:57:14 +01:00
<app-group-messages
2021-07-26 12:12:59 +01:00
*ngIf="showGroupMessages"
2021-07-16 21:17:34 +01:00
[style.display]="showEmptyComponent ? 'flex' : 'none'"
2021-04-15 23:57:14 +01:00
(closeAllDesktopComponents)="closeAllDesktopComponents()"
(showEmptyContainer)="showEmptyContainer()"
2021-04-16 11:25:10 +01:00
(openGroupContacts)="openGroupContactsPage($event)"
(openEditGroupPage)="openEditGroupPage($event)"
2021-08-18 16:40:58 +01:00
(openNewEventPage)="openNewEventPage($event)"
2021-08-30 18:56:37 +01:00
(getGroups)="getGroups($event)"
2021-07-16 21:17:34 +01:00
[style.display]="showGroupMessages ? 'flex' : 'none'"
2021-07-22 17:11:41 +01:00
class=" height-100 flex-column"
2021-04-16 11:25:10 +01:00
[roomId]="roomId" #messagecontainer>
</app-group-messages>
2021-08-18 16:40:58 +01:00
<app-new-event
[profile]=""
[roomId]="groupRoomId"
2021-08-18 16:40:58 +01:00
[selectedSegment]=segment
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[selectedDate]="eventSelectedDate"
[eventAttendees]="contacts"
(onAddEvent)="closeNewEventComponent()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(cloneAllmobileComponent)="closeNewEventComponent()"
[style.display]="showNewEvent ? 'flex' : 'none'"
class=" height-100 flex-column">
</app-new-event>
<app-attendee-modal
[adding]="adding"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
(closeComponent)="closeAttendeesComponent()"
(setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)"
(setContact)="setContact($event)"
[style.display]="showAttendees ? 'flex' : 'none'"
[footer]="true"
class=" height-100 flex-column">
</app-attendee-modal>
2021-03-04 15:24:47 +01:00
</div>
</div>
2020-09-10 09:48:37 +01:00
</ion-content>