mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-07 19:46:53 +00:00
Initial commit
This commit is contained in:
@@ -32,7 +32,8 @@ import MongoDocumentsTab from "../Tabs/MongoDocumentsTab";
|
||||
import { NewMongoQueryTab } from "../Tabs/MongoQueryTab/MongoQueryTab";
|
||||
import { NewMongoShellTab } from "../Tabs/MongoShellTab/MongoShellTab";
|
||||
import { NewQueryTab } from "../Tabs/QueryTab/QueryTab";
|
||||
import QueryTablesTab from "../Tabs/QueryTablesTab";
|
||||
// import QueryTablesTab from "../Tabs/QueryTablesTab";
|
||||
import NewQueryTablesTab from "../Tabs/QueryTablesTab/QueryTablesTab";
|
||||
import { CollectionSettingsTabV2 } from "../Tabs/SettingsTabV2";
|
||||
import { useDatabases } from "../useDatabases";
|
||||
import { useSelectedNode } from "../useSelectedNode";
|
||||
@@ -391,13 +392,13 @@ export default class Collection implements ViewModels.Collection {
|
||||
});
|
||||
}
|
||||
|
||||
const queryTablesTabs: QueryTablesTab[] = useTabs
|
||||
const queryTablesTabs: NewQueryTablesTab[] = useTabs
|
||||
.getState()
|
||||
.getTabs(
|
||||
ViewModels.CollectionTabKind.QueryTables,
|
||||
(tab) => tab.collection && tab.collection.databaseId === this.databaseId && tab.collection.id() === this.id()
|
||||
) as QueryTablesTab[];
|
||||
let queryTablesTab: QueryTablesTab = queryTablesTabs && queryTablesTabs[0];
|
||||
) as NewQueryTablesTab[];
|
||||
let queryTablesTab: NewQueryTablesTab = queryTablesTabs && queryTablesTabs[0];
|
||||
|
||||
if (queryTablesTab) {
|
||||
useTabs.getState().activateTab(queryTablesTab);
|
||||
@@ -415,14 +416,57 @@ export default class Collection implements ViewModels.Collection {
|
||||
tabTitle: title,
|
||||
});
|
||||
|
||||
queryTablesTab = new QueryTablesTab({
|
||||
tabKind: ViewModels.CollectionTabKind.QueryTables,
|
||||
title: title,
|
||||
tabPath: "",
|
||||
collection: this,
|
||||
node: this,
|
||||
onLoadStartKey: startKey,
|
||||
});
|
||||
queryTablesTab = new NewQueryTablesTab(
|
||||
{
|
||||
tabKind: ViewModels.CollectionTabKind.QueryTables,
|
||||
title: title,
|
||||
tabPath: "",
|
||||
collection: this,
|
||||
node: this,
|
||||
onLoadStartKey: startKey,
|
||||
},
|
||||
{
|
||||
container: this.container,
|
||||
}
|
||||
);
|
||||
|
||||
// const queryTablesTabs: QueryTablesTab[] = useTabs
|
||||
// .getState()
|
||||
// .getTabs(
|
||||
// ViewModels.CollectionTabKind.QueryTables,
|
||||
// (tab) => tab.collection && tab.collection.databaseId === this.databaseId && tab.collection.id() === this.id()
|
||||
// ) as QueryTablesTab[];
|
||||
// let queryTablesTab: QueryTablesTab = queryTablesTabs && queryTablesTabs[0];
|
||||
|
||||
// if (queryTablesTab) {
|
||||
// useTabs.getState().activateTab(queryTablesTab);
|
||||
// } else {
|
||||
// this.documentIds([]);
|
||||
// let title = `Entities`;
|
||||
// if (userContext.apiType === "Cassandra") {
|
||||
// title = `Rows`;
|
||||
// }
|
||||
// const startKey: number = TelemetryProcessor.traceStart(Action.Tab, {
|
||||
// databaseName: this.databaseId,
|
||||
// collectionName: this.id(),
|
||||
|
||||
// dataExplorerArea: Constants.Areas.Tab,
|
||||
// tabTitle: title,
|
||||
// });
|
||||
|
||||
// queryTablesTab = new QueryTablesTab(
|
||||
// {
|
||||
// tabKind: ViewModels.CollectionTabKind.QueryTables,
|
||||
// title: title,
|
||||
// tabPath: "",
|
||||
// collection: this,
|
||||
// node: this,
|
||||
// onLoadStartKey: startKey,
|
||||
// },
|
||||
// {
|
||||
// container: this.container,
|
||||
// }
|
||||
// );
|
||||
|
||||
useTabs.getState().activateNewTab(queryTablesTab);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user