From 254068ec39b9e331bf683cefe23f89744792c774 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Sat, 21 Aug 2021 10:08:16 +0300 Subject: [PATCH] Fix the TypeScript warnings --- ui/src/App.tsx | 4 ++-- ui/src/components/HarEntryDetailed.tsx | 3 +-- ui/src/components/HarEntryViewer/HAREntrySections.tsx | 3 +-- ui/src/components/HarEntryViewer/HAREntryViewer.tsx | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index c30d09083..ed8eeab65 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -38,14 +38,14 @@ const App = () => { } })(); - }, []); + }); const onTLSDetected = (destAddress: string) => { addressesWithTLS.add(destAddress); setAddressesWithTLS(new Set(addressesWithTLS)); if (!userDismissedTLSWarning) { - setShowTLSWarning(true); + setShowTLSWarning(true); } }; diff --git a/ui/src/components/HarEntryDetailed.tsx b/ui/src/components/HarEntryDetailed.tsx index cefa7e57a..62430341e 100644 --- a/ui/src/components/HarEntryDetailed.tsx +++ b/ui/src/components/HarEntryDetailed.tsx @@ -1,9 +1,8 @@ import React from "react"; import {singleEntryToHAR} from "./utils"; -import styles from './style/HarEntryDetailed.module.sass'; import HAREntryViewer from "./HarEntryViewer/HAREntryViewer"; import {makeStyles} from "@material-ui/core"; -import Protocol, {ProtocolInterface} from "./Protocol" +import Protocol from "./Protocol" import StatusCode from "./StatusCode"; import {EndpointPath} from "./EndpointPath"; diff --git a/ui/src/components/HarEntryViewer/HAREntrySections.tsx b/ui/src/components/HarEntryViewer/HAREntrySections.tsx index 66c20ea07..c1ba4538a 100644 --- a/ui/src/components/HarEntryViewer/HAREntrySections.tsx +++ b/ui/src/components/HarEntryViewer/HAREntrySections.tsx @@ -5,7 +5,6 @@ import CollapsibleContainer from "../CollapsibleContainer"; import FancyTextDisplay from "../FancyTextDisplay"; import Checkbox from "../Checkbox"; import ProtobufDecoder from "protobuf-decoder"; -var jp = require('jsonpath'); interface HAREntryViewLineProps { label: string; @@ -202,7 +201,7 @@ export const HAREntryPolicySectionContainer: React.FC = ({service, title, color, response, latency, arrayToIterate}) => { - const base64ToJson = response.content.mimeType === "application/json; charset=utf-8" ? JSON.parse(Buffer.from(response.content.text, "base64").toString()) : {}; + // const base64ToJson = response.content.mimeType === "application/json; charset=utf-8" ? JSON.parse(Buffer.from(response.content.text, "base64").toString()) : {}; return { arrayToIterate && arrayToIterate.length > 0 ? diff --git a/ui/src/components/HarEntryViewer/HAREntryViewer.tsx b/ui/src/components/HarEntryViewer/HAREntryViewer.tsx index e96d5ca9c..141f12204 100644 --- a/ui/src/components/HarEntryViewer/HAREntryViewer.tsx +++ b/ui/src/components/HarEntryViewer/HAREntryViewer.tsx @@ -6,7 +6,7 @@ import {HAREntryTableSection, HAREntryBodySection, HAREntryTablePolicySection} f const SectionsRepresentation: React.FC = ({data, color}) => { const sections = [] - for (const [i, row] of data.entries()) { + data.forEach((row) => { switch (row.type) { case "table": sections.push( @@ -21,7 +21,7 @@ const SectionsRepresentation: React.FC = ({data, color}) => { default: break; } - } + }); return <>{sections}; }