From 9a1733effa1ed838b25b2a4e6750aa0b316e730f Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Mon, 29 Apr 2024 14:36:33 +0200 Subject: [PATCH] feat(OpenConversationsList): expose description Signed-off-by: DorraJaouad --- lib/Service/RoomFormatter.php | 1 + .../ConversationsList/Conversation.vue | 2 +- .../ConversationSearchResult.vue | 9 +++------ .../ConversationsSearchListVirtual.vue | 7 ++----- .../OpenConversationsList.vue | 5 +++++ src/composables/useConversationInfo.js | 16 +++++++++------- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lib/Service/RoomFormatter.php b/lib/Service/RoomFormatter.php index c850bc54e663..54630f9e0a42 100644 --- a/lib/Service/RoomFormatter.php +++ b/lib/Service/RoomFormatter.php @@ -162,6 +162,7 @@ public function formatRoomV4( return array_merge($roomData, [ 'name' => $room->getName(), 'displayName' => $room->getDisplayName($isListingBreakoutRooms || $isSIPBridgeRequest || $this->userId === null ? '' : $this->userId, $isListingBreakoutRooms || $isSIPBridgeRequest), + 'description' => $room->getListable() !== Room::LISTABLE_NONE ? $room->getDescription() : '', 'objectType' => $room->getObjectType(), 'objectId' => $room->getObjectId(), 'readOnly' => $room->getReadOnly(), diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.vue b/src/components/LeftSidebar/ConversationsList/Conversation.vue index 06a9159a7849..e935fb3e010c 100644 --- a/src/components/LeftSidebar/ConversationsList/Conversation.vue +++ b/src/components/LeftSidebar/ConversationsList/Conversation.vue @@ -182,7 +182,7 @@ export default { setup(props) { const { item, isSearchResult } = toRefs(props) - const { counterType, conversationInformation } = useConversationInfo({ item, isSearchResult }) + const { counterType, conversationInformation } = useConversationInfo({ item, isSearchResult, exposeMessages: true, exposeDescription: true }) return { counterType, diff --git a/src/components/LeftSidebar/ConversationsList/ConversationSearchResult.vue b/src/components/LeftSidebar/ConversationsList/ConversationSearchResult.vue index 2e47ed7f0d9e..25877bdc2194 100644 --- a/src/components/LeftSidebar/ConversationsList/ConversationSearchResult.vue +++ b/src/components/LeftSidebar/ConversationsList/ConversationSearchResult.vue @@ -39,10 +39,6 @@ export default { }, props: { - exposeMessages: { - type: Boolean, - default: false, - }, item: { type: Object, default() { @@ -66,9 +62,10 @@ export default { emits: ['click'], setup(props) { - const { item, exposeMessages } = toRefs(props) + const { item } = toRefs(props) const selectedRoom = inject('selectedRoom', null) - const { counterType, conversationInformation } = useConversationInfo({ item, exposeMessages }) + const exposeDescription = inject('exposeDescription', false) + const { counterType, conversationInformation } = useConversationInfo({ item, exposeDescription }) return { selectedRoom, diff --git a/src/components/LeftSidebar/ConversationsList/ConversationsSearchListVirtual.vue b/src/components/LeftSidebar/ConversationsList/ConversationsSearchListVirtual.vue index 2db1931d80f3..191411516539 100644 --- a/src/components/LeftSidebar/ConversationsList/ConversationsSearchListVirtual.vue +++ b/src/components/LeftSidebar/ConversationsList/ConversationsSearchListVirtual.vue @@ -10,7 +10,7 @@ :item-size="CONVERSATION_ITEM_SIZE" key-field="token">