mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 10:51:30 +00:00
Compare commits
3 Commits
PSQL_Shell
...
unhandled-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccac4b8741 | ||
|
|
0e841e34a6 | ||
|
|
b4cc0f8e52 |
@@ -88,16 +88,18 @@ export class IndexingPolicyComponent extends React.Component<
|
|||||||
private async createIndexingPolicyEditor(): Promise<void> {
|
private async createIndexingPolicyEditor(): Promise<void> {
|
||||||
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
|
const value: string = JSON.stringify(this.props.indexingPolicyContent, undefined, 4);
|
||||||
const monaco = await loadMonaco();
|
const monaco = await loadMonaco();
|
||||||
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
if (monaco.editor) {
|
||||||
value: value,
|
this.indexingPolicyEditor = monaco.editor.create(this.indexingPolicyDiv.current, {
|
||||||
language: "json",
|
value: value,
|
||||||
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
language: "json",
|
||||||
ariaLabel: "Indexing Policy",
|
readOnly: isIndexTransforming(this.props.indexTransformationProgress),
|
||||||
});
|
ariaLabel: "Indexing Policy",
|
||||||
if (this.indexingPolicyEditor) {
|
});
|
||||||
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
if (this.indexingPolicyEditor) {
|
||||||
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
const indexingPolicyEditorModel = this.indexingPolicyEditor.getModel();
|
||||||
this.props.logIndexingPolicySuccessMessage();
|
indexingPolicyEditorModel.onDidChangeContent(this.onEditorContentChange.bind(this));
|
||||||
|
this.props.logIndexingPolicySuccessMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,17 +138,19 @@ describe("D3ForceGraph", () => {
|
|||||||
|
|
||||||
it("should call onHighlightedNode callback when mouse hovering over node", () => {
|
it("should call onHighlightedNode callback when mouse hovering over node", () => {
|
||||||
forceGraph.params.onGraphUpdated = () => {
|
forceGraph.params.onGraphUpdated = () => {
|
||||||
const mouseoverEvent = document.createEvent("Events");
|
if (document) {
|
||||||
mouseoverEvent.initEvent("mouseover", true, false);
|
const mouseoverEvent = document.createEvent("Events");
|
||||||
$(rootNode).find(".node")[0].dispatchEvent(mouseoverEvent); // [0] is v1 vertex
|
mouseoverEvent.initEvent("mouseover", true, false);
|
||||||
expect($(rootNode).find(".node")[0]).toBe(1);
|
$(rootNode).find(".node")[0].dispatchEvent(mouseoverEvent); // [0] is v1 vertex
|
||||||
|
|
||||||
// onHighlightedNode is always called once to clear the selection
|
// onHighlightedNode is always called once to clear the selection
|
||||||
expect((forceGraph.params.onHighlightedNode as sinon.SinonSpy).calledTwice).toBe(true);
|
expect((forceGraph.params.onHighlightedNode as sinon.SinonSpy).calledTwice).toBe(true);
|
||||||
|
|
||||||
const onHighlightedNode = (forceGraph.params.onHighlightedNode as sinon.SinonSpy).args[1][0] as D3GraphNodeData;
|
const onHighlightedNode = (forceGraph.params.onHighlightedNode as sinon.SinonSpy)
|
||||||
expect(onHighlightedNode).not.toBe(null);
|
.args[1][0] as D3GraphNodeData;
|
||||||
expect(onHighlightedNode.id).toEqual(v1Id);
|
expect(onHighlightedNode).not.toBe(null);
|
||||||
|
expect(onHighlightedNode.id).toEqual(v1Id);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
forceGraph.updateGraph(newGraph, forceGraph.igraphConfig);
|
forceGraph.updateGraph(newGraph, forceGraph.igraphConfig);
|
||||||
|
|||||||
@@ -1084,7 +1084,6 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
|
|||||||
public static reportToConsole(type: ConsoleDataType, msg: string, ...errorData: any[]): void | (() => void) {
|
public static reportToConsole(type: ConsoleDataType, msg: string, ...errorData: any[]): void | (() => void) {
|
||||||
let errorDataStr: string = "";
|
let errorDataStr: string = "";
|
||||||
if (errorData && errorData.length > 0) {
|
if (errorData && errorData.length > 0) {
|
||||||
console.error(msg, errorData);
|
|
||||||
errorDataStr = ": " + JSON.stringify(errorData);
|
errorDataStr = ": " + JSON.stringify(errorData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export class MiddlePaneComponent extends React.Component<MiddlePaneComponentProp
|
|||||||
onClick={this.props.toggleExpandGraph}
|
onClick={this.props.toggleExpandGraph}
|
||||||
role="button"
|
role="button"
|
||||||
aria-expanded={this.props.isTabsContentExpanded}
|
aria-expanded={this.props.isTabsContentExpanded}
|
||||||
aria-name="View graph in full screen"
|
aria-label="View graph in full screen"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default class NotebookManager {
|
|||||||
this.notebookContentProvider = new NotebookContentProvider(
|
this.notebookContentProvider = new NotebookContentProvider(
|
||||||
this.inMemoryContentProvider,
|
this.inMemoryContentProvider,
|
||||||
this.gitHubContentProvider,
|
this.gitHubContentProvider,
|
||||||
contents.JupyterContentProvider
|
contents?.JupyterContentProvider
|
||||||
);
|
);
|
||||||
|
|
||||||
this.notebookClient = new NotebookContainerClient(() =>
|
this.notebookClient = new NotebookContainerClient(() =>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { initializeIcons } from "@fluentui/react";
|
||||||
import { configure } from "enzyme";
|
import { configure } from "enzyme";
|
||||||
import Adapter from "enzyme-adapter-react-16";
|
import Adapter from "enzyme-adapter-react-16";
|
||||||
import "jest-canvas-mock";
|
import "jest-canvas-mock";
|
||||||
import { initializeIcons } from "@fluentui/react";
|
|
||||||
import { TextDecoder, TextEncoder } from "util";
|
import { TextDecoder, TextEncoder } from "util";
|
||||||
configure({ adapter: new Adapter() });
|
configure({ adapter: new Adapter() });
|
||||||
initializeIcons();
|
initializeIcons();
|
||||||
@@ -16,3 +16,12 @@ if (typeof window.URL.createObjectURL === "undefined") {
|
|||||||
require("jquery-ui-dist/jquery-ui");
|
require("jquery-ui-dist/jquery-ui");
|
||||||
(<any>global).TextEncoder = TextEncoder;
|
(<any>global).TextEncoder = TextEncoder;
|
||||||
(<any>global).TextDecoder = TextDecoder;
|
(<any>global).TextDecoder = TextDecoder;
|
||||||
|
|
||||||
|
// In Node v7 unhandled promise rejections
|
||||||
|
if (process.env.LISTENING_TO_UNHANDLED_REJECTION !== "true") {
|
||||||
|
process.on("unhandledRejection", (reason) => {
|
||||||
|
console.error("reason", reason);
|
||||||
|
});
|
||||||
|
// Avoid memory leak by adding too many listeners
|
||||||
|
process.env.LISTENING_TO_UNHANDLED_REJECTION = "true";
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user