From 983c9201bbf0c32a2ff9d9b1eb335a843dd53761 Mon Sep 17 00:00:00 2001 From: Chris-MS-896 <64865559+Chris-MS-896@users.noreply.github.com> Date: Fri, 8 Jan 2021 21:14:53 -0600 Subject: [PATCH] Add two files of GraphExplorer component in Master (#365) --- src/Explorer/Graph/GraphExplorerComponent/GraphData.ts | 6 +++--- .../Notebook/NotebookComponent/__mocks__/rx-jupyter.ts | 10 +++++----- tsconfig.strict.json | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Explorer/Graph/GraphExplorerComponent/GraphData.ts b/src/Explorer/Graph/GraphExplorerComponent/GraphData.ts index 420d98e5e..9cbf502bd 100644 --- a/src/Explorer/Graph/GraphExplorerComponent/GraphData.ts +++ b/src/Explorer/Graph/GraphExplorerComponent/GraphData.ts @@ -413,13 +413,13 @@ export class GraphData { * @param node * @param prop */ - public static getNodePropValue(node: D3Node, prop: string): string | number | boolean { + public static getNodePropValue(node: D3Node, prop: string): undefined | string | number | boolean { if (node.hasOwnProperty(prop)) { return (node as any)[prop]; } // This is DocDB specific - if (node.hasOwnProperty("properties") && node.properties.hasOwnProperty(prop)) { + if (node.properties && node.properties.hasOwnProperty(prop)) { return node.properties[prop][0]["value"]; } @@ -496,7 +496,7 @@ export class GraphData { * Get list of children ids of a given vertex * @param vertex */ - private static getChildrenId(vertex: GremlinVertex): string[] { + public static getChildrenId(vertex: GremlinVertex): string[] { const ids = {}; // HashSet if (vertex.hasOwnProperty("outE")) { let outE = vertex.outE; diff --git a/src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts b/src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts index 1472d5f5d..564527eec 100644 --- a/src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts +++ b/src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts @@ -1,14 +1,14 @@ import { Observable, of } from "rxjs"; -import { AjaxResponse } from "rxjs/ajax"; -import { ServerConfig } from "rx-jupyter"; +import { AjaxRequest, AjaxResponse } from "rxjs/ajax"; +import { ServerConfig } from "@nteract/types"; let fakeAjaxResponse: AjaxResponse = { - originalEvent: undefined, + originalEvent: (undefined), xhr: new XMLHttpRequest(), - request: null, + request: (null), status: 200, response: {}, - responseText: null, + responseText: "", responseType: "json" }; export const sessions = { diff --git a/tsconfig.strict.json b/tsconfig.strict.json index e0432eb30..cc2adecd8 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -47,6 +47,9 @@ "./src/Explorer/Controls/InputTypeahead/InputTypeahead.ts", "./src/Explorer/Controls/SmartUi/InputUtils.ts", "./src/Explorer/Graph/GraphExplorerComponent/__mocks__/GremlinClient.ts", + "./src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts", + "./src/Explorer/Graph/GraphExplorerComponent/GraphData.ts", + "./src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts", "./src/Explorer/Notebook/FileSystemUtil.ts", "./src/Explorer/Notebook/NTeractUtil.ts", "./src/Explorer/Notebook/NotebookComponent/actions.ts",