浏览代码

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

j8
Calinteodor 4 年前
父节点
当前提交
9b5eae7a60
没有帐户链接到提交者的电子邮件

+ 13
- 1
react/features/base/flags/constants.js 查看文件

104
  */
104
  */
105
 export const LIVE_STREAMING_ENABLED = 'live-streaming.enabled';
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
  * Flag indicating if displaying the meeting name should be enabled.
114
  * Flag indicating if displaying the meeting name should be enabled.
109
  * Default: enabled (true).
115
  * Default: enabled (true).
113
 /**
119
 /**
114
  * Flag indicating if the meeting password button should be enabled.
120
  * Flag indicating if the meeting password button should be enabled.
115
  * Note that this flag just decides on the button, if a meeting has a password
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
  * Default: enabled (true).
123
  * Default: enabled (true).
118
  */
124
  */
119
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
125
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
155
  */
161
  */
156
 export const RESOLUTION = 'resolution';
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
  * Flag indicating if server URL change is enabled.
171
  * Flag indicating if server URL change is enabled.
160
  * Default: enabled (true)
172
  * Default: enabled (true)

+ 16
- 1
react/features/security/components/security-dialog/SecurityDialogButton.js 查看文件

3
 import type { Dispatch } from 'redux';
3
 import type { Dispatch } from 'redux';
4
 
4
 
5
 import { createToolbarEvent, sendAnalytics } from '../../../analytics';
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
 import { translate } from '../../../base/i18n';
12
 import { translate } from '../../../base/i18n';
7
 import { IconSecurityOff, IconSecurityOn } from '../../../base/icons';
13
 import { IconSecurityOff, IconSecurityOn } from '../../../base/icons';
14
+import { isLocalParticipantModerator } from '../../../base/participants';
8
 import { connect } from '../../../base/redux';
15
 import { connect } from '../../../base/redux';
9
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
16
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
10
 import { toggleSecurityDialog } from '../../actions';
17
 import { toggleSecurityDialog } from '../../actions';
62
  * @returns {Props}
69
  * @returns {Props}
63
  */
70
  */
64
 function mapStateToProps(state: Object) {
71
 function mapStateToProps(state: Object) {
72
+    const { conference } = state['features/base/conference'];
73
+    const { hideLobbyButton } = state['features/base/config'];
65
     const { locked } = state['features/base/conference'];
74
     const { locked } = state['features/base/conference'];
66
     const { lobbyEnabled } = state['features/lobby'];
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
     return {
82
     return {
69
-        _locked: locked || lobbyEnabled
83
+        _locked: locked || lobbyEnabled,
84
+        visible: enabledFlag || (enabledLobbyModeFlag || enabledMeetingPassFlag)
70
     };
85
     };
71
 }
86
 }
72
 
87
 

正在加载...
取消
保存