mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Move tabs state out into React (#621)
This PR is just about moving the tabs array. I'm hoping to let it bake for a bit before merging the rest of the tabs in react work. Preview here: https://ms.portal.azure.com/?dataExplorerSource=https%3A%2F%2Fcosmos-explorer-preview.azurewebsites.net%2Fcommit%2Fda809beb82bb54dc82da18eda41caaf7b9b6597f%2Fexplorer.html#@microsoft.onmicrosoft.com/resource/subscriptions/b9c77f10-b438-4c32-9819-eef8a654e478/resourceGroups/stfaul/providers/Microsoft.DocumentDb/databaseAccounts/stfaul-sql/dataExplorer
This commit is contained in:
10
src/Main.tsx
10
src/Main.tsx
@@ -53,6 +53,7 @@ import "./Explorer/Tabs/QueryTab.less";
|
||||
import { useConfig } from "./hooks/useConfig";
|
||||
import { useKnockoutExplorer } from "./hooks/useKnockoutExplorer";
|
||||
import { useSidePanel } from "./hooks/useSidePanel";
|
||||
import { useTabs } from "./hooks/useTabs";
|
||||
import { KOCommentEnd, KOCommentIfStart } from "./koComment";
|
||||
import "./Libs/jquery";
|
||||
import "./Shared/appInsights";
|
||||
@@ -78,6 +79,7 @@ const App: React.FunctionComponent = () => {
|
||||
};
|
||||
|
||||
const { isPanelOpen, panelContent, headerText, openSidePanel, closeSidePanel } = useSidePanel();
|
||||
const { tabs, tabsManager } = useTabs();
|
||||
|
||||
const explorerParams: ExplorerParams = {
|
||||
setIsNotificationConsoleExpanded,
|
||||
@@ -87,7 +89,9 @@ const App: React.FunctionComponent = () => {
|
||||
closeSidePanel,
|
||||
openDialog,
|
||||
closeDialog,
|
||||
tabsManager,
|
||||
};
|
||||
|
||||
const config = useConfig();
|
||||
const explorer = useKnockoutExplorer(config?.platform, explorerParams);
|
||||
|
||||
@@ -200,11 +204,7 @@ const App: React.FunctionComponent = () => {
|
||||
{/* Splitter - End */}
|
||||
</div>
|
||||
{/* Collections Tree - End */}
|
||||
<div className="connectExplorerContainer" data-bind="visible: tabsManager.openedTabs().length === 0">
|
||||
<form className="connectExplorerFormContainer">
|
||||
<SplashScreen explorer={explorer} />
|
||||
</form>
|
||||
</div>
|
||||
{tabs.length === 0 && <SplashScreen explorer={explorer} />}
|
||||
<div className="tabsManagerContainer" data-bind='component: { name: "tabs-manager", params: tabsManager }' />
|
||||
</div>
|
||||
{/* Collections Tree and Tabs - End */}
|
||||
|
||||
Reference in New Issue
Block a user