From bd47e5ed49dcf44ff166bbeeceefc9418767cc5f Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Wed, 5 May 2021 17:35:35 -0500 Subject: [PATCH] Remove unused Explorer methods (#750) --- .../SettingsComponent.test.tsx.snap | 24 ----------- src/Explorer/Explorer.tsx | 40 +------------------ .../GitHubReposPanel.test.tsx.snap | 6 --- .../StringInputPane.test.tsx.snap | 6 --- ...eteDatabaseConfirmationPanel.test.tsx.snap | 6 --- 5 files changed, 1 insertion(+), 81 deletions(-) diff --git a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap index 7239097c6..8a6cbcf72 100644 --- a/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap +++ b/src/Explorer/Controls/Settings/__snapshots__/SettingsComponent.test.tsx.snap @@ -399,8 +399,6 @@ exports[`SettingsComponent renders 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -1223,7 +1221,6 @@ exports[`SettingsComponent renders 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -1239,14 +1236,12 @@ exports[`SettingsComponent renders 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -1270,7 +1265,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { @@ -1681,8 +1675,6 @@ exports[`SettingsComponent renders 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -2505,7 +2497,6 @@ exports[`SettingsComponent renders 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -2521,14 +2512,12 @@ exports[`SettingsComponent renders 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -2552,7 +2541,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { @@ -2976,8 +2964,6 @@ exports[`SettingsComponent renders 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -3800,7 +3786,6 @@ exports[`SettingsComponent renders 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -3816,14 +3801,12 @@ exports[`SettingsComponent renders 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -3847,7 +3830,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { @@ -4258,8 +4240,6 @@ exports[`SettingsComponent renders 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -5082,7 +5062,6 @@ exports[`SettingsComponent renders 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -5098,14 +5077,12 @@ exports[`SettingsComponent renders 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -5129,7 +5106,6 @@ exports[`SettingsComponent renders 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 408c8466f..1f1ecace4 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -12,7 +12,7 @@ import { readCollection } from "../Common/dataAccess/readCollection"; import { readDatabases } from "../Common/dataAccess/readDatabases"; import { getErrorMessage, getErrorStack, handleError } from "../Common/ErrorHandlingUtils"; import * as Logger from "../Common/Logger"; -import { sendCachedDataMessage, sendMessage } from "../Common/MessageHandler"; +import { sendCachedDataMessage } from "../Common/MessageHandler"; import { QueriesClient } from "../Common/QueriesClient"; import { Splitter, SplitterBounds, SplitterDirection } from "../Common/Splitter"; import { configContext, Platform } from "../ConfigContext"; @@ -161,7 +161,6 @@ export default class Explorer { // features public isPublishNotebookPaneEnabled: ko.Observable; public isHostedDataExplorerEnabled: ko.Computed; - public isRightPanelV2Enabled: ko.Computed; public isMongoIndexingEnabled: ko.Observable; public canExceedMaximumValue: ko.Computed; public isAutoscaleDefaultEnabled: ko.Observable; @@ -386,7 +385,6 @@ export default class Explorer { !this.isRunningOnNationalCloud() && userContext.apiType !== "Gremlin" ); - this.isRightPanelV2Enabled = ko.computed(() => userContext.features.enableRightPanelV2); this.selectedDatabaseId = ko.computed(() => { const selectedNode = this.selectedNode(); if (!selectedNode) { @@ -709,10 +707,6 @@ export default class Explorer { this.setIsNotificationConsoleExpanded(true); } - public collapseConsole(): void { - this.setIsNotificationConsoleExpanded(false); - } - public toggleLeftPaneExpanded() { this.isLeftPaneExpanded(!this.isLeftPaneExpanded()); @@ -1127,38 +1121,6 @@ export default class Explorer { this.commandBarComponentAdapter.onUpdateTabsButtons(buttons); } - public signInAad = () => { - TelemetryProcessor.trace(Action.SignInAad, undefined, { area: "Explorer" }); - sendMessage({ - type: MessageTypes.AadSignIn, - }); - }; - - public onSwitchToConnectionString = () => { - $("#connectWithAad").hide(); - $("#connectWithConnectionString").show(); - }; - - public clickHostedAccountSwitch = () => { - sendMessage({ - type: MessageTypes.UpdateAccountSwitch, - click: true, - }); - }; - - public clickHostedDirectorySwitch = () => { - sendMessage({ - type: MessageTypes.UpdateDirectoryControl, - click: true, - }); - }; - - public refreshDatabaseAccount = () => { - sendMessage({ - type: MessageTypes.RefreshDatabaseAccount, - }); - }; - private refreshAndExpandNewDatabases(newDatabases: ViewModels.Database[]): Q.Promise { // we reload collections for all databases so the resource tree reflects any collection-level changes // i.e addition of stored procedures, etc. diff --git a/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap index a28795479..233653711 100644 --- a/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap +++ b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap @@ -388,8 +388,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -1212,7 +1210,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -1228,14 +1225,12 @@ exports[`GitHub Repos Panel should render Default properly 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -1259,7 +1254,6 @@ exports[`GitHub Repos Panel should render Default properly 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { diff --git a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap index 152a6c726..4bcb29364 100644 --- a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap +++ b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap @@ -378,8 +378,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = ` "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -1202,7 +1200,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = ` "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isServerlessEnabled": [Function], "isSparkEnabled": [Function], @@ -1218,14 +1215,12 @@ exports[`StringInput Pane should render Create new directory properly 1`] = ` "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], "queriesClient": QueriesClient { "container": [Circular], }, - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -1249,7 +1244,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = ` "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object { diff --git a/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap b/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap index 34b31c072..7fc867e67 100644 --- a/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap +++ b/src/Explorer/Panes/__snapshots__/DeleteDatabaseConfirmationPanel.test.tsx.snap @@ -376,8 +376,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "userTableQuery": [Function], "visible": [Function], }, - "clickHostedAccountSwitch": [Function], - "clickHostedDirectorySwitch": [Function], "closeDialog": undefined, "closeSidePanel": undefined, "collapsedResourceTreeWidth": 36, @@ -1202,7 +1200,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "isNotebooksEnabledForAccount": [Function], "isPublishNotebookPaneEnabled": [Function], "isResourceTokenCollectionNodeSelected": [Function], - "isRightPanelV2Enabled": [Function], "isSchemaEnabled": [Function], "isSelectedDatabaseShared": [Function], "isServerlessEnabled": [Function], @@ -1219,7 +1216,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "onGitHubClientError": [Function], "onRefreshDatabasesKeyPress": [Function], "onRefreshResourcesClick": [Function], - "onSwitchToConnectionString": [Function], "openDialog": undefined, "openSidePanel": undefined, "provideFeedbackEmail": [Function], @@ -1227,7 +1223,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "container": [Circular], }, "refreshAllDatabases": [Function], - "refreshDatabaseAccount": [Function], "refreshNotebookList": [Function], "refreshTreeTitle": [Function], "resourceTokenCollection": [Function], @@ -1251,7 +1246,6 @@ exports[`Delete Database Confirmation Pane submit() Should call delete database "setInProgressConsoleDataIdToBeDeleted": undefined, "setIsNotificationConsoleExpanded": undefined, "setNotificationConsoleData": undefined, - "signInAad": [Function], "sparkClusterConnectionInfo": [Function], "splitter": Splitter { "bounds": Object {