mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 19:01:28 +00:00
Compare commits
1 Commits
fixed-ts-s
...
fixed-ts-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb134a2441 |
@@ -1,5 +1,7 @@
|
|||||||
jest.mock("./MessageHandler");
|
jest.mock("./MessageHandler");
|
||||||
|
import { LogEntryLevel } from "../Contracts/Diagnostics";
|
||||||
import * as Logger from "./Logger";
|
import * as Logger from "./Logger";
|
||||||
|
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||||
import { sendMessage } from "./MessageHandler";
|
import { sendMessage } from "./MessageHandler";
|
||||||
|
|
||||||
describe("Logger", () => {
|
describe("Logger", () => {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { GraphData, GremlinEdge, GremlinVertex } from "./GraphData";
|
import { GraphData, GremlinVertex, GremlinEdge } from "./GraphData";
|
||||||
|
|
||||||
describe("Graph Data", () => {
|
describe("Graph Data", () => {
|
||||||
it("should set only one node as root", () => {
|
it("should set only one node as root", () => {
|
||||||
const graphData = new GraphData<GremlinVertex, GremlinEdge>();
|
const graphData = new GraphData<GremlinVertex, GremlinEdge>();
|
||||||
const v1: GremlinVertex = { id: "1", label: undefined };
|
const v1: GremlinVertex = { id: "1", label: null };
|
||||||
const v2: GremlinVertex = { id: "2", label: undefined };
|
const v2: GremlinVertex = { id: "2", label: null };
|
||||||
const v3: GremlinVertex = { id: "3", label: undefined };
|
const v3: GremlinVertex = { id: "3", label: null };
|
||||||
v3._isRoot = true;
|
v3._isRoot = true;
|
||||||
|
|
||||||
graphData.addVertex(v1);
|
graphData.addVertex(v1);
|
||||||
@@ -28,9 +28,9 @@ describe("Graph Data", () => {
|
|||||||
|
|
||||||
it("should properly find root id", () => {
|
it("should properly find root id", () => {
|
||||||
const graphData = new GraphData();
|
const graphData = new GraphData();
|
||||||
const v1: GremlinVertex = { id: "1", label: undefined };
|
const v1: GremlinVertex = { id: "1", label: null };
|
||||||
const v2: GremlinVertex = { id: "2", label: undefined };
|
const v2: GremlinVertex = { id: "2", label: null };
|
||||||
const v3: GremlinVertex = { id: "3", label: undefined };
|
const v3: GremlinVertex = { id: "3", label: null };
|
||||||
|
|
||||||
graphData.addVertex(v1);
|
graphData.addVertex(v1);
|
||||||
graphData.addVertex(v2);
|
graphData.addVertex(v2);
|
||||||
@@ -44,12 +44,12 @@ describe("Graph Data", () => {
|
|||||||
it("should remove edge from graph", () => {
|
it("should remove edge from graph", () => {
|
||||||
const graphData = new GraphData();
|
const graphData = new GraphData();
|
||||||
|
|
||||||
graphData.addVertex({ id: "v1", label: undefined });
|
graphData.addVertex({ id: "v1", label: null });
|
||||||
graphData.addVertex({ id: "v2", label: undefined });
|
graphData.addVertex({ id: "v2", label: null });
|
||||||
graphData.addVertex({ id: "v3", label: undefined });
|
graphData.addVertex({ id: "v3", label: null });
|
||||||
|
|
||||||
graphData.addEdge({ id: "e1", inV: "v1", outV: "v2", label: "" });
|
graphData.addEdge({ id: "e1", inV: "v1", outV: "v2", label: null });
|
||||||
graphData.addEdge({ id: "e2", inV: "v1", outV: "v3", label: "" });
|
graphData.addEdge({ id: "e2", inV: "v1", outV: "v3", label: null });
|
||||||
|
|
||||||
// in edge
|
// in edge
|
||||||
graphData.removeEdge("e1", false);
|
graphData.removeEdge("e1", false);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SimulationLinkDatum, SimulationNodeDatum } from "d3";
|
|
||||||
import _ from "underscore";
|
import _ from "underscore";
|
||||||
|
import { SimulationNodeDatum, SimulationLinkDatum } from "d3";
|
||||||
|
|
||||||
export interface PaginationInfo {
|
export interface PaginationInfo {
|
||||||
total: number;
|
total: number;
|
||||||
@@ -10,7 +10,7 @@ export interface PaginationInfo {
|
|||||||
|
|
||||||
export interface GremlinVertex {
|
export interface GremlinVertex {
|
||||||
id: string;
|
id: string;
|
||||||
label?: string;
|
label: string;
|
||||||
inE?: { [label: string]: GremlinShortInEdge[] };
|
inE?: { [label: string]: GremlinShortInEdge[] };
|
||||||
outE?: { [label: string]: GremlinShortOutEdge[] };
|
outE?: { [label: string]: GremlinShortOutEdge[] };
|
||||||
properties?: { [propName: string]: GremlinProperty[] };
|
properties?: { [propName: string]: GremlinProperty[] };
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const EditorContainer = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
interface MappedStateProps {
|
interface MappedStateProps {
|
||||||
mimetype: string;
|
mimetype: string | null;
|
||||||
text: string;
|
text: string;
|
||||||
contentRef: ContentRef;
|
contentRef: ContentRef;
|
||||||
theme?: "light" | "dark";
|
theme?: "light" | "dark";
|
||||||
@@ -37,7 +37,7 @@ interface TextFileState {
|
|||||||
class EditorPlaceholder extends React.PureComponent<MonacoEditorProps> {
|
class EditorPlaceholder extends React.PureComponent<MonacoEditorProps> {
|
||||||
render(): JSX.Element {
|
render(): JSX.Element {
|
||||||
// TODO: Show a little blocky placeholder
|
// TODO: Show a little blocky placeholder
|
||||||
return undefined;
|
return <div />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ interface InitialProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function makeMapStateToTextFileProps(
|
function makeMapStateToTextFileProps(
|
||||||
initialState: AppState,
|
_initialState: AppState,
|
||||||
initialProps: InitialProps
|
initialProps: InitialProps
|
||||||
): (state: AppState) => MappedStateProps {
|
): (state: AppState) => MappedStateProps {
|
||||||
const { contentRef } = initialProps;
|
const { contentRef } = initialProps;
|
||||||
@@ -106,7 +106,7 @@ function makeMapStateToTextFileProps(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const makeMapDispatchToTextFileProps = (
|
const makeMapDispatchToTextFileProps = (
|
||||||
initialDispatch: Dispatch,
|
_initialDispatch: Dispatch,
|
||||||
initialProps: InitialProps
|
initialProps: InitialProps
|
||||||
): ((dispatch: Dispatch) => MappedDispatchProps) => {
|
): ((dispatch: Dispatch) => MappedDispatchProps) => {
|
||||||
const { contentRef } = initialProps;
|
const { contentRef } = initialProps;
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class PureMarkdownCell extends React.Component<ComponentProps & DispatchP
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const makeMapStateToProps = (
|
export const makeMapStateToProps = (
|
||||||
initialState: AppState,
|
_initialState: AppState,
|
||||||
ownProps: ComponentProps
|
ownProps: ComponentProps
|
||||||
): ((state: AppState) => StateProps) => {
|
): ((state: AppState) => StateProps) => {
|
||||||
const { id, contentRef } = ownProps;
|
const { id, contentRef } = ownProps;
|
||||||
@@ -134,7 +134,7 @@ export const makeMapStateToProps = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const makeMapDispatchToProps = (
|
const makeMapDispatchToProps = (
|
||||||
initialDispatch: Dispatch,
|
_initialDispatch: Dispatch,
|
||||||
ownProps: ComponentProps
|
ownProps: ComponentProps
|
||||||
): ((dispatch: Dispatch) => DispatchProps) => {
|
): ((dispatch: Dispatch) => DispatchProps) => {
|
||||||
const { id, contentRef } = ownProps;
|
const { id, contentRef } = ownProps;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ interface InitialProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Redux
|
// Redux
|
||||||
const makeMapStateToProps = (_state: AppState, initialProps: InitialProps) => {
|
const makeMapStateToProps = (state: AppState, initialProps: InitialProps) => {
|
||||||
const mapStateToProps = (state: AppState): StateProps => ({
|
const mapStateToProps = (state: AppState): StateProps => ({
|
||||||
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, initialProps.contentRef),
|
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, initialProps.contentRef),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ export async function fetchDatabaseAccounts(subscriptionId: string, accessToken:
|
|||||||
|
|
||||||
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
||||||
const { data } = useSWR(
|
const { data } = useSWR(
|
||||||
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : undefined),
|
// eslint-disable-next-line no-null/no-null
|
||||||
(_, subscriptionId, armToken) => fetchDatabaseAccounts(subscriptionId, armToken)
|
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : null),
|
||||||
|
(_: string, subscriptionId: string, armToken: string) => fetchDatabaseAccounts(subscriptionId, armToken)
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ export async function fetchSubscriptions(accessToken: string): Promise<Subscript
|
|||||||
|
|
||||||
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
||||||
const { data } = useSWR(
|
const { data } = useSWR(
|
||||||
() => (armToken ? ["subscriptions", armToken] : undefined),
|
// eslint-disable-next-line no-null/no-null
|
||||||
(_, armToken) => fetchSubscriptions(armToken)
|
() => (armToken ? ["subscriptions", armToken] : null),
|
||||||
|
(_: string, armToken: string) => fetchSubscriptions(armToken)
|
||||||
);
|
);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
"noUnusedParameters": true
|
"noUnusedParameters": true
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"./src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts",
|
"./src/hooks/useDatabaseAccounts.tsx",
|
||||||
"./src/Common/Logger.test.ts",
|
"./src/hooks/useSubscriptions.tsx",
|
||||||
|
"./src/Explorer/Notebook/NotebookComponent/contents/file/text-file.tsx",
|
||||||
"./src/AuthType.ts",
|
"./src/AuthType.ts",
|
||||||
"./src/Bindings/ReactBindingHandler.ts",
|
"./src/Bindings/ReactBindingHandler.ts",
|
||||||
"./src/Common/ArrayHashMap.ts",
|
"./src/Common/ArrayHashMap.ts",
|
||||||
@@ -57,7 +58,6 @@
|
|||||||
"./src/Explorer/Notebook/NotebookContentItem.ts",
|
"./src/Explorer/Notebook/NotebookContentItem.ts",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/AzureTheme.tsx",
|
"./src/Explorer/Notebook/NotebookRenderer/AzureTheme.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/Prompt.tsx",
|
"./src/Explorer/Notebook/NotebookRenderer/Prompt.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/PromptContent.test.tsx",
|
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/PromptContent.tsx",
|
"./src/Explorer/Notebook/NotebookRenderer/PromptContent.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/StatusBar.tsx",
|
"./src/Explorer/Notebook/NotebookRenderer/StatusBar.tsx",
|
||||||
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellCreator.tsx",
|
"./src/Explorer/Notebook/NotebookRenderer/decorators/CellCreator.tsx",
|
||||||
@@ -65,7 +65,6 @@
|
|||||||
"./src/Explorer/Notebook/NotebookUtil.ts",
|
"./src/Explorer/Notebook/NotebookUtil.ts",
|
||||||
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx",
|
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx",
|
||||||
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts",
|
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts",
|
||||||
"./src/Explorer/Notebook/SecurityWarningBar/SecurityWarningBar.tsx",
|
|
||||||
"./src/Explorer/OpenFullScreen.test.tsx",
|
"./src/Explorer/OpenFullScreen.test.tsx",
|
||||||
"./src/Explorer/OpenFullScreen.tsx",
|
"./src/Explorer/OpenFullScreen.tsx",
|
||||||
"./src/Explorer/Panes/PanelContainerComponent.test.tsx",
|
"./src/Explorer/Panes/PanelContainerComponent.test.tsx",
|
||||||
@@ -86,13 +85,10 @@
|
|||||||
"./src/Explorer/Tree/AccessibleVerticalList.ts",
|
"./src/Explorer/Tree/AccessibleVerticalList.ts",
|
||||||
"./src/GitHub/GitHubConnector.ts",
|
"./src/GitHub/GitHubConnector.ts",
|
||||||
"./src/HostedExplorerChildFrame.ts",
|
"./src/HostedExplorerChildFrame.ts",
|
||||||
"./src/Index.tsx",
|
|
||||||
"./src/Platform/Hosted/Authorization.ts",
|
"./src/Platform/Hosted/Authorization.ts",
|
||||||
"./src/Platform/Hosted/Components/MeControl.test.tsx",
|
"./src/Platform/Hosted/Components/MeControl.test.tsx",
|
||||||
"./src/Platform/Hosted/Components/MeControl.tsx",
|
"./src/Platform/Hosted/Components/MeControl.tsx",
|
||||||
"./src/Platform/Hosted/Components/SignInButton.tsx",
|
"./src/Platform/Hosted/Components/SignInButton.tsx",
|
||||||
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
|
||||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
|
|
||||||
"./src/Platform/Hosted/HostedUtils.test.ts",
|
"./src/Platform/Hosted/HostedUtils.test.ts",
|
||||||
"./src/Platform/Hosted/HostedUtils.ts",
|
"./src/Platform/Hosted/HostedUtils.ts",
|
||||||
"./src/Platform/Hosted/extractFeatures.test.ts",
|
"./src/Platform/Hosted/extractFeatures.test.ts",
|
||||||
@@ -136,15 +132,17 @@
|
|||||||
"./src/hooks/useFullScreenURLs.tsx",
|
"./src/hooks/useFullScreenURLs.tsx",
|
||||||
"./src/hooks/useGraphPhoto.tsx",
|
"./src/hooks/useGraphPhoto.tsx",
|
||||||
"./src/hooks/useNotebookSnapshotStore.ts",
|
"./src/hooks/useNotebookSnapshotStore.ts",
|
||||||
|
"./src/hooks/usePortalAccessToken.tsx",
|
||||||
"./src/hooks/useNotificationConsole.ts",
|
"./src/hooks/useNotificationConsole.ts",
|
||||||
"./src/hooks/useObservable.ts",
|
"./src/hooks/useObservable.ts",
|
||||||
"./src/hooks/usePortalAccessToken.tsx",
|
|
||||||
"./src/hooks/useSidePanel.ts",
|
"./src/hooks/useSidePanel.ts",
|
||||||
"./src/i18n.ts",
|
"./src/i18n.ts",
|
||||||
"./src/quickstart.ts",
|
"./src/quickstart.ts",
|
||||||
"./src/setupTests.ts",
|
"./src/setupTests.ts",
|
||||||
"./src/userContext.test.ts",
|
"./src/userContext.test.ts",
|
||||||
"src/Common/EntityValue.tsx"
|
"src/Common/EntityValue.tsx",
|
||||||
|
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
||||||
|
"./src/Platform/Hosted/Components/SwitchSubscription.tsx"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"src/CellOutputViewer/transforms/**/*",
|
"src/CellOutputViewer/transforms/**/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user