resolve eslint ReadOnlyNodePropertiesComponent

This commit is contained in:
hardiknai-techm
2021-08-20 08:10:58 +05:30
parent 8eeda41021
commit 043541b0dc
7 changed files with 9 additions and 33 deletions

View File

@@ -2,8 +2,6 @@
src/**/__mocks__/**/* src/**/__mocks__/**/*
dist/ dist/
Contracts/ Contracts/
src/Api/Apis.ts
src/AuthType.ts
src/Bindings/BindingHandlersRegisterer.ts src/Bindings/BindingHandlersRegisterer.ts
src/Bindings/ReactBindingHandler.ts src/Bindings/ReactBindingHandler.ts
src/Common/Constants.ts src/Common/Constants.ts
@@ -129,12 +127,8 @@ src/ReactDevTools.ts
src/Shared/Constants.ts src/Shared/Constants.ts
src/Shared/DefaultExperienceUtility.test.ts src/Shared/DefaultExperienceUtility.test.ts
src/Shared/DefaultExperienceUtility.ts src/Shared/DefaultExperienceUtility.ts
src/Shared/appInsights.ts
src/SparkClusterManager/ArcadiaResourceManager.ts
src/SparkClusterManager/SparkClusterManager.ts
src/Terminal/JupyterLabAppFactory.ts src/Terminal/JupyterLabAppFactory.ts
src/Terminal/NotebookAppContracts.d.ts src/Terminal/NotebookAppContracts.d.ts
src/applyExplorerBindings.ts
src/global.d.ts src/global.d.ts
src/setupTests.ts src/setupTests.ts
src/Explorer/Controls/InputTypeahead/InputTypeaheadComponent.tsx src/Explorer/Controls/InputTypeahead/InputTypeaheadComponent.tsx
@@ -144,13 +138,8 @@ src/Explorer/Controls/NotebookViewer/NotebookViewerComponent.tsx
src/Explorer/Controls/TreeComponent/TreeComponent.tsx src/Explorer/Controls/TreeComponent/TreeComponent.tsx
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx
src/Explorer/Graph/GraphExplorerComponent/GraphVizComponent.tsx
src/Explorer/Graph/GraphExplorerComponent/LeftPaneComponent.tsx
src/Explorer/Graph/GraphExplorerComponent/MiddlePaneComponent.tsx
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.test.tsx src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.test.tsx
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
@@ -161,7 +150,6 @@ src/Explorer/Notebook/NotebookRenderer/NotebookRenderer.tsx
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
src/Explorer/Notebook/temp/inputs/connected-editors/codemirror.tsx
src/Explorer/Tree/ResourceTreeAdapter.tsx src/Explorer/Tree/ResourceTreeAdapter.tsx
__mocks__/monaco-editor.ts __mocks__/monaco-editor.ts
src/Explorer/Tree/ResourceTree.tsx src/Explorer/Tree/ResourceTree.tsx

View File

@@ -1,4 +1,4 @@
/** /**
* Data Explorer version {major.minor.patch} * Data Explorer version {major.minor.patch}
*/ */
export const DataExplorer: string = "1.0.1"; export const DataExplorer = "1.0.1";

View File

@@ -58,7 +58,7 @@ export class LeftPaneComponent extends React.Component<LeftPaneComponentProps> {
className={className} className={className}
as="tr" as="tr"
aria-label={node.caption} aria-label={node.caption}
onActivated={(e) => this.props.onRootNodeSelected(node.id)} onActivated={() => this.props.onRootNodeSelected(node.id)}
key={node.id} key={node.id}
> >
<td className="resultItem"> <td className="resultItem">

View File

@@ -1,7 +1,6 @@
import React from "react";
import { shallow } from "enzyme"; import { shallow } from "enzyme";
import React from "react";
import { GraphHighlightedNodeData } from "./GraphExplorer"; import { GraphHighlightedNodeData } from "./GraphExplorer";
import { import {
ReadOnlyNodePropertiesComponent, ReadOnlyNodePropertiesComponent,
ReadOnlyNodePropertiesComponentProps, ReadOnlyNodePropertiesComponentProps,
@@ -44,7 +43,7 @@ describe("<ReadOnlyNodePropertiesComponent />", () => {
const mockNode2 = { const mockNode2 = {
...mockNode, ...mockNode,
properties: { properties: {
key3: ["abcd", 1234, true, false, undefined, null], key3: ["abcd", 1234, true, false, undefined],
}, },
}; };
const props: ReadOnlyNodePropertiesComponentProps = { node: mockNode2 }; const props: ReadOnlyNodePropertiesComponentProps = { node: mockNode2 };

View File

@@ -60,9 +60,7 @@ export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNod
} }
public static singlePropertyValueToString(value: ViewModels.GremlinPropertyValueType): string { public static singlePropertyValueToString(value: ViewModels.GremlinPropertyValueType): string {
if (value === null) { if (typeof value === "undefined") {
return "null";
} else if (typeof value === "undefined") {
return "undefined"; return "undefined";
} else { } else {
return value.toString(); return value.toString();
@@ -71,11 +69,8 @@ export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNod
public static renderSinglePropertyValue(value: ViewModels.GremlinPropertyValueType): JSX.Element { public static renderSinglePropertyValue(value: ViewModels.GremlinPropertyValueType): JSX.Element {
let singlePropValue = value; let singlePropValue = value;
let className = "propertyValue"; const className = "propertyValue";
if (singlePropValue === null) { if (typeof singlePropValue === "undefined") {
singlePropValue = "null";
className += " isNull";
} else if (typeof singlePropValue === "undefined") {
singlePropValue = "undefined"; singlePropValue = "undefined";
} else { } else {
singlePropValue = value.toString(); singlePropValue = value.toString();

View File

@@ -123,7 +123,7 @@ exports[`<ReadOnlyNodePropertiesComponent /> renders properties (with multiple v
</td> </td>
<td <td
className="valueCol" className="valueCol"
title="abcd, 1234, true, false, undefined, null" title="abcd, 1234, true, false, undefined"
> >
<div <div
className="propertyValue" className="propertyValue"
@@ -155,12 +155,6 @@ exports[`<ReadOnlyNodePropertiesComponent /> renders properties (with multiple v
> >
undefined undefined
</div> </div>
<div
className="propertyValue isNull"
key="null"
>
null
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -3,7 +3,7 @@ import { BindingHandlersRegisterer } from "./Bindings/BindingHandlersRegisterer"
import Explorer from "./Explorer/Explorer"; import Explorer from "./Explorer/Explorer";
export const applyExplorerBindings = (explorer: Explorer) => { export const applyExplorerBindings = (explorer: Explorer) => {
if (!!explorer) { if (explorer) {
window.dataExplorer = explorer; window.dataExplorer = explorer;
BindingHandlersRegisterer.registerBindingHandlers(); BindingHandlersRegisterer.registerBindingHandlers();
ko.applyBindings(explorer); ko.applyBindings(explorer);