mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-11 15:07:30 +01:00
removed duplicate tab from settings tab
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { ActionType, OpenCollectionTab, TabKind } from "Contracts/ActionContracts";
|
import { ActionType, OpenCollectionTab, TabKind } from "Contracts/ActionContracts";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
import { useTabs } from "../../hooks/useTabs";
|
|
||||||
import { SettingsComponent } from "../Controls/Settings/SettingsComponent";
|
import { SettingsComponent } from "../Controls/Settings/SettingsComponent";
|
||||||
import TabsBase from "./TabsBase";
|
import TabsBase from "./TabsBase";
|
||||||
|
|
||||||
@@ -24,21 +23,6 @@ export class CollectionSettingsTabV2 extends SettingsTabV2 {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public canDuplicate(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public duplicateTab(): void {
|
|
||||||
const newTab = new CollectionSettingsTabV2({
|
|
||||||
tabKind: ViewModels.CollectionTabKind.CollectionSettingsV2,
|
|
||||||
title: this.tabTitle(),
|
|
||||||
tabPath: "",
|
|
||||||
collection: this.collection,
|
|
||||||
node: this.collection,
|
|
||||||
});
|
|
||||||
useTabs.getState().activateNewTab(newTab);
|
|
||||||
}
|
|
||||||
|
|
||||||
public onActivate(): void {
|
public onActivate(): void {
|
||||||
super.onActivate();
|
super.onActivate();
|
||||||
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.CollectionSettingsV2);
|
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.CollectionSettingsV2);
|
||||||
|
|||||||
@@ -77,25 +77,6 @@ test("Duplicate Query tab preserves query text in new tab", async () => {
|
|||||||
expect(editorText).toContain("duplicate-query-test");
|
expect(editorText).toContain("duplicate-query-test");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Duplicate Scale & Settings tab opens a second settings tab", async () => {
|
|
||||||
await explorer.openScaleAndSettings(context);
|
|
||||||
|
|
||||||
// Wait for the settings tab pane to be attached
|
|
||||||
const tab0 = explorer.tab("tab0");
|
|
||||||
await expect(tab0).toBeAttached({ timeout: 30_000 });
|
|
||||||
|
|
||||||
// Right-click the tab nav header
|
|
||||||
await explorer.tabNavHeader("tab0").click({ button: "right" });
|
|
||||||
|
|
||||||
const duplicateMenuItem = explorer.tabContextMenuItem("Duplicate tab");
|
|
||||||
await expect(duplicateMenuItem).toBeVisible();
|
|
||||||
await duplicateMenuItem.click();
|
|
||||||
|
|
||||||
// A second settings tab should appear
|
|
||||||
const tab1 = explorer.tab("tab1");
|
|
||||||
await expect(tab1).toBeAttached({ timeout: 30_000 });
|
|
||||||
});
|
|
||||||
|
|
||||||
test("Duplicate tab menu item is not shown for the Home tab", async () => {
|
test("Duplicate tab menu item is not shown for the Home tab", async () => {
|
||||||
// The Home tab (ReactTabKind) is never duplicable
|
// The Home tab (ReactTabKind) is never duplicable
|
||||||
await explorer.tabNavHeader("Home").click({ button: "right" });
|
await explorer.tabNavHeader("Home").click({ button: "right" });
|
||||||
|
|||||||
Reference in New Issue
Block a user