removed duplicate tab from settings tab

This commit is contained in:
Bikram Choudhury
2026-05-22 21:51:14 +05:30
parent 663f0e6faf
commit 0dda2069eb
2 changed files with 0 additions and 35 deletions
-16
View File
@@ -1,7 +1,6 @@
import { ActionType, OpenCollectionTab, TabKind } from "Contracts/ActionContracts";
import React from "react";
import * as ViewModels from "../../Contracts/ViewModels";
import { useTabs } from "../../hooks/useTabs";
import { SettingsComponent } from "../Controls/Settings/SettingsComponent";
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 {
super.onActivate();
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.CollectionSettingsV2);
-19
View File
@@ -77,25 +77,6 @@ test("Duplicate Query tab preserves query text in new tab", async () => {
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 () => {
// The Home tab (ReactTabKind) is never duplicable
await explorer.tabNavHeader("Home").click({ button: "right" });