소스 검색

feat(flags) add feature flag for help button

Introduces a new feature flag ('help.enabled') and uses that to
determine the visibility of the 'Help' button in a call.
master
Nando Thomassen 4 년 전
부모
커밋
16b00dc2af
No account linked to committer's email address
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 6
    0
      react/features/base/flags/constants.js
  2. 3
    1
      react/features/toolbox/components/HelpButton.js

+ 6
- 0
react/features/base/flags/constants.js 파일 보기

@@ -56,6 +56,12 @@ export const CHAT_ENABLED = 'chat.enabled';
56 56
  */
57 57
 export const FILMSTRIP_ENABLED = 'filmstrip.enabled';
58 58
 
59
+/**
60
+ * Flag indicating if the Help button should be enabled.
61
+ * Default: enabled (true).
62
+ */
63
+export const HELP_BUTTON_ENABLED = 'help.enabled';
64
+
59 65
 /**
60 66
  * Flag indicating if invite functionality should be enabled.
61 67
  * Default: enabled (true).

+ 3
- 1
react/features/toolbox/components/HelpButton.js 파일 보기

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { createToolbarEvent, sendAnalytics } from '../../analytics';
4
+import { getFeatureFlag, HELP_BUTTON_ENABLED } from '../../base/flags';
4 5
 import { translate } from '../../base/i18n';
5 6
 import { IconHelp } from '../../base/icons';
6 7
 import { connect } from '../../base/redux';
@@ -45,7 +46,8 @@ class HelpButton extends AbstractButton<Props, *> {
45 46
  */
46 47
 function _mapStateToProps(state: Object) {
47 48
     const { userDocumentationURL } = state['features/base/config'].deploymentUrls || {};
48
-    const visible = typeof userDocumentationURL === 'string';
49
+    const enabled = getFeatureFlag(state, HELP_BUTTON_ENABLED, true);
50
+    const visible = typeof userDocumentationURL === 'string' && enabled;
49 51
 
50 52
     return {
51 53
         _userDocumentationURL: userDocumentationURL,

Loading…
취소
저장