mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 01:11:25 +00:00
Pure React Command Bar (#828)
This commit is contained in:
@@ -2,7 +2,6 @@ import * as ko from "knockout";
|
||||
import { DatabaseAccount } from "../../Contracts/DataModels";
|
||||
import * as ViewModels from "../../Contracts/ViewModels";
|
||||
import { updateUserContext } from "../../UserContext";
|
||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||
import Explorer from "../Explorer";
|
||||
import DocumentId from "../Tree/DocumentId";
|
||||
import DocumentsTab from "./DocumentsTab";
|
||||
@@ -17,7 +16,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.buildQuery("")).toContain("select");
|
||||
@@ -93,7 +91,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.showPartitionKey).toBe(false);
|
||||
@@ -108,7 +105,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.showPartitionKey).toBe(false);
|
||||
@@ -123,7 +119,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.showPartitionKey).toBe(true);
|
||||
@@ -141,7 +136,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.showPartitionKey).toBe(false);
|
||||
@@ -156,7 +150,6 @@ describe("Documents tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
|
||||
expect(documentsTab.showPartitionKey).toBe(true);
|
||||
|
||||
@@ -2,7 +2,6 @@ import * as ko from "knockout";
|
||||
import { DatabaseAccount } from "../../Contracts/DataModels";
|
||||
import * as ViewModels from "../../Contracts/ViewModels";
|
||||
import { updateUserContext } from "../../UserContext";
|
||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||
import Explorer from "../Explorer";
|
||||
import QueryTab from "./QueryTab";
|
||||
|
||||
@@ -26,7 +25,6 @@ describe("Query Tab", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: (buttons: CommandButtonComponentProps[]): void => {},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstan
|
||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
|
||||
import Explorer from "../Explorer";
|
||||
import { useCommandBar } from "../Menus/CommandBar/CommandBarComponentAdapter";
|
||||
import { WaitsForTemplateViewModel } from "../WaitsForTemplateViewModel";
|
||||
import { TabsManager } from "./TabsManager";
|
||||
|
||||
@@ -163,7 +164,7 @@ export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
|
||||
protected updateNavbarWithTabsButtons = (): void => {
|
||||
if (this.isActive()) {
|
||||
this.getContainer().onUpdateTabsButtons(this.getTabsButtons());
|
||||
useCommandBar.getState().setContextButtons(this.getTabsButtons());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ describe("Tabs manager tests", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: undefined,
|
||||
});
|
||||
|
||||
documentsTab = new DocumentsTab({
|
||||
@@ -63,7 +62,6 @@ describe("Tabs manager tests", () => {
|
||||
title: "",
|
||||
tabPath: "",
|
||||
hashLocation: "",
|
||||
onUpdateTabsButtons: undefined,
|
||||
});
|
||||
|
||||
// make sure tabs have different tabId
|
||||
|
||||
Reference in New Issue
Block a user