mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 09:02:41 +01:00
Remove Phoenix and notebooks (Phase 5) (#2561)
* Remove Phoenix and notebook core Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e4f2ebd-f2f8-4c2b-b63d-40e1a2b1c662 * Fix merge issue. --------- Copilot-Session: 4e4f2ebd-f2f8-4c2b-b63d-40e1a2b1c662
This commit is contained in:
@@ -83,12 +83,6 @@ export function useKnockoutExplorer(platform: Platform): Explorer {
|
||||
useEffect(() => {
|
||||
const effect = async () => {
|
||||
if (platform) {
|
||||
//Updating phoenix feature flags for MPAC based of config context
|
||||
if (configContext.isPhoenixEnabled === true) {
|
||||
userContext.features.phoenixNotebooks = true;
|
||||
userContext.features.phoenixFeatures = true;
|
||||
}
|
||||
|
||||
let explorer: Explorer;
|
||||
try {
|
||||
if (platform === Platform.Hosted) {
|
||||
@@ -1010,15 +1004,6 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
|
||||
if (inputs.flights.indexOf(Flights.PKPartitionKeyTest) !== -1) {
|
||||
userContext.features.partitionKeyDefault2 = true;
|
||||
}
|
||||
if (inputs.flights.indexOf(Flights.PhoenixNotebooks) !== -1) {
|
||||
userContext.features.phoenixNotebooks = true;
|
||||
}
|
||||
if (inputs.flights.indexOf(Flights.PhoenixFeatures) !== -1) {
|
||||
userContext.features.phoenixFeatures = true;
|
||||
}
|
||||
if (inputs.flights.indexOf(Flights.NotebooksDownBanner) !== -1) {
|
||||
userContext.features.notebooksDownBanner = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle initial theme from portal
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import create, { UseStore } from "zustand";
|
||||
|
||||
export interface NotebookSnapshotHooks {
|
||||
snapshot?: string;
|
||||
error?: string;
|
||||
setSnapshot: (imageSrc: string) => void;
|
||||
setError: (error: string) => void;
|
||||
}
|
||||
|
||||
export const useNotebookSnapshotStore: UseStore<NotebookSnapshotHooks> = create((set) => ({
|
||||
snapshot: undefined,
|
||||
error: undefined,
|
||||
setSnapshot: (imageSrc: string) => set((state) => ({ ...state, snapshot: imageSrc })),
|
||||
setError: (error: string) => set((state) => ({ ...state, error })),
|
||||
}));
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
} from "Shared/AppStatePersistenceUtility";
|
||||
import create, { UseStore } from "zustand";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { CollectionTabKind } from "../Contracts/ViewModels";
|
||||
import TabsBase from "../Explorer/Tabs/TabsBase";
|
||||
|
||||
export interface TabsState {
|
||||
@@ -27,7 +26,6 @@ export interface TabsState {
|
||||
refreshActiveTab: (comparator: (tab: TabsBase) => boolean) => void;
|
||||
closeTabsByComparator: (comparator: (tab: TabsBase) => boolean) => void;
|
||||
closeTab: (tab: TabsBase) => void;
|
||||
closeAllNotebookTabs: (hardClose: boolean) => void;
|
||||
openAndActivateReactTab: (tabKind: ReactTabKind) => void;
|
||||
closeReactTab: (tabKind: ReactTabKind) => void;
|
||||
setIsTabExecuting: (state: boolean) => void;
|
||||
@@ -132,33 +130,6 @@ export const useTabs: UseStore<TabsState> = create((set, get) => ({
|
||||
|
||||
get().persistTabsState();
|
||||
},
|
||||
closeAllNotebookTabs: (): void => {
|
||||
const isNotebook = (tabKind: CollectionTabKind): boolean => {
|
||||
if (
|
||||
tabKind === CollectionTabKind.Notebook ||
|
||||
tabKind === CollectionTabKind.NotebookV2 ||
|
||||
tabKind === CollectionTabKind.SchemaAnalyzer ||
|
||||
tabKind === CollectionTabKind.Terminal
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const tabList = get().openedTabs;
|
||||
if (tabList && tabList.length > 0) {
|
||||
tabList.forEach((tab: TabsBase) => {
|
||||
const tabKind: CollectionTabKind = tab.tabKind;
|
||||
if (tabKind && isNotebook(tabKind)) {
|
||||
tab.onCloseTabButtonClick();
|
||||
}
|
||||
});
|
||||
|
||||
if (get().openedTabs.length === 0 && !isFabricMirrored()) {
|
||||
set({ activeTab: undefined, activeReactTab: undefined });
|
||||
}
|
||||
}
|
||||
},
|
||||
openAndActivateReactTab: (tabKind: ReactTabKind) => {
|
||||
if (get().openedReactTabs.indexOf(tabKind) === -1) {
|
||||
set((state) => ({
|
||||
|
||||
Reference in New Issue
Block a user