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 31c28a43e87..b829509d497 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,12 @@ - + @submit="broadcastMessage" + @close="isSendMessageDialogOpened = false" /> @@ -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' @@ -181,14 +184,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 +260,6 @@ export default { this.breakoutRoomsStore.stopBreakoutRooms(this.mainToken) }, - openSendMessageDialog() { - this.sendMessageDialogOpened = true - }, - - closeSendMessageDialog() { - this.sendMessageDialogOpened = false - }, - openParticipantsEditor() { this.showParticipantsEditor = true }, @@ -284,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 + } }, }