Skip to content

Commit

Permalink
Don't show obsolete PreviousTestResultsView (#7317)
Browse files Browse the repository at this point in the history
* Don't render previous test result views

* Remove unused imports

* Don't show uhoh if errorHtml is missing
  • Loading branch information
dem4ron authored Jan 15, 2025
1 parent 1c8ec69 commit 9928034
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { TestResultsButtons } from '../TestResultsView/TestResultsButtons'
import { wrapWithErrorBoundary } from '@/components/bootcamp/common/ErrorBoundary/wrapWithErrorBoundary'
import { CheckScenariosButton } from './CheckScenariosButton'
import useTestStore from '../store/testStore'
import { PreviousTestResultsButtons } from '../PreviousTestResultsView/PreviousTestResultsButtons'
import { assembleClassNames } from '@/utils/assemble-classnames'

function _ControlButtons({ handleRunCode }: { handleRunCode: () => void }) {
Expand All @@ -16,8 +15,6 @@ function _ControlButtons({ handleRunCode }: { handleRunCode: () => void }) {
<PreviewTestButtons />
{/* Just ran the tests */}
<TestResultsButtons />
{/* Previous test result buttons - previous means we had a submission of this exercise saved in the db */}
<PreviousTestResultsButtons />
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import ErrorBoundary from '../common/ErrorBoundary/ErrorBoundary'
import { Resizer, useResizablePanels } from './hooks/useResize'
import { TaskPreview } from './TaskPreview/TaskPreview'
import SolveExercisePageContextWrapper from './SolveExercisePageContextWrapper'
import { PreviousTestResultView } from './PreviousTestResultsView/PreviousTestResultsView'
import { Header } from './Header/Header'
import { useLocalStorage } from '@uidotdev/usehooks'

Expand Down Expand Up @@ -94,7 +93,6 @@ export default function SolveExercisePage({
<ControlButtons handleRunCode={handleRunCode} />
<InspectedTestResultView />
<TaskPreview />
<PreviousTestResultView exercise={exercise} />
</div>
</div>
<Resizer direction="vertical" handleMouseDown={handleMouseDown} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { GraphicalIcon } from '@/components/common'
import React from 'react'
export function StateTestResultView({ errorHtml }: { errorHtml: string }) {
export function StateTestResultView({
errorHtml,
}: {
errorHtml: string | undefined
}) {
if (!errorHtml) return null
return (
<div className="error-message">
<GraphicalIcon icon="bootcamp-cross-red" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function TestResultInfo({
return null
}
if (firstExpect.testsType === 'state') {
return <StateTestResultView errorHtml={firstExpect.errorHtml!} />
return <StateTestResultView errorHtml={firstExpect.errorHtml} />
} else {
return (
<>
Expand Down

0 comments on commit 9928034

Please sign in to comment.