From cdd6d329909101bef25a9bd7f64aa45ddececa8f Mon Sep 17 00:00:00 2001 From: Hardikkumar Nai <80053762+hardiknai-techm@users.noreply.github.com> Date: Thu, 22 Apr 2021 00:05:32 +0530 Subject: [PATCH] Rename index.tsx to {class name}.tsx (#689) * Rename index.tsx to {class name}.tsx * Update tests Co-authored-by: Steve Faulkner --- src/Common/Tooltip/{index.tsx => Tooltip.tsx} | 0 src/Common/Upload/{index.tsx => Upload.tsx} | 4 +-- src/Explorer/Explorer.tsx | 26 +++++++++---------- .../BrowseQueriesPane.test.tsx} | 6 ++--- .../BrowseQueriesPane.tsx} | 6 ++--- .../BrowseQueriesPane.test.tsx.snap} | 4 +-- src/Explorer/Panes/CopyNotebookPane.tsx | 21 ++++++++------- ...DeleteCollectionConfirmationPane.test.tsx} | 6 ++--- .../DeleteCollectionConfirmationPane.tsx} | 11 +++++--- ...eCollectionConfirmationPane.test.tsx.snap} | 4 +-- .../ExecuteSprocParamsPane.test.tsx} | 10 +++---- .../ExecuteSprocParamsPane.tsx} | 7 +++-- .../InputParameter.tsx | 0 .../ExecuteSprocParamsPane.test.tsx.snap} | 4 +-- ...ndex.tsx => GenericRightPaneComponent.tsx} | 0 .../LoadQueryPane.test.tsx} | 4 +-- .../LoadQueryPane.tsx} | 13 ++++++---- .../LoadQueryPane.test.tsx.snap} | 0 .../Panes/PublishNotebookPaneAdapter.tsx | 25 ++++++++++-------- .../SaveQueryPane.test.tsx} | 6 ++--- .../SaveQueryPane.tsx} | 11 +++++--- .../SaveQueryPane.test.tsx.snap} | 0 .../{index.test.tsx => SettingsPane.test.tsx} | 2 +- .../{index.tsx => SettingsPane.tsx} | 7 +++-- ...st.tsx.snap => SettingsPane.test.tsx.snap} | 0 .../Tables/TableQuerySelectPanel/index.tsx | 5 +++- .../{index.tsx => UploadFilePane.tsx} | 7 +++-- ...ndex.test.tsx => UploadItemsPane.test.tsx} | 2 +- .../{index.tsx => UploadItemsPane.tsx} | 7 +++-- ...tsx.snap => UploadItemsPane.test.tsx.snap} | 0 30 files changed, 114 insertions(+), 84 deletions(-) rename src/Common/Tooltip/{index.tsx => Tooltip.tsx} (100%) rename src/Common/Upload/{index.tsx => Upload.tsx} (95%) rename src/Explorer/Panes/{BrowseQueriesPanel/index.test.tsx => BrowseQueriesPane/BrowseQueriesPane.test.tsx} (83%) rename src/Explorer/Panes/{BrowseQueriesPanel/index.tsx => BrowseQueriesPane/BrowseQueriesPane.tsx} (93%) rename src/Explorer/Panes/{BrowseQueriesPanel/__snapshots__/index.test.tsx.snap => BrowseQueriesPane/__snapshots__/BrowseQueriesPane.test.tsx.snap} (97%) rename src/Explorer/Panes/{DeleteCollectionConfirmationPanel/index.test.tsx => DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.test.tsx} (96%) rename src/Explorer/Panes/{DeleteCollectionConfirmationPanel/index.tsx => DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.tsx} (94%) rename src/Explorer/Panes/{DeleteCollectionConfirmationPanel/__snapshots__/index.test.tsx.snap => DeleteCollectionConfirmationPane/__snapshots__/DeleteCollectionConfirmationPane.test.tsx.snap} (99%) rename src/Explorer/Panes/{ExecuteSprocParamsPanel/index.test.tsx => ExecuteSprocParamsPane/ExecuteSprocParamsPane.test.tsx} (74%) rename src/Explorer/Panes/{ExecuteSprocParamsPanel/index.tsx => ExecuteSprocParamsPane/ExecuteSprocParamsPane.tsx} (96%) rename src/Explorer/Panes/{ExecuteSprocParamsPanel => ExecuteSprocParamsPane}/InputParameter.tsx (100%) rename src/Explorer/Panes/{ExecuteSprocParamsPanel/__snapshots__/index.test.tsx.snap => ExecuteSprocParamsPane/__snapshots__/ExecuteSprocParamsPane.test.tsx.snap} (99%) rename src/Explorer/Panes/GenericRightPaneComponent/{index.tsx => GenericRightPaneComponent.tsx} (100%) rename src/Explorer/Panes/{LoadQueryPanel/index.test.tsx => LoadQueryPane/LoadQueryPane.test.tsx} (77%) rename src/Explorer/Panes/{LoadQueryPanel/index.tsx => LoadQueryPane/LoadQueryPane.tsx} (93%) rename src/Explorer/Panes/{LoadQueryPanel/__snapshots__/index.test.tsx.snap => LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap} (100%) rename src/Explorer/Panes/{SaveQueryPanel/index.test.tsx => SaveQueryPane/SaveQueryPane.test.tsx} (83%) rename src/Explorer/Panes/{SaveQueryPanel/index.tsx => SaveQueryPane/SaveQueryPane.tsx} (95%) rename src/Explorer/Panes/{SaveQueryPanel/__snapshots__/index.test.tsx.snap => SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap} (100%) rename src/Explorer/Panes/SettingsPane/{index.test.tsx => SettingsPane.test.tsx} (94%) rename src/Explorer/Panes/SettingsPane/{index.tsx => SettingsPane.tsx} (98%) rename src/Explorer/Panes/SettingsPane/__snapshots__/{index.test.tsx.snap => SettingsPane.test.tsx.snap} (100%) rename src/Explorer/Panes/UploadFilePane/{index.tsx => UploadFilePane.tsx} (95%) rename src/Explorer/Panes/UploadItemsPane/{index.test.tsx => UploadItemsPane.test.tsx} (87%) rename src/Explorer/Panes/UploadItemsPane/{index.tsx => UploadItemsPane.tsx} (95%) rename src/Explorer/Panes/UploadItemsPane/__snapshots__/{index.test.tsx.snap => UploadItemsPane.test.tsx.snap} (100%) diff --git a/src/Common/Tooltip/index.tsx b/src/Common/Tooltip/Tooltip.tsx similarity index 100% rename from src/Common/Tooltip/index.tsx rename to src/Common/Tooltip/Tooltip.tsx diff --git a/src/Common/Upload/index.tsx b/src/Common/Upload/Upload.tsx similarity index 95% rename from src/Common/Upload/index.tsx rename to src/Common/Upload/Upload.tsx index 6f0187bad..30cc6b51d 100644 --- a/src/Common/Upload/index.tsx +++ b/src/Common/Upload/Upload.tsx @@ -1,8 +1,8 @@ import { Image, Stack, TextField } from "office-ui-fabric-react"; import React, { ChangeEvent, FunctionComponent, KeyboardEvent, useRef, useState } from "react"; import FolderIcon from "../../../images/folder_16x16.svg"; -import * as Constants from "../../Common/Constants"; -import { Tooltip } from "../Tooltip"; +import * as Constants from "../Constants"; +import { Tooltip } from "../Tooltip/Tooltip"; interface UploadProps { label: string; diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index b1fa3035e..01a746934 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -50,24 +50,24 @@ import { NotebookUtil } from "./Notebook/NotebookUtil"; import AddCollectionPane from "./Panes/AddCollectionPane"; import { AddCollectionPanel } from "./Panes/AddCollectionPanel"; import AddDatabasePane from "./Panes/AddDatabasePane"; -import { BrowseQueriesPanel } from "./Panes/BrowseQueriesPanel"; +import { BrowseQueriesPane } from "./Panes/BrowseQueriesPane/BrowseQueriesPane"; import CassandraAddCollectionPane from "./Panes/CassandraAddCollectionPane"; import { ContextualPaneBase } from "./Panes/ContextualPaneBase"; -import { DeleteCollectionConfirmationPanel } from "./Panes/DeleteCollectionConfirmationPanel"; +import { DeleteCollectionConfirmationPane } from "./Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane"; import { DeleteDatabaseConfirmationPanel } from "./Panes/DeleteDatabaseConfirmationPanel"; -import { ExecuteSprocParamsPanel } from "./Panes/ExecuteSprocParamsPanel"; +import { ExecuteSprocParamsPane } from "./Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane"; import GraphStylingPane from "./Panes/GraphStylingPane"; -import { LoadQueryPanel } from "./Panes/LoadQueryPanel"; +import { LoadQueryPane } from "./Panes/LoadQueryPane/LoadQueryPane"; import NewVertexPane from "./Panes/NewVertexPane"; -import { SaveQueryPanel } from "./Panes/SaveQueryPanel"; -import { SettingsPane } from "./Panes/SettingsPane"; +import { SaveQueryPane } from "./Panes/SaveQueryPane/SaveQueryPane"; +import { SettingsPane } from "./Panes/SettingsPane/SettingsPane"; import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel"; import { StringInputPane } from "./Panes/StringInputPane"; import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel"; import EditTableEntityPane from "./Panes/Tables/EditTableEntityPane"; import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel"; -import { UploadFilePane } from "./Panes/UploadFilePane"; -import { UploadItemsPane } from "./Panes/UploadItemsPane"; +import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane"; +import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane"; import TableListViewModal from "./Tables/DataTable/TableEntityListViewModel"; import QueryViewModel from "./Tables/QueryBuilder/QueryViewModel"; import { CassandraAPIDataClient, TableDataClient, TablesAPIDataClient } from "./Tables/TableDataClient"; @@ -2179,7 +2179,7 @@ export default class Explorer { let collectionName = PricingUtils.getCollectionName(userContext.defaultExperience); this.openSidePanel( "Delete " + collectionName, - this.closeSidePanel()} @@ -2231,15 +2231,15 @@ export default class Explorer { } public openBrowseQueriesPanel(): void { - this.openSidePanel("Open Saved Queries", ); + this.openSidePanel("Open Saved Queries", ); } public openLoadQueryPanel(): void { - this.openSidePanel("Load Query", this.closeSidePanel()} />); + this.openSidePanel("Load Query", this.closeSidePanel()} />); } public openSaveQueryPanel(): void { - this.openSidePanel("Save Query", this.closeSidePanel()} />); + this.openSidePanel("Save Query", this.closeSidePanel()} />); } public openUploadFilePanel(parent?: NotebookContentItem): void { diff --git a/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx b/src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.test.tsx similarity index 83% rename from src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx rename to src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.test.tsx index 195aac75c..e052a6616 100644 --- a/src/Explorer/Panes/BrowseQueriesPanel/index.test.tsx +++ b/src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.test.tsx @@ -4,7 +4,7 @@ import React from "react"; import { QueriesClient } from "../../../Common/QueriesClient"; import { Query } from "../../../Contracts/DataModels"; import Explorer from "../../Explorer"; -import { BrowseQueriesPanel } from "./index"; +import { BrowseQueriesPane } from "./BrowseQueriesPane"; describe("Browse queries panel", () => { const fakeExplorer = {} as Explorer; @@ -19,12 +19,12 @@ describe("Browse queries panel", () => { }; it("Should render Default properly", () => { - const wrapper = mount(); + const wrapper = mount(); expect(wrapper).toMatchSnapshot(); }); it("Should show empty view when query is empty []", () => { - const wrapper = mount(); + const wrapper = mount(); expect(wrapper.exists("#emptyQueryBanner")).toBe(true); }); }); diff --git a/src/Explorer/Panes/BrowseQueriesPanel/index.tsx b/src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.tsx similarity index 93% rename from src/Explorer/Panes/BrowseQueriesPanel/index.tsx rename to src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.tsx index 83bf6480e..5ad4a036d 100644 --- a/src/Explorer/Panes/BrowseQueriesPanel/index.tsx +++ b/src/Explorer/Panes/BrowseQueriesPane/BrowseQueriesPane.tsx @@ -13,15 +13,15 @@ import { import Explorer from "../../Explorer"; import QueryTab from "../../Tabs/QueryTab"; -interface BrowseQueriesPanelProps { +interface BrowseQueriesPaneProps { explorer: Explorer; closePanel: () => void; } -export const BrowseQueriesPanel: FunctionComponent = ({ +export const BrowseQueriesPane: FunctionComponent = ({ explorer, closePanel, -}: BrowseQueriesPanelProps): JSX.Element => { +}: BrowseQueriesPaneProps): JSX.Element => { const loadSavedQuery = (savedQuery: Query): void => { const selectedCollection: Collection = explorer && explorer.findSelectedCollection(); if (!selectedCollection) { diff --git a/src/Explorer/Panes/BrowseQueriesPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/BrowseQueriesPane/__snapshots__/BrowseQueriesPane.test.tsx.snap similarity index 97% rename from src/Explorer/Panes/BrowseQueriesPanel/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/BrowseQueriesPane/__snapshots__/BrowseQueriesPane.test.tsx.snap index 488ad5cf4..eed894482 100644 --- a/src/Explorer/Panes/BrowseQueriesPanel/__snapshots__/index.test.tsx.snap +++ b/src/Explorer/Panes/BrowseQueriesPane/__snapshots__/BrowseQueriesPane.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Browse queries panel Should render Default properly 1`] = ` - - + `; diff --git a/src/Explorer/Panes/CopyNotebookPane.tsx b/src/Explorer/Panes/CopyNotebookPane.tsx index 8cc0cdafb..a5b429aa7 100644 --- a/src/Explorer/Panes/CopyNotebookPane.tsx +++ b/src/Explorer/Panes/CopyNotebookPane.tsx @@ -1,18 +1,21 @@ import ko from "knockout"; +import { IDropdownOption } from "office-ui-fabric-react"; import * as React from "react"; import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; -import { JunoClient, IPinnedRepo } from "../../Juno/JunoClient"; +import { HttpStatusCodes } from "../../Common/Constants"; +import { getErrorMessage, handleError } from "../../Common/ErrorHandlingUtils"; +import { GitHubOAuthService } from "../../GitHub/GitHubOAuthService"; +import { IPinnedRepo, JunoClient } from "../../Juno/JunoClient"; +import * as GitHubUtils from "../../Utils/GitHubUtils"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; import Explorer from "../Explorer"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "./GenericRightPaneComponent"; -import { CopyNotebookPaneComponent, CopyNotebookPaneProps } from "./CopyNotebookPaneComponent"; -import { IDropdownOption } from "office-ui-fabric-react"; -import { GitHubOAuthService } from "../../GitHub/GitHubOAuthService"; -import { HttpStatusCodes } from "../../Common/Constants"; -import * as GitHubUtils from "../../Utils/GitHubUtils"; -import { NotebookContentItemType, NotebookContentItem } from "../Notebook/NotebookContentItem"; +import { NotebookContentItem, NotebookContentItemType } from "../Notebook/NotebookContentItem"; import { ResourceTreeAdapter } from "../Tree/ResourceTreeAdapter"; -import { handleError, getErrorMessage } from "../../Common/ErrorHandlingUtils"; +import { CopyNotebookPaneComponent, CopyNotebookPaneProps } from "./CopyNotebookPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "./GenericRightPaneComponent/GenericRightPaneComponent"; interface Location { type: "MyNotebooks" | "GitHub"; diff --git a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.test.tsx b/src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.test.tsx similarity index 96% rename from src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.test.tsx rename to src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.test.tsx index 224ffa89e..ec24e6089 100644 --- a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.test.tsx +++ b/src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.test.tsx @@ -3,7 +3,6 @@ jest.mock("../../../Shared/Telemetry/TelemetryProcessor"); import { mount, ReactWrapper, shallow } from "enzyme"; import * as ko from "knockout"; import React from "react"; -import { DeleteCollectionConfirmationPanel } from "."; import { deleteCollection } from "../../../Common/dataAccess/deleteCollection"; import DeleteFeedback from "../../../Common/DeleteFeedback"; import { ApiKind, DatabaseAccount } from "../../../Contracts/DataModels"; @@ -13,6 +12,7 @@ import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryCons import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor"; import { updateUserContext } from "../../../UserContext"; import Explorer from "../../Explorer"; +import { DeleteCollectionConfirmationPane } from "./DeleteCollectionConfirmationPane"; describe("Delete Collection Confirmation Pane", () => { describe("Explorer.isLastCollection()", () => { @@ -65,7 +65,7 @@ describe("Delete Collection Confirmation Pane", () => { closePanel: (): void => undefined, collectionName: "container", }; - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper.exists(".deleteCollectionFeedback")).toBe(true); props.explorer.isLastCollection = () => true; @@ -119,7 +119,7 @@ describe("Delete Collection Confirmation Pane", () => { closePanel: (): void => undefined, collectionName: "container", }; - wrapper = mount(); + wrapper = mount(); }); it("should call delete collection", () => { diff --git a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.tsx b/src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.tsx similarity index 94% rename from src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.tsx rename to src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.tsx index 0daca44fe..e6a10ff50 100644 --- a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/index.tsx +++ b/src/Explorer/Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane.tsx @@ -11,18 +11,21 @@ import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcesso import { userContext } from "../../../UserContext"; import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; -export interface DeleteCollectionConfirmationPanelProps { +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; +export interface DeleteCollectionConfirmationPaneProps { explorer: Explorer; collectionName: string; closePanel: () => void; } -export const DeleteCollectionConfirmationPanel: FunctionComponent = ({ +export const DeleteCollectionConfirmationPane: FunctionComponent = ({ explorer, closePanel, collectionName, -}: DeleteCollectionConfirmationPanelProps) => { +}: DeleteCollectionConfirmationPaneProps) => { const [deleteCollectionFeedback, setDeleteCollectionFeedback] = useState(""); const [inputCollectionName, setInputCollectionName] = useState(""); const [formError, setFormError] = useState(""); diff --git a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/DeleteCollectionConfirmationPane/__snapshots__/DeleteCollectionConfirmationPane.test.tsx.snap similarity index 99% rename from src/Explorer/Panes/DeleteCollectionConfirmationPanel/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/DeleteCollectionConfirmationPane/__snapshots__/DeleteCollectionConfirmationPane.test.tsx.snap index 5999c9b22..8d5985440 100644 --- a/src/Explorer/Panes/DeleteCollectionConfirmationPanel/__snapshots__/index.test.tsx.snap +++ b/src/Explorer/Panes/DeleteCollectionConfirmationPane/__snapshots__/DeleteCollectionConfirmationPane.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Delete Collection Confirmation Pane submit() should call delete collection 1`] = ` - - + `; diff --git a/src/Explorer/Panes/ExecuteSprocParamsPanel/index.test.tsx b/src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.test.tsx similarity index 74% rename from src/Explorer/Panes/ExecuteSprocParamsPanel/index.test.tsx rename to src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.test.tsx index 56dbdb336..571ccb65c 100644 --- a/src/Explorer/Panes/ExecuteSprocParamsPanel/index.test.tsx +++ b/src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.test.tsx @@ -2,7 +2,7 @@ import { mount } from "enzyme"; import React from "react"; import Explorer from "../../Explorer"; import StoredProcedure from "../../Tree/StoredProcedure"; -import { ExecuteSprocParamsPanel } from "./index"; +import { ExecuteSprocParamsPane } from "./ExecuteSprocParamsPane"; describe("Excute Sproc Param Pane", () => { const fakeExplorer = {} as Explorer; @@ -14,23 +14,23 @@ describe("Excute Sproc Param Pane", () => { }; it("should render Default properly", () => { - const wrapper = mount(); + const wrapper = mount(); expect(wrapper).toMatchSnapshot(); }); it("initially display 2 input field, 1 partition and 1 parameter", () => { - const wrapper = mount(); + const wrapper = mount(); expect(wrapper.find("input[type='text']")).toHaveLength(2); }); it("add a new parameter field", () => { - const wrapper = mount(); + const wrapper = mount(); wrapper.find("#addparam").last().simulate("click"); expect(wrapper.find("input[type='text']")).toHaveLength(3); }); it("remove a parameter field", () => { - const wrapper = mount(); + const wrapper = mount(); wrapper.find("#deleteparam").last().simulate("click"); expect(wrapper.find("input[type='text']")).toHaveLength(1); }); diff --git a/src/Explorer/Panes/ExecuteSprocParamsPanel/index.tsx b/src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.tsx similarity index 96% rename from src/Explorer/Panes/ExecuteSprocParamsPanel/index.tsx rename to src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.tsx index cd8a3334c..ab63e4fcb 100644 --- a/src/Explorer/Panes/ExecuteSprocParamsPanel/index.tsx +++ b/src/Explorer/Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane.tsx @@ -4,7 +4,10 @@ import React, { FunctionComponent, useState } from "react"; import AddPropertyIcon from "../../../../images/Add-property.svg"; import Explorer from "../../Explorer"; import StoredProcedure from "../../Tree/StoredProcedure"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; import { InputParameter } from "./InputParameter"; interface ExecuteSprocParamsPaneProps { @@ -23,7 +26,7 @@ interface UnwrappedExecuteSprocParam { text: string; } -export const ExecuteSprocParamsPanel: FunctionComponent = ({ +export const ExecuteSprocParamsPane: FunctionComponent = ({ explorer, storedProcedure, closePanel, diff --git a/src/Explorer/Panes/ExecuteSprocParamsPanel/InputParameter.tsx b/src/Explorer/Panes/ExecuteSprocParamsPane/InputParameter.tsx similarity index 100% rename from src/Explorer/Panes/ExecuteSprocParamsPanel/InputParameter.tsx rename to src/Explorer/Panes/ExecuteSprocParamsPane/InputParameter.tsx diff --git a/src/Explorer/Panes/ExecuteSprocParamsPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/ExecuteSprocParamsPane/__snapshots__/ExecuteSprocParamsPane.test.tsx.snap similarity index 99% rename from src/Explorer/Panes/ExecuteSprocParamsPanel/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/ExecuteSprocParamsPane/__snapshots__/ExecuteSprocParamsPane.test.tsx.snap index 9435e33e5..f0745e91f 100644 --- a/src/Explorer/Panes/ExecuteSprocParamsPanel/__snapshots__/index.test.tsx.snap +++ b/src/Explorer/Panes/ExecuteSprocParamsPane/__snapshots__/ExecuteSprocParamsPane.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Excute Sproc Param Pane should render Default properly 1`] = ` - - + `; diff --git a/src/Explorer/Panes/GenericRightPaneComponent/index.tsx b/src/Explorer/Panes/GenericRightPaneComponent/GenericRightPaneComponent.tsx similarity index 100% rename from src/Explorer/Panes/GenericRightPaneComponent/index.tsx rename to src/Explorer/Panes/GenericRightPaneComponent/GenericRightPaneComponent.tsx diff --git a/src/Explorer/Panes/LoadQueryPanel/index.test.tsx b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.test.tsx similarity index 77% rename from src/Explorer/Panes/LoadQueryPanel/index.test.tsx rename to src/Explorer/Panes/LoadQueryPane/LoadQueryPane.test.tsx index fbed0b672..71d1f7d3a 100644 --- a/src/Explorer/Panes/LoadQueryPanel/index.test.tsx +++ b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.test.tsx @@ -1,7 +1,7 @@ import { shallow } from "enzyme"; import React from "react"; import Explorer from "../../Explorer"; -import { LoadQueryPanel } from "./index"; +import { LoadQueryPane } from "./LoadQueryPane"; describe("Load Query Pane", () => { it("should render Default properly", () => { @@ -11,7 +11,7 @@ describe("Load Query Pane", () => { closePanel: (): void => undefined, }; - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); }); }); diff --git a/src/Explorer/Panes/LoadQueryPanel/index.tsx b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx similarity index 93% rename from src/Explorer/Panes/LoadQueryPanel/index.tsx rename to src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx index 0b2816c04..6a8fed727 100644 --- a/src/Explorer/Panes/LoadQueryPanel/index.tsx +++ b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx @@ -3,22 +3,25 @@ import { IImageProps, Image, ImageFit, Stack, TextField } from "office-ui-fabric import React, { FunctionComponent, useState } from "react"; import folderIcon from "../../../../images/folder_16x16.svg"; import { logError } from "../../../Common/Logger"; +import { Collection } from "../../../Contracts/ViewModels"; import { userContext } from "../../../UserContext"; import { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; import QueryTab from "../../Tabs/QueryTab"; -import { Collection } from "..//../../Contracts/ViewModels"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; -interface LoadQueryPanelProps { +interface LoadQueryPaneProps { explorer: Explorer; closePanel: () => void; } -export const LoadQueryPanel: FunctionComponent = ({ +export const LoadQueryPane: FunctionComponent = ({ explorer, closePanel, -}: LoadQueryPanelProps): JSX.Element => { +}: LoadQueryPaneProps): JSX.Element => { const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false); const [formError, setFormError] = useState(""); const [formErrorsDetails, setFormErrorsDetails] = useState(""); diff --git a/src/Explorer/Panes/LoadQueryPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap similarity index 100% rename from src/Explorer/Panes/LoadQueryPanel/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap diff --git a/src/Explorer/Panes/PublishNotebookPaneAdapter.tsx b/src/Explorer/Panes/PublishNotebookPaneAdapter.tsx index e6028b29e..ee7927d69 100644 --- a/src/Explorer/Panes/PublishNotebookPaneAdapter.tsx +++ b/src/Explorer/Panes/PublishNotebookPaneAdapter.tsx @@ -1,20 +1,23 @@ +import { toJS } from "@nteract/commutable"; +import { ImmutableNotebook } from "@nteract/commutable/src"; import ko from "knockout"; import * as React from "react"; import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; -import Explorer from "../Explorer"; -import { JunoClient } from "../../Juno/JunoClient"; -import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "./GenericRightPaneComponent"; -import { PublishNotebookPaneComponent, PublishNotebookPaneProps } from "./PublishNotebookPaneComponent"; -import { ImmutableNotebook } from "@nteract/commutable/src"; -import { toJS } from "@nteract/commutable"; -import { CodeOfConductComponent } from "../Controls/NotebookGallery/CodeOfConductComponent"; import { HttpStatusCodes } from "../../Common/Constants"; -import { handleError, getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; -import { GalleryTab } from "../Controls/NotebookGallery/GalleryViewerComponent"; -import { traceFailure, traceStart, traceSuccess } from "../../Shared/Telemetry/TelemetryProcessor"; +import { getErrorMessage, getErrorStack, handleError } from "../../Common/ErrorHandlingUtils"; +import { JunoClient } from "../../Juno/JunoClient"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; +import { traceFailure, traceStart, traceSuccess } from "../../Shared/Telemetry/TelemetryProcessor"; +import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; +import { CodeOfConductComponent } from "../Controls/NotebookGallery/CodeOfConductComponent"; +import { GalleryTab } from "../Controls/NotebookGallery/GalleryViewerComponent"; +import Explorer from "../Explorer"; import * as FileSystemUtil from "../Notebook/FileSystemUtil"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "./GenericRightPaneComponent/GenericRightPaneComponent"; +import { PublishNotebookPaneComponent, PublishNotebookPaneProps } from "./PublishNotebookPaneComponent"; export class PublishNotebookPaneAdapter implements ReactAdapter { parameters: ko.Observable; diff --git a/src/Explorer/Panes/SaveQueryPanel/index.test.tsx b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.test.tsx similarity index 83% rename from src/Explorer/Panes/SaveQueryPanel/index.test.tsx rename to src/Explorer/Panes/SaveQueryPane/SaveQueryPane.test.tsx index 85e928b54..8edacc4a0 100644 --- a/src/Explorer/Panes/SaveQueryPanel/index.test.tsx +++ b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.test.tsx @@ -2,7 +2,7 @@ import { shallow } from "enzyme"; import * as ko from "knockout"; import React from "react"; import Explorer from "../../Explorer"; -import { SaveQueryPanel } from "./index"; +import { SaveQueryPane } from "./SaveQueryPane"; describe("Save Query Pane", () => { const fakeExplorer = {} as Explorer; @@ -13,7 +13,7 @@ describe("Save Query Pane", () => { closePanel: (): void => undefined, }; - const wrapper = shallow(); + const wrapper = shallow(); it("should return true if can save Queries else false", () => { fakeExplorer.canSaveQueries = ko.computed(() => true); @@ -26,7 +26,7 @@ describe("Save Query Pane", () => { }); it("should render Default properly", () => { - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); }); }); diff --git a/src/Explorer/Panes/SaveQueryPanel/index.tsx b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx similarity index 95% rename from src/Explorer/Panes/SaveQueryPanel/index.tsx rename to src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx index a4e5bc559..949e9203f 100644 --- a/src/Explorer/Panes/SaveQueryPanel/index.tsx +++ b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx @@ -9,17 +9,20 @@ import { traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetr import { logConsoleError } from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; import QueryTab from "../../Tabs/QueryTab"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; -interface SaveQueryPanelProps { +interface SaveQueryPaneProps { explorer: Explorer; closePanel: () => void; } -export const SaveQueryPanel: FunctionComponent = ({ +export const SaveQueryPane: FunctionComponent = ({ explorer, closePanel, -}: SaveQueryPanelProps): JSX.Element => { +}: SaveQueryPaneProps): JSX.Element => { const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false); const [formError, setFormError] = useState(""); const [formErrorsDetails, setFormErrorsDetails] = useState(""); diff --git a/src/Explorer/Panes/SaveQueryPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap similarity index 100% rename from src/Explorer/Panes/SaveQueryPanel/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap diff --git a/src/Explorer/Panes/SettingsPane/index.test.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.test.tsx similarity index 94% rename from src/Explorer/Panes/SettingsPane/index.test.tsx rename to src/Explorer/Panes/SettingsPane/SettingsPane.test.tsx index a8959b2a3..6b601286c 100644 --- a/src/Explorer/Panes/SettingsPane/index.test.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.test.tsx @@ -1,9 +1,9 @@ import { shallow } from "enzyme"; import React from "react"; -import { SettingsPane } from "."; import { DatabaseAccount } from "../../../Contracts/DataModels"; import { updateUserContext } from "../../../UserContext"; import Explorer from "../../Explorer"; +import { SettingsPane } from "./SettingsPane"; const props = { explorer: new Explorer(), closePanel: (): void => undefined, diff --git a/src/Explorer/Panes/SettingsPane/index.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx similarity index 98% rename from src/Explorer/Panes/SettingsPane/index.tsx rename to src/Explorer/Panes/SettingsPane/SettingsPane.tsx index fa561dd19..02dfdd614 100644 --- a/src/Explorer/Panes/SettingsPane/index.tsx +++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx @@ -1,14 +1,17 @@ import { Checkbox, ChoiceGroup, IChoiceGroupOption, SpinButton } from "office-ui-fabric-react"; import React, { FunctionComponent, MouseEvent, useState } from "react"; import * as Constants from "../../../Common/Constants"; -import { Tooltip } from "../../../Common/Tooltip"; +import { Tooltip } from "../../../Common/Tooltip/Tooltip"; import { configContext } from "../../../ConfigContext"; import { LocalStorageUtility, StorageKey } from "../../../Shared/StorageUtility"; import * as StringUtility from "../../../Shared/StringUtility"; import { userContext } from "../../../UserContext"; import { logConsoleInfo } from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; export interface SettingsPaneProps { explorer: Explorer; diff --git a/src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap similarity index 100% rename from src/Explorer/Panes/SettingsPane/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap diff --git a/src/Explorer/Panes/Tables/TableQuerySelectPanel/index.tsx b/src/Explorer/Panes/Tables/TableQuerySelectPanel/index.tsx index 76a54db6c..52a0b65d5 100644 --- a/src/Explorer/Panes/Tables/TableQuerySelectPanel/index.tsx +++ b/src/Explorer/Panes/Tables/TableQuerySelectPanel/index.tsx @@ -4,7 +4,10 @@ import { userContext } from "../../../../UserContext"; import Explorer from "../../../Explorer"; import * as Constants from "../../../Tables/Constants"; import QueryViewModel from "../../../Tables/QueryBuilder/QueryViewModel"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../../GenericRightPaneComponent/GenericRightPaneComponent"; interface TableQuerySelectPanelProps { explorer: Explorer; diff --git a/src/Explorer/Panes/UploadFilePane/index.tsx b/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx similarity index 95% rename from src/Explorer/Panes/UploadFilePane/index.tsx rename to src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx index 68fd4b80e..70b66baea 100644 --- a/src/Explorer/Panes/UploadFilePane/index.tsx +++ b/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx @@ -1,9 +1,12 @@ import React, { ChangeEvent, FunctionComponent, useState } from "react"; -import { Upload } from "../../../Common/Upload"; +import { Upload } from "../../../Common/Upload/Upload"; import { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; import { NotebookContentItem } from "../../Notebook/NotebookContentItem"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; export interface UploadFilePanelProps { explorer: Explorer; diff --git a/src/Explorer/Panes/UploadItemsPane/index.test.tsx b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.test.tsx similarity index 87% rename from src/Explorer/Panes/UploadItemsPane/index.test.tsx rename to src/Explorer/Panes/UploadItemsPane/UploadItemsPane.test.tsx index cf6bbd3e8..e259b6ba5 100644 --- a/src/Explorer/Panes/UploadItemsPane/index.test.tsx +++ b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.test.tsx @@ -1,7 +1,7 @@ import { shallow } from "enzyme"; import React from "react"; -import { UploadItemsPane } from "."; import Explorer from "../../Explorer"; +import { UploadItemsPane } from "./UploadItemsPane"; const props = { explorer: new Explorer(), closePanel: (): void => undefined, diff --git a/src/Explorer/Panes/UploadItemsPane/index.tsx b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx similarity index 95% rename from src/Explorer/Panes/UploadItemsPane/index.tsx rename to src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx index 0ac55ec45..c2836ba3c 100644 --- a/src/Explorer/Panes/UploadItemsPane/index.tsx +++ b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx @@ -1,12 +1,15 @@ import { DetailsList, DetailsListLayoutMode, IColumn, SelectionMode } from "office-ui-fabric-react"; import React, { ChangeEvent, FunctionComponent, useState } from "react"; -import { Upload } from "../../../Common/Upload"; +import { Upload } from "../../../Common/Upload/Upload"; import { UploadDetailsRecord } from "../../../Contracts/ViewModels"; import { userContext } from "../../../UserContext"; import { logConsoleError } from "../../../Utils/NotificationConsoleUtils"; import Explorer from "../../Explorer"; import { getErrorMessage } from "../../Tables/Utilities"; -import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent"; +import { + GenericRightPaneComponent, + GenericRightPaneProps, +} from "../GenericRightPaneComponent/GenericRightPaneComponent"; export interface UploadItemsPaneProps { explorer: Explorer; diff --git a/src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap similarity index 100% rename from src/Explorer/Panes/UploadItemsPane/__snapshots__/index.test.tsx.snap rename to src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap