Parcourir la source

feat(rn, security) added flag for controlling security options button visibility

master
Calinteodor il y a 4 ans
Parent
révision
9b5eae7a60
Aucun compte lié à l'adresse e-mail de l'auteur

+ 13
- 1
react/features/base/flags/constants.js Voir le fichier

@@ -104,6 +104,12 @@ export const KICK_OUT_ENABLED = 'kick-out.enabled';
104 104
  */
105 105
 export const LIVE_STREAMING_ENABLED = 'live-streaming.enabled';
106 106
 
107
+/**
108
+ * Flag indicating if lobby mode button should be enabled.
109
+ * Default: enabled.
110
+ */
111
+export const LOBBY_MODE_ENABLED = 'lobby-mode.enabled';
112
+
107 113
 /**
108 114
  * Flag indicating if displaying the meeting name should be enabled.
109 115
  * Default: enabled (true).
@@ -113,7 +119,7 @@ export const MEETING_NAME_ENABLED = 'meeting-name.enabled';
113 119
 /**
114 120
  * Flag indicating if the meeting password button should be enabled.
115 121
  * Note that this flag just decides on the button, if a meeting has a password
116
- * set, the password ddialog will still show up.
122
+ * set, the password dialog will still show up.
117 123
  * Default: enabled (true).
118 124
  */
119 125
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
@@ -155,6 +161,12 @@ export const RECORDING_ENABLED = 'recording.enabled';
155 161
  */
156 162
 export const RESOLUTION = 'resolution';
157 163
 
164
+/**
165
+ * Flag indicating if the security options button should be enabled.
166
+ * Default: enabled (true)
167
+ */
168
+export const SECURITY_OPTIONS_ENABLED = 'security-options.enabled';
169
+
158 170
 /**
159 171
  * Flag indicating if server URL change is enabled.
160 172
  * Default: enabled (true)

+ 16
- 1
react/features/security/components/security-dialog/SecurityDialogButton.js Voir le fichier

@@ -3,8 +3,15 @@
3 3
 import type { Dispatch } from 'redux';
4 4
 
5 5
 import { createToolbarEvent, sendAnalytics } from '../../../analytics';
6
+import {
7
+    getFeatureFlag,
8
+    LOBBY_MODE_ENABLED,
9
+    MEETING_PASSWORD_ENABLED,
10
+    SECURITY_OPTIONS_ENABLED
11
+} from '../../../base/flags';
6 12
 import { translate } from '../../../base/i18n';
7 13
 import { IconSecurityOff, IconSecurityOn } from '../../../base/icons';
14
+import { isLocalParticipantModerator } from '../../../base/participants';
8 15
 import { connect } from '../../../base/redux';
9 16
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
10 17
 import { toggleSecurityDialog } from '../../actions';
@@ -62,11 +69,19 @@ class SecurityDialogButton extends AbstractButton<Props, *> {
62 69
  * @returns {Props}
63 70
  */
64 71
 function mapStateToProps(state: Object) {
72
+    const { conference } = state['features/base/conference'];
73
+    const { hideLobbyButton } = state['features/base/config'];
65 74
     const { locked } = state['features/base/conference'];
66 75
     const { lobbyEnabled } = state['features/lobby'];
76
+    const lobbySupported = conference && conference.isLobbySupported();
77
+    const lobby = lobbySupported && isLocalParticipantModerator(state) && !hideLobbyButton;
78
+    const enabledFlag = getFeatureFlag(state, SECURITY_OPTIONS_ENABLED, true);
79
+    const enabledLobbyModeFlag = getFeatureFlag(state, LOBBY_MODE_ENABLED, true) && lobby;
80
+    const enabledMeetingPassFlag = getFeatureFlag(state, MEETING_PASSWORD_ENABLED, true);
67 81
 
68 82
     return {
69
-        _locked: locked || lobbyEnabled
83
+        _locked: locked || lobbyEnabled,
84
+        visible: enabledFlag || (enabledLobbyModeFlag || enabledMeetingPassFlag)
70 85
     };
71 86
 }
72 87
 

Chargement…
Annuler
Enregistrer