浏览代码

feat(mobile) adds more feature flags (#8450)

Features flags added:  
-tile-view.enabled
-filmstrip.enabled
-notifications.enabled
-toolbox.enabled
master
tmoldovan8x8 4 年前
父节点
当前提交
6a6aeb1d95
没有帐户链接到提交者的电子邮件

+ 19
- 0
react/features/base/flags/constants.js 查看文件

37
  */
37
  */
38
 export const CHAT_ENABLED = 'chat.enabled';
38
 export const CHAT_ENABLED = 'chat.enabled';
39
 
39
 
40
+/**
41
+ * Flag indicating if the filmstrip should be enabled.
42
+ * Default: enabled (true).
43
+ */
44
+export const FILMSTRIP_ENABLED = 'filmstrip.enabled';
45
+
40
 /**
46
 /**
41
  * Flag indicating if invite functionality should be enabled.
47
  * Flag indicating if invite functionality should be enabled.
42
  * Default: enabled (true).
48
  * Default: enabled (true).
75
  */
81
  */
76
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
82
 export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
77
 
83
 
84
+
85
+/**
86
+ * Flag indicating if the notifications should be enabled.
87
+ * Default: enabled (true).
88
+ */
89
+export const NOTIFICATIONS_ENABLED = 'notifications.enabled';
90
+
78
 /**
91
 /**
79
  * Flag indicating if Picture-in-Picture should be enabled.
92
  * Flag indicating if Picture-in-Picture should be enabled.
80
  * Default: auto-detected.
93
  * Default: auto-detected.
118
  */
131
  */
119
 export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
132
 export const TOOLBOX_ALWAYS_VISIBLE = 'toolbox.alwaysVisible';
120
 
133
 
134
+/**
135
+ * Flag indicating if the toolbox should be enabled
136
+ * Default: enabled.
137
+ */
138
+export const TOOLBOX_ENABLED = 'toolbox.enabled';
139
+
121
 /**
140
 /**
122
  * Flag indicating if the video share button should be enabled
141
  * Flag indicating if the video share button should be enabled
123
  * Default: enabled (true).
142
  * Default: enabled (true).

+ 8
- 0
react/features/filmstrip/functions.native.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { getFeatureFlag, FILMSTRIP_ENABLED } from '../base/flags';
3
 import { toState } from '../base/redux';
4
 import { toState } from '../base/redux';
4
 
5
 
5
 /**
6
 /**
14
  */
15
  */
15
 export function isFilmstripVisible(stateful: Object | Function) {
16
 export function isFilmstripVisible(stateful: Object | Function) {
16
     const state = toState(stateful);
17
     const state = toState(stateful);
18
+
19
+    const enabled = getFeatureFlag(state, FILMSTRIP_ENABLED, true);
20
+
21
+    if (!enabled) {
22
+        return false;
23
+    }
24
+
17
     const { length: participantCount } = state['features/base/participants'];
25
     const { length: participantCount } = state['features/base/participants'];
18
 
26
 
19
     return participantCount > 1;
27
     return participantCount > 1;

+ 8
- 3
react/features/notifications/actions.js 查看文件

3
 import throttle from 'lodash/throttle';
3
 import throttle from 'lodash/throttle';
4
 import type { Dispatch } from 'redux';
4
 import type { Dispatch } from 'redux';
5
 
5
 
6
+import { NOTIFICATIONS_ENABLED, getFeatureFlag } from '../base/flags';
7
+
6
 import {
8
 import {
7
     CLEAR_NOTIFICATIONS,
9
     CLEAR_NOTIFICATIONS,
8
     HIDE_NOTIFICATION,
10
     HIDE_NOTIFICATION,
81
 export function showNotification(props: Object = {}, timeout: ?number) {
83
 export function showNotification(props: Object = {}, timeout: ?number) {
82
     return function(dispatch: Function, getState: Function) {
84
     return function(dispatch: Function, getState: Function) {
83
         const { notifications } = getState()['features/base/config'];
85
         const { notifications } = getState()['features/base/config'];
84
-        const shouldDisplay = !notifications
85
-            || notifications.includes(props.descriptionKey)
86
-            || notifications.includes(props.titleKey);
86
+        const enabledFlag = getFeatureFlag(getState(), NOTIFICATIONS_ENABLED, true);
87
+
88
+        const shouldDisplay = enabledFlag
89
+            && (!notifications
90
+                || notifications.includes(props.descriptionKey)
91
+                || notifications.includes(props.titleKey));
87
 
92
 
88
         if (shouldDisplay) {
93
         if (shouldDisplay) {
89
             return dispatch({
94
             return dispatch({

+ 4
- 3
react/features/toolbox/functions.native.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { hasAvailableDevices } from '../base/devices';
3
 import { hasAvailableDevices } from '../base/devices';
4
-import { TOOLBOX_ALWAYS_VISIBLE, getFeatureFlag } from '../base/flags';
4
+import { TOOLBOX_ALWAYS_VISIBLE, getFeatureFlag, TOOLBOX_ENABLED } from '../base/flags';
5
 import { toState } from '../base/redux';
5
 import { toState } from '../base/redux';
6
 import { isLocalVideoTrackDesktop } from '../base/tracks';
6
 import { isLocalVideoTrackDesktop } from '../base/tracks';
7
 
7
 
16
     const state = toState(stateful);
16
     const state = toState(stateful);
17
     const { alwaysVisible, enabled, visible } = state['features/toolbox'];
17
     const { alwaysVisible, enabled, visible } = state['features/toolbox'];
18
     const { length: participantCount } = state['features/base/participants'];
18
     const { length: participantCount } = state['features/base/participants'];
19
-    const flag = getFeatureFlag(state, TOOLBOX_ALWAYS_VISIBLE, false);
19
+    const alwaysVisibleFlag = getFeatureFlag(state, TOOLBOX_ALWAYS_VISIBLE, false);
20
+    const enabledFlag = getFeatureFlag(state, TOOLBOX_ENABLED, true);
20
 
21
 
21
-    return enabled && (alwaysVisible || visible || participantCount === 1 || flag);
22
+    return enabledFlag && enabled && (alwaysVisible || visible || participantCount === 1 || alwaysVisibleFlag);
22
 }
23
 }
23
 
24
 
24
 /**
25
 /**

+ 3
- 1
react/features/video-layout/functions.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { getFeatureFlag, TILE_VIEW_ENABLED } from '../base/flags';
3
 import { getPinnedParticipant, getParticipantCount } from '../base/participants';
4
 import { getPinnedParticipant, getParticipantCount } from '../base/participants';
4
 import { isYoutubeVideoPlaying } from '../youtube-player/functions';
5
 import { isYoutubeVideoPlaying } from '../youtube-player/functions';
5
 
6
 
82
         return false;
83
         return false;
83
     }
84
     }
84
 
85
 
86
+    const tileViewEnabledFeatureFlag = getFeatureFlag(state, TILE_VIEW_ENABLED, true);
85
     const { disableTileView } = state['features/base/config'];
87
     const { disableTileView } = state['features/base/config'];
86
 
88
 
87
-    if (disableTileView) {
89
+    if (disableTileView || !tileViewEnabledFeatureFlag) {
88
         return false;
90
         return false;
89
     }
91
     }
90
 
92
 

正在加载...
取消
保存