mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
addDatabasePane provide backward compatibility
This commit is contained in:
@@ -113,6 +113,8 @@ src/Explorer/OpenActions.ts
|
|||||||
src/Explorer/OpenActionsStubs.ts
|
src/Explorer/OpenActionsStubs.ts
|
||||||
src/Explorer/Panes/AddCollectionPane.test.ts
|
src/Explorer/Panes/AddCollectionPane.test.ts
|
||||||
src/Explorer/Panes/AddCollectionPane.ts
|
src/Explorer/Panes/AddCollectionPane.ts
|
||||||
|
src/Explorer/Panes/AddDatabasePane.ts
|
||||||
|
src/Explorer/Panes/AddDatabasePane.test.ts
|
||||||
src/Explorer/Panes/BrowseQueriesPane.ts
|
src/Explorer/Panes/BrowseQueriesPane.ts
|
||||||
src/Explorer/Panes/CassandraAddCollectionPane.ts
|
src/Explorer/Panes/CassandraAddCollectionPane.ts
|
||||||
src/Explorer/Panes/ContextualPaneBase.ts
|
src/Explorer/Panes/ContextualPaneBase.ts
|
||||||
@@ -130,7 +132,6 @@ src/Explorer/Panes/Tables/TableEntityPane.ts
|
|||||||
src/Explorer/Panes/Tables/Validators/EntityPropertyNameValidator.ts
|
src/Explorer/Panes/Tables/Validators/EntityPropertyNameValidator.ts
|
||||||
src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts
|
src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts
|
||||||
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
src/Explorer/Panes/Tables/Validators/EntityPropertyValueValidator.ts
|
||||||
src/Explorer/Panes/AddDatabasePane.ts
|
|
||||||
src/Explorer/SplashScreen/SplashScreen.test.ts
|
src/Explorer/SplashScreen/SplashScreen.test.ts
|
||||||
src/Explorer/Tables/Constants.ts
|
src/Explorer/Tables/Constants.ts
|
||||||
src/Explorer/Tables/DataTable/CacheBase.ts
|
src/Explorer/Tables/DataTable/CacheBase.ts
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
|
|||||||
if (isAutoscaleSelected) {
|
if (isAutoscaleSelected) {
|
||||||
return AutoPilotUtils.getAutoPilotHeaderText();
|
return AutoPilotUtils.getAutoPilotHeaderText();
|
||||||
}
|
}
|
||||||
|
|
||||||
const minRU: string = SharedConstants.CollectionCreation.DefaultCollectionRUs400.toLocaleString();
|
const minRU: string = SharedConstants.CollectionCreation.DefaultCollectionRUs400.toLocaleString();
|
||||||
const maxRU: string = userContext.isTryCosmosDBSubscription
|
const maxRU: string = userContext.isTryCosmosDBSubscription
|
||||||
? Constants.TryCosmosExperience.maxRU.toLocaleString()
|
? Constants.TryCosmosExperience.maxRU.toLocaleString()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ 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 { AddDatabasePanel } from "./Panes/AddDatabasePanelF/AddDatabasePanelF";
|
import { AddDatabasePanelF } from "./Panes/AddDatabasePanelF/AddDatabasePanelF";
|
||||||
import { BrowseQueriesPane } from "./Panes/BrowseQueriesPane/BrowseQueriesPane";
|
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";
|
||||||
@@ -2163,10 +2163,20 @@ export default class Explorer {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
public openAddDatabasePane(): void {
|
public openAddDatabasePane(): void {
|
||||||
this.openSidePanel(
|
let isEnable = true;
|
||||||
"Add Database",
|
if (isEnable) {
|
||||||
<AddDatabasePanel explorer={this} openNotificationConsole={this.expandConsole} closePanel={this.closeSidePanel} />
|
this.addDatabasePane.open();
|
||||||
);
|
document.getElementById("linkAddDatabase").focus();
|
||||||
|
} else {
|
||||||
|
this.openSidePanel(
|
||||||
|
"Add Database",
|
||||||
|
<AddDatabasePanelF
|
||||||
|
explorer={this}
|
||||||
|
openNotificationConsole={this.expandConsole}
|
||||||
|
closePanel={this.closeSidePanel}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public openBrowseQueriesPanel(): void {
|
public openBrowseQueriesPanel(): void {
|
||||||
|
|||||||
@@ -279,9 +279,7 @@ function createNewDatabase(container: Explorer): CommandButtonComponentProps {
|
|||||||
iconSrc: AddDatabaseIcon,
|
iconSrc: AddDatabaseIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
onCommandClick: () => {
|
onCommandClick: () => {
|
||||||
container.addDatabasePane.open();
|
container.openAddDatabasePane();
|
||||||
// container.openAddDatabasePane();
|
|
||||||
document.getElementById("linkAddDatabase").focus();
|
|
||||||
},
|
},
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
|
|||||||
@@ -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 { AddDatabasePanel } from "./AddDatabasePanelF";
|
import { AddDatabasePanelF } from "./AddDatabasePanelF";
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
explorer: new Explorer(),
|
explorer: new Explorer(),
|
||||||
@@ -11,7 +11,7 @@ const props = {
|
|||||||
|
|
||||||
describe("AddDatabasePane Pane", () => {
|
describe("AddDatabasePane Pane", () => {
|
||||||
it("should render Default properly", () => {
|
it("should render Default properly", () => {
|
||||||
const wrapper = shallow(<AddDatabasePanel {...props} />);
|
const wrapper = shallow(<AddDatabasePanelF {...props} />);
|
||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export interface AddDatabasePaneProps {
|
|||||||
openNotificationConsole: () => void;
|
openNotificationConsole: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
|
export const AddDatabasePanelF: FunctionComponent<AddDatabasePaneProps> = ({
|
||||||
explorer: container,
|
explorer: container,
|
||||||
closePanel,
|
closePanel,
|
||||||
openNotificationConsole,
|
openNotificationConsole,
|
||||||
@@ -258,7 +258,7 @@ export const AddDatabasePanel: FunctionComponent<AddDatabasePaneProps> = ({
|
|||||||
container,
|
container,
|
||||||
formError: formErrors,
|
formError: formErrors,
|
||||||
formErrorDetail: formErrorsDetails,
|
formErrorDetail: formErrorsDetails,
|
||||||
id: "copynotebookpane",
|
id: "add-database-inputs",
|
||||||
isExecuting,
|
isExecuting,
|
||||||
title,
|
title,
|
||||||
submitButtonText: "OK",
|
submitButtonText: "OK",
|
||||||
|
|||||||
@@ -227,6 +227,7 @@ const App: React.FunctionComponent = () => {
|
|||||||
closePanel={closeSidePanel}
|
closePanel={closeSidePanel}
|
||||||
isConsoleExpanded={isNotificationConsoleExpanded}
|
isConsoleExpanded={isNotificationConsoleExpanded}
|
||||||
/>
|
/>
|
||||||
|
<div data-bind='component: { name: "add-database-pane", params: {data: addDatabasePane} }' />
|
||||||
<div data-bind='component: { name: "add-collection-pane", params: { data: addCollectionPane} }' />
|
<div data-bind='component: { name: "add-collection-pane", params: { data: addCollectionPane} }' />
|
||||||
<div data-bind='component: { name: "graph-styling-pane", params: { data: graphStylingPane} }' />
|
<div data-bind='component: { name: "graph-styling-pane", params: { data: graphStylingPane} }' />
|
||||||
<div data-bind='component: { name: "table-edit-entity-pane", params: { data: editTableEntityPane} }' />
|
<div data-bind='component: { name: "table-edit-entity-pane", params: { data: editTableEntityPane} }' />
|
||||||
|
|||||||
Reference in New Issue
Block a user