From 16b00dc2aff7bcbac9e91a1924dea7683b2fb346 Mon Sep 17 00:00:00 2001 From: Nando Thomassen Date: Wed, 10 Feb 2021 22:34:13 +0100 Subject: [PATCH] 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. --- react/features/base/flags/constants.js | 6 ++++++ react/features/toolbox/components/HelpButton.js | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js index 777cc40fc..de330fb3f 100644 --- a/react/features/base/flags/constants.js +++ b/react/features/base/flags/constants.js @@ -56,6 +56,12 @@ export const CHAT_ENABLED = 'chat.enabled'; */ export const FILMSTRIP_ENABLED = 'filmstrip.enabled'; +/** + * Flag indicating if the Help button should be enabled. + * Default: enabled (true). + */ +export const HELP_BUTTON_ENABLED = 'help.enabled'; + /** * Flag indicating if invite functionality should be enabled. * Default: enabled (true). diff --git a/react/features/toolbox/components/HelpButton.js b/react/features/toolbox/components/HelpButton.js index b9057ef92..c013ed0f0 100644 --- a/react/features/toolbox/components/HelpButton.js +++ b/react/features/toolbox/components/HelpButton.js @@ -1,6 +1,7 @@ // @flow import { createToolbarEvent, sendAnalytics } from '../../analytics'; +import { getFeatureFlag, HELP_BUTTON_ENABLED } from '../../base/flags'; import { translate } from '../../base/i18n'; import { IconHelp } from '../../base/icons'; import { connect } from '../../base/redux'; @@ -45,7 +46,8 @@ class HelpButton extends AbstractButton { */ function _mapStateToProps(state: Object) { const { userDocumentationURL } = state['features/base/config'].deploymentUrls || {}; - const visible = typeof userDocumentationURL === 'string'; + const enabled = getFeatureFlag(state, HELP_BUTTON_ENABLED, true); + const visible = typeof userDocumentationURL === 'string' && enabled; return { _userDocumentationURL: userDocumentationURL,