mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add repository patter for chat
This commit is contained in:
@@ -31,160 +31,21 @@
|
||||
</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>
|
||||
<h3>Current Count Object: {{ count$ | async | json }}</h3>
|
||||
|
||||
<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 *ngFor="let item of (count$ | async)?.chatRooms | keyvalue">
|
||||
<p>{{ item.key }}: {{ item.value | json }}</p>
|
||||
</div>
|
||||
<!-- <p>Current Count: {{ (count$ | async)?.count }}</p> -->
|
||||
<!-- <p>Current Count Details: {{ (count$ | async)?.details }}</p> -->
|
||||
|
||||
<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">
|
||||
|
||||
<div>Current Count: {{ count$ | async }}</div>
|
||||
|
||||
|
||||
<app-empty-chat [texto]="emptyTextDescription"
|
||||
class="height-100 flex-column"
|
||||
[style.display]="showEmptyComponent && !showContacts && !showNewGroup && !showEditGroup && !showGroupContacts && !showGroupMessages && !showNewEvent ? 'flex' : 'none'"
|
||||
|
||||
Reference in New Issue
Block a user