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.
// remoteVideoMenu: {
// // 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.

View File

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

View File

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