mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 17:12:47 +01:00
Move Portal Backend calls into a PortalBackendClient helper
fetchEncryptedToken and isAccountRestrictedForConnectionStringLogin lived in ConnectExplorer.tsx, so HostedExplorer imported a network call from a React component. Merge them with fetchAccessData into src/Platform/Hosted/Helpers/PortalBackendClient.ts along with the PortalBackendError type, leaving ConnectExplorer as UI only.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
jest.mock("./hooks/useAADAuth");
|
||||
jest.mock("./hooks/useConfig");
|
||||
jest.mock("./Platform/Hosted/Helpers/PortalAccessData");
|
||||
jest.mock("./Platform/Hosted/Helpers/PortalBackendClient");
|
||||
jest.mock("./Platform/Hosted/Components/ConnectExplorer");
|
||||
jest.mock("./Shared/appInsights");
|
||||
jest.mock("./Platform/Hosted/Components/AccountSwitcher", () => ({
|
||||
@@ -28,8 +28,8 @@ import React from "react";
|
||||
import { useAADAuth } from "./hooks/useAADAuth";
|
||||
import { useConfig } from "./hooks/useConfig";
|
||||
import { App } from "./HostedExplorer";
|
||||
import { ConnectExplorer, fetchEncryptedToken } from "./Platform/Hosted/Components/ConnectExplorer";
|
||||
import { fetchAccessData } from "./Platform/Hosted/Helpers/PortalAccessData";
|
||||
import { ConnectExplorer } from "./Platform/Hosted/Components/ConnectExplorer";
|
||||
import { fetchAccessData, fetchEncryptedToken } from "./Platform/Hosted/Helpers/PortalBackendClient";
|
||||
|
||||
const mockFetchEncryptedToken = fetchEncryptedToken as jest.MockedFunction<typeof fetchEncryptedToken>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user