From e18c46b95433df2bebb5cf70685f76361d4d7336 Mon Sep 17 00:00:00 2001 From: John OHara Date: Thu, 5 Oct 2023 13:44:30 +0100 Subject: [PATCH] Remove Maybe loading from RunData.tsx and DatasetData.tsx - Fixes #712 --- webapp/src/domain/runs/DatasetData.tsx | 6 +----- webapp/src/domain/runs/RunData.tsx | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/webapp/src/domain/runs/DatasetData.tsx b/webapp/src/domain/runs/DatasetData.tsx index cb91f27ef..18f21642e 100644 --- a/webapp/src/domain/runs/DatasetData.tsx +++ b/webapp/src/domain/runs/DatasetData.tsx @@ -28,13 +28,11 @@ export default function DatasetData(props: DatasetDataProps) { const [editorData, setEditorData] = useState() const [validationErrors, setValidationErrors] = useState([]) const [schemas, setSchemas] = useState() - const [loading, setLoading] = useState(false) const [labelValuesOpen, setLabelValuesOpen] = useState(false) const [labelsLogOpen, setLabelsLogOpen] = useState(false) const [hasExperiments, setHasExperiments] = useState(false) const [experimentsOpen, setExperimentsOpen] = useState(false) useEffect(() => { - setLoading(true) Api.datasetServiceGetDataSet(props.datasetId) .then( dataset => { @@ -47,7 +45,7 @@ export default function DatasetData(props: DatasetDataProps) { noop ) ) - .finally(() => setLoading(false)) + }, [props.datasetId]) useEffect(() => { Api.datasetServiceGetSummary(props.datasetId).then( @@ -112,7 +110,6 @@ export default function DatasetData(props: DatasetDataProps) { )} - - ) } diff --git a/webapp/src/domain/runs/RunData.tsx b/webapp/src/domain/runs/RunData.tsx index 3dd937196..246da5195 100644 --- a/webapp/src/domain/runs/RunData.tsx +++ b/webapp/src/domain/runs/RunData.tsx @@ -11,7 +11,6 @@ import Editor from "../../components/Editor/monaco/Editor" import Api, { RunExtended } from "../../api" import { toString } from "../../components/Editor" -import MaybeLoading from "../../components/MaybeLoading" import ChangeSchemaModal from "./ChangeSchemaModal" import JsonPathSearchToolbar from "./JsonPathSearchToolbar" import { NoSchemaInRun } from "./NoSchema" @@ -41,7 +40,6 @@ type RunDataProps = { } export default function RunData(props: RunDataProps) { - const [loading, setLoading] = useState(false) const [data, setData] = useState() const [editorData, setEditorData] = useState() const [updateCounter, setUpdateCounter] = useState(0) @@ -52,7 +50,6 @@ export default function RunData(props: RunDataProps) { useEffect(() => { const urlParams = new URLSearchParams(window.location.search) const token = urlParams.get("token") - setLoading(true) Api.runServiceGetData(props.run.id, token || undefined) .then( data => { @@ -61,7 +58,6 @@ export default function RunData(props: RunDataProps) { }, error => dispatchError(dispatch, error, "FETCH_RUN_DATA", "Failed to fetch run data").catch(noop) ) - .finally(() => setLoading(false)) }, [dispatch, props.run.id, teams, updateCounter]) const isTester = useTester(props.run.owner) @@ -109,7 +105,7 @@ export default function RunData(props: RunDataProps) { onRemoteQuery={(query, array) => Api.sqlServiceQueryRunData(props.run.id, query, array)} onDataUpdate={setEditorData} /> - {memoizedEditor} + {memoizedEditor} ) }