change room name

This commit is contained in:
Peter Maquiran
2024-06-12 09:44:28 +01:00
parent 703c3aaed6
commit 751ebb7731
7 changed files with 108 additions and 62 deletions
+31 -24
View File
@@ -28,7 +28,7 @@
</div>
</div>
<ion-toolbar [class.block-button]="showNewEvent || showNewGroup || showContacts">
<!-- <ion-toolbar [class.block-button]="showNewEvent || showNewGroup || showContacts">
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
<ion-segment-button value="Contactos" class="font-14-em">
Conversas
@@ -37,36 +37,43 @@
Grupos
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</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 *ngFor="let room of ChatSystemService._dm"
[class.item-active]="room.id ==idSelected"
class="item item-hover d-flex">
<div class="item-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && room.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' && room.id == idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-group-chat-40-hover.svg"></ion-icon>
</div>
<div (click)="openMessagesPage(room.id)" class="item-content flex-grow-1 cursor-pointer">
<div class="item-title-time">
<div class="item-title add-ellipsis" [class.item-title-active]="room.id ==idSelected">
<p class="font-15-em add-ellipsis mb-0 white-space-nowrap" [class.bold-message]="room.messageUnread == true">{{room.name.split('-').join(' ')}}</p>
<ion-item-sliding>
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
*ngFor="let room of (items$ | async)"
[class.item-active]="room.id == idSelected">
<div class="item-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>
</div>
<div
(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]="true">
{{room.roomName}}
</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 class="item-date font-13-em" [class.item-date-active]="room.id ==idSelected" *ngIf="room.lastMessage && !room.customFields.countDownDate">{{room.duration }}</div>
<div class="item-date font-13-em" [class.item-date-active]="room.id ==idSelected" *ngIf="room.customFields.countDownDate">{{room.countDownTime }}</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.u.name}} <span *ngIf="room.lastMessage.u.name">:</span> {{room.lastMessage.msg}} </div>
<div class="font-13-em" *ngIf="room.otherUserType == true">{{room.userThatIsTyping}} está escrever ...</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> -->
</div>
</div>
</div>
</ion-item-sliding>
</ion-item-sliding>
</ion-list>
<ion-list *ngSwitchCase="'Grupos'">
<ion-item-sliding>
+2 -8
View File
@@ -24,12 +24,9 @@ import { environment } from 'src/environments/environment';
import { TimeService } from 'src/app/services/functions/time.service';
import { ThemeService } from 'src/app/services/theme.service'
import { DataService } from 'src/app/services/data.service';
import { SqliteService } from 'src/app/services/sqlite.service';
import { StorageService } from 'src/app/services/storage.service';
import { SessionStore } from 'src/app/store/session.service';
import { ChatDebuggingPage } from 'src/app/shared/popover/chat-debugging/chat-debugging.page';
import { EventTrigger } from 'src/app/services/eventTrigger.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
import { RouteService } from 'src/app/services/route.service';
import { Plugins } from '@capacitor/core';
import { Store } from '@ngrx/store';
@@ -39,8 +36,6 @@ import { RoomListOutPutDTO } from 'src/app/services/Repositorys/chat/dto/room/ro
import { Observable as DexieObservable } from 'Dexie';
const { App } = Plugins;
@Component({
selector: 'app-chat',
templateUrl: './chat.page.html',
@@ -56,7 +51,7 @@ export class ChatPage implements OnInit {
X_Auth_Token: any;
loggedUser: any;
segment: string;
segment: string = 'Grupos'
allGroups: any[];
privateGroups: any[];
publicGroups: any[];
@@ -149,7 +144,7 @@ export class ChatPage implements OnInit {
this.showLoader = true;
this.segment = 'Contactos'
this.segment = 'Grupos'
/* this.eventTriger.getObservable().subscribe((event) => {
if (event.notification == "recive") {
@@ -167,7 +162,6 @@ export class ChatPage implements OnInit {
this.items$ = this.RoomRepositoryService.getItemsLive()
this.RoomRepositoryService.list();
this.segment = "Contactos";
this.authService.userData$.subscribe((res: any) => {
this.loggedUser = res;