diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html
index bb3d6cfb..4a301e5e 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html
@@ -77,7 +77,7 @@
{{ roomInfo.roomName }}
- {{ _roomUserInfos | ucapTranslate: 'name':',' }}
+ {{ getRoomNameByRoomUser(_roomUserInfos) }}
@@ -319,9 +319,7 @@
#messageContextMenuTrigger="matMenuTrigger"
[matMenuTriggerFor]="messageContextMenu"
>
-
+
- {{ _roomUserInfos | ucapTranslate: 'name':',' }}
+ {{ getRoomNameByRoomUser(_roomUserInfos) }}
@@ -94,6 +94,5 @@
matBadgeOverlap="true"
matBadgeColor="accent"
matBadgePosition="below after"
- >
-
+ >
diff --git a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
index ed2afc16..b14ec23f 100644
--- a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
+++ b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
@@ -4,7 +4,8 @@ import {
Input,
Output,
EventEmitter,
- ViewChildren
+ ViewChildren,
+ ChangeDetectorRef
} from '@angular/core';
import {
RoomInfo,
@@ -15,8 +16,9 @@ import {
import { NGXLogger } from 'ngx-logger';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
-import { FormsModule } from '@angular/forms';
-import { MatCheckbox } from '@angular/material';
+import { TranslatePipe } from 'projects/ucap-webmessenger-ui/src/lib/pipes/translate.pipe';
+import { TranslateService as uiTranslateService } from '@ucap-webmessenger/ui';
+import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'ucap-room-list-item',
@@ -50,7 +52,12 @@ export class ListItemComponent implements OnInit {
finalEventMessage: string;
RoomType = RoomType;
- constructor(private logger: NGXLogger) {}
+ constructor(
+ private logger: NGXLogger,
+ private uiTranslateService: uiTranslateService,
+ private translateService: TranslateService,
+ private changeDetectorRef: ChangeDetectorRef
+ ) {}
ngOnInit() {
if (this.roomInfo.isTimeRoom) {
@@ -96,6 +103,18 @@ export class ListItemComponent implements OnInit {
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
}
+ getRoomNameByRoomUser(roomUserInfos: (RoomUserInfo | UserInfoShort)[]) {
+ let roomName = new TranslatePipe(
+ this.uiTranslateService,
+ this.changeDetectorRef
+ ).transform(roomUserInfos, 'name', ',');
+
+ if (!roomName || roomName.trim().length === 0) {
+ roomName = this.translateService.instant('chat.noRoomUser');
+ }
+ return roomName;
+ }
+
// getChecked(value: boolean, roomInfo: RoomInfo) {
// if (value && !this.multiCheckable) {
// if (this.selected === roomInfo.roomSeq) {