From 0fc148af55acee154396e5b4c17e0e9825234554 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Thu, 10 Jan 2019 18:25:08 +0000 Subject: [PATCH 1/6] add create breakout room option to user manage menu --- .../user-options/component.jsx | 51 +++++++++++++++++-- .../user-options/container.jsx | 7 +++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/component.jsx index 0db0a225fd..0258ee61a4 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/component.jsx @@ -10,6 +10,7 @@ import DropdownContent from '/imports/ui/components/dropdown/content/component'; import DropdownList from '/imports/ui/components/dropdown/list/component'; import DropdownListItem from '/imports/ui/components/dropdown/list/item/component'; import LockViewersContainer from '/imports/ui/components/lock-viewers/container'; +import BreakoutRoom from '/imports/ui/components/actions-bar/create-breakout-room/component'; import { styles } from './styles'; const propTypes = { @@ -21,6 +22,9 @@ const propTypes = { toggleMuteAllUsersExceptPresenter: PropTypes.func.isRequired, toggleStatus: PropTypes.func.isRequired, mountModal: PropTypes.func.isRequired, + users: PropTypes.arrayOf(Object).isRequired, + meetingName: PropTypes.string.isRequired, + createBreakoutRoom: PropTypes.func.isRequired, }; const intlMessages = defineMessages({ @@ -68,6 +72,14 @@ const intlMessages = defineMessages({ id: 'app.userList.userOptions.muteAllExceptPresenterDesc', description: 'Mute all except presenter description', }, + createBreakoutRoom: { + id: 'app.actionsBar.actionsDropdown.createBreakoutRoom', + description: 'Create breakout room option', + }, + createBreakoutRoomDesc: { + id: 'app.actionsBar.actionsDropdown.createBreakoutRoomDesc', + description: 'Description of create breakout room option', + }, }); class UserOptions extends PureComponent { @@ -78,9 +90,16 @@ class UserOptions extends PureComponent { isUserOptionsOpen: false, }; + this.clearStatusId = _.uniqueId('list-item-'); + this.muteId = _.uniqueId('list-item-'); + this.muteAllId = _.uniqueId('list-item-'); + this.lockId = _.uniqueId('list-item-'); + this.createBreakoutId = _.uniqueId('list-item-'); + this.onActionsShow = this.onActionsShow.bind(this); this.onActionsHide = this.onActionsHide.bind(this); this.alterMenu = this.alterMenu.bind(this); + this.handleCreateBreakoutRoomClick = this.handleCreateBreakoutRoomClick.bind(this); } componentWillMount() { @@ -95,33 +114,40 @@ class UserOptions extends PureComponent { this.menuItems = _.compact([ (), (), (), ( mountModal()} />), + ( this.handleCreateBreakoutRoomClick()} + />), ]); if (isMeetingMuted) { @@ -148,6 +174,23 @@ class UserOptions extends PureComponent { }); } + handleCreateBreakoutRoomClick() { + const { + createBreakoutRoom, + mountModal, + meetingName, + users, + } = this.props; + + mountModal( + , + ); + } + alterMenu() { const { intl, diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/container.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/container.jsx index 24d71cfeff..9dc4b2ee88 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-options/container.jsx @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import Auth from '/imports/ui/services/auth'; +import Service from '/imports/ui/components/actions-bar/service'; import UserOptions from './component'; @@ -10,6 +11,9 @@ const propTypes = { muteAllExceptPresenter: PropTypes.func.isRequired, setEmojiStatus: PropTypes.func.isRequired, meeting: PropTypes.shape({}).isRequired, + currentUser: PropTypes.shape({ + isModerator: PropTypes.bool.isRequired, + }).isRequired, }; export default class UserOptionsContainer extends PureComponent { @@ -59,6 +63,9 @@ export default class UserOptionsContainer extends PureComponent { toggleMuteAllUsersExceptPresenter={this.muteAllUsersExceptPresenter} toggleStatus={this.handleClearStatus} isMeetingMuted={meetingMuted} + createBreakoutRoom={Service.createBreakoutRoom} + meetingName={Service.meetingName()} + users={Service.users()} />) : null ); } From 484403f4c1dddcdadf65a6e86865e0733a413dd9 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Thu, 10 Jan 2019 18:51:19 +0000 Subject: [PATCH 2/6] fix console error for array elements missing keys --- .../create-breakout-room/component.jsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx index a10f95fd32..67b63837b8 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx @@ -116,6 +116,10 @@ class BreakoutRoom extends Component { preventClosing: true, valid: true, }; + + this.breakoutFormId = _.uniqueId('breakout-form-'); + this.freeJoinId = _.uniqueId('free-join-check-'); + this.btnLevelId = _.uniqueId('btn-set-level-'); } componentDidMount() { @@ -208,7 +212,7 @@ class BreakoutRoom extends Component { changeUserRoom(userId, room) { const { users } = this.state; - + const idxUser = users.findIndex(user => user.userId === userId); users[idxUser].room = room; this.setState({ users }); @@ -251,7 +255,7 @@ class BreakoutRoom extends Component { }; return ( -
+
- + )) }
@@ -291,7 +295,7 @@ class BreakoutRoom extends Component { durationTime, } = this.state; return ( -
+