Add: remoteVideoMenu.disableGrantModerator option (#7534)

* Add: remoteVideoMenu.disableGrantModerator option

* Add disableGrantModerator to native side

* Update RemoteVideoMenu.js

* Update RemoteVideoMenuTriggerButton.js

Co-authored-by: ouya99 <alexander@andlabs.eu>
This commit is contained in:
Christoph Wiechert 2021-04-30 18:22:36 +02:00 committed by GitHub
parent f44faa8d81
commit 79497cecba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 10 deletions

View File

@ -671,7 +671,9 @@ var config = {
// Options related to the remote participant menu. // Options related to the remote participant menu.
// remoteVideoMenu: { // remoteVideoMenu: {
// // If set to true the 'Kick out' button will be disabled. // // If set to true the 'Kick out' button will be disabled.
// disableKick: true // disableKick: true,
// // If set to true the 'Grant moderator' button will be disabled.
// disableGrantModerator: true
// }, // },
// If set to true all muting operations of remote participants will be disabled. // If set to true all muting operations of remote participants will be disabled.

View File

@ -53,6 +53,11 @@ type Props = {
*/ */
_disableRemoteMute: boolean, _disableRemoteMute: boolean,
/**
* Whether or not to display the grant moderator button.
*/
_disableGrantModerator: Boolean,
/** /**
* True if the menu is currently open, false otherwise. * True if the menu is currently open, false otherwise.
*/ */
@ -89,7 +94,7 @@ class RemoteVideoMenu extends PureComponent<Props> {
* @inheritdoc * @inheritdoc
*/ */
render() { render() {
const { _disableKick, _disableRemoteMute, participant } = this.props; const { _disableKick, _disableRemoteMute, _disableGrantModerator, participant } = this.props;
const buttonProps = { const buttonProps = {
afterClick: this._onCancel, afterClick: this._onCancel,
showLabel: true, showLabel: true,
@ -103,7 +108,7 @@ class RemoteVideoMenu extends PureComponent<Props> {
renderHeader = { this._renderMenuHeader }> renderHeader = { this._renderMenuHeader }>
{ !_disableRemoteMute && <MuteButton { ...buttonProps } /> } { !_disableRemoteMute && <MuteButton { ...buttonProps } /> }
{ !_disableKick && <KickButton { ...buttonProps } /> } { !_disableKick && <KickButton { ...buttonProps } /> }
<GrantModeratorButton { ...buttonProps } /> { !_disableGrantModerator && <GrantModeratorButton { ...buttonProps } /> }
<PinButton { ...buttonProps } /> <PinButton { ...buttonProps } />
<PrivateMessageButton { ...buttonProps } /> <PrivateMessageButton { ...buttonProps } />
<MuteEveryoneElseButton { ...buttonProps } /> <MuteEveryoneElseButton { ...buttonProps } />

View File

@ -43,6 +43,11 @@ type Props = {
*/ */
_disableRemoteMute: Boolean, _disableRemoteMute: Boolean,
/**
* Whether or not to display the grant moderator button.
*/
_disableGrantModerator: Boolean,
/** /**
* Whether or not the participant is a conference moderator. * Whether or not the participant is a conference moderator.
*/ */
@ -136,6 +141,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
const { const {
_disableKick, _disableKick,
_disableRemoteMute, _disableRemoteMute,
_disableGrantModerator,
_isModerator, _isModerator,
dispatch, dispatch,
initialVolumeValue, initialVolumeValue,
@ -170,11 +176,13 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
); );
} }
if (!_disableGrantModerator) {
buttons.push( buttons.push(
<GrantModeratorButton <GrantModeratorButton
key = 'grant-moderator' key = 'grant-moderator'
participantID = { participantID } /> participantID = { participantID } />
); );
}
if (!_disableKick) { if (!_disableKick) {
buttons.push( buttons.push(
@ -242,7 +250,7 @@ function _mapStateToProps(state, ownProps) {
const { participantID } = ownProps; const { participantID } = ownProps;
const localParticipant = getLocalParticipant(state); const localParticipant = getLocalParticipant(state);
const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config']; const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
const { disableKick } = remoteVideoMenu; const { disableKick, disableGrantModerator } = remoteVideoMenu;
let _remoteControlState = null; let _remoteControlState = null;
const participant = getParticipantById(state, participantID); const participant = getParticipantById(state, participantID);
const _isRemoteControlSessionActive = participant?.remoteControlSessionStatus ?? false; const _isRemoteControlSessionActive = participant?.remoteControlSessionStatus ?? false;
@ -283,7 +291,8 @@ function _mapStateToProps(state, ownProps) {
_disableRemoteMute: Boolean(disableRemoteMute), _disableRemoteMute: Boolean(disableRemoteMute),
_remoteControlState, _remoteControlState,
_menuPosition, _menuPosition,
_overflowDrawer: overflowDrawer _overflowDrawer: overflowDrawer,
_disableGrantModerator: Boolean(disableGrantModerator)
}; };
} }