From c3b99c1e24f719905016fded43c67fc09e6fd116 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 23 Oct 2024 12:24:35 +0200 Subject: [PATCH 1/3] fix: drop redundant functions Signed-off-by: Maksim Sukharev --- .../BreakoutRooms/BreakoutRoomItem.vue | 11 ++-------- .../BreakoutRooms/BreakoutRoomsActions.vue | 20 ++++++------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomItem.vue b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomItem.vue index 5fa269f2b73..b701d2bc515 100644 --- a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomItem.vue +++ b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomItem.vue @@ -37,7 +37,7 @@ {{ t('spreed', 'Dismiss request for assistance') }} - + @@ -48,7 +48,7 @@ + @close="isDialogOpened = false" />
    @@ -195,13 +195,6 @@ export default { methods: { t, - openSendMessageDialog() { - this.isDialogOpened = true - }, - - closeSendMessageDialog() { - this.isDialogOpened = false - }, dismissRequestAssistance() { this.breakoutRoomsStore.dismissRequestAssistance(this.roomToken) diff --git a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue index 31c28a43e87..84944f26d13 100644 --- a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue +++ b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue @@ -38,7 +38,7 @@ :aria-label="sendMessageLabel" type="secondary" :wide="true" - @click="openSendMessageDialog"> + @click="isSendMessageDialogOpened = true"> @@ -69,7 +69,7 @@ + @click="isSendMessageDialogOpened = true"> @@ -103,10 +103,10 @@ - + @close="isSendMessageDialogOpened = false" /> @@ -181,14 +181,14 @@ export default { setup() { const showParticipantsEditor = ref(false) - const sendMessageDialogOpened = ref(false) + const isSendMessageDialogOpened = ref(false) const dialogHeaderId = `breakout-rooms-actions-header-${useId()}` return { isInCall: useIsInCall(), breakoutRoomsStore: useBreakoutRoomsStore(), showParticipantsEditor, - sendMessageDialogOpened, + isSendMessageDialogOpened, dialogHeaderId, } }, @@ -257,14 +257,6 @@ export default { this.breakoutRoomsStore.stopBreakoutRooms(this.mainToken) }, - openSendMessageDialog() { - this.sendMessageDialogOpened = true - }, - - closeSendMessageDialog() { - this.sendMessageDialogOpened = false - }, - openParticipantsEditor() { this.showParticipantsEditor = true }, From 5e2b9b113714f71f73c0437ccc6c7526549c1ed8 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 23 Oct 2024 12:33:09 +0200 Subject: [PATCH 2/3] fix: delegate message posting from NewMessage to parent components - remove breakoutRooms logic from reused components Signed-off-by: Maksim Sukharev --- .../BreakoutRoomsEditor/SendMessageDialog.vue | 34 ++++--------- src/components/NewMessage/NewMessage.vue | 49 +++++++------------ .../NewMessage/NewMessageUploadEditor.vue | 37 +++++++++++--- .../BreakoutRooms/BreakoutRoomItem.vue | 19 ++++++- .../BreakoutRooms/BreakoutRoomsActions.vue | 9 ++++ 5 files changed, 84 insertions(+), 64 deletions(-) diff --git a/src/components/BreakoutRoomsEditor/SendMessageDialog.vue b/src/components/BreakoutRoomsEditor/SendMessageDialog.vue index bca61cbeee9..d71a2d514ff 100644 --- a/src/components/BreakoutRoomsEditor/SendMessageDialog.vue +++ b/src/components/BreakoutRoomsEditor/SendMessageDialog.vue @@ -15,15 +15,14 @@ class="send-message-dialog" :token="token" :container="modalContainerId" - :aria-label="t('spreed', 'Post message')" + :aria-label="dialogTitle" + dialog :broadcast="broadcast" - @sent="handleMessageSent" - @failure="handleMessageFailure" /> + @submit="handleSubmit" /> diff --git a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue index 84944f26d13..b829509d497 100644 --- a/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue +++ b/src/components/RightSidebar/BreakoutRooms/BreakoutRoomsActions.vue @@ -105,7 +105,9 @@ @@ -120,6 +122,7 @@ import Cog from 'vue-material-design-icons/Cog.vue' import Play from 'vue-material-design-icons/Play.vue' import Send from 'vue-material-design-icons/Send.vue' +import { showSuccess } from '@nextcloud/dialogs' import { t } from '@nextcloud/l10n' import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js' @@ -276,6 +279,12 @@ export default { token: this.mainToken, }) }, + + async broadcastMessage({ token, temporaryMessage, options }) { + await this.breakoutRoomsStore.broadcastMessageToBreakoutRooms({ token, message: temporaryMessage.message }) + showSuccess(t('spreed', 'The message was sent to all breakout rooms')) + this.isSendMessageDialogOpened = false + } }, } From 3dc111745d5814c8ffe035bcedbee49d3dae83de Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Thu, 21 Nov 2024 10:46:30 +0100 Subject: [PATCH 3/3] fix: disable some features in dialog mode Signed-off-by: Maksim Sukharev --- src/components/NewMessage/NewMessage.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index 80740d1761d..b127a3ce98d 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -34,11 +34,11 @@
    - - +