Browse Source

feat(config/flag): enable/disable participants pane

factor2
Calin-Teodor 1 year ago
parent
commit
aff671b44a

+ 2
- 0
config.js View File

1388
 
1388
 
1389
     // Options related to the participants pane.
1389
     // Options related to the participants pane.
1390
     // participantsPane: {
1390
     // participantsPane: {
1391
+    //     // Enables feature
1392
+    //     enabled: true,
1391
     //     // Hides the moderator settings tab.
1393
     //     // Hides the moderator settings tab.
1392
     //     hideModeratorSettingsTab: false,
1394
     //     hideModeratorSettingsTab: false,
1393
     //     // Hides the more actions button.
1395
     //     // Hides the more actions button.

+ 1
- 0
react/features/base/config/configType.ts View File

503
         preventExecution: boolean;
503
         preventExecution: boolean;
504
     }>;
504
     }>;
505
     participantsPane?: {
505
     participantsPane?: {
506
+        enabled?: boolean;
506
         hideModeratorSettingsTab?: boolean;
507
         hideModeratorSettingsTab?: boolean;
507
         hideMoreActionsButton?: boolean;
508
         hideMoreActionsButton?: boolean;
508
         hideMuteAllButton?: boolean;
509
         hideMuteAllButton?: boolean;

+ 6
- 0
react/features/base/flags/constants.ts View File

164
  */
164
  */
165
 export const OVERFLOW_MENU_ENABLED = 'overflow-menu.enabled';
165
 export const OVERFLOW_MENU_ENABLED = 'overflow-menu.enabled';
166
 
166
 
167
+/**
168
+ * Flag indicating if participants should be enabled.
169
+ * Default: enabled (true).
170
+ */
171
+export const PARTICIPANTS_ENABLED = 'participants.enabled';
172
+
167
 /**
173
 /**
168
  * Flag indicating if Picture-in-Picture should be enabled.
174
  * Flag indicating if Picture-in-Picture should be enabled.
169
  * Default: auto-detected.
175
  * Default: auto-detected.

+ 15
- 4
react/features/conference/components/native/TitleBar.tsx View File

9
 import AudioDeviceToggleButton from '../../../mobile/audio-mode/components/AudioDeviceToggleButton';
9
 import AudioDeviceToggleButton from '../../../mobile/audio-mode/components/AudioDeviceToggleButton';
10
 import PictureInPictureButton from '../../../mobile/picture-in-picture/components/PictureInPictureButton';
10
 import PictureInPictureButton from '../../../mobile/picture-in-picture/components/PictureInPictureButton';
11
 import ParticipantsPaneButton from '../../../participants-pane/components/native/ParticipantsPaneButton';
11
 import ParticipantsPaneButton from '../../../participants-pane/components/native/ParticipantsPaneButton';
12
+import { isParticipantsPaneEnabled } from '../../../participants-pane/functions';
12
 import { isRoomNameEnabled } from '../../../prejoin/functions';
13
 import { isRoomNameEnabled } from '../../../prejoin/functions';
13
 import ToggleCameraButton from '../../../toolbox/components/native/ToggleCameraButton';
14
 import ToggleCameraButton from '../../../toolbox/components/native/ToggleCameraButton';
14
 import { isToolboxVisible } from '../../../toolbox/functions.native';
15
 import { isToolboxVisible } from '../../../toolbox/functions.native';
31
      */
32
      */
32
     _createOnPress: Function;
33
     _createOnPress: Function;
33
 
34
 
35
+    /**
36
+     * Whether participants feature is enabled or not.
37
+     */
38
+    _isParticipantsPaneEnabled: boolean;
39
+
34
     /**
40
     /**
35
      * Name of the meeting we're currently in.
41
      * Name of the meeting we're currently in.
36
      */
42
      */
55
  * @returns {JSX.Element}
61
  * @returns {JSX.Element}
56
  */
62
  */
57
 const TitleBar = (props: IProps) => {
63
 const TitleBar = (props: IProps) => {
58
-    const { _visible } = props;
64
+    const { _isParticipantsPaneEnabled, _visible } = props;
59
 
65
 
60
     if (!_visible) {
66
     if (!_visible) {
61
         return null;
67
         return null;
95
             <View style = { styles.titleBarButtonContainer }>
101
             <View style = { styles.titleBarButtonContainer }>
96
                 <AudioDeviceToggleButton styles = { styles.titleBarButton } />
102
                 <AudioDeviceToggleButton styles = { styles.titleBarButton } />
97
             </View>
103
             </View>
98
-            <View style = { styles.titleBarButtonContainer }>
99
-                <ParticipantsPaneButton styles = { styles.titleBarButton } />
100
-            </View>
104
+            {
105
+                _isParticipantsPaneEnabled
106
+                && <View style = { styles.titleBarButtonContainer }>
107
+                    <ParticipantsPaneButton
108
+                        styles = { styles.titleBarButton } />
109
+                </View>
110
+            }
101
         </View>
111
         </View>
102
     );
112
     );
103
 };
113
 };
115
     return {
125
     return {
116
         _conferenceTimerEnabled:
126
         _conferenceTimerEnabled:
117
             Boolean(getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !hideConferenceTimer && startTimestamp),
127
             Boolean(getFeatureFlag(state, CONFERENCE_TIMER_ENABLED, true) && !hideConferenceTimer && startTimestamp),
128
+        _isParticipantsPaneEnabled: isParticipantsPaneEnabled(state),
118
         _meetingName: getConferenceName(state),
129
         _meetingName: getConferenceName(state),
119
         _roomNameEnabled: isRoomNameEnabled(state),
130
         _roomNameEnabled: isRoomNameEnabled(state),
120
         _visible: isToolboxVisible(state)
131
         _visible: isToolboxVisible(state)

+ 16
- 2
react/features/participants-pane/components/web/ParticipantsPaneButton.tsx View File

9
     close as closeParticipantsPane,
9
     close as closeParticipantsPane,
10
     open as openParticipantsPane
10
     open as openParticipantsPane
11
 } from '../../../participants-pane/actions.web';
11
 } from '../../../participants-pane/actions.web';
12
+import { isParticipantsPaneEnabled } from '../../functions';
12
 
13
 
13
 import ParticipantsCounter from './ParticipantsCounter';
14
 import ParticipantsCounter from './ParticipantsCounter';
14
 
15
 
16
+
15
 /**
17
 /**
16
  * The type of the React {@code Component} props of {@link ParticipantsPaneButton}.
18
  * The type of the React {@code Component} props of {@link ParticipantsPaneButton}.
17
  */
19
  */
21
      * Whether or not the participants pane is open.
23
      * Whether or not the participants pane is open.
22
      */
24
      */
23
     _isOpen: boolean;
25
     _isOpen: boolean;
26
+
27
+    /**
28
+     * Whether participants feature is enabled or not.
29
+     */
30
+    _isParticipantsPaneEnabled: boolean;
24
 }
31
 }
25
 
32
 
26
 /**
33
 /**
69
      * @returns {React$Node}
76
      * @returns {React$Node}
70
      */
77
      */
71
     render() {
78
     render() {
79
+        const { _isParticipantsPaneEnabled } = this.props;
80
+
81
+        if (!_isParticipantsPaneEnabled) {
82
+            return null;
83
+        }
84
+
72
         return (
85
         return (
73
             <div
86
             <div
74
                 className = 'toolbar-button-with-badge'>
87
                 className = 'toolbar-button-with-badge'>
75
-                {super.render()}
88
+                { super.render() }
76
                 <ParticipantsCounter />
89
                 <ParticipantsCounter />
77
             </div>
90
             </div>
78
         );
91
         );
89
     const { isOpen } = state['features/participants-pane'];
102
     const { isOpen } = state['features/participants-pane'];
90
 
103
 
91
     return {
104
     return {
92
-        _isOpen: isOpen
105
+        _isOpen: isOpen,
106
+        _isParticipantsPaneEnabled: isParticipantsPaneEnabled(state)
93
     };
107
     };
94
 }
108
 }
95
 
109
 

+ 15
- 1
react/features/participants-pane/functions.ts View File

7
 } from '../av-moderation/functions';
7
 } from '../av-moderation/functions';
8
 import { IStateful } from '../base/app/types';
8
 import { IStateful } from '../base/app/types';
9
 import { getCurrentConference } from '../base/conference/functions';
9
 import { getCurrentConference } from '../base/conference/functions';
10
-import { INVITE_ENABLED } from '../base/flags/constants';
10
+import { INVITE_ENABLED, PARTICIPANTS_ENABLED } from '../base/flags/constants';
11
 import { getFeatureFlag } from '../base/flags/functions';
11
 import { getFeatureFlag } from '../base/flags/functions';
12
 import { MEDIA_TYPE, type MediaType } from '../base/media/constants';
12
 import { MEDIA_TYPE, type MediaType } from '../base/media/constants';
13
 import {
13
 import {
309
 
309
 
310
     return isLocalModerator && isRenameBreakoutRoomsSupported;
310
     return isLocalModerator && isRenameBreakoutRoomsSupported;
311
 }
311
 }
312
+
313
+/**
314
+ * Returns true if participants is enabled and false otherwise.
315
+ *
316
+ * @param {IStateful} stateful - The redux store, the redux
317
+ * {@code getState} function, or the redux state itself.
318
+ * @returns {boolean}
319
+ */
320
+export const isParticipantsPaneEnabled = (stateful: IStateful) => {
321
+    const state = toState(stateful);
322
+    const { enabled = true } = getParticipantsPaneConfig(state);
323
+
324
+    return Boolean(getFeatureFlag(state, PARTICIPANTS_ENABLED, true) && enabled);
325
+};

+ 6
- 2
react/features/toolbox/hooks.web.ts View File

17
     close as closeParticipantsPane,
17
     close as closeParticipantsPane,
18
     open as openParticipantsPane
18
     open as openParticipantsPane
19
 } from '../participants-pane/actions.web';
19
 } from '../participants-pane/actions.web';
20
-import { getParticipantsPaneOpen } from '../participants-pane/functions';
20
+import {
21
+    getParticipantsPaneOpen,
22
+    isParticipantsPaneEnabled
23
+} from '../participants-pane/functions';
21
 import { addReactionToBuffer } from '../reactions/actions.any';
24
 import { addReactionToBuffer } from '../reactions/actions.any';
22
 import { toggleReactionsMenuVisibility } from '../reactions/actions.web';
25
 import { toggleReactionsMenuVisibility } from '../reactions/actions.web';
23
 import { REACTIONS } from '../reactions/constants';
26
 import { REACTIONS } from '../reactions/constants';
36
 export const useKeyboardShortcuts = (toolbarButtons: Array<string>) => {
39
 export const useKeyboardShortcuts = (toolbarButtons: Array<string>) => {
37
     const dispatch = useDispatch();
40
     const dispatch = useDispatch();
38
     const _isSpeakerStatsDisabled = useSelector(isSpeakerStatsDisabled);
41
     const _isSpeakerStatsDisabled = useSelector(isSpeakerStatsDisabled);
42
+    const _isParticipantsPaneEnabled = useSelector(isParticipantsPaneEnabled);
39
     const _shouldDisplayReactionsButtons = useSelector(shouldDisplayReactionsButtons);
43
     const _shouldDisplayReactionsButtons = useSelector(shouldDisplayReactionsButtons);
40
     const _toolbarButtons = useSelector((state: IReduxState) => toolbarButtons || getToolbarButtons(state));
44
     const _toolbarButtons = useSelector((state: IReduxState) => toolbarButtons || getToolbarButtons(state));
41
     const chatOpen = useSelector((state: IReduxState) => state['features/chat'].isOpen);
45
     const chatOpen = useSelector((state: IReduxState) => state['features/chat'].isOpen);
216
                 exec: onToggleScreenshare,
220
                 exec: onToggleScreenshare,
217
                 helpDescription: 'keyboardShortcuts.toggleScreensharing'
221
                 helpDescription: 'keyboardShortcuts.toggleScreensharing'
218
             },
222
             },
219
-            isToolbarButtonEnabled('participants-pane', _toolbarButtons) && {
223
+            _isParticipantsPaneEnabled && isToolbarButtonEnabled('participants-pane', _toolbarButtons) && {
220
                 character: 'P',
224
                 character: 'P',
221
                 exec: onToggleParticipantsPane,
225
                 exec: onToggleParticipantsPane,
222
                 helpDescription: 'keyboardShortcuts.toggleParticipantsPane'
226
                 helpDescription: 'keyboardShortcuts.toggleParticipantsPane'

Loading…
Cancel
Save