mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 01:41:31 +00:00
Remove NotebookViewerTab (#749)
[Preview this branch](https://cosmos-explorer-preview.azurewebsites.net/pull/749)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import * as ko from "knockout";
|
||||
import { IChoiceGroupProps } from "@fluentui/react";
|
||||
import * as path from "path";
|
||||
import * as ko from "knockout";
|
||||
import Q from "q";
|
||||
import React from "react";
|
||||
import _ from "underscore";
|
||||
@@ -1843,39 +1842,6 @@ export default class Explorer {
|
||||
}
|
||||
}
|
||||
|
||||
public async openNotebookViewer(notebookUrl: string) {
|
||||
const title = path.basename(notebookUrl);
|
||||
const hashLocation = notebookUrl;
|
||||
const NotebookViewerTab = await (
|
||||
await import(/* webpackChunkName: "NotebookViewerTab" */ "./Tabs/NotebookViewerTab")
|
||||
).default;
|
||||
|
||||
const notebookViewerTab = this.tabsManager.getTabs(ViewModels.CollectionTabKind.NotebookV2).find((tab) => {
|
||||
return tab.hashLocation() == hashLocation && tab instanceof NotebookViewerTab && tab.notebookUrl === notebookUrl;
|
||||
});
|
||||
|
||||
if (notebookViewerTab) {
|
||||
this.tabsManager.activateNewTab(notebookViewerTab);
|
||||
} else {
|
||||
const notebookViewerTab = new NotebookViewerTab({
|
||||
account: userContext.databaseAccount,
|
||||
tabKind: ViewModels.CollectionTabKind.NotebookViewer,
|
||||
node: null,
|
||||
title: title,
|
||||
tabPath: title,
|
||||
collection: null,
|
||||
hashLocation: hashLocation,
|
||||
isTabsContentExpanded: ko.observable(true),
|
||||
onLoadStartKey: null,
|
||||
onUpdateTabsButtons: this.onUpdateTabsButtons,
|
||||
container: this,
|
||||
notebookUrl,
|
||||
});
|
||||
|
||||
this.tabsManager.activateNewTab(notebookViewerTab);
|
||||
}
|
||||
}
|
||||
|
||||
public onNewCollectionClicked(databaseId?: string): void {
|
||||
if (userContext.apiType === "Cassandra") {
|
||||
this.cassandraAddCollectionPane.open();
|
||||
|
||||
Reference in New Issue
Block a user