Browse Source

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.
master
Saúl Ibarra Corretgé 3 years ago
parent
commit
ffa55cca1e

+ 11
- 9
config.js View File

1108
     */
1108
     */
1109
     // dynamicBrandingUrl: '',
1109
     // dynamicBrandingUrl: '',
1110
 
1110
 
1111
+    // Options related to the participants pane.
1112
+    // participantsPane: {
1113
+    //     // Hides the moderator settings tab.
1114
+    //     hideModeratorSettingsTab: false,
1115
+    //     // Hides the more actions button.
1116
+    //     hideMoreActionsButton: false,
1117
+    //     // Hides the mute all button.
1118
+    //     hideMuteAllButton: false
1119
+    // },
1120
+
1111
     // Options related to the breakout rooms feature.
1121
     // Options related to the breakout rooms feature.
1112
     // breakoutRooms: {
1122
     // breakoutRooms: {
1113
     //     // Hides the add breakout room button. This replaces `hideAddRoomButton`.
1123
     //     // Hides the add breakout room button. This replaces `hideAddRoomButton`.
1114
     //     hideAddRoomButton: false,
1124
     //     hideAddRoomButton: false,
1115
     //     // Hides the auto assign participants button.
1125
     //     // Hides the auto assign participants button.
1116
     //     hideAutoAssignButton: false,
1126
     //     hideAutoAssignButton: false,
1117
-    //     // Hides the participants pane footer menu.
1118
-    //     hideFooterMenu: false,
1119
     //     // Hides the join breakout room button.
1127
     //     // Hides the join breakout room button.
1120
-    //     hideJoinRoomButton: false,
1121
-    //     // Hides the moderator settings tab.
1122
-    //     hideModeratorSettingsTab: false,
1123
-    //     // Hides the more actions button.
1124
-    //     hideMoreActionsButton: false,
1125
-    //     // Hides the mute all button.
1126
-    //     hideMuteAllButton: false
1128
+    //     hideJoinRoomButton: false
1127
     // },
1129
     // },
1128
 
1130
 
1129
     // When true the user cannot add more images to be used as virtual background.
1131
     // When true the user cannot add more images to be used as virtual background.

+ 1
- 0
react/features/base/config/configWhitelist.js View File

192
     'openSharedDocumentOnJoin',
192
     'openSharedDocumentOnJoin',
193
     'opusMaxAverageBitrate',
193
     'opusMaxAverageBitrate',
194
     'p2p',
194
     'p2p',
195
+    'participantsPane',
195
     'pcStatsInterval',
196
     'pcStatsInterval',
196
     'preferH264',
197
     'preferH264',
197
     'preferredCodec',
198
     'preferredCodec',

+ 2
- 3
react/features/participants-pane/components/native/ParticipantsPane.js View File

20
 import { getKnockingParticipants } from '../../../lobby/functions';
20
 import { getKnockingParticipants } from '../../../lobby/functions';
21
 import MuteEveryoneDialog
21
 import MuteEveryoneDialog
22
     from '../../../video-menu/components/native/MuteEveryoneDialog';
22
     from '../../../video-menu/components/native/MuteEveryoneDialog';
23
-import { isFooterMenuVisible, isMoreActionsVisible, isMuteAllVisible } from '../../functions';
23
+import { isMoreActionsVisible, isMuteAllVisible } from '../../functions';
24
 import {
24
 import {
25
     AddBreakoutRoomButton,
25
     AddBreakoutRoomButton,
26
     AutoAssignButton,
26
     AutoAssignButton,
57
     const inBreakoutRoom = useSelector(isInBreakoutRoom);
57
     const inBreakoutRoom = useSelector(isInBreakoutRoom);
58
     const showAddBreakoutRoom = useSelector(isAddBreakoutRoomButtonVisible);
58
     const showAddBreakoutRoom = useSelector(isAddBreakoutRoomButtonVisible);
59
     const showAutoAssign = useSelector(isAutoAssignParticipantsVisible);
59
     const showAutoAssign = useSelector(isAutoAssignParticipantsVisible);
60
-    const showFooterMenu = useSelector(isFooterMenuVisible);
61
     const showMoreActions = useSelector(isMoreActionsVisible);
60
     const showMoreActions = useSelector(isMoreActionsVisible);
62
     const showMuteAll = useSelector(isMuteAllVisible);
61
     const showMuteAll = useSelector(isMuteAllVisible);
63
     const lobbyParticipants = useSelector(getKnockingParticipants);
62
     const lobbyParticipants = useSelector(getKnockingParticipants);
88
                 showAddBreakoutRoom && <AddBreakoutRoomButton />
87
                 showAddBreakoutRoom && <AddBreakoutRoomButton />
89
             }
88
             }
90
             {
89
             {
91
-                showFooterMenu
90
+                isLocalModerator
92
                 && <View style = { styles.participantsPaneFooter }>
91
                 && <View style = { styles.participantsPaneFooter }>
93
                     {
92
                     {
94
                         showMuteAll && (
93
                         showMuteAll && (

+ 2
- 2
react/features/participants-pane/components/web/ParticipantsPane.js View File

7
 import { openDialog } from '../../../base/dialog';
7
 import { openDialog } from '../../../base/dialog';
8
 import { translate } from '../../../base/i18n';
8
 import { translate } from '../../../base/i18n';
9
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
9
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
10
+import { isLocalParticipantModerator } from '../../../base/participants/functions';
10
 import { connect } from '../../../base/redux';
11
 import { connect } from '../../../base/redux';
11
 import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
12
 import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
12
 import { MuteEveryoneDialog } from '../../../video-menu/components/';
13
 import { MuteEveryoneDialog } from '../../../video-menu/components/';
14
 import {
15
 import {
15
     findAncestorByClass,
16
     findAncestorByClass,
16
     getParticipantsPaneOpen,
17
     getParticipantsPaneOpen,
17
-    isFooterMenuVisible,
18
     isMoreActionsVisible,
18
     isMoreActionsVisible,
19
     isMuteAllVisible
19
     isMuteAllVisible
20
 } from '../../functions';
20
 } from '../../functions';
402
         _isBreakoutRoomsSupported,
402
         _isBreakoutRoomsSupported,
403
         _paneOpen: isPaneOpen,
403
         _paneOpen: isPaneOpen,
404
         _showAddRoomButton: isAddBreakoutRoomButtonVisible(state),
404
         _showAddRoomButton: isAddBreakoutRoomButtonVisible(state),
405
-        _showFooter: isFooterMenuVisible(state),
405
+        _showFooter: isLocalParticipantModerator(state),
406
         _showMuteAllButton: isMuteAllVisible(state),
406
         _showMuteAllButton: isMuteAllVisible(state),
407
         _showMoreActionsButton: isMoreActionsVisible(state)
407
         _showMoreActionsButton: isMoreActionsVisible(state)
408
     };
408
     };

+ 21
- 25
react/features/participants-pane/functions.js View File

18
 } from '../base/participants/functions';
18
 } from '../base/participants/functions';
19
 import { toState } from '../base/redux';
19
 import { toState } from '../base/redux';
20
 import { normalizeAccents } from '../base/util/strings';
20
 import { normalizeAccents } from '../base/util/strings';
21
-import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
21
+import { isInBreakoutRoom } from '../breakout-rooms/functions';
22
 
22
 
23
 import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
23
 import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
24
 
24
 
141
  */
141
  */
142
 const getState = (state: Object) => state[REDUCER_KEY];
142
 const getState = (state: Object) => state[REDUCER_KEY];
143
 
143
 
144
+/**
145
+ * Returns the participants pane config.
146
+ *
147
+ * @param {Function|Object} stateful - The redux store, the redux
148
+ * {@code getState} function, or the redux state itself.
149
+ * @returns {Object}
150
+ */
151
+export const getParticipantsPaneConfig = (stateful: Function | Object) => {
152
+    const state = toState(stateful);
153
+    const { participantsPane = {} } = state['features/base/config'];
154
+
155
+    return participantsPane;
156
+};
157
+
144
 /**
158
 /**
145
  * Is the participants pane open.
159
  * Is the participants pane open.
146
  *
160
  *
262
     return false;
276
     return false;
263
 }
277
 }
264
 
278
 
265
-/**
266
- * Returns whether the participants pane footer menu is visible.
267
- *
268
- * @param {Object} state - Global state.
269
- * @returns {boolean}
270
- */
271
-export const isFooterMenuVisible = (state: Object) => {
272
-    const isLocalModerator = isLocalParticipantModerator(state);
273
-    const inBreakoutRoom = isInBreakoutRoom(state);
274
-    const { hideFooterMenu } = getBreakoutRoomsConfig(state);
275
-
276
-    return inBreakoutRoom
277
-        ? !hideFooterMenu && isLocalModerator
278
-        : isLocalModerator;
279
-};
280
-
281
 /**
279
 /**
282
  * Returns whether the more actions button is visible.
280
  * Returns whether the more actions button is visible.
283
  *
281
  *
285
  * @returns {boolean}
283
  * @returns {boolean}
286
  */
284
  */
287
 export const isMoreActionsVisible = (state: Object) => {
285
 export const isMoreActionsVisible = (state: Object) => {
286
+    const isLocalModerator = isLocalParticipantModerator(state);
288
     const inBreakoutRoom = isInBreakoutRoom(state);
287
     const inBreakoutRoom = isInBreakoutRoom(state);
289
-    const { hideMoreActionsButton } = getBreakoutRoomsConfig(state);
288
+    const { hideMoreActionsButton } = getParticipantsPaneConfig(state);
290
 
289
 
291
-    return inBreakoutRoom
292
-        ? !hideMoreActionsButton
293
-        : true;
290
+    return inBreakoutRoom ? false : !hideMoreActionsButton && isLocalModerator;
294
 };
291
 };
295
 
292
 
296
 /**
293
 /**
300
  * @returns {boolean}
297
  * @returns {boolean}
301
  */
298
  */
302
 export const isMuteAllVisible = (state: Object) => {
299
 export const isMuteAllVisible = (state: Object) => {
300
+    const isLocalModerator = isLocalParticipantModerator(state);
303
     const inBreakoutRoom = isInBreakoutRoom(state);
301
     const inBreakoutRoom = isInBreakoutRoom(state);
304
-    const { hideMuteAllButton } = getBreakoutRoomsConfig(state);
302
+    const { hideMuteAllButton } = getParticipantsPaneConfig(state);
305
 
303
 
306
-    return inBreakoutRoom
307
-        ? !hideMuteAllButton
308
-        : true;
304
+    return inBreakoutRoom ? false : !hideMuteAllButton && isLocalModerator;
309
 };
305
 };

+ 5
- 11
react/features/settings/functions.js View File

11
 import { toState } from '../base/redux';
11
 import { toState } from '../base/redux';
12
 import { getHideSelfView } from '../base/settings';
12
 import { getHideSelfView } from '../base/settings';
13
 import { parseStandardURIString } from '../base/util';
13
 import { parseStandardURIString } from '../base/util';
14
-import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
15
 import { isStageFilmstripEnabled } from '../filmstrip/functions';
14
 import { isStageFilmstripEnabled } from '../filmstrip/functions';
16
 import { isFollowMeActive } from '../follow-me';
15
 import { isFollowMeActive } from '../follow-me';
16
+import { getParticipantsPaneConfig } from '../participants-pane/functions';
17
 import { isReactionsEnabled } from '../reactions/functions.any';
17
 import { isReactionsEnabled } from '../reactions/functions.any';
18
 
18
 
19
 import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from './constants';
19
 import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from './constants';
181
  */
181
  */
182
 export function shouldShowModeratorSettings(stateful: Object | Function) {
182
 export function shouldShowModeratorSettings(stateful: Object | Function) {
183
     const state = toState(stateful);
183
     const state = toState(stateful);
184
-    const inBreakoutRoom = isInBreakoutRoom(state);
185
-    const { hideModeratorSettingsTab } = getBreakoutRoomsConfig(state);
186
-    const hasModeratorRights = Boolean(
187
-        isSettingEnabled('moderator')
188
-        && isLocalParticipantModerator(state)
189
-    );
190
-
191
-    return inBreakoutRoom
192
-        ? hasModeratorRights && !hideModeratorSettingsTab
193
-        : hasModeratorRights;
184
+    const { hideModeratorSettingsTab } = getParticipantsPaneConfig(state);
185
+    const hasModeratorRights = Boolean(isSettingEnabled('moderator') && isLocalParticipantModerator(state));
186
+
187
+    return hasModeratorRights && !hideModeratorSettingsTab;
194
 }
188
 }
195
 
189
 
196
 /**
190
 /**

Loading…
Cancel
Save