From 0f52db73e7ffe52f1331fb1fc87ac30bd7750cde Mon Sep 17 00:00:00 2001 From: Predrag Klepic <60631598+Klepic95@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:48:18 +0200 Subject: [PATCH] [Query Copilot] Fix failing comparison for CopilosSampleDB (#1581) * Fix failing comparison for CopilosSampleDB * using constant --------- Co-authored-by: Predrag Klepic --- src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx index 556b92210..e5c2823f4 100644 --- a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx +++ b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx @@ -1,7 +1,6 @@ import { FeedOptions } from "@azure/cosmos"; import { QueryCopilotSidebar } from "Explorer/QueryCopilot/V2/Sidebar/QueryCopilotSidebar"; import { QueryResultSection } from "Explorer/Tabs/QueryTab/QueryResultSection"; -import { useDatabases } from "Explorer/useDatabases"; import { QueryCopilotState, useQueryCopilot } from "hooks/useQueryCopilot"; import React, { Fragment } from "react"; import SplitterLayout from "react-splitter-layout"; @@ -9,7 +8,7 @@ import "react-splitter-layout/lib/index.css"; import LaunchCopilot from "../../../../images/CopilotTabIcon.svg"; import ExecuteQueryIcon from "../../../../images/ExecuteQuery.svg"; import SaveQueryIcon from "../../../../images/save-cosmos.svg"; -import { NormalizedEventKey } from "../../../Common/Constants"; +import { NormalizedEventKey, QueryCopilotSampleDatabaseId } from "../../../Common/Constants"; import { getErrorMessage } from "../../../Common/ErrorHandlingUtils"; import * as HeadersUtility from "../../../Common/HeadersUtility"; import { MinimalQueryIterator } from "../../../Common/IteratorUtilities"; @@ -77,7 +76,6 @@ interface IQueryTabStates { isExecutionError: boolean; isExecuting: boolean; showCopilotSidebar: boolean; - isCopilotTabActive: boolean; } export default class QueryTabComponent extends React.Component { @@ -88,6 +86,7 @@ export default class QueryTabComponent extends React.Component 0, @@ -136,7 +134,7 @@ export default class QueryTabComponent extends React.Component {this.getEditorAndQueryResult()} - {this.state.showCopilotSidebar && this.state.isCopilotTabActive && ( + {this.state.showCopilotSidebar && this.isCopilotTabActive && (