fix(av-moderation,breakout-rooms) disable controls on breakout rooms
AV moderation does not work on brerakout rooms. Since some of the options in the "breakoutRooms" config section no longer apply, I moved the relevant ones to a new "participantsPane" section.
This commit is contained in:
parent
0098091a37
commit
ffa55cca1e
22
config.js
22
config.js
|
@ -1108,16 +1108,8 @@ var config = {
|
||||||
*/
|
*/
|
||||||
// dynamicBrandingUrl: '',
|
// dynamicBrandingUrl: '',
|
||||||
|
|
||||||
// Options related to the breakout rooms feature.
|
// Options related to the participants pane.
|
||||||
// breakoutRooms: {
|
// participantsPane: {
|
||||||
// // Hides the add breakout room button. This replaces `hideAddRoomButton`.
|
|
||||||
// hideAddRoomButton: false,
|
|
||||||
// // Hides the auto assign participants button.
|
|
||||||
// hideAutoAssignButton: false,
|
|
||||||
// // Hides the participants pane footer menu.
|
|
||||||
// hideFooterMenu: false,
|
|
||||||
// // Hides the join breakout room button.
|
|
||||||
// hideJoinRoomButton: false,
|
|
||||||
// // Hides the moderator settings tab.
|
// // Hides the moderator settings tab.
|
||||||
// hideModeratorSettingsTab: false,
|
// hideModeratorSettingsTab: false,
|
||||||
// // Hides the more actions button.
|
// // Hides the more actions button.
|
||||||
|
@ -1126,6 +1118,16 @@ var config = {
|
||||||
// hideMuteAllButton: false
|
// hideMuteAllButton: false
|
||||||
// },
|
// },
|
||||||
|
|
||||||
|
// Options related to the breakout rooms feature.
|
||||||
|
// breakoutRooms: {
|
||||||
|
// // Hides the add breakout room button. This replaces `hideAddRoomButton`.
|
||||||
|
// hideAddRoomButton: false,
|
||||||
|
// // Hides the auto assign participants button.
|
||||||
|
// hideAutoAssignButton: false,
|
||||||
|
// // Hides the join breakout room button.
|
||||||
|
// hideJoinRoomButton: false
|
||||||
|
// },
|
||||||
|
|
||||||
// When true the user cannot add more images to be used as virtual background.
|
// When true the user cannot add more images to be used as virtual background.
|
||||||
// Only the default ones from will be available.
|
// Only the default ones from will be available.
|
||||||
// disableAddingBackgroundImages: false,
|
// disableAddingBackgroundImages: false,
|
||||||
|
|
|
@ -192,6 +192,7 @@ export default [
|
||||||
'openSharedDocumentOnJoin',
|
'openSharedDocumentOnJoin',
|
||||||
'opusMaxAverageBitrate',
|
'opusMaxAverageBitrate',
|
||||||
'p2p',
|
'p2p',
|
||||||
|
'participantsPane',
|
||||||
'pcStatsInterval',
|
'pcStatsInterval',
|
||||||
'preferH264',
|
'preferH264',
|
||||||
'preferredCodec',
|
'preferredCodec',
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
import { getKnockingParticipants } from '../../../lobby/functions';
|
import { getKnockingParticipants } from '../../../lobby/functions';
|
||||||
import MuteEveryoneDialog
|
import MuteEveryoneDialog
|
||||||
from '../../../video-menu/components/native/MuteEveryoneDialog';
|
from '../../../video-menu/components/native/MuteEveryoneDialog';
|
||||||
import { isFooterMenuVisible, isMoreActionsVisible, isMuteAllVisible } from '../../functions';
|
import { isMoreActionsVisible, isMuteAllVisible } from '../../functions';
|
||||||
import {
|
import {
|
||||||
AddBreakoutRoomButton,
|
AddBreakoutRoomButton,
|
||||||
AutoAssignButton,
|
AutoAssignButton,
|
||||||
|
@ -57,7 +57,6 @@ const ParticipantsPane = () => {
|
||||||
const inBreakoutRoom = useSelector(isInBreakoutRoom);
|
const inBreakoutRoom = useSelector(isInBreakoutRoom);
|
||||||
const showAddBreakoutRoom = useSelector(isAddBreakoutRoomButtonVisible);
|
const showAddBreakoutRoom = useSelector(isAddBreakoutRoomButtonVisible);
|
||||||
const showAutoAssign = useSelector(isAutoAssignParticipantsVisible);
|
const showAutoAssign = useSelector(isAutoAssignParticipantsVisible);
|
||||||
const showFooterMenu = useSelector(isFooterMenuVisible);
|
|
||||||
const showMoreActions = useSelector(isMoreActionsVisible);
|
const showMoreActions = useSelector(isMoreActionsVisible);
|
||||||
const showMuteAll = useSelector(isMuteAllVisible);
|
const showMuteAll = useSelector(isMuteAllVisible);
|
||||||
const lobbyParticipants = useSelector(getKnockingParticipants);
|
const lobbyParticipants = useSelector(getKnockingParticipants);
|
||||||
|
@ -88,7 +87,7 @@ const ParticipantsPane = () => {
|
||||||
showAddBreakoutRoom && <AddBreakoutRoomButton />
|
showAddBreakoutRoom && <AddBreakoutRoomButton />
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
showFooterMenu
|
isLocalModerator
|
||||||
&& <View style = { styles.participantsPaneFooter }>
|
&& <View style = { styles.participantsPaneFooter }>
|
||||||
{
|
{
|
||||||
showMuteAll && (
|
showMuteAll && (
|
||||||
|
|
|
@ -7,6 +7,7 @@ import participantsPaneTheme from '../../../base/components/themes/participantsP
|
||||||
import { openDialog } from '../../../base/dialog';
|
import { openDialog } from '../../../base/dialog';
|
||||||
import { translate } from '../../../base/i18n';
|
import { translate } from '../../../base/i18n';
|
||||||
import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
|
import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
|
||||||
|
import { isLocalParticipantModerator } from '../../../base/participants/functions';
|
||||||
import { connect } from '../../../base/redux';
|
import { connect } from '../../../base/redux';
|
||||||
import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
|
import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
|
||||||
import { MuteEveryoneDialog } from '../../../video-menu/components/';
|
import { MuteEveryoneDialog } from '../../../video-menu/components/';
|
||||||
|
@ -14,7 +15,6 @@ import { close } from '../../actions';
|
||||||
import {
|
import {
|
||||||
findAncestorByClass,
|
findAncestorByClass,
|
||||||
getParticipantsPaneOpen,
|
getParticipantsPaneOpen,
|
||||||
isFooterMenuVisible,
|
|
||||||
isMoreActionsVisible,
|
isMoreActionsVisible,
|
||||||
isMuteAllVisible
|
isMuteAllVisible
|
||||||
} from '../../functions';
|
} from '../../functions';
|
||||||
|
@ -402,7 +402,7 @@ function _mapStateToProps(state: Object) {
|
||||||
_isBreakoutRoomsSupported,
|
_isBreakoutRoomsSupported,
|
||||||
_paneOpen: isPaneOpen,
|
_paneOpen: isPaneOpen,
|
||||||
_showAddRoomButton: isAddBreakoutRoomButtonVisible(state),
|
_showAddRoomButton: isAddBreakoutRoomButtonVisible(state),
|
||||||
_showFooter: isFooterMenuVisible(state),
|
_showFooter: isLocalParticipantModerator(state),
|
||||||
_showMuteAllButton: isMuteAllVisible(state),
|
_showMuteAllButton: isMuteAllVisible(state),
|
||||||
_showMoreActionsButton: isMoreActionsVisible(state)
|
_showMoreActionsButton: isMoreActionsVisible(state)
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
} from '../base/participants/functions';
|
} from '../base/participants/functions';
|
||||||
import { toState } from '../base/redux';
|
import { toState } from '../base/redux';
|
||||||
import { normalizeAccents } from '../base/util/strings';
|
import { normalizeAccents } from '../base/util/strings';
|
||||||
import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
|
import { isInBreakoutRoom } from '../breakout-rooms/functions';
|
||||||
|
|
||||||
import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
|
import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
|
||||||
|
|
||||||
|
@ -141,6 +141,20 @@ export const getComputedOuterHeight = (element: HTMLElement) => {
|
||||||
*/
|
*/
|
||||||
const getState = (state: Object) => state[REDUCER_KEY];
|
const getState = (state: Object) => state[REDUCER_KEY];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the participants pane config.
|
||||||
|
*
|
||||||
|
* @param {Function|Object} stateful - The redux store, the redux
|
||||||
|
* {@code getState} function, or the redux state itself.
|
||||||
|
* @returns {Object}
|
||||||
|
*/
|
||||||
|
export const getParticipantsPaneConfig = (stateful: Function | Object) => {
|
||||||
|
const state = toState(stateful);
|
||||||
|
const { participantsPane = {} } = state['features/base/config'];
|
||||||
|
|
||||||
|
return participantsPane;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the participants pane open.
|
* Is the participants pane open.
|
||||||
*
|
*
|
||||||
|
@ -262,22 +276,6 @@ export function participantMatchesSearch(participant: Object, searchString: stri
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the participants pane footer menu is visible.
|
|
||||||
*
|
|
||||||
* @param {Object} state - Global state.
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
export const isFooterMenuVisible = (state: Object) => {
|
|
||||||
const isLocalModerator = isLocalParticipantModerator(state);
|
|
||||||
const inBreakoutRoom = isInBreakoutRoom(state);
|
|
||||||
const { hideFooterMenu } = getBreakoutRoomsConfig(state);
|
|
||||||
|
|
||||||
return inBreakoutRoom
|
|
||||||
? !hideFooterMenu && isLocalModerator
|
|
||||||
: isLocalModerator;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the more actions button is visible.
|
* Returns whether the more actions button is visible.
|
||||||
*
|
*
|
||||||
|
@ -285,12 +283,11 @@ export const isFooterMenuVisible = (state: Object) => {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export const isMoreActionsVisible = (state: Object) => {
|
export const isMoreActionsVisible = (state: Object) => {
|
||||||
|
const isLocalModerator = isLocalParticipantModerator(state);
|
||||||
const inBreakoutRoom = isInBreakoutRoom(state);
|
const inBreakoutRoom = isInBreakoutRoom(state);
|
||||||
const { hideMoreActionsButton } = getBreakoutRoomsConfig(state);
|
const { hideMoreActionsButton } = getParticipantsPaneConfig(state);
|
||||||
|
|
||||||
return inBreakoutRoom
|
return inBreakoutRoom ? false : !hideMoreActionsButton && isLocalModerator;
|
||||||
? !hideMoreActionsButton
|
|
||||||
: true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -300,10 +297,9 @@ export const isMoreActionsVisible = (state: Object) => {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export const isMuteAllVisible = (state: Object) => {
|
export const isMuteAllVisible = (state: Object) => {
|
||||||
|
const isLocalModerator = isLocalParticipantModerator(state);
|
||||||
const inBreakoutRoom = isInBreakoutRoom(state);
|
const inBreakoutRoom = isInBreakoutRoom(state);
|
||||||
const { hideMuteAllButton } = getBreakoutRoomsConfig(state);
|
const { hideMuteAllButton } = getParticipantsPaneConfig(state);
|
||||||
|
|
||||||
return inBreakoutRoom
|
return inBreakoutRoom ? false : !hideMuteAllButton && isLocalModerator;
|
||||||
? !hideMuteAllButton
|
|
||||||
: true;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,9 +11,9 @@ import {
|
||||||
import { toState } from '../base/redux';
|
import { toState } from '../base/redux';
|
||||||
import { getHideSelfView } from '../base/settings';
|
import { getHideSelfView } from '../base/settings';
|
||||||
import { parseStandardURIString } from '../base/util';
|
import { parseStandardURIString } from '../base/util';
|
||||||
import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
|
|
||||||
import { isStageFilmstripEnabled } from '../filmstrip/functions';
|
import { isStageFilmstripEnabled } from '../filmstrip/functions';
|
||||||
import { isFollowMeActive } from '../follow-me';
|
import { isFollowMeActive } from '../follow-me';
|
||||||
|
import { getParticipantsPaneConfig } from '../participants-pane/functions';
|
||||||
import { isReactionsEnabled } from '../reactions/functions.any';
|
import { isReactionsEnabled } from '../reactions/functions.any';
|
||||||
|
|
||||||
import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from './constants';
|
import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from './constants';
|
||||||
|
@ -181,16 +181,10 @@ export function getModeratorTabProps(stateful: Object | Function) {
|
||||||
*/
|
*/
|
||||||
export function shouldShowModeratorSettings(stateful: Object | Function) {
|
export function shouldShowModeratorSettings(stateful: Object | Function) {
|
||||||
const state = toState(stateful);
|
const state = toState(stateful);
|
||||||
const inBreakoutRoom = isInBreakoutRoom(state);
|
const { hideModeratorSettingsTab } = getParticipantsPaneConfig(state);
|
||||||
const { hideModeratorSettingsTab } = getBreakoutRoomsConfig(state);
|
const hasModeratorRights = Boolean(isSettingEnabled('moderator') && isLocalParticipantModerator(state));
|
||||||
const hasModeratorRights = Boolean(
|
|
||||||
isSettingEnabled('moderator')
|
|
||||||
&& isLocalParticipantModerator(state)
|
|
||||||
);
|
|
||||||
|
|
||||||
return inBreakoutRoom
|
return hasModeratorRights && !hideModeratorSettingsTab;
|
||||||
? hasModeratorRights && !hideModeratorSettingsTab
|
|
||||||
: hasModeratorRights;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue