mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
More ViewModel cleanup (#116)
This commit is contained in:
@@ -28,15 +28,24 @@ import { NotebookConfigurationUtils } from "../../Utils/NotebookConfigurationUti
|
||||
import { KernelSpecsDisplay, NotebookClientV2 } from "../Notebook/NotebookClientV2";
|
||||
import { config } from "../../Config";
|
||||
import Explorer from "../Explorer";
|
||||
import { NotebookContentItem } from "../Notebook/NotebookContentItem";
|
||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||
|
||||
export default class NotebookTabV2 extends TabsBase implements ViewModels.Tab {
|
||||
export interface NotebookTabOptions extends ViewModels.TabOptions {
|
||||
account: DataModels.DatabaseAccount;
|
||||
masterKey: string;
|
||||
container: Explorer;
|
||||
notebookContentItem: NotebookContentItem;
|
||||
}
|
||||
|
||||
export default class NotebookTabV2 extends TabsBase {
|
||||
private static clientManager: NotebookClientV2;
|
||||
private container: Explorer;
|
||||
public notebookPath: ko.Observable<string>;
|
||||
private selectedSparkPool: ko.Observable<string>;
|
||||
private notebookComponentAdapter: NotebookComponentAdapter;
|
||||
|
||||
constructor(options: ViewModels.NotebookTabOptions) {
|
||||
constructor(options: NotebookTabOptions) {
|
||||
super(options);
|
||||
|
||||
this.container = options.container;
|
||||
@@ -109,7 +118,7 @@ export default class NotebookTabV2 extends TabsBase implements ViewModels.Tab {
|
||||
return this.container;
|
||||
}
|
||||
|
||||
protected getTabsButtons(): ViewModels.NavbarButtonConfig[] {
|
||||
protected getTabsButtons(): CommandButtonComponentProps[] {
|
||||
const availableKernels = NotebookTabV2.clientManager.getAvailableKernelSpecs();
|
||||
|
||||
const saveLabel = "Save";
|
||||
@@ -136,7 +145,7 @@ export default class NotebookTabV2 extends TabsBase implements ViewModels.Tab {
|
||||
const cellCodeType = "code";
|
||||
const cellMarkdownType = "markdown";
|
||||
const cellRawType = "raw";
|
||||
let buttons: ViewModels.NavbarButtonConfig[] = [
|
||||
let buttons: CommandButtonComponentProps[] = [
|
||||
{
|
||||
iconSrc: SaveIcon,
|
||||
iconAlt: saveLabel,
|
||||
@@ -188,7 +197,7 @@ export default class NotebookTabV2 extends TabsBase implements ViewModels.Tab {
|
||||
hasPopup: false,
|
||||
disabled: false,
|
||||
ariaLabel: kernel.displayName
|
||||
} as ViewModels.NavbarButtonConfig)
|
||||
} as CommandButtonComponentProps)
|
||||
),
|
||||
ariaLabel: kernelLabel
|
||||
},
|
||||
@@ -363,7 +372,7 @@ export default class NotebookTabV2 extends TabsBase implements ViewModels.Tab {
|
||||
];
|
||||
|
||||
if (this.container.hasStorageAnalyticsAfecFeature()) {
|
||||
const arcadiaWorkspaceDropdown: ViewModels.NavbarButtonConfig = {
|
||||
const arcadiaWorkspaceDropdown: CommandButtonComponentProps = {
|
||||
iconSrc: null,
|
||||
iconAlt: workspaceLabel,
|
||||
ariaLabel: workspaceLabel,
|
||||
|
||||
Reference in New Issue
Block a user