Remove breakout room option from actions-dropdown

This commit is contained in:
bobakoftadeh 2019-03-28 20:18:21 +00:00
parent 2820af6288
commit b266fb11b4
3 changed files with 1 additions and 120 deletions

View File

@ -11,7 +11,6 @@ import DropdownListItem from '/imports/ui/components/dropdown/list/item/componen
import PresentationUploaderContainer from '/imports/ui/components/presentation/presentation-uploader/container';
import { withModalMounter } from '/imports/ui/components/modal/service';
import withShortcutHelper from '/imports/ui/components/shortcut-help/service';
import BreakoutRoom from '../create-breakout-room/component';
import { styles } from '../styles';
import ExternalVideoModal from '/imports/ui/components/external-video-player/modal/container';
@ -21,12 +20,7 @@ const propTypes = {
intl: intlShape.isRequired,
mountModal: PropTypes.func.isRequired,
isUserModerator: PropTypes.bool.isRequired,
meetingIsBreakout: PropTypes.bool.isRequired,
hasBreakoutRoom: PropTypes.bool.isRequired,
createBreakoutRoom: PropTypes.func.isRequired,
meetingName: PropTypes.string.isRequired,
shortcuts: PropTypes.string.isRequired,
users: PropTypes.arrayOf(PropTypes.object).isRequired,
handleTakePresenter: PropTypes.func.isRequired,
};
@ -67,18 +61,6 @@ const intlMessages = defineMessages({
id: 'app.actionsBar.actionsDropdown.pollBtnDesc',
description: 'poll menu toggle button 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',
},
invitationItem: {
id: 'app.invitation.title',
description: 'invitation to breakout title',
},
takePresenter: {
id: 'app.actionsBar.actionsDropdown.takePresenter',
description: 'Label for take presenter role option',
@ -101,18 +83,13 @@ class ActionsDropdown extends Component {
constructor(props) {
super(props);
this.handlePresentationClick = this.handlePresentationClick.bind(this);
this.handleCreateBreakoutRoomClick = this.handleCreateBreakoutRoomClick.bind(this);
this.onCreateBreakouts = this.onCreateBreakouts.bind(this);
this.onInvitationUsers = this.onInvitationUsers.bind(this);
this.presentationItemId = _.uniqueId('action-item-');
this.recordId = _.uniqueId('action-item-');
this.pollId = _.uniqueId('action-item-');
this.createBreakoutRoomId = _.uniqueId('action-item-');
this.takePresenterId = _.uniqueId('action-item-');
this.handlePresentationClick = this.handlePresentationClick.bind(this);
this.handleCreateBreakoutRoomClick = this.handleCreateBreakoutRoomClick.bind(this);
}
componentWillUpdate(nextProps) {
@ -123,24 +100,11 @@ class ActionsDropdown extends Component {
}
}
onCreateBreakouts() {
return this.handleCreateBreakoutRoomClick(false);
}
onInvitationUsers() {
return this.handleCreateBreakoutRoomClick(true);
}
getAvailableActions() {
const {
intl,
isUserPresenter,
isUserModerator,
allowExternalVideo,
meetingIsBreakout,
hasBreakoutRoom,
getUsersNotAssigned,
users,
handleTakePresenter,
isSharingVideo,
} = this.props;
@ -150,9 +114,6 @@ class ActionsDropdown extends Component {
pollBtnDesc,
presentationLabel,
presentationDesc,
createBreakoutRoom,
createBreakoutRoomDesc,
invitationItem,
takePresenter,
takePresenterDesc,
} = intlMessages;
@ -161,15 +122,6 @@ class ActionsDropdown extends Component {
formatMessage,
} = intl;
const canCreateBreakout = isUserModerator
&& !meetingIsBreakout
&& !hasBreakoutRoom;
const canInviteUsers = isUserModerator
&& !meetingIsBreakout
&& hasBreakoutRoom
&& getUsersNotAssigned(users).length;
return _.compact([
(isUserPresenter
? (
@ -216,28 +168,7 @@ class ActionsDropdown extends Component {
onClick={this.handleExternalVideoClick}
/>
)
: null),
(canCreateBreakout
? (
<DropdownListItem
icon="rooms"
label={formatMessage(createBreakoutRoom)}
description={formatMessage(createBreakoutRoomDesc)}
key={this.createBreakoutRoomId}
onClick={this.onCreateBreakouts}
/>
)
: null),
(canInviteUsers
? (
<DropdownListItem
icon="rooms"
label={formatMessage(invitationItem)}
key={this.createBreakoutRoomId}
onClick={this.onInvitationUsers}
/>
)
: null),
: null)
]);
}
@ -250,32 +181,6 @@ class ActionsDropdown extends Component {
mountModal(<PresentationUploaderContainer />);
}
handleCreateBreakoutRoomClick(isInvitation) {
const {
createBreakoutRoom,
mountModal,
meetingName,
users,
getUsersNotAssigned,
getBreakouts,
sendInvitation,
} = this.props;
mountModal(
<BreakoutRoom
{...{
createBreakoutRoom,
meetingName,
users,
getUsersNotAssigned,
isInvitation,
getBreakouts,
sendInvitation,
}}
/>,
);
}
render() {
const {
intl,

View File

@ -23,16 +23,8 @@ class ActionsBar extends React.PureComponent {
toggleRecording,
screenSharingCheck,
enableVideo,
createBreakoutRoom,
meetingIsBreakout,
hasBreakoutRoom,
meetingName,
users,
isLayoutSwapped,
toggleSwapLayout,
getUsersNotAssigned,
sendInvitation,
getBreakouts,
handleTakePresenter,
intl,
currentSlidHasContent,
@ -63,14 +55,6 @@ class ActionsBar extends React.PureComponent {
isRecording,
record,
toggleRecording,
createBreakoutRoom,
meetingIsBreakout,
hasBreakoutRoom,
meetingName,
users,
getUsersNotAssigned,
sendInvitation,
getBreakouts,
handleTakePresenter,
intl,
isSharingVideo,

View File

@ -40,16 +40,8 @@ export default withTracker(() => {
toggleRecording: Service.toggleRecording,
screenSharingCheck: getFromUserSettings('enableScreensharing', Meteor.settings.public.kurento.enableScreensharing),
enableVideo: getFromUserSettings('enableVideo', Meteor.settings.public.kurento.enableVideo),
createBreakoutRoom: Service.createBreakoutRoom,
meetingIsBreakout: Service.meetingIsBreakout(),
hasBreakoutRoom: Service.hasBreakoutRoom(),
meetingName: Service.meetingName(),
users: Service.users(),
isLayoutSwapped: getSwapLayout(),
toggleSwapLayout: MediaService.toggleSwapLayout,
sendInvitation: Service.sendInvitation,
getBreakouts: Service.getBreakouts,
getUsersNotAssigned: Service.getUsersNotAssigned,
handleTakePresenter: Service.takePresenterRole,
currentSlidHasContent: PresentationService.currentSlidHasContent(),
parseCurrentSlideContent: PresentationService.parseCurrentSlideContent,