diff --git a/src/Explorer/ContextMenuButtonFactory.tsx b/src/Explorer/ContextMenuButtonFactory.tsx index 2439a1691..fbd25ae74 100644 --- a/src/Explorer/ContextMenuButtonFactory.tsx +++ b/src/Explorer/ContextMenuButtonFactory.tsx @@ -141,14 +141,12 @@ export const createCollectionContextMenuButton = ( return items; }; -export const createSampleCollectionContextMenuButton = ( - selectedCollection: ViewModels.CollectionBase -): TreeNodeMenuItem[] => { +export const createSampleCollectionContextMenuButton = (): TreeNodeMenuItem[] => { const items: TreeNodeMenuItem[] = []; if (userContext.apiType === "SQL") { items.push({ iconSrc: AddSqlQueryIcon, - onClick: () => selectedCollection && useTabs.getState().openAndActivateReactTab(ReactTabKind.QueryCopilot), + onClick: () => useTabs.getState().openAndActivateReactTab(ReactTabKind.QueryCopilot), label: "New SQL Query", }); } diff --git a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx index d7dced7a8..5120d595c 100644 --- a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx @@ -2,12 +2,12 @@ import { Checkbox, ChoiceGroup, IChoiceGroupOption, SpinButton } from "@fluentui import * as Constants from "Common/Constants"; import { InfoTooltip } from "Common/Tooltip/InfoTooltip"; import { configContext } from "ConfigContext"; -import { useSidePanel } from "hooks/useSidePanel"; -import React, { FunctionComponent, MouseEvent, useState } from "react"; import { LocalStorageUtility, StorageKey } from "Shared/StorageUtility"; import * as StringUtility from "Shared/StringUtility"; import { userContext } from "UserContext"; import { logConsoleInfo } from "Utils/NotificationConsoleUtils"; +import { useSidePanel } from "hooks/useSidePanel"; +import React, { FunctionComponent, MouseEvent, useState } from "react"; import { RightPaneForm, RightPaneFormProps } from "../RightPaneForm/RightPaneForm"; export const SettingsPane: FunctionComponent = () => { @@ -29,7 +29,7 @@ export const SettingsPane: FunctionComponent = () => { const [crossPartitionQueryEnabled, setCrossPartitionQueryEnabled] = useState( LocalStorageUtility.hasItem(StorageKey.IsCrossPartitionQueryEnabled) ? LocalStorageUtility.getEntryString(StorageKey.IsCrossPartitionQueryEnabled) === "true" - : true + : false ); const [graphAutoVizDisabled, setGraphAutoVizDisabled] = useState( LocalStorageUtility.hasItem(StorageKey.IsGraphAutoVizDisabled) diff --git a/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap b/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap index ffa847681..14837845b 100644 --- a/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap +++ b/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap @@ -142,7 +142,7 @@ exports[`Settings Pane should render Default properly 1`] = ` return ( <> - ( @@ -110,7 +109,6 @@ export const WelcomeModal = ({ visible }: { visible: boolean }): JSX.Element => - ) ); }; diff --git a/src/Explorer/QueryCopilot/QueryCopilotTab.tsx b/src/Explorer/QueryCopilot/QueryCopilotTab.tsx index dd9574b3b..594d3d1b2 100644 --- a/src/Explorer/QueryCopilot/QueryCopilotTab.tsx +++ b/src/Explorer/QueryCopilot/QueryCopilotTab.tsx @@ -294,6 +294,7 @@ export const QueryCopilotTab: React.FC = ({ generateSQLQuery(); } showTeachingBubble(); + useTabs.getState().setIsQueryErrorThrown(false); }, []); return ( @@ -447,19 +448,17 @@ export const QueryCopilotTab: React.FC = ({ Read preview terms - {showErrorMessageBar ? ( + {showErrorMessageBar && ( We ran into an error and were not able to execute query. Please try again after sometime - ) : ( - <> )} - {showFeedbackBar ? ( + {showFeedbackBar && ( Provide feedback on the query generated {showCallout && !hideFeedbackModalForLikedQueries && ( @@ -527,8 +526,6 @@ export const QueryCopilotTab: React.FC = ({ Delete code - ) : ( - <> )} @@ -552,9 +549,9 @@ export const QueryCopilotTab: React.FC = ({ /> - - {isSamplePromptsOpen ? : <>} - {query !== "" && query.trim().length !== 0 ? ( + + {isSamplePromptsOpen && } + {query !== "" && query.trim().length !== 0 && ( = ({ clearFeedback={resetButtonState} showFeedbackBar={setShowFeedbackBar} /> - ) : ( - <> )} diff --git a/src/Explorer/Tree/SampleDataTree.tsx b/src/Explorer/Tree/SampleDataTree.tsx index ca9a76cd3..0036164c5 100644 --- a/src/Explorer/Tree/SampleDataTree.tsx +++ b/src/Explorer/Tree/SampleDataTree.tsx @@ -29,9 +29,7 @@ export const SampleDataTree = ({ iconSrc: CollectionIcon, isExpanded: false, className: "dataResourceTree", - contextMenu: ResourceTreeContextMenuButtonFactory.createSampleCollectionContextMenuButton( - sampleDataResourceTokenCollection - ), + contextMenu: ResourceTreeContextMenuButtonFactory.createSampleCollectionContextMenuButton(), onClick: () => { // Rewritten version of expandCollapseCollection useSelectedNode.getState().setSelectedNode(sampleDataResourceTokenCollection);