mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Mongo tabs UX fixes (#851)
* Fixed mongo tabs UX * changed logic for new tab index * moved index to tabs base * removed getIndex method
This commit is contained in:
committed by
GitHub
parent
f296c00a1c
commit
ee60f61cfe
@@ -16,6 +16,7 @@ import { TabsManager } from "./TabsManager";
|
||||
// TODO: Use specific actions for logging telemetry data
|
||||
export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
private static id = 0;
|
||||
public readonly index: number;
|
||||
public closeTabButton: ViewModels.Button;
|
||||
public node: ViewModels.TreeNode;
|
||||
public collection: ViewModels.CollectionBase;
|
||||
@@ -35,6 +36,7 @@ export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
|
||||
constructor(options: ViewModels.TabOptions) {
|
||||
super();
|
||||
this.index = options.index;
|
||||
this._theme = ThemeUtility.getMonacoTheme(options.theme);
|
||||
this.node = options.node;
|
||||
this.collection = options.collection;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Spinner, SpinnerSize } from "@fluentui/react";
|
||||
import * as ko from "knockout";
|
||||
import * as React from "react";
|
||||
import { ReactAdapter } from "../../Bindings/ReactBindingHandler";
|
||||
@@ -33,7 +34,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter {
|
||||
databaseAccount={this.getDatabaseAccount()}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
<Spinner styles={{ root: { marginTop: 10 } }} size={SpinnerSize.large}></Spinner>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -51,7 +52,11 @@ export default class TerminalTab extends TabsBase {
|
||||
() => userContext?.databaseAccount
|
||||
);
|
||||
this.notebookTerminalComponentAdapter.parameters = ko.computed<boolean>(() => {
|
||||
if (this.isTemplateReady() && this.container.isNotebookEnabled()) {
|
||||
if (
|
||||
this.isTemplateReady() &&
|
||||
this.container.isNotebookEnabled() &&
|
||||
this.container.notebookServerInfo().notebookServerEndpoint
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user