mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Rename index.tsx to {class name}.tsx (#689)
* Rename index.tsx to {class name}.tsx * Update tests Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
parent
c1dcd0e90b
commit
cdd6d32990
@ -1,8 +1,8 @@
|
|||||||
import { Image, Stack, TextField } from "office-ui-fabric-react";
|
import { Image, Stack, TextField } from "office-ui-fabric-react";
|
||||||
import React, { ChangeEvent, FunctionComponent, KeyboardEvent, useRef, useState } from "react";
|
import React, { ChangeEvent, FunctionComponent, KeyboardEvent, useRef, useState } from "react";
|
||||||
import FolderIcon from "../../../images/folder_16x16.svg";
|
import FolderIcon from "../../../images/folder_16x16.svg";
|
||||||
import * as Constants from "../../Common/Constants";
|
import * as Constants from "../Constants";
|
||||||
import { Tooltip } from "../Tooltip";
|
import { Tooltip } from "../Tooltip/Tooltip";
|
||||||
|
|
||||||
interface UploadProps {
|
interface UploadProps {
|
||||||
label: string;
|
label: string;
|
@ -50,24 +50,24 @@ import { NotebookUtil } from "./Notebook/NotebookUtil";
|
|||||||
import AddCollectionPane from "./Panes/AddCollectionPane";
|
import AddCollectionPane from "./Panes/AddCollectionPane";
|
||||||
import { AddCollectionPanel } from "./Panes/AddCollectionPanel";
|
import { AddCollectionPanel } from "./Panes/AddCollectionPanel";
|
||||||
import AddDatabasePane from "./Panes/AddDatabasePane";
|
import AddDatabasePane from "./Panes/AddDatabasePane";
|
||||||
import { BrowseQueriesPanel } from "./Panes/BrowseQueriesPanel";
|
import { BrowseQueriesPane } from "./Panes/BrowseQueriesPane/BrowseQueriesPane";
|
||||||
import CassandraAddCollectionPane from "./Panes/CassandraAddCollectionPane";
|
import CassandraAddCollectionPane from "./Panes/CassandraAddCollectionPane";
|
||||||
import { ContextualPaneBase } from "./Panes/ContextualPaneBase";
|
import { ContextualPaneBase } from "./Panes/ContextualPaneBase";
|
||||||
import { DeleteCollectionConfirmationPanel } from "./Panes/DeleteCollectionConfirmationPanel";
|
import { DeleteCollectionConfirmationPane } from "./Panes/DeleteCollectionConfirmationPane/DeleteCollectionConfirmationPane";
|
||||||
import { DeleteDatabaseConfirmationPanel } from "./Panes/DeleteDatabaseConfirmationPanel";
|
import { DeleteDatabaseConfirmationPanel } from "./Panes/DeleteDatabaseConfirmationPanel";
|
||||||
import { ExecuteSprocParamsPanel } from "./Panes/ExecuteSprocParamsPanel";
|
import { ExecuteSprocParamsPane } from "./Panes/ExecuteSprocParamsPane/ExecuteSprocParamsPane";
|
||||||
import GraphStylingPane from "./Panes/GraphStylingPane";
|
import GraphStylingPane from "./Panes/GraphStylingPane";
|
||||||
import { LoadQueryPanel } from "./Panes/LoadQueryPanel";
|
import { LoadQueryPane } from "./Panes/LoadQueryPane/LoadQueryPane";
|
||||||
import NewVertexPane from "./Panes/NewVertexPane";
|
import NewVertexPane from "./Panes/NewVertexPane";
|
||||||
import { SaveQueryPanel } from "./Panes/SaveQueryPanel";
|
import { SaveQueryPane } from "./Panes/SaveQueryPane/SaveQueryPane";
|
||||||
import { SettingsPane } from "./Panes/SettingsPane";
|
import { SettingsPane } from "./Panes/SettingsPane/SettingsPane";
|
||||||
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
||||||
import { StringInputPane } from "./Panes/StringInputPane";
|
import { StringInputPane } from "./Panes/StringInputPane";
|
||||||
import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel";
|
import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel";
|
||||||
import EditTableEntityPane from "./Panes/Tables/EditTableEntityPane";
|
import EditTableEntityPane from "./Panes/Tables/EditTableEntityPane";
|
||||||
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel";
|
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel";
|
||||||
import { UploadFilePane } from "./Panes/UploadFilePane";
|
import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane";
|
||||||
import { UploadItemsPane } from "./Panes/UploadItemsPane";
|
import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane";
|
||||||
import TableListViewModal from "./Tables/DataTable/TableEntityListViewModel";
|
import TableListViewModal from "./Tables/DataTable/TableEntityListViewModel";
|
||||||
import QueryViewModel from "./Tables/QueryBuilder/QueryViewModel";
|
import QueryViewModel from "./Tables/QueryBuilder/QueryViewModel";
|
||||||
import { CassandraAPIDataClient, TableDataClient, TablesAPIDataClient } from "./Tables/TableDataClient";
|
import { CassandraAPIDataClient, TableDataClient, TablesAPIDataClient } from "./Tables/TableDataClient";
|
||||||
@ -2179,7 +2179,7 @@ export default class Explorer {
|
|||||||
let collectionName = PricingUtils.getCollectionName(userContext.defaultExperience);
|
let collectionName = PricingUtils.getCollectionName(userContext.defaultExperience);
|
||||||
this.openSidePanel(
|
this.openSidePanel(
|
||||||
"Delete " + collectionName,
|
"Delete " + collectionName,
|
||||||
<DeleteCollectionConfirmationPanel
|
<DeleteCollectionConfirmationPane
|
||||||
explorer={this}
|
explorer={this}
|
||||||
collectionName={collectionName}
|
collectionName={collectionName}
|
||||||
closePanel={this.closeSidePanel}
|
closePanel={this.closeSidePanel}
|
||||||
@ -2210,7 +2210,7 @@ export default class Explorer {
|
|||||||
public openExecuteSprocParamsPanel(storedProcedure: StoredProcedure): void {
|
public openExecuteSprocParamsPanel(storedProcedure: StoredProcedure): void {
|
||||||
this.openSidePanel(
|
this.openSidePanel(
|
||||||
"Input parameters",
|
"Input parameters",
|
||||||
<ExecuteSprocParamsPanel
|
<ExecuteSprocParamsPane
|
||||||
explorer={this}
|
explorer={this}
|
||||||
storedProcedure={storedProcedure}
|
storedProcedure={storedProcedure}
|
||||||
closePanel={() => this.closeSidePanel()}
|
closePanel={() => this.closeSidePanel()}
|
||||||
@ -2231,15 +2231,15 @@ export default class Explorer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public openBrowseQueriesPanel(): void {
|
public openBrowseQueriesPanel(): void {
|
||||||
this.openSidePanel("Open Saved Queries", <BrowseQueriesPanel explorer={this} closePanel={this.closeSidePanel} />);
|
this.openSidePanel("Open Saved Queries", <BrowseQueriesPane explorer={this} closePanel={this.closeSidePanel} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openLoadQueryPanel(): void {
|
public openLoadQueryPanel(): void {
|
||||||
this.openSidePanel("Load Query", <LoadQueryPanel explorer={this} closePanel={() => this.closeSidePanel()} />);
|
this.openSidePanel("Load Query", <LoadQueryPane explorer={this} closePanel={() => this.closeSidePanel()} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openSaveQueryPanel(): void {
|
public openSaveQueryPanel(): void {
|
||||||
this.openSidePanel("Save Query", <SaveQueryPanel explorer={this} closePanel={() => this.closeSidePanel()} />);
|
this.openSidePanel("Save Query", <SaveQueryPane explorer={this} closePanel={() => this.closeSidePanel()} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openUploadFilePanel(parent?: NotebookContentItem): void {
|
public openUploadFilePanel(parent?: NotebookContentItem): void {
|
||||||
|
@ -4,7 +4,7 @@ import React from "react";
|
|||||||
import { QueriesClient } from "../../../Common/QueriesClient";
|
import { QueriesClient } from "../../../Common/QueriesClient";
|
||||||
import { Query } from "../../../Contracts/DataModels";
|
import { Query } from "../../../Contracts/DataModels";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { BrowseQueriesPanel } from "./index";
|
import { BrowseQueriesPane } from "./BrowseQueriesPane";
|
||||||
|
|
||||||
describe("Browse queries panel", () => {
|
describe("Browse queries panel", () => {
|
||||||
const fakeExplorer = {} as Explorer;
|
const fakeExplorer = {} as Explorer;
|
||||||
@ -19,12 +19,12 @@ describe("Browse queries panel", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
it("Should render Default properly", () => {
|
it("Should render Default properly", () => {
|
||||||
const wrapper = mount(<BrowseQueriesPanel {...props} />);
|
const wrapper = mount(<BrowseQueriesPane {...props} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should show empty view when query is empty []", () => {
|
it("Should show empty view when query is empty []", () => {
|
||||||
const wrapper = mount(<BrowseQueriesPanel {...props} />);
|
const wrapper = mount(<BrowseQueriesPane {...props} />);
|
||||||
expect(wrapper.exists("#emptyQueryBanner")).toBe(true);
|
expect(wrapper.exists("#emptyQueryBanner")).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -13,15 +13,15 @@ import {
|
|||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import QueryTab from "../../Tabs/QueryTab";
|
import QueryTab from "../../Tabs/QueryTab";
|
||||||
|
|
||||||
interface BrowseQueriesPanelProps {
|
interface BrowseQueriesPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
closePanel: () => void;
|
closePanel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BrowseQueriesPanel: FunctionComponent<BrowseQueriesPanelProps> = ({
|
export const BrowseQueriesPane: FunctionComponent<BrowseQueriesPaneProps> = ({
|
||||||
explorer,
|
explorer,
|
||||||
closePanel,
|
closePanel,
|
||||||
}: BrowseQueriesPanelProps): JSX.Element => {
|
}: BrowseQueriesPaneProps): JSX.Element => {
|
||||||
const loadSavedQuery = (savedQuery: Query): void => {
|
const loadSavedQuery = (savedQuery: Query): void => {
|
||||||
const selectedCollection: Collection = explorer && explorer.findSelectedCollection();
|
const selectedCollection: Collection = explorer && explorer.findSelectedCollection();
|
||||||
if (!selectedCollection) {
|
if (!selectedCollection) {
|
@ -1,7 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Browse queries panel Should render Default properly 1`] = `
|
exports[`Browse queries panel Should render Default properly 1`] = `
|
||||||
<BrowseQueriesPanel
|
<BrowseQueriesPane
|
||||||
closePanel={[Function]}
|
closePanel={[Function]}
|
||||||
explorer={
|
explorer={
|
||||||
Object {
|
Object {
|
||||||
@ -54,5 +54,5 @@ exports[`Browse queries panel Should render Default properly 1`] = `
|
|||||||
</QueriesGridComponent>
|
</QueriesGridComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</BrowseQueriesPanel>
|
</BrowseQueriesPane>
|
||||||
`;
|
`;
|
@ -1,18 +1,21 @@
|
|||||||
import ko from "knockout";
|
import ko from "knockout";
|
||||||
|
import { IDropdownOption } from "office-ui-fabric-react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
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 * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "./GenericRightPaneComponent";
|
import { NotebookContentItem, NotebookContentItemType } from "../Notebook/NotebookContentItem";
|
||||||
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 { ResourceTreeAdapter } from "../Tree/ResourceTreeAdapter";
|
import { ResourceTreeAdapter } from "../Tree/ResourceTreeAdapter";
|
||||||
import { handleError, getErrorMessage } from "../../Common/ErrorHandlingUtils";
|
import { CopyNotebookPaneComponent, CopyNotebookPaneProps } from "./CopyNotebookPaneComponent";
|
||||||
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "./GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
interface Location {
|
interface Location {
|
||||||
type: "MyNotebooks" | "GitHub";
|
type: "MyNotebooks" | "GitHub";
|
||||||
|
@ -3,7 +3,6 @@ jest.mock("../../../Shared/Telemetry/TelemetryProcessor");
|
|||||||
import { mount, ReactWrapper, shallow } from "enzyme";
|
import { mount, ReactWrapper, shallow } from "enzyme";
|
||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { DeleteCollectionConfirmationPanel } from ".";
|
|
||||||
import { deleteCollection } from "../../../Common/dataAccess/deleteCollection";
|
import { deleteCollection } from "../../../Common/dataAccess/deleteCollection";
|
||||||
import DeleteFeedback from "../../../Common/DeleteFeedback";
|
import DeleteFeedback from "../../../Common/DeleteFeedback";
|
||||||
import { ApiKind, DatabaseAccount } from "../../../Contracts/DataModels";
|
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 * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { updateUserContext } from "../../../UserContext";
|
import { updateUserContext } from "../../../UserContext";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
|
import { DeleteCollectionConfirmationPane } from "./DeleteCollectionConfirmationPane";
|
||||||
|
|
||||||
describe("Delete Collection Confirmation Pane", () => {
|
describe("Delete Collection Confirmation Pane", () => {
|
||||||
describe("Explorer.isLastCollection()", () => {
|
describe("Explorer.isLastCollection()", () => {
|
||||||
@ -65,7 +65,7 @@ describe("Delete Collection Confirmation Pane", () => {
|
|||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
||||||
collectionName: "container",
|
collectionName: "container",
|
||||||
};
|
};
|
||||||
const wrapper = shallow(<DeleteCollectionConfirmationPanel {...props} />);
|
const wrapper = shallow(<DeleteCollectionConfirmationPane {...props} />);
|
||||||
expect(wrapper.exists(".deleteCollectionFeedback")).toBe(true);
|
expect(wrapper.exists(".deleteCollectionFeedback")).toBe(true);
|
||||||
|
|
||||||
props.explorer.isLastCollection = () => true;
|
props.explorer.isLastCollection = () => true;
|
||||||
@ -119,7 +119,7 @@ describe("Delete Collection Confirmation Pane", () => {
|
|||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
||||||
collectionName: "container",
|
collectionName: "container",
|
||||||
};
|
};
|
||||||
wrapper = mount(<DeleteCollectionConfirmationPanel {...props} />);
|
wrapper = mount(<DeleteCollectionConfirmationPane {...props} />);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call delete collection", () => {
|
it("should call delete collection", () => {
|
@ -11,18 +11,21 @@ import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcesso
|
|||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils";
|
import * as NotificationConsoleUtils from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
export interface DeleteCollectionConfirmationPanelProps {
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
export interface DeleteCollectionConfirmationPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
collectionName: string;
|
collectionName: string;
|
||||||
closePanel: () => void;
|
closePanel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DeleteCollectionConfirmationPanel: FunctionComponent<DeleteCollectionConfirmationPanelProps> = ({
|
export const DeleteCollectionConfirmationPane: FunctionComponent<DeleteCollectionConfirmationPaneProps> = ({
|
||||||
explorer,
|
explorer,
|
||||||
closePanel,
|
closePanel,
|
||||||
collectionName,
|
collectionName,
|
||||||
}: DeleteCollectionConfirmationPanelProps) => {
|
}: DeleteCollectionConfirmationPaneProps) => {
|
||||||
const [deleteCollectionFeedback, setDeleteCollectionFeedback] = useState<string>("");
|
const [deleteCollectionFeedback, setDeleteCollectionFeedback] = useState<string>("");
|
||||||
const [inputCollectionName, setInputCollectionName] = useState<string>("");
|
const [inputCollectionName, setInputCollectionName] = useState<string>("");
|
||||||
const [formError, setFormError] = useState<string>("");
|
const [formError, setFormError] = useState<string>("");
|
@ -1,7 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Delete Collection Confirmation Pane submit() should call delete collection 1`] = `
|
exports[`Delete Collection Confirmation Pane submit() should call delete collection 1`] = `
|
||||||
<DeleteCollectionConfirmationPanel
|
<DeleteCollectionConfirmationPane
|
||||||
closePanel={[Function]}
|
closePanel={[Function]}
|
||||||
collectionName="container"
|
collectionName="container"
|
||||||
explorer={
|
explorer={
|
||||||
@ -3627,5 +3627,5 @@ exports[`Delete Collection Confirmation Pane submit() should call delete collect
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</GenericRightPaneComponent>
|
</GenericRightPaneComponent>
|
||||||
</DeleteCollectionConfirmationPanel>
|
</DeleteCollectionConfirmationPane>
|
||||||
`;
|
`;
|
@ -2,7 +2,7 @@ import { mount } from "enzyme";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import StoredProcedure from "../../Tree/StoredProcedure";
|
import StoredProcedure from "../../Tree/StoredProcedure";
|
||||||
import { ExecuteSprocParamsPanel } from "./index";
|
import { ExecuteSprocParamsPane } from "./ExecuteSprocParamsPane";
|
||||||
|
|
||||||
describe("Excute Sproc Param Pane", () => {
|
describe("Excute Sproc Param Pane", () => {
|
||||||
const fakeExplorer = {} as Explorer;
|
const fakeExplorer = {} as Explorer;
|
||||||
@ -14,23 +14,23 @@ describe("Excute Sproc Param Pane", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
it("should render Default properly", () => {
|
it("should render Default properly", () => {
|
||||||
const wrapper = mount(<ExecuteSprocParamsPanel {...props} />);
|
const wrapper = mount(<ExecuteSprocParamsPane {...props} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("initially display 2 input field, 1 partition and 1 parameter", () => {
|
it("initially display 2 input field, 1 partition and 1 parameter", () => {
|
||||||
const wrapper = mount(<ExecuteSprocParamsPanel {...props} />);
|
const wrapper = mount(<ExecuteSprocParamsPane {...props} />);
|
||||||
expect(wrapper.find("input[type='text']")).toHaveLength(2);
|
expect(wrapper.find("input[type='text']")).toHaveLength(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("add a new parameter field", () => {
|
it("add a new parameter field", () => {
|
||||||
const wrapper = mount(<ExecuteSprocParamsPanel {...props} />);
|
const wrapper = mount(<ExecuteSprocParamsPane {...props} />);
|
||||||
wrapper.find("#addparam").last().simulate("click");
|
wrapper.find("#addparam").last().simulate("click");
|
||||||
expect(wrapper.find("input[type='text']")).toHaveLength(3);
|
expect(wrapper.find("input[type='text']")).toHaveLength(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("remove a parameter field", () => {
|
it("remove a parameter field", () => {
|
||||||
const wrapper = mount(<ExecuteSprocParamsPanel {...props} />);
|
const wrapper = mount(<ExecuteSprocParamsPane {...props} />);
|
||||||
wrapper.find("#deleteparam").last().simulate("click");
|
wrapper.find("#deleteparam").last().simulate("click");
|
||||||
expect(wrapper.find("input[type='text']")).toHaveLength(1);
|
expect(wrapper.find("input[type='text']")).toHaveLength(1);
|
||||||
});
|
});
|
@ -4,7 +4,10 @@ import React, { FunctionComponent, useState } from "react";
|
|||||||
import AddPropertyIcon from "../../../../images/Add-property.svg";
|
import AddPropertyIcon from "../../../../images/Add-property.svg";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import StoredProcedure from "../../Tree/StoredProcedure";
|
import StoredProcedure from "../../Tree/StoredProcedure";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
import { InputParameter } from "./InputParameter";
|
import { InputParameter } from "./InputParameter";
|
||||||
|
|
||||||
interface ExecuteSprocParamsPaneProps {
|
interface ExecuteSprocParamsPaneProps {
|
||||||
@ -23,7 +26,7 @@ interface UnwrappedExecuteSprocParam {
|
|||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ExecuteSprocParamsPanel: FunctionComponent<ExecuteSprocParamsPaneProps> = ({
|
export const ExecuteSprocParamsPane: FunctionComponent<ExecuteSprocParamsPaneProps> = ({
|
||||||
explorer,
|
explorer,
|
||||||
storedProcedure,
|
storedProcedure,
|
||||||
closePanel,
|
closePanel,
|
@ -1,7 +1,7 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Excute Sproc Param Pane should render Default properly 1`] = `
|
exports[`Excute Sproc Param Pane should render Default properly 1`] = `
|
||||||
<ExecuteSprocParamsPanel
|
<ExecuteSprocParamsPane
|
||||||
closePanel={[Function]}
|
closePanel={[Function]}
|
||||||
explorer={Object {}}
|
explorer={Object {}}
|
||||||
storedProcedure={Object {}}
|
storedProcedure={Object {}}
|
||||||
@ -8176,5 +8176,5 @@ exports[`Excute Sproc Param Pane should render Default properly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</GenericRightPaneComponent>
|
</GenericRightPaneComponent>
|
||||||
</ExecuteSprocParamsPanel>
|
</ExecuteSprocParamsPane>
|
||||||
`;
|
`;
|
@ -1,7 +1,7 @@
|
|||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { LoadQueryPanel } from "./index";
|
import { LoadQueryPane } from "./LoadQueryPane";
|
||||||
|
|
||||||
describe("Load Query Pane", () => {
|
describe("Load Query Pane", () => {
|
||||||
it("should render Default properly", () => {
|
it("should render Default properly", () => {
|
||||||
@ -11,7 +11,7 @@ describe("Load Query Pane", () => {
|
|||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapper = shallow(<LoadQueryPanel {...props} />);
|
const wrapper = shallow(<LoadQueryPane {...props} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -3,22 +3,25 @@ import { IImageProps, Image, ImageFit, Stack, TextField } from "office-ui-fabric
|
|||||||
import React, { FunctionComponent, useState } from "react";
|
import React, { FunctionComponent, useState } from "react";
|
||||||
import folderIcon from "../../../../images/folder_16x16.svg";
|
import folderIcon from "../../../../images/folder_16x16.svg";
|
||||||
import { logError } from "../../../Common/Logger";
|
import { logError } from "../../../Common/Logger";
|
||||||
|
import { Collection } from "../../../Contracts/ViewModels";
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils";
|
import { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import QueryTab from "../../Tabs/QueryTab";
|
import QueryTab from "../../Tabs/QueryTab";
|
||||||
import { Collection } from "..//../../Contracts/ViewModels";
|
import {
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
interface LoadQueryPanelProps {
|
interface LoadQueryPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
closePanel: () => void;
|
closePanel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LoadQueryPanel: FunctionComponent<LoadQueryPanelProps> = ({
|
export const LoadQueryPane: FunctionComponent<LoadQueryPaneProps> = ({
|
||||||
explorer,
|
explorer,
|
||||||
closePanel,
|
closePanel,
|
||||||
}: LoadQueryPanelProps): JSX.Element => {
|
}: LoadQueryPaneProps): JSX.Element => {
|
||||||
const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false);
|
const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false);
|
||||||
const [formError, setFormError] = useState<string>("");
|
const [formError, setFormError] = useState<string>("");
|
||||||
const [formErrorsDetails, setFormErrorsDetails] = useState<string>("");
|
const [formErrorsDetails, setFormErrorsDetails] = useState<string>("");
|
@ -1,20 +1,23 @@
|
|||||||
|
import { toJS } from "@nteract/commutable";
|
||||||
|
import { ImmutableNotebook } from "@nteract/commutable/src";
|
||||||
import ko from "knockout";
|
import ko from "knockout";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
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 { HttpStatusCodes } from "../../Common/Constants";
|
||||||
import { handleError, getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
import { getErrorMessage, getErrorStack, handleError } from "../../Common/ErrorHandlingUtils";
|
||||||
import { GalleryTab } from "../Controls/NotebookGallery/GalleryViewerComponent";
|
import { JunoClient } from "../../Juno/JunoClient";
|
||||||
import { traceFailure, traceStart, traceSuccess } from "../../Shared/Telemetry/TelemetryProcessor";
|
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
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 * as FileSystemUtil from "../Notebook/FileSystemUtil";
|
||||||
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "./GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
import { PublishNotebookPaneComponent, PublishNotebookPaneProps } from "./PublishNotebookPaneComponent";
|
||||||
|
|
||||||
export class PublishNotebookPaneAdapter implements ReactAdapter {
|
export class PublishNotebookPaneAdapter implements ReactAdapter {
|
||||||
parameters: ko.Observable<number>;
|
parameters: ko.Observable<number>;
|
||||||
|
@ -2,7 +2,7 @@ import { shallow } from "enzyme";
|
|||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { SaveQueryPanel } from "./index";
|
import { SaveQueryPane } from "./SaveQueryPane";
|
||||||
|
|
||||||
describe("Save Query Pane", () => {
|
describe("Save Query Pane", () => {
|
||||||
const fakeExplorer = {} as Explorer;
|
const fakeExplorer = {} as Explorer;
|
||||||
@ -13,7 +13,7 @@ describe("Save Query Pane", () => {
|
|||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
const wrapper = shallow(<SaveQueryPanel {...props} />);
|
const wrapper = shallow(<SaveQueryPane {...props} />);
|
||||||
|
|
||||||
it("should return true if can save Queries else false", () => {
|
it("should return true if can save Queries else false", () => {
|
||||||
fakeExplorer.canSaveQueries = ko.computed<boolean>(() => true);
|
fakeExplorer.canSaveQueries = ko.computed<boolean>(() => true);
|
||||||
@ -26,7 +26,7 @@ describe("Save Query Pane", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should render Default properly", () => {
|
it("should render Default properly", () => {
|
||||||
const wrapper = shallow(<SaveQueryPanel {...props} />);
|
const wrapper = shallow(<SaveQueryPane {...props} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -9,17 +9,20 @@ import { traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetr
|
|||||||
import { logConsoleError } from "../../../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import QueryTab from "../../Tabs/QueryTab";
|
import QueryTab from "../../Tabs/QueryTab";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
interface SaveQueryPanelProps {
|
interface SaveQueryPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
closePanel: () => void;
|
closePanel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SaveQueryPanel: FunctionComponent<SaveQueryPanelProps> = ({
|
export const SaveQueryPane: FunctionComponent<SaveQueryPaneProps> = ({
|
||||||
explorer,
|
explorer,
|
||||||
closePanel,
|
closePanel,
|
||||||
}: SaveQueryPanelProps): JSX.Element => {
|
}: SaveQueryPaneProps): JSX.Element => {
|
||||||
const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false);
|
const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false);
|
||||||
const [formError, setFormError] = useState<string>("");
|
const [formError, setFormError] = useState<string>("");
|
||||||
const [formErrorsDetails, setFormErrorsDetails] = useState<string>("");
|
const [formErrorsDetails, setFormErrorsDetails] = useState<string>("");
|
@ -1,9 +1,9 @@
|
|||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { SettingsPane } from ".";
|
|
||||||
import { DatabaseAccount } from "../../../Contracts/DataModels";
|
import { DatabaseAccount } from "../../../Contracts/DataModels";
|
||||||
import { updateUserContext } from "../../../UserContext";
|
import { updateUserContext } from "../../../UserContext";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
|
import { SettingsPane } from "./SettingsPane";
|
||||||
const props = {
|
const props = {
|
||||||
explorer: new Explorer(),
|
explorer: new Explorer(),
|
||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
@ -1,14 +1,17 @@
|
|||||||
import { Checkbox, ChoiceGroup, IChoiceGroupOption, SpinButton } from "office-ui-fabric-react";
|
import { Checkbox, ChoiceGroup, IChoiceGroupOption, SpinButton } from "office-ui-fabric-react";
|
||||||
import React, { FunctionComponent, MouseEvent, useState } from "react";
|
import React, { FunctionComponent, MouseEvent, useState } from "react";
|
||||||
import * as Constants from "../../../Common/Constants";
|
import * as Constants from "../../../Common/Constants";
|
||||||
import { Tooltip } from "../../../Common/Tooltip";
|
import { Tooltip } from "../../../Common/Tooltip/Tooltip";
|
||||||
import { configContext } from "../../../ConfigContext";
|
import { configContext } from "../../../ConfigContext";
|
||||||
import { LocalStorageUtility, StorageKey } from "../../../Shared/StorageUtility";
|
import { LocalStorageUtility, StorageKey } from "../../../Shared/StorageUtility";
|
||||||
import * as StringUtility from "../../../Shared/StringUtility";
|
import * as StringUtility from "../../../Shared/StringUtility";
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import { logConsoleInfo } from "../../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo } from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
export interface SettingsPaneProps {
|
export interface SettingsPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
@ -4,7 +4,10 @@ import { userContext } from "../../../../UserContext";
|
|||||||
import Explorer from "../../../Explorer";
|
import Explorer from "../../../Explorer";
|
||||||
import * as Constants from "../../../Tables/Constants";
|
import * as Constants from "../../../Tables/Constants";
|
||||||
import QueryViewModel from "../../../Tables/QueryBuilder/QueryViewModel";
|
import QueryViewModel from "../../../Tables/QueryBuilder/QueryViewModel";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
interface TableQuerySelectPanelProps {
|
interface TableQuerySelectPanelProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
import React, { ChangeEvent, FunctionComponent, useState } from "react";
|
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 { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { NotebookContentItem } from "../../Notebook/NotebookContentItem";
|
import { NotebookContentItem } from "../../Notebook/NotebookContentItem";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
export interface UploadFilePanelProps {
|
export interface UploadFilePanelProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
@ -1,7 +1,7 @@
|
|||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { UploadItemsPane } from ".";
|
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
|
import { UploadItemsPane } from "./UploadItemsPane";
|
||||||
const props = {
|
const props = {
|
||||||
explorer: new Explorer(),
|
explorer: new Explorer(),
|
||||||
closePanel: (): void => undefined,
|
closePanel: (): void => undefined,
|
@ -1,12 +1,15 @@
|
|||||||
import { DetailsList, DetailsListLayoutMode, IColumn, SelectionMode } from "office-ui-fabric-react";
|
import { DetailsList, DetailsListLayoutMode, IColumn, SelectionMode } from "office-ui-fabric-react";
|
||||||
import React, { ChangeEvent, FunctionComponent, useState } from "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 { UploadDetailsRecord } from "../../../Contracts/ViewModels";
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import { logConsoleError } from "../../../Utils/NotificationConsoleUtils";
|
import { logConsoleError } from "../../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import { getErrorMessage } from "../../Tables/Utilities";
|
import { getErrorMessage } from "../../Tables/Utilities";
|
||||||
import { GenericRightPaneComponent, GenericRightPaneProps } from "../GenericRightPaneComponent";
|
import {
|
||||||
|
GenericRightPaneComponent,
|
||||||
|
GenericRightPaneProps,
|
||||||
|
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
|
||||||
|
|
||||||
export interface UploadItemsPaneProps {
|
export interface UploadItemsPaneProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
Loading…
Reference in New Issue
Block a user