From ec718ea43e90353bf647a6b21fada73894f71fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Mon, 18 Mar 2024 15:33:37 -0300 Subject: [PATCH] Port: Changes to layout toast's workflow --- .../apps/layout/BroadcastLayoutMsgHdlr.scala | 14 ++++++++++++++ .../ui/components/layout/modal/component.jsx | 18 ++++++++++++++++++ .../ui/components/notifications/container.jsx | 9 +++++++++ bigbluebutton-html5/public/locales/en.json | 3 +++ 4 files changed, 44 insertions(+) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/layout/BroadcastLayoutMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/layout/BroadcastLayoutMsgHdlr.scala index 11d44edc49..c32eb5c4ae 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/layout/BroadcastLayoutMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/layout/BroadcastLayoutMsgHdlr.scala @@ -6,6 +6,7 @@ import org.bigbluebutton.core.running.OutMsgRouter import org.bigbluebutton.core2.MeetingStatus2x import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait } import org.bigbluebutton.core.db.LayoutDAO +import org.bigbluebutton.core2.message.senders.{ MsgBuilder } trait BroadcastLayoutMsgHdlr extends RightsManagementTrait { this: LayoutApp2x => @@ -60,5 +61,18 @@ trait BroadcastLayoutMsgHdlr extends RightsManagementTrait { val msgEvent = BbbCommonEnvCoreMsg(envelope, event) outGW.send(msgEvent) + + if (body.pushLayout) { + val notifyEvent = MsgBuilder.buildNotifyUserInMeetingEvtMsg( + fromUserId, + liveMeeting.props.meetingProp.intId, + "info", + "user", + "app.layoutUpdate.label", + "Notification to when the presenter changes size of cams", + Vector() + ) + outGW.send(notifyEvent) + } } } diff --git a/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx b/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx index b8aad92ce2..ab1d201f3a 100644 --- a/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx @@ -21,6 +21,7 @@ const LayoutModalComponent = (props) => { } = props; const [selectedLayout, setSelectedLayout] = useState(application.selectedLayout); + const [updateAllUsed, setUpdateAllUsed] = useState(false); const BASE_NAME = window.meetingClientSettings.public.app.basename; @@ -44,6 +45,14 @@ const LayoutModalComponent = (props) => { id: 'app.layout.modal.layoutLabel', description: 'Layout label', }, + layoutToastLabelAuto: { + id: 'app.layout.modal.layoutToastLabelAuto', + description: 'Layout toast label', + }, + layoutToastLabelAutoOff: { + id: 'app.layout.modal.layoutToastLabelAutoOff', + description: 'Layout toast label', + }, layoutToastLabel: { id: 'app.layout.modal.layoutToastLabel', description: 'Layout toast label', @@ -83,6 +92,15 @@ const LayoutModalComponent = (props) => { application: { ...application, selectedLayout, pushLayout: updateAll }, }; + if ((isModerator || isPresenter) && updateAll) { + updateSettings(obj, intlMessages.layoutToastLabelAuto); + setUpdateAllUsed(true); + } else if ((isModerator || isPresenter) && !updateAll && !updateAllUsed) { + updateSettings(obj, intlMessages.layoutToastLabelAutoOff); + setUpdateAllUsed(false); + } else { + updateSettings(obj, intlMessages.layoutToastLabel); + } updateSettings(obj, intlMessages.layoutToastLabel, setLocalSettings); setIsOpen(false); }; diff --git a/bigbluebutton-html5/imports/ui/components/notifications/container.jsx b/bigbluebutton-html5/imports/ui/components/notifications/container.jsx index 23f1849d84..8502f3c2b4 100644 --- a/bigbluebutton-html5/imports/ui/components/notifications/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/notifications/container.jsx @@ -44,6 +44,15 @@ export default injectIntl(injectCurrentUser(withTracker(({ intl, currentUser }) return UserService.UserLeftMeetingAlert(obj); } + if (obj.messageId === 'app.layoutUpdate.label') { + const last = new Date(Session.get('lastLayoutUpdateNotification')); + const now = new Date(); + if (now - last < 1000) { + return {}; + } + Session.set('lastLayoutUpdateNotification', now); + } + return notify(