Skip to content

Commit

Permalink
Remove Maybe loading from RunData.tsx and DatasetData.tsx - Fixes #712
Browse files Browse the repository at this point in the history
  • Loading branch information
johnaohara authored and jesperpedersen committed Oct 5, 2023
1 parent c82b8d9 commit e18c46b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions webapp/src/domain/runs/DatasetData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ export default function DatasetData(props: DatasetDataProps) {
const [editorData, setEditorData] = useState<string>()
const [validationErrors, setValidationErrors] = useState<ValidationError[]>([])
const [schemas, setSchemas] = useState<SchemaUsage[]>()
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 => {
Expand All @@ -47,7 +45,7 @@ export default function DatasetData(props: DatasetDataProps) {
noop
)
)
.finally(() => setLoading(false))

}, [props.datasetId])
useEffect(() => {
Api.datasetServiceGetSummary(props.datasetId).then(
Expand Down Expand Up @@ -112,7 +110,6 @@ export default function DatasetData(props: DatasetDataProps) {
)}
</FlexItem>
</Flex>
<MaybeLoading loading={loading}>
<Editor
height="600px"
value={editorData}
Expand All @@ -121,7 +118,6 @@ export default function DatasetData(props: DatasetDataProps) {
readOnly: true,
}}
/>
</MaybeLoading>
</>
)
}
6 changes: 1 addition & 5 deletions webapp/src/domain/runs/RunData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<string>()
const [updateCounter, setUpdateCounter] = useState(0)
Expand All @@ -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 => {
Expand All @@ -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)
Expand Down Expand Up @@ -109,7 +105,7 @@ export default function RunData(props: RunDataProps) {
onRemoteQuery={(query, array) => Api.sqlServiceQueryRunData(props.run.id, query, array)}
onDataUpdate={setEditorData}
/>
<MaybeLoading loading={loading}>{memoizedEditor}</MaybeLoading>
{memoizedEditor}
</>
)
}

0 comments on commit e18c46b

Please sign in to comment.