addDatabasePane provide backward compatibility

This commit is contained in:
hardiknai-techm
2021-04-24 13:32:00 +05:30
parent 0aeb16fb96
commit 42552bad07
7 changed files with 23 additions and 14 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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,11 +2163,21 @@ export default class Explorer {
); );
} }
public openAddDatabasePane(): void { public openAddDatabasePane(): void {
let isEnable = true;
if (isEnable) {
this.addDatabasePane.open();
document.getElementById("linkAddDatabase").focus();
} else {
this.openSidePanel( this.openSidePanel(
"Add Database", "Add Database",
<AddDatabasePanel explorer={this} openNotificationConsole={this.expandConsole} closePanel={this.closeSidePanel} /> <AddDatabasePanelF
explorer={this}
openNotificationConsole={this.expandConsole}
closePanel={this.closeSidePanel}
/>
); );
} }
}
public openBrowseQueriesPanel(): void { public openBrowseQueriesPanel(): void {
this.openSidePanel("Open Saved Queries", <BrowseQueriesPane explorer={this} closePanel={this.closeSidePanel} />); this.openSidePanel("Open Saved Queries", <BrowseQueriesPane explorer={this} closePanel={this.closeSidePanel} />);

View File

@@ -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,

View File

@@ -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();
}); });
}); });

View File

@@ -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",

View File

@@ -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} }' />