From 959d34d88d2250b60fee61532fe9b07719f32754 Mon Sep 17 00:00:00 2001 From: Hardikkumar Nai <80053762+hardiknai-techm@users.noreply.github.com> Date: Fri, 11 Jun 2021 10:11:24 +0530 Subject: [PATCH] Remove Explorer.openCassandraAddCollectionPane (#888) --- src/Explorer/Explorer.tsx | 15 ++++++--------- src/Explorer/OpenActions/OpenActions.tsx | 9 ++++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index d0b1e7f4e..73c37510a 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -1378,7 +1378,12 @@ export default class Explorer { public onNewCollectionClicked(databaseId?: string): void { if (userContext.apiType === "Cassandra") { - this.openCassandraAddCollectionPane(); + useSidePanel + .getState() + .openSidePanel( + "Add Table", + + ); } else { this.openAddCollectionPanel(databaseId); } @@ -1503,14 +1508,6 @@ export default class Explorer { ); } - public openCassandraAddCollectionPane(): void { - useSidePanel - .getState() - .openSidePanel( - "Add Table", - - ); - } public openGitHubReposPanel(header: string, junoClient?: JunoClient): void { useSidePanel .getState() diff --git a/src/Explorer/OpenActions/OpenActions.tsx b/src/Explorer/OpenActions/OpenActions.tsx index 6c4b54b9e..ff17adf21 100644 --- a/src/Explorer/OpenActions/OpenActions.tsx +++ b/src/Explorer/OpenActions/OpenActions.tsx @@ -4,7 +4,9 @@ import { ActionContracts } from "../../Contracts/ExplorerContracts"; import * as ViewModels from "../../Contracts/ViewModels"; import { useSidePanel } from "../../hooks/useSidePanel"; import Explorer from "../Explorer"; +import { CassandraAddCollectionPane } from "../Panes/CassandraAddCollectionPane/CassandraAddCollectionPane"; import { SettingsPane } from "../Panes/SettingsPane/SettingsPane"; +import { CassandraAPIDataClient } from "../Tables/TableDataClient"; function generateQueryText(action: ActionContracts.OpenQueryTab, partitionKeyProperty: string): string { if (!action.query) { @@ -142,7 +144,12 @@ function openPane(action: ActionContracts.OpenPane, explorer: Explorer) { action.paneKind === ActionContracts.PaneKind.CassandraAddCollection || action.paneKind === ActionContracts.PaneKind[ActionContracts.PaneKind.CassandraAddCollection] ) { - explorer.openCassandraAddCollectionPane(); + useSidePanel + .getState() + .openSidePanel( + "Add Table", + + ); } else if ( action.paneKind === ActionContracts.PaneKind.GlobalSettings || action.paneKind === ActionContracts.PaneKind[ActionContracts.PaneKind.GlobalSettings]