Remove Explorer openEditTableEntityPanel and openAddTableEntityPanel (#887)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
parent
3bc58a80e4
commit
615bfeaf48
|
@ -146,9 +146,6 @@ src/Explorer/Tabs/MongoDocumentsTab.ts
|
||||||
# src/Explorer/Tabs/MongoQueryTab.ts
|
# src/Explorer/Tabs/MongoQueryTab.ts
|
||||||
src/Explorer/Tabs/MongoShellTab.ts
|
src/Explorer/Tabs/MongoShellTab.ts
|
||||||
src/Explorer/Tabs/NotebookV2Tab.ts
|
src/Explorer/Tabs/NotebookV2Tab.ts
|
||||||
# src/Explorer/Tabs/QueryTab.test.ts
|
|
||||||
# src/Explorer/Tabs/QueryTab.ts
|
|
||||||
src/Explorer/Tabs/QueryTablesTab.ts
|
|
||||||
src/Explorer/Tabs/ScriptTabBase.ts
|
src/Explorer/Tabs/ScriptTabBase.ts
|
||||||
src/Explorer/Tabs/StoredProcedureTab.ts
|
src/Explorer/Tabs/StoredProcedureTab.ts
|
||||||
src/Explorer/Tabs/TabComponents.ts
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
|
|
|
@ -58,16 +58,12 @@ import { GitHubReposPanel } from "./Panes/GitHubReposPanel/GitHubReposPanel";
|
||||||
import { SaveQueryPane } from "./Panes/SaveQueryPane/SaveQueryPane";
|
import { SaveQueryPane } from "./Panes/SaveQueryPane/SaveQueryPane";
|
||||||
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
import { SetupNoteBooksPanel } from "./Panes/SetupNotebooksPanel/SetupNotebooksPanel";
|
||||||
import { StringInputPane } from "./Panes/StringInputPane/StringInputPane";
|
import { StringInputPane } from "./Panes/StringInputPane/StringInputPane";
|
||||||
import { AddTableEntityPanel } from "./Panes/Tables/AddTableEntityPanel";
|
|
||||||
import { EditTableEntityPanel } from "./Panes/Tables/EditTableEntityPanel";
|
|
||||||
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel/TableQuerySelectPanel";
|
import { TableQuerySelectPanel } from "./Panes/Tables/TableQuerySelectPanel/TableQuerySelectPanel";
|
||||||
import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane";
|
import { UploadFilePane } from "./Panes/UploadFilePane/UploadFilePane";
|
||||||
import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane";
|
import { UploadItemsPane } from "./Panes/UploadItemsPane/UploadItemsPane";
|
||||||
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";
|
||||||
import NotebookV2Tab, { NotebookTabOptions } from "./Tabs/NotebookV2Tab";
|
import NotebookV2Tab, { NotebookTabOptions } from "./Tabs/NotebookV2Tab";
|
||||||
import QueryTablesTab from "./Tabs/QueryTablesTab";
|
|
||||||
import { TabsManager } from "./Tabs/TabsManager";
|
import { TabsManager } from "./Tabs/TabsManager";
|
||||||
import TerminalTab from "./Tabs/TerminalTab";
|
import TerminalTab from "./Tabs/TerminalTab";
|
||||||
import Database from "./Tree/Database";
|
import Database from "./Tree/Database";
|
||||||
|
@ -1512,39 +1508,12 @@ export default class Explorer {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openAddTableEntityPanel(queryTablesTab: QueryTablesTab, tableEntityListViewModel: TableListViewModal): void {
|
|
||||||
useSidePanel
|
|
||||||
.getState()
|
|
||||||
.openSidePanel(
|
|
||||||
"Add Table Entity",
|
|
||||||
<AddTableEntityPanel
|
|
||||||
tableDataClient={this.tableDataClient}
|
|
||||||
queryTablesTab={queryTablesTab}
|
|
||||||
tableEntityListViewModel={tableEntityListViewModel}
|
|
||||||
cassandraApiClient={new CassandraAPIDataClient()}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
public openSetupNotebooksPanel(title: string, description: string): void {
|
public openSetupNotebooksPanel(title: string, description: string): void {
|
||||||
useSidePanel
|
useSidePanel
|
||||||
.getState()
|
.getState()
|
||||||
.openSidePanel(title, <SetupNoteBooksPanel explorer={this} panelTitle={title} panelDescription={description} />);
|
.openSidePanel(title, <SetupNoteBooksPanel explorer={this} panelTitle={title} panelDescription={description} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
public openEditTableEntityPanel(queryTablesTab: QueryTablesTab, tableEntityListViewModel: TableListViewModal): void {
|
|
||||||
useSidePanel
|
|
||||||
.getState()
|
|
||||||
.openSidePanel(
|
|
||||||
"Edit Table Entity",
|
|
||||||
<EditTableEntityPanel
|
|
||||||
tableDataClient={this.tableDataClient}
|
|
||||||
queryTablesTab={queryTablesTab}
|
|
||||||
tableEntityListViewModel={tableEntityListViewModel}
|
|
||||||
cassandraApiClient={new CassandraAPIDataClient()}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public openTableSelectQueryPanel(queryViewModal: QueryViewModel): void {
|
public openTableSelectQueryPanel(queryViewModal: QueryViewModel): void {
|
||||||
useSidePanel.getState().openSidePanel("Select Column", <TableQuerySelectPanel queryViewModel={queryViewModal} />);
|
useSidePanel.getState().openSidePanel("Select Column", <TableQuerySelectPanel queryViewModel={queryViewModal} />);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import Q from "q";
|
import React from "react";
|
||||||
import AddEntityIcon from "../../../images/AddEntity.svg";
|
import AddEntityIcon from "../../../images/AddEntity.svg";
|
||||||
import DeleteEntitiesIcon from "../../../images/DeleteEntities.svg";
|
import DeleteEntitiesIcon from "../../../images/DeleteEntities.svg";
|
||||||
import EditEntityIcon from "../../../images/Edit-entity.svg";
|
import EditEntityIcon from "../../../images/Edit-entity.svg";
|
||||||
|
@ -7,13 +7,16 @@ import ExecuteQueryIcon from "../../../images/ExecuteQuery.svg";
|
||||||
import QueryBuilderIcon from "../../../images/Query-Builder.svg";
|
import QueryBuilderIcon from "../../../images/Query-Builder.svg";
|
||||||
import QueryTextIcon from "../../../images/Query-Text.svg";
|
import QueryTextIcon from "../../../images/Query-Text.svg";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
|
import { useSidePanel } from "../../hooks/useSidePanel";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
|
import { AddTableEntityPanel } from "../Panes/Tables/AddTableEntityPanel";
|
||||||
|
import { EditTableEntityPanel } from "../Panes/Tables/EditTableEntityPanel";
|
||||||
import TableCommands from "../Tables/DataTable/TableCommands";
|
import TableCommands from "../Tables/DataTable/TableCommands";
|
||||||
import TableEntityListViewModel from "../Tables/DataTable/TableEntityListViewModel";
|
import TableEntityListViewModel from "../Tables/DataTable/TableEntityListViewModel";
|
||||||
import QueryViewModel from "../Tables/QueryBuilder/QueryViewModel";
|
import QueryViewModel from "../Tables/QueryBuilder/QueryViewModel";
|
||||||
import { TableDataClient } from "../Tables/TableDataClient";
|
import { CassandraAPIDataClient, TableDataClient } from "../Tables/TableDataClient";
|
||||||
import template from "./QueryTablesTab.html";
|
import template from "./QueryTablesTab.html";
|
||||||
import TabsBase from "./TabsBase";
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
|
@ -130,34 +133,36 @@ export default class QueryTablesTab extends TabsBase {
|
||||||
this.buildCommandBarOptions();
|
this.buildCommandBarOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public onExecuteQueryClick = (): Q.Promise<any> => {
|
public onAddEntityClick = (): void => {
|
||||||
this.queryViewModel().runQuery();
|
useSidePanel
|
||||||
return null;
|
.getState()
|
||||||
|
.openSidePanel(
|
||||||
|
"Add Table Entity",
|
||||||
|
<AddTableEntityPanel
|
||||||
|
tableDataClient={this.tableDataClient}
|
||||||
|
queryTablesTab={this}
|
||||||
|
tableEntityListViewModel={this.tableEntityListViewModel()}
|
||||||
|
cassandraApiClient={new CassandraAPIDataClient()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
public onQueryBuilderClick = (): Q.Promise<any> => {
|
public onEditEntityClick = (): void => {
|
||||||
this.queryViewModel().selectHelper();
|
useSidePanel
|
||||||
return null;
|
.getState()
|
||||||
|
.openSidePanel(
|
||||||
|
"Edit Table Entity",
|
||||||
|
<EditTableEntityPanel
|
||||||
|
tableDataClient={this.tableDataClient}
|
||||||
|
queryTablesTab={this}
|
||||||
|
tableEntityListViewModel={this.tableEntityListViewModel()}
|
||||||
|
cassandraApiClient={new CassandraAPIDataClient()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
public onQueryTextClick = (): Q.Promise<any> => {
|
public onDeleteEntityClick = (): void => {
|
||||||
this.queryViewModel().selectEditor();
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
public onAddEntityClick = (): Q.Promise<any> => {
|
|
||||||
this.container.openAddTableEntityPanel(this, this.tableEntityListViewModel());
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
public onEditEntityClick = (): Q.Promise<any> => {
|
|
||||||
this.container.openEditTableEntityPanel(this, this.tableEntityListViewModel());
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
public onDeleteEntityClick = (): Q.Promise<any> => {
|
|
||||||
this.tableCommands.deleteEntitiesCommand(this.tableEntityListViewModel());
|
this.tableCommands.deleteEntitiesCommand(this.tableEntityListViewModel());
|
||||||
return null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public onActivate(): void {
|
public onActivate(): void {
|
||||||
|
@ -166,7 +171,7 @@ export default class QueryTablesTab extends TabsBase {
|
||||||
!!this.tableEntityListViewModel() &&
|
!!this.tableEntityListViewModel() &&
|
||||||
!!this.tableEntityListViewModel().table &&
|
!!this.tableEntityListViewModel().table &&
|
||||||
this.tableEntityListViewModel().table.columns;
|
this.tableEntityListViewModel().table.columns;
|
||||||
if (!!columns) {
|
if (columns) {
|
||||||
columns.adjust();
|
columns.adjust();
|
||||||
$(window).resize();
|
$(window).resize();
|
||||||
}
|
}
|
||||||
|
@ -179,7 +184,7 @@ export default class QueryTablesTab extends TabsBase {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
iconSrc: QueryBuilderIcon,
|
iconSrc: QueryBuilderIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
onCommandClick: this.onQueryBuilderClick,
|
onCommandClick: () => this.queryViewModel().selectHelper(),
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
|
@ -193,7 +198,7 @@ export default class QueryTablesTab extends TabsBase {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
iconSrc: QueryTextIcon,
|
iconSrc: QueryTextIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
onCommandClick: this.onQueryTextClick,
|
onCommandClick: () => this.queryViewModel().selectEditor(),
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
|
@ -207,7 +212,7 @@ export default class QueryTablesTab extends TabsBase {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
iconSrc: ExecuteQueryIcon,
|
iconSrc: ExecuteQueryIcon,
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
onCommandClick: this.onExecuteQueryClick,
|
onCommandClick: () => this.queryViewModel().runQuery(),
|
||||||
commandButtonLabel: label,
|
commandButtonLabel: label,
|
||||||
ariaLabel: label,
|
ariaLabel: label,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
Loading…
Reference in New Issue