mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-06-05 15:12:04 +01:00
Move restore flag behind feature flag. Whitelist restorable tabs in for Fabric. Restore e2e tests.
This commit is contained in:
parent
846cc105d7
commit
35e997a97b
@ -1166,7 +1166,10 @@ export default class Explorer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.refreshSampleData();
|
await this.refreshSampleData();
|
||||||
this.restoreOpenTabs();
|
|
||||||
|
if (userContext.features.restoreTabs) {
|
||||||
|
this.restoreOpenTabs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async configureCopilot(): Promise<void> {
|
public async configureCopilot(): Promise<void> {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// TODO convert this file to an action registry in order to have actions and their handlers be more tightly coupled.
|
// TODO convert this file to an action registry in order to have actions and their handlers be more tightly coupled.
|
||||||
|
import { configContext, Platform } from "ConfigContext";
|
||||||
import { useDatabases } from "Explorer/useDatabases";
|
import { useDatabases } from "Explorer/useDatabases";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { ActionContracts } from "../../Contracts/ExplorerContracts";
|
import { ActionContracts } from "../../Contracts/ExplorerContracts";
|
||||||
@ -56,6 +57,19 @@ function openCollectionTab(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
configContext.platform === Platform.Fabric &&
|
||||||
|
!(
|
||||||
|
// whitelist the tab kinds that are allowed to be opened in Fabric
|
||||||
|
(
|
||||||
|
action.tabKind === ActionContracts.TabKind.SQLDocuments ||
|
||||||
|
action.tabKind === ActionContracts.TabKind.SQLQuery
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//expand database first if not expanded to load the collections
|
//expand database first if not expanded to load the collections
|
||||||
if (!database.isDatabaseExpanded?.()) {
|
if (!database.isDatabaseExpanded?.()) {
|
||||||
database.expandDatabase?.();
|
database.expandDatabase?.();
|
||||||
|
@ -38,6 +38,7 @@ export type Features = {
|
|||||||
readonly copilotChatFixedMonacoEditorHeight: boolean;
|
readonly copilotChatFixedMonacoEditorHeight: boolean;
|
||||||
readonly enablePriorityBasedExecution: boolean;
|
readonly enablePriorityBasedExecution: boolean;
|
||||||
readonly disableConnectionStringLogin: boolean;
|
readonly disableConnectionStringLogin: boolean;
|
||||||
|
readonly restoreTabs: boolean;
|
||||||
|
|
||||||
// can be set via both flight and feature flag
|
// can be set via both flight and feature flag
|
||||||
autoscaleDefault: boolean;
|
autoscaleDefault: boolean;
|
||||||
@ -108,6 +109,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
|
|||||||
copilotChatFixedMonacoEditorHeight: "true" === get("copilotchatfixedmonacoeditorheight"),
|
copilotChatFixedMonacoEditorHeight: "true" === get("copilotchatfixedmonacoeditorheight"),
|
||||||
enablePriorityBasedExecution: "true" === get("enableprioritybasedexecution"),
|
enablePriorityBasedExecution: "true" === get("enableprioritybasedexecution"),
|
||||||
disableConnectionStringLogin: "true" === get("disableconnectionstringlogin"),
|
disableConnectionStringLogin: "true" === get("disableconnectionstringlogin"),
|
||||||
|
restoreTabs: "true" === get("restoretabs"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
import { StorageKey } from "../../src/Shared/StorageUtility";
|
|
||||||
import { DataExplorer, Editor, QueryTab, TestAccount } from "../fx";
|
import { DataExplorer, Editor, QueryTab, TestAccount } from "../fx";
|
||||||
import { TestContainerContext, TestItem, createTestSQLContainer } from "../testData";
|
import { TestContainerContext, TestItem, createTestSQLContainer } from "../testData";
|
||||||
|
|
||||||
@ -17,9 +16,6 @@ test.beforeEach("Open new query tab", async ({ page }) => {
|
|||||||
// Open a query tab
|
// Open a query tab
|
||||||
explorer = await DataExplorer.open(page, TestAccount.SQL);
|
explorer = await DataExplorer.open(page, TestAccount.SQL);
|
||||||
|
|
||||||
// Clear previous settings
|
|
||||||
page.evaluate(() => localStorage.removeItem(StorageKey[StorageKey.AppState]));
|
|
||||||
|
|
||||||
// Container nodes should be visible. The explorer auto-expands database nodes when they are first loaded.
|
// Container nodes should be visible. The explorer auto-expands database nodes when they are first loaded.
|
||||||
const containerNode = await explorer.waitForContainerNode(context.database.id, context.container.id);
|
const containerNode = await explorer.waitForContainerNode(context.database.id, context.container.id);
|
||||||
await containerNode.openContextMenu();
|
await containerNode.openContextMenu();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user