From 7bce5cf45ab4c3187f239bd0b1a59a904048a9f5 Mon Sep 17 00:00:00 2001 From: imdt Date: Tue, 12 Sep 2023 10:42:55 -0300 Subject: [PATCH] Changes to layout toast's workflow --- .../apps/layout/BroadcastLayoutMsgHdlr.scala | 12 ++++++++++++ .../ui/components/layout/modal/component.jsx | 19 ++++++++++++++++++- .../ui/components/notifications/container.jsx | 1 + .../ui/components/webcam/component.jsx | 11 +++++++++++ bigbluebutton-html5/public/locales/en.json | 3 +++ 5 files changed, 45 insertions(+), 1 deletion(-) 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 a6e3382c62..23f9578844 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 @@ -5,6 +5,7 @@ import org.bigbluebutton.core.models.{ Layouts, LayoutsType } import org.bigbluebutton.core.running.OutMsgRouter import org.bigbluebutton.core2.MeetingStatus2x import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait } +import org.bigbluebutton.core2.message.senders.{ MsgBuilder } trait BroadcastLayoutMsgHdlr extends RightsManagementTrait { this: LayoutApp2x => @@ -58,5 +59,16 @@ trait BroadcastLayoutMsgHdlr extends RightsManagementTrait { val msgEvent = BbbCommonEnvCoreMsg(envelope, event) outGW.send(msgEvent) + + val notifyEvent = MsgBuilder.buildNotifyUserInMeetingEvtMsg( + fromUserId, + liveMeeting.props.meetingProp.intId, + "info", + "user", + "app.layoutUpdate.label", + "Notification to when the presenter changes dize 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 985f23c8e6..49e74f1d4a 100644 --- a/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/layout/modal/component.jsx @@ -20,6 +20,7 @@ const LayoutModalComponent = (props) => { } = props; const [selectedLayout, setSelectedLayout] = useState(application.selectedLayout); + const [updateAllUsed, setUpdateAllUsed] = useState(false); const BASE_NAME = Meteor.settings.public.app.basename; @@ -43,10 +44,18 @@ const LayoutModalComponent = (props) => { id: 'app.layout.modal.layoutLabel', description: 'Layout label', }, + layoutToastLabelAuto: { + id: 'app.layout.modal.layoutToastLabelAuto', + description: 'Layout toast label', + }, layoutToastLabel: { id: 'app.layout.modal.layoutToastLabel', description: 'Layout toast label', }, + layoutToastLabelAutoOff: { + id: 'app.layout.modal.layoutToastLabelAutoOff', + description: 'Layout toast label', + }, customLayout: { id: 'app.layout.style.custom', description: 'label for custom layout style', @@ -82,7 +91,15 @@ const LayoutModalComponent = (props) => { application: { ...application, selectedLayout, pushLayout: updateAll }, }; - updateSettings(obj, intlMessages.layoutToastLabel); + 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); + } setIsOpen(false); }; diff --git a/bigbluebutton-html5/imports/ui/components/notifications/container.jsx b/bigbluebutton-html5/imports/ui/components/notifications/container.jsx index a1e754bb2a..3ff2414a80 100644 --- a/bigbluebutton-html5/imports/ui/components/notifications/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/notifications/container.jsx @@ -9,6 +9,7 @@ import UserService from '/imports/ui/components/user-list/service'; export default injectIntl(withTracker(({ intl }) => { NotificationsCollection.find({}).observe({ added: (obj) => { + console.log({obj}); NotificationsCollection.remove(obj); if (obj.messageId === 'app.userList.guest.pendingGuestAlert') { diff --git a/bigbluebutton-html5/imports/ui/components/webcam/component.jsx b/bigbluebutton-html5/imports/ui/components/webcam/component.jsx index fdf6790edc..846e8eb97a 100644 --- a/bigbluebutton-html5/imports/ui/components/webcam/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/webcam/component.jsx @@ -7,6 +7,17 @@ import DropAreaContainer from './drop-areas/container'; import VideoProviderContainer from '/imports/ui/components/video-provider/container'; import Storage from '/imports/ui/services/storage/session'; import { colorContentBackground } from '/imports/ui/stylesheets/styled-components/palette'; +import { defineMessages } from 'react-intl'; +import { + isPresenter, +} from '/imports/ui/components/settings/service'; + +const intlMessages = defineMessages({ + layoutToastLabelAuto: { + id: 'app.layout.modal.layoutToastLabelAuto', + description: 'Layout toast label', + }, +}); const WebcamComponent = ({ cameraDock, diff --git a/bigbluebutton-html5/public/locales/en.json b/bigbluebutton-html5/public/locales/en.json index ba64b0eac3..89cc01d9c2 100755 --- a/bigbluebutton-html5/public/locales/en.json +++ b/bigbluebutton-html5/public/locales/en.json @@ -1093,6 +1093,7 @@ "app.video.meetingCamCapReached": "Meeting reached it's simultaneous cameras limit", "app.video.dropZoneLabel": "Drop here", "app.fullscreenButton.label": "Make {0} fullscreen", + "app.layoutUpdate.label": "Layout updates applied to everyone", "app.fullscreenUndoButton.label": "Undo {0} fullscreen", "app.switchButton.expandLabel": "Expand screenshare video", "app.switchButton.shrinkLabel": "Shrink screenshare video", @@ -1253,6 +1254,8 @@ "app.layout.modal.layoutLabel": "Select your layout", "app.layout.modal.pushLayoutLabel": "Push to everyone", "app.layout.modal.layoutToastLabel": "Layout settings changed", + "app.layout.modal.layoutToastLabelAuto": "Auto layout updates enabled, layout updates are now applied to everyone", + "app.layout.modal.layoutToastLabelAutoOff": "Auto layout updates disabled", "app.layout.modal.layoutSingular": "Layout", "app.layout.modal.layoutBtnDesc": "Sets layout as selected option", "app.layout.style.custom": "Custom layout",