From a089bac80ec846285e3d986c4885831ff81a395d Mon Sep 17 00:00:00 2001 From: Bala Lakshmi Narayanasami Date: Fri, 6 May 2022 16:59:47 +0530 Subject: [PATCH] Adding chatbot behind feature flag --- .../Menus/CommandBar/CommandBarComponentButtonFactory.tsx | 2 +- src/Platform/Hosted/extractFeatures.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index f054c5bf6..b7611e62f 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -196,7 +196,7 @@ export function createControlCommandBarButtons(container: Explorer): CommandButt const showOpenFullScreen = configContext.platform === Platform.Portal && !isRunningOnNationalCloud() && userContext.apiType !== "Gremlin"; - if (userContext.authType === AuthType.AAD) { + if (userContext.authType === AuthType.AAD && userContext.features.enableChatbot) { const label = "Chat Assistant"; const supportPaneButton: CommandButtonComponentProps = { iconName: "ChatBot", diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 8d6a763cc..efa7e1e72 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -30,6 +30,7 @@ export type Features = { readonly mongoProxyAPIs?: string; readonly enableThroughputCap: boolean; readonly enableNewQuickstart: boolean; + readonly enableChatbot?: boolean; // can be set via both flight and feature flag autoscaleDefault: boolean; @@ -92,6 +93,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear notebooksDownBanner: "true" === get("notebooksDownBanner"), enableThroughputCap: "true" === get("enablethroughputcap"), enableNewQuickstart: "true" === get("enablenewquickstart"), + enableChatbot: "true" === get("enablechatbot"), }; }