diff --git a/src/Explorer/ComponentRegisterer.test.ts b/src/Explorer/ComponentRegisterer.test.ts index 98f5af729..e2671ef2e 100644 --- a/src/Explorer/ComponentRegisterer.test.ts +++ b/src/Explorer/ComponentRegisterer.test.ts @@ -20,51 +20,6 @@ describe("Component Registerer", () => { expect(ko.components.isRegistered("json-editor")).toBe(true); }); - it("should register documents-tab component", () => { - expect(ko.components.isRegistered("documents-tab")).toBe(true); - }); - - it("should register stored-procedure-tab component", () => { - expect(ko.components.isRegistered("stored-procedure-tab")).toBe(true); - }); - - it("should register trigger-tab component", () => { - expect(ko.components.isRegistered("trigger-tab")).toBe(true); - }); - - it("should register user-defined-function-tab component", () => { - expect(ko.components.isRegistered("user-defined-function-tab")).toBe(true); - }); - - it("should register settings-tab-v2 component", () => { - expect(ko.components.isRegistered("database-settings-tab-v2")).toBe(true); - expect(ko.components.isRegistered("collection-settings-tab-v2")).toBe(true); - }); - - it("should register query-tab component", () => { - expect(ko.components.isRegistered("query-tab")).toBe(true); - }); - - it("should register tables-query-tab component", () => { - expect(ko.components.isRegistered("tables-query-tab")).toBe(true); - }); - - it("should register graph-tab component", () => { - expect(ko.components.isRegistered("graph-tab")).toBe(true); - }); - - it("should register notebookv2-tab component", () => { - expect(ko.components.isRegistered("notebookv2-tab")).toBe(true); - }); - - it("should register terminal-tab component", () => { - expect(ko.components.isRegistered("terminal-tab")).toBe(true); - }); - - it("should register mongo-shell-tab component", () => { - expect(ko.components.isRegistered("mongo-shell-tab")).toBe(true); - }); - it("should registeradd-collection-pane component", () => { expect(ko.components.isRegistered("add-collection-pane")).toBe(true); }); diff --git a/src/Explorer/ComponentRegisterer.ts b/src/Explorer/ComponentRegisterer.ts index 1f2984612..0c4e8c1d8 100644 --- a/src/Explorer/ComponentRegisterer.ts +++ b/src/Explorer/ComponentRegisterer.ts @@ -8,21 +8,6 @@ import { JsonEditorComponent } from "./Controls/JsonEditor/JsonEditorComponent"; import { ThroughputInputComponentAutoPilotV3 } from "./Controls/ThroughputInput/ThroughputInputComponentAutoPilotV3"; import { GraphStyleComponent } from "./Graph/GraphStyleComponent/GraphStyleComponent"; import * as PaneComponents from "./Panes/PaneComponents"; -import ConflictsTab from "./Tabs/ConflictsTab"; -import DocumentsTab from "./Tabs/DocumentsTab"; -import GalleryTab from "./Tabs/GalleryTab"; -import GraphTab from "./Tabs/GraphTab"; -import MongoShellTab from "./Tabs/MongoShellTab"; -import NotebookTabV2 from "./Tabs/NotebookV2Tab"; -import NotebookViewerTab from "./Tabs/NotebookViewerTab"; -import QueryTab from "./Tabs/QueryTab"; -import QueryTablesTab from "./Tabs/QueryTablesTab"; -import SchemaAnalyzerTab from "./Tabs/SchemaAnalyzerTab"; -import { DatabaseSettingsTabV2, SettingsTabV2 } from "./Tabs/SettingsTabV2"; -import StoredProcedureTab from "./Tabs/StoredProcedureTab"; -import TerminalTab from "./Tabs/TerminalTab"; -import TriggerTab from "./Tabs/TriggerTab"; -import UserDefinedFunctionTab from "./Tabs/UserDefinedFunctionTab"; ko.components.register("input-typeahead", new InputTypeaheadComponent()); ko.components.register("error-display", new ErrorDisplayComponent()); @@ -33,26 +18,6 @@ ko.components.register("diff-editor", new DiffEditorComponent()); ko.components.register("dynamic-list", DynamicListComponent); ko.components.register("throughput-input-autopilot-v3", ThroughputInputComponentAutoPilotV3); -// Collection Tabs -[ - DocumentsTab, - StoredProcedureTab, - TriggerTab, - UserDefinedFunctionTab, - SettingsTabV2, - QueryTab, - QueryTablesTab, - GraphTab, - MongoShellTab, - ConflictsTab, - NotebookTabV2, - TerminalTab, - GalleryTab, - NotebookViewerTab, - DatabaseSettingsTabV2, - SchemaAnalyzerTab, -].forEach(({ component: { name, template } }) => ko.components.register(name, { template })); - // Panes ko.components.register("add-database-pane", new PaneComponents.AddDatabasePaneComponent()); ko.components.register("add-collection-pane", new PaneComponents.AddCollectionPaneComponent()); diff --git a/src/Explorer/Tabs/ConflictsTab.ts b/src/Explorer/Tabs/ConflictsTab.ts index a74b8e6d6..6d95b01eb 100644 --- a/src/Explorer/Tabs/ConflictsTab.ts +++ b/src/Explorer/Tabs/ConflictsTab.ts @@ -1,35 +1,34 @@ +import { ConflictDefinition, FeedOptions, QueryIterator, Resource } from "@azure/cosmos"; import * as ko from "knockout"; import Q from "q"; +import DeleteIcon from "../../../images/delete.svg"; +import DiscardIcon from "../../../images/discard.svg"; +import SaveIcon from "../../../images/save-cosmos.svg"; import * as Constants from "../../Common/Constants"; +import { DocumentsGridMetrics, KeyCodes } from "../../Common/Constants"; +import { createDocument } from "../../Common/dataAccess/createDocument"; +import { deleteConflict } from "../../Common/dataAccess/deleteConflict"; +import { deleteDocument } from "../../Common/dataAccess/deleteDocument"; +import { queryConflicts } from "../../Common/dataAccess/queryConflicts"; +import { updateDocument } from "../../Common/dataAccess/updateDocument"; +import editable from "../../Common/EditableUtility"; +import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; +import * as HeadersUtility from "../../Common/HeadersUtility"; +import { MinimalQueryIterator } from "../../Common/IteratorUtilities"; +import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; import * as DataModels from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; -import { AccessibleVerticalList } from "../Tree/AccessibleVerticalList"; -import { KeyCodes } from "../../Common/Constants"; -import ConflictId from "../Tree/ConflictId"; -import editable from "../../Common/EditableUtility"; -import * as HeadersUtility from "../../Common/HeadersUtility"; -import TabsBase from "./TabsBase"; -import { DocumentsGridMetrics } from "../../Common/Constants"; -import { Splitter, SplitterBounds, SplitterDirection } from "../../Common/Splitter"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; -import SaveIcon from "../../../images/save-cosmos.svg"; -import DiscardIcon from "../../../images/discard.svg"; -import DeleteIcon from "../../../images/delete.svg"; -import { QueryIterator, Resource, ConflictDefinition, FeedOptions } from "@azure/cosmos"; -import { MinimalQueryIterator } from "../../Common/IteratorUtilities"; -import Explorer from "../Explorer"; import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; -import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; -import { createDocument } from "../../Common/dataAccess/createDocument"; -import { deleteDocument } from "../../Common/dataAccess/deleteDocument"; -import { updateDocument } from "../../Common/dataAccess/updateDocument"; -import { deleteConflict } from "../../Common/dataAccess/deleteConflict"; -import { queryConflicts } from "../../Common/dataAccess/queryConflicts"; +import Explorer from "../Explorer"; +import { AccessibleVerticalList } from "../Tree/AccessibleVerticalList"; +import ConflictId from "../Tree/ConflictId"; import template from "./ConflictsTab.html"; +import TabsBase from "./TabsBase"; export default class ConflictsTab extends TabsBase { - public static readonly component = { name: "conflicts-tab", template }; + public readonly html = template; public selectedConflictId: ko.Observable; public selectedConflictContent: ViewModels.Editable; public selectedConflictCurrent: ViewModels.Editable; diff --git a/src/Explorer/Tabs/DocumentsTab.ts b/src/Explorer/Tabs/DocumentsTab.ts index cdb1f739e..9f6cafcd4 100644 --- a/src/Explorer/Tabs/DocumentsTab.ts +++ b/src/Explorer/Tabs/DocumentsTab.ts @@ -31,7 +31,7 @@ import template from "./DocumentsTab.html"; import TabsBase from "./TabsBase"; export default class DocumentsTab extends TabsBase { - public static readonly component = { name: "documents-tab", template }; + public readonly html = template; public selectedDocumentId: ko.Observable; public selectedDocumentContent: ViewModels.Editable; public initialDocumentContent: ko.Observable; diff --git a/src/Explorer/Tabs/GalleryTab.html b/src/Explorer/Tabs/GalleryTab.html deleted file mode 100644 index d7c6f055a..000000000 --- a/src/Explorer/Tabs/GalleryTab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/GalleryTab.tsx b/src/Explorer/Tabs/GalleryTab.tsx index 927e8ba1c..abd2b35da 100644 --- a/src/Explorer/Tabs/GalleryTab.tsx +++ b/src/Explorer/Tabs/GalleryTab.tsx @@ -1,12 +1,11 @@ +import { DatabaseAccount } from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; +import { IGalleryItem, JunoClient } from "../../Juno/JunoClient"; import { GalleryAndNotebookViewerComponentProps } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponent"; import { GalleryAndNotebookViewerComponentAdapter } from "../Controls/NotebookGallery/GalleryAndNotebookViewerComponentAdapter"; import { GalleryTab as GalleryViewerTab, SortBy } from "../Controls/NotebookGallery/GalleryViewerComponent"; -import TabsBase from "./TabsBase"; import Explorer from "../Explorer"; -import { DatabaseAccount } from "../../Contracts/DataModels"; -import { JunoClient, IGalleryItem } from "../../Juno/JunoClient"; -import template from "./GalleryTab.html"; +import TabsBase from "./TabsBase"; interface GalleryTabOptions extends ViewModels.TabOptions { account: DatabaseAccount; @@ -22,7 +21,7 @@ interface GalleryTabOptions extends ViewModels.TabOptions { * Notebook gallery tab */ export default class GalleryTab extends TabsBase { - public static readonly component = { name: "gallery-tab", template }; + public readonly html = '
'; private container: Explorer; private galleryAndNotebookViewerComponentProps: GalleryAndNotebookViewerComponentProps; public galleryAndNotebookViewerComponentAdapter: GalleryAndNotebookViewerComponentAdapter; diff --git a/src/Explorer/Tabs/GraphTab.html b/src/Explorer/Tabs/GraphTab.html deleted file mode 100644 index ac7ef7c40..000000000 --- a/src/Explorer/Tabs/GraphTab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/GraphTab.tsx b/src/Explorer/Tabs/GraphTab.tsx index b30fa2469..8a6712b67 100644 --- a/src/Explorer/Tabs/GraphTab.tsx +++ b/src/Explorer/Tabs/GraphTab.tsx @@ -10,7 +10,6 @@ import { GraphExplorerAdapter } from "../Graph/GraphExplorerComponent/GraphExplo import { ContextualPaneBase } from "../Panes/ContextualPaneBase"; import GraphStylingPane from "../Panes/GraphStylingPane"; import { NewVertexPanel } from "../Panes/NewVertexPanel/NewVertexPanel"; -import template from "./GraphTab.html"; import TabsBase from "./TabsBase"; export interface GraphIconMap { [key: string]: { data: string; format: string }; @@ -37,7 +36,8 @@ interface GraphTabOptions extends ViewModels.TabOptions { } export default class GraphTab extends TabsBase { - public static readonly component = { name: "graph-tab", template }; + public readonly html = + '
'; // Graph default configuration public static readonly DEFAULT_NODE_CAPTION = "id"; private static readonly LINK_COLOR = "#aaa"; diff --git a/src/Explorer/Tabs/MongoShellTab.ts b/src/Explorer/Tabs/MongoShellTab.ts index 4dbdc0c99..4ae74947f 100644 --- a/src/Explorer/Tabs/MongoShellTab.ts +++ b/src/Explorer/Tabs/MongoShellTab.ts @@ -13,7 +13,7 @@ import template from "./MongoShellTab.html"; import TabsBase from "./TabsBase"; export default class MongoShellTab extends TabsBase { - public static readonly component = { name: "mongo-shell-tab", template }; + public readonly html = template; public url: ko.Computed; private _container: Explorer; private _runtimeEndpoint: string; diff --git a/src/Explorer/Tabs/NotebookV2Tab.html b/src/Explorer/Tabs/NotebookV2Tab.html deleted file mode 100644 index 6f3c449b6..000000000 --- a/src/Explorer/Tabs/NotebookV2Tab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/NotebookV2Tab.ts b/src/Explorer/Tabs/NotebookV2Tab.ts index f0440f61e..758aa1ce8 100644 --- a/src/Explorer/Tabs/NotebookV2Tab.ts +++ b/src/Explorer/Tabs/NotebookV2Tab.ts @@ -27,14 +27,13 @@ import { KernelSpecsDisplay } from "../Notebook/NotebookClientV2"; import { NotebookComponentAdapter } from "../Notebook/NotebookComponent/NotebookComponentAdapter"; import { NotebookContentItem } from "../Notebook/NotebookContentItem"; import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase"; -import template from "./NotebookV2Tab.html"; export interface NotebookTabOptions extends NotebookTabBaseOptions { notebookContentItem: NotebookContentItem; } export default class NotebookTabV2 extends NotebookTabBase { - public static readonly component = { name: "notebookv2-tab", template }; + public readonly html = '
'; public notebookPath: ko.Observable; private selectedSparkPool: ko.Observable; private notebookComponentAdapter: NotebookComponentAdapter; diff --git a/src/Explorer/Tabs/NotebookViewerTab.html b/src/Explorer/Tabs/NotebookViewerTab.html deleted file mode 100644 index 255a7aebe..000000000 --- a/src/Explorer/Tabs/NotebookViewerTab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/NotebookViewerTab.tsx b/src/Explorer/Tabs/NotebookViewerTab.tsx index 5161231c8..677ca21a8 100644 --- a/src/Explorer/Tabs/NotebookViewerTab.tsx +++ b/src/Explorer/Tabs/NotebookViewerTab.tsx @@ -1,16 +1,15 @@ import * as ko from "knockout"; import * as React from "react"; import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; +import { DatabaseAccount } from "../../Contracts/DataModels"; import * as ViewModels from "../../Contracts/ViewModels"; +import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; import { NotebookViewerComponent, NotebookViewerComponentProps, } from "../Controls/NotebookViewer/NotebookViewerComponent"; -import TabsBase from "./TabsBase"; import Explorer from "../Explorer"; -import { DatabaseAccount } from "../../Contracts/DataModels"; -import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; -import template from "./NotebookViewerTab.html"; +import TabsBase from "./TabsBase"; interface NotebookViewerTabOptions extends ViewModels.TabOptions { account: DatabaseAccount; @@ -39,7 +38,7 @@ class NotebookViewerComponentAdapter implements ReactAdapter { } export default class NotebookViewerTab extends TabsBase { - public static readonly component = { name: "notebook-viewer-tab", template }; + public readonly html = '
'; private container: Explorer; public notebookUrl: string; diff --git a/src/Explorer/Tabs/QueryTab.html b/src/Explorer/Tabs/QueryTab.html index 8f3b2d229..9adb59c2d 100644 --- a/src/Explorer/Tabs/QueryTab.html +++ b/src/Explorer/Tabs/QueryTab.html @@ -1,11 +1,4 @@ -
+
Start by writing a Mongo query, for example: {'id':'foo'} or { } to get all the diff --git a/src/Explorer/Tabs/QueryTab.ts b/src/Explorer/Tabs/QueryTab.ts index fc1132242..976befa21 100644 --- a/src/Explorer/Tabs/QueryTab.ts +++ b/src/Explorer/Tabs/QueryTab.ts @@ -25,7 +25,7 @@ enum ToggleState { } export default class QueryTab extends TabsBase implements ViewModels.WaitsForTemplate { - public static readonly component = { name: "query-tab", template }; + public readonly html = template; public queryEditorId: string; public executeQueryButton: ViewModels.Button; public fetchNextPageButton: ViewModels.Button; diff --git a/src/Explorer/Tabs/QueryTablesTab.html b/src/Explorer/Tabs/QueryTablesTab.html index 614828400..97bd77016 100644 --- a/src/Explorer/Tabs/QueryTablesTab.html +++ b/src/Explorer/Tabs/QueryTablesTab.html @@ -1,11 +1,4 @@ -
+
(); public queryViewModel = ko.observable(); diff --git a/src/Explorer/Tabs/SchemaAnalyzerTab.html b/src/Explorer/Tabs/SchemaAnalyzerTab.html deleted file mode 100644 index 120d9213b..000000000 --- a/src/Explorer/Tabs/SchemaAnalyzerTab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/SchemaAnalyzerTab.ts b/src/Explorer/Tabs/SchemaAnalyzerTab.ts index 1f998d657..0e3aa8418 100644 --- a/src/Explorer/Tabs/SchemaAnalyzerTab.ts +++ b/src/Explorer/Tabs/SchemaAnalyzerTab.ts @@ -1,10 +1,8 @@ import { SchemaAnalyzerComponentAdapter } from "../Notebook/SchemaAnalyzerComponent/SchemaAnalyzerComponentAdapter"; import NotebookTabBase, { NotebookTabBaseOptions } from "./NotebookTabBase"; -import template from "./SchemaAnalyzerTab.html"; export default class SchemaAnalyzerTab extends NotebookTabBase { - public static readonly component = { name: "schema-analyzer-tab", template }; - + public readonly html = '
'; private schemaAnalyzerComponentAdapter: SchemaAnalyzerComponentAdapter; constructor(options: NotebookTabBaseOptions) { diff --git a/src/Explorer/Tabs/SettingsTabV2.html b/src/Explorer/Tabs/SettingsTabV2.html deleted file mode 100644 index e51370097..000000000 --- a/src/Explorer/Tabs/SettingsTabV2.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/SettingsTabV2.tsx b/src/Explorer/Tabs/SettingsTabV2.tsx index 973cc9f31..1221a53f7 100644 --- a/src/Explorer/Tabs/SettingsTabV2.tsx +++ b/src/Explorer/Tabs/SettingsTabV2.tsx @@ -1,18 +1,17 @@ -import * as ViewModels from "../../Contracts/ViewModels"; -import * as DataModels from "../../Contracts/DataModels"; -import TabsBase from "./TabsBase"; -import { SettingsComponentAdapter } from "../Controls/Settings/SettingsComponentAdapter"; -import { SettingsComponentProps } from "../Controls/Settings/SettingsComponent"; -import { traceFailure } from "../../Shared/Telemetry/TelemetryProcessor"; import ko from "knockout"; import * as Constants from "../../Common/Constants"; -import { Action } from "../../Shared/Telemetry/TelemetryConstants"; -import { logConsoleError } from "../../Utils/NotificationConsoleUtils"; import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; -import template from "./SettingsTabV2.html"; +import * as DataModels from "../../Contracts/DataModels"; +import * as ViewModels from "../../Contracts/ViewModels"; +import { Action } from "../../Shared/Telemetry/TelemetryConstants"; +import { traceFailure } from "../../Shared/Telemetry/TelemetryProcessor"; +import { logConsoleError } from "../../Utils/NotificationConsoleUtils"; +import { SettingsComponentProps } from "../Controls/Settings/SettingsComponent"; +import { SettingsComponentAdapter } from "../Controls/Settings/SettingsComponentAdapter"; +import TabsBase from "./TabsBase"; export class SettingsTabV2 extends TabsBase { - public static readonly component = { name: "collection-settings-tab-v2", template }; + public readonly html = '
'; public settingsComponentAdapter: SettingsComponentAdapter; constructor(options: ViewModels.TabOptions) { @@ -89,7 +88,6 @@ export class CollectionSettingsTabV2 extends SettingsTabV2 { } export class DatabaseSettingsTabV2 extends SettingsTabV2 { - public static readonly component = { name: "database-settings-tab-v2", template }; private notificationRead: ko.Observable; private notification: DataModels.Notification; diff --git a/src/Explorer/Tabs/StoredProcedureTab.ts b/src/Explorer/Tabs/StoredProcedureTab.ts index 416753fdd..01ff59c11 100644 --- a/src/Explorer/Tabs/StoredProcedureTab.ts +++ b/src/Explorer/Tabs/StoredProcedureTab.ts @@ -22,7 +22,7 @@ enum ToggleState { } export default class StoredProcedureTab extends ScriptTabBase { - public static readonly component = { name: "stored-procedure-tab", template }; + public readonly html = template; public collection: ViewModels.Collection; public node: StoredProcedure; public executeResultsEditorId: string; diff --git a/src/Explorer/Tabs/Tabs.tsx b/src/Explorer/Tabs/Tabs.tsx index f71ecec4a..91028c501 100644 --- a/src/Explorer/Tabs/Tabs.tsx +++ b/src/Explorer/Tabs/Tabs.tsx @@ -103,11 +103,8 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { ko.applyBindings(tab, element); const ctx = ko.contextFor(element).createChildContext(tab); ko.applyBindingsToDescendants(ctx, element); - return () => ko.cleanNode(element); - } - - if ("render" in tab) { tab.isTemplateReady(true); + return () => ko.cleanNode(element); } }, [ref, tab]); @@ -115,5 +112,5 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) { return
{tab.render()}
; } - return
; + return
; } diff --git a/src/Explorer/Tabs/TabsBase.ts b/src/Explorer/Tabs/TabsBase.ts index b02065153..dfd92a651 100644 --- a/src/Explorer/Tabs/TabsBase.ts +++ b/src/Explorer/Tabs/TabsBase.ts @@ -14,7 +14,6 @@ import { TabsManager } from "./TabsManager"; // TODO: Use specific actions for logging telemetry data export default class TabsBase extends WaitsForTemplateViewModel { private static id = 0; - public static readonly component = { name: "tab", template: "" }; public closeTabButton: ViewModels.Button; public node: ViewModels.TreeNode; public collection: ViewModels.CollectionBase; diff --git a/src/Explorer/Tabs/TerminalTab.html b/src/Explorer/Tabs/TerminalTab.html deleted file mode 100644 index e53e1c983..000000000 --- a/src/Explorer/Tabs/TerminalTab.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/src/Explorer/Tabs/TerminalTab.tsx b/src/Explorer/Tabs/TerminalTab.tsx index 3f19dcc4e..9115bf4bd 100644 --- a/src/Explorer/Tabs/TerminalTab.tsx +++ b/src/Explorer/Tabs/TerminalTab.tsx @@ -1,13 +1,12 @@ import * as ko from "knockout"; -import * as ViewModels from "../../Contracts/ViewModels"; -import * as DataModels from "../../Contracts/DataModels"; -import TabsBase from "./TabsBase"; import * as React from "react"; import { ReactAdapter } from "../../Bindings/ReactBindingHandler"; +import * as DataModels from "../../Contracts/DataModels"; +import * as ViewModels from "../../Contracts/ViewModels"; +import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; import { NotebookTerminalComponent } from "../Controls/Notebook/NotebookTerminalComponent"; import Explorer from "../Explorer"; -import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent"; -import template from "./TerminalTab.html"; +import TabsBase from "./TabsBase"; export interface TerminalTabOptions extends ViewModels.TabOptions { account: DataModels.DatabaseAccount; @@ -39,7 +38,7 @@ class NotebookTerminalComponentAdapter implements ReactAdapter { } export default class TerminalTab extends TabsBase { - public static readonly component = { name: "terminal-tab", template }; + public readonly html = '
'; private container: Explorer; private notebookTerminalComponentAdapter: NotebookTerminalComponentAdapter; diff --git a/src/Explorer/Tabs/TriggerTab.ts b/src/Explorer/Tabs/TriggerTab.ts index bf68c7bb8..54cd47c3f 100644 --- a/src/Explorer/Tabs/TriggerTab.ts +++ b/src/Explorer/Tabs/TriggerTab.ts @@ -3,16 +3,16 @@ import * as Constants from "../../Common/Constants"; import { createTrigger } from "../../Common/dataAccess/createTrigger"; import { updateTrigger } from "../../Common/dataAccess/updateTrigger"; import editable from "../../Common/EditableUtility"; +import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import Trigger from "../Tree/Trigger"; import ScriptTabBase from "./ScriptTabBase"; -import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; import template from "./TriggerTab.html"; export default class TriggerTab extends ScriptTabBase { - public static readonly component = { name: "trigger-tab", template }; + public readonly html = template; public collection: ViewModels.Collection; public node: Trigger; public triggerType: ViewModels.Editable; diff --git a/src/Explorer/Tabs/UserDefinedFunctionTab.ts b/src/Explorer/Tabs/UserDefinedFunctionTab.ts index a150df2a8..ff5a7753d 100644 --- a/src/Explorer/Tabs/UserDefinedFunctionTab.ts +++ b/src/Explorer/Tabs/UserDefinedFunctionTab.ts @@ -2,16 +2,16 @@ import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos"; import * as Constants from "../../Common/Constants"; import { createUserDefinedFunction } from "../../Common/dataAccess/createUserDefinedFunction"; import { updateUserDefinedFunction } from "../../Common/dataAccess/updateUserDefinedFunction"; +import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; import * as ViewModels from "../../Contracts/ViewModels"; import { Action } from "../../Shared/Telemetry/TelemetryConstants"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import UserDefinedFunction from "../Tree/UserDefinedFunction"; import ScriptTabBase from "./ScriptTabBase"; -import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; import template from "./UserDefinedFunctionTab.html"; export default class UserDefinedFunctionTab extends ScriptTabBase { - public static readonly component = { name: "user-defined-function-tab", template }; + public readonly html = template; public collection: ViewModels.Collection; public node: UserDefinedFunction; constructor(options: ViewModels.ScriptTabOption) {