diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 3e6b15816..f159c6ac1 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -3,7 +3,7 @@ import { isPublicInternetAccessAllowed } from "Common/DatabaseAccountUtility"; import { sendMessage } from "Common/MessageHandler"; import { Platform, configContext } from "ConfigContext"; import { MessageTypes } from "Contracts/ExplorerContracts"; -import { getCopilotEnabled, isCopilotFeatureRegistered } from "Explorer/QueryCopilot/Shared/QueryCopilotClient"; +import { getCopilotEnabled } from "Explorer/QueryCopilot/Shared/QueryCopilotClient"; import { IGalleryItem } from "Juno/JunoClient"; import { requestDatabaseResourceTokens } from "Platform/Fabric/FabricUtil"; import { allowedNotebookServerUrls, validateEndpoint } from "Utils/EndpointValidation"; @@ -1389,14 +1389,9 @@ export default class Explorer { if (userContext.apiType !== "SQL" || !userContext.subscriptionId) { return; } - const copilotEnabledPromise = getCopilotEnabled(); - const copilotUserDBEnabledPromise = isCopilotFeatureRegistered(userContext.subscriptionId); - const [copilotEnabled, copilotUserDBEnabled] = await Promise.all([ - copilotEnabledPromise, - copilotUserDBEnabledPromise, - ]); + const copilotEnabled = await getCopilotEnabled(); useQueryCopilot.getState().setCopilotEnabled(copilotEnabled); - useQueryCopilot.getState().setCopilotUserDBEnabled(copilotUserDBEnabled); + useQueryCopilot.getState().setCopilotUserDBEnabled(copilotEnabled); } public async refreshSampleData(): Promise { diff --git a/src/Explorer/QueryCopilot/Modal/WelcomeModal.tsx b/src/Explorer/QueryCopilot/Modal/WelcomeModal.tsx index 58b968621..8c22cec43 100644 --- a/src/Explorer/QueryCopilot/Modal/WelcomeModal.tsx +++ b/src/Explorer/QueryCopilot/Modal/WelcomeModal.tsx @@ -37,9 +37,6 @@ export const WelcomeModal = ({ visible }: { visible: boolean }): JSX.Element => - - Preview - - Welcome to Microsoft Copilot for Azure in Cosmos DB (preview) + Welcome to Microsoft Copilot for Azure in Cosmos DB diff --git a/src/Explorer/QueryCopilot/Modal/__snapshots__/WelcomeModal.test.tsx.snap b/src/Explorer/QueryCopilot/Modal/__snapshots__/WelcomeModal.test.tsx.snap index a7193cdf5..324542a15 100644 --- a/src/Explorer/QueryCopilot/Modal/__snapshots__/WelcomeModal.test.tsx.snap +++ b/src/Explorer/QueryCopilot/Modal/__snapshots__/WelcomeModal.test.tsx.snap @@ -40,15 +40,6 @@ exports[`Query Copilot Welcome Modal snapshot test should render when isOpen is horizontalAlign="end" verticalAlign="start" > - - - Preview - - - Welcome to Microsoft Copilot for Azure in Cosmos DB (preview) + Welcome to Microsoft Copilot for Azure in Cosmos DB => { - const api_version = "2021-07-01"; - const url = `${configContext.ARM_ENDPOINT}/subscriptions/${subscriptionId}/providers/Microsoft.Features/featureProviders/Microsoft.DocumentDB/subscriptionFeatureRegistrations/MicrosoftCopilotForAzureInCDB?api-version=${api_version}`; - const authorizationHeader: AuthorizationTokenHeaderMetadata = getAuthorizationHeader(); - const headers = { [authorizationHeader.header]: authorizationHeader.token }; - - let response; - - try { - response = await fetchWithTimeout(url, headers); - } catch (error) { - return false; - } - - if (!response?.ok) { - return false; - } - - const featureRegistration = (await response?.json()) as FeatureRegistration; - return featureRegistration?.properties?.state === "Registered"; -}; - export const getCopilotEnabled = async (): Promise => { const url = `${configContext.BACKEND_ENDPOINT}/api/portalsettings/querycopilot`; const authorizationHeader: AuthorizationTokenHeaderMetadata = getAuthorizationHeader();