-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync localStorage with readonly ranges, fix resetting code when there…
… are locked lines (#7279) * Make SolveExercisePageProps global * Start adding readonly ranges * Adjust more types * Make things work
- Loading branch information
Showing
6 changed files
with
130 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 41 additions & 38 deletions
79
app/javascript/components/bootcamp/types/SolveExercisePage.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
import { LanguageFeatures } from '@/interpreter/interpreter' | ||
|
||
type Code = { | ||
stub: string | ||
code: string | ||
storedAt: Date | string | null | ||
readonlyRanges: { from: number; to: number }[] | ||
} | ||
|
||
type Solution = { | ||
uuid: string | ||
status: 'completed' | 'in_progress' | ||
} | ||
declare global { | ||
type SolveExercisePageProps = { | ||
solution: Solution | ||
project: Project | ||
exercise: Exercise | ||
code: Code | ||
links: { | ||
postSubmission: string | ||
completeSolution: string | ||
projectsIndex: string | ||
dashboardIndex: string | ||
} | ||
} | ||
|
||
interface Exercise { | ||
part: number | ||
introductionHtml: string | ||
config: Config | ||
tasks: Task[] | ||
testResults: Pick<TestSuiteResult<NewTestResult>, 'status'> & { | ||
tests: (Pick<NewTestResult, 'status' | 'slug'> & { actual: string })[] | ||
type Code = { | ||
stub: string | ||
code: string | ||
storedAt: Date | string | null | ||
readonlyRanges?: { from: number; to: number }[] | ||
defaultReadonlyRanges?: { from: number; to: number }[] | ||
} | ||
} | ||
|
||
type Project = { slug: string } | ||
type Solution = { | ||
uuid: string | ||
status: 'completed' | 'in_progress' | ||
} | ||
|
||
declare type SolveExercisePageProps = { | ||
solution: Solution | ||
project: Project | ||
exercise: Exercise | ||
code: Code | ||
links: { | ||
postSubmission: string | ||
completeSolution: string | ||
projectsIndex: string | ||
dashboardIndex: string | ||
interface Exercise { | ||
part: number | ||
introductionHtml: string | ||
config: Config | ||
tasks: Task[] | ||
testResults: Pick<TestSuiteResult<NewTestResult>, 'status'> & { | ||
tests: (Pick<NewTestResult, 'status' | 'slug'> & { actual: string })[] | ||
} | ||
} | ||
} | ||
|
||
declare type Config = { | ||
description: string | ||
title: string | ||
projectType: string | ||
// tasks: Task[]; | ||
testsType: 'io' | 'state' | ||
interpreterOptions: LanguageFeatures | ||
type Project = { slug: string } | ||
|
||
type Config = { | ||
description: string | ||
title: string | ||
projectType: string | ||
// tasks: Task[]; | ||
testsType: 'io' | 'state' | ||
interpreterOptions: LanguageFeatures | ||
} | ||
} |