Skip to content

Commit ae4c5d0

Browse files
committed
remove save from ui
1 parent 299769f commit ae4c5d0

File tree

9 files changed

+21
-36
lines changed

9 files changed

+21
-36
lines changed

src/actions/runTest.ts

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface Props {
2727
}
2828

2929
async function runTest({onSuccess, onFail, onRun, onError}: Props): Promise<void> {
30+
console.log('------------------- run test ------------------')
3031
// increment process id
3132
const processId = ++currentId
3233

@@ -44,6 +45,7 @@ async function runTest({onSuccess, onFail, onRun, onError}: Props): Promise<void
4445
// jest CLI docs https://jestjs.io/docs/en/cli
4546
const testArgs = [
4647
'--json',
48+
'--onlyChanged',
4749
'--env=node',
4850
'--maxConcurrency=4',
4951
'--maxWorkers=4'

src/actions/tutorialConfig.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface TutorialConfigParams {
99
}
1010

1111
const tutorialConfig = async ({tutorial, alreadyConfigured, onComplete}: TutorialConfigParams) => {
12+
console.log('---------- tutorialConfig -----------')
1213
if (!alreadyConfigured) {
1314
// setup git, add remote
1415
await git.initIfNotExists()

src/channel/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ class Channel implements Channel {
9494
this.context.position.set(action.payload.position)
9595
this.context.progress.set(action.payload.progress)
9696
return
97-
// run unit tests on step
98-
case 'TEST_RUN':
99-
vscode.commands.executeCommand('coderoad.run_test', action.payload)
100-
return
10197
// load step actions (git commits, commands, open files)
10298
case 'SETUP_ACTIONS':
10399
vscode.commands.executeCommand('coderoad.set_current_step', action.payload)

src/editor/commands.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const createCommands = ({extensionPath, workspaceState, workspaceRoot}: C
6464
currentStepId = stepId
6565
},
6666
[COMMANDS.RUN_TEST]: (current: {stepId: string} | undefined) => {
67+
console.log('-------- command.run_test ------ ')
6768
// use stepId from client, or last set stepId
6869
const payload = {stepId: current ? current.stepId : currentStepId}
6970
runTest({
@@ -85,9 +86,9 @@ export const createCommands = ({extensionPath, workspaceState, workspaceRoot}: C
8586
webview.send({type: 'TEST_ERROR', payload})
8687
},
8788
onRun: () => {
88-
console.log('COMMAND TEST_RUN')
89+
console.log('COMMAND TEST_RUNNING')
8990
// send test run message back to client
90-
webview.send({type: 'TEST_RUN', payload})
91+
webview.send({type: 'TEST_RUNNING', payload})
9192
}
9293
})
9394
},

web-app/src/containers/Tutorial/StagePage/Stage/index.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ const styles = {
2525
interface Props {
2626
stage: T.Stage
2727
onContinue(): void
28-
onSave(): void
2928
onLoadSolution(): void
3029
}
3130

32-
const Stage = ({ stage, onContinue, onSave, onLoadSolution }: Props) => {
31+
const Stage = ({ stage, onContinue, onLoadSolution }: Props) => {
3332
if (!stage.steps) {
3433
throw new Error('No Stage steps found')
3534
}
@@ -62,14 +61,10 @@ const Stage = ({ stage, onContinue, onSave, onLoadSolution }: Props) => {
6261
</Step>
6362
</div>
6463

65-
{stage.status === 'COMPLETE' ? (
64+
{stage.status === 'COMPLETE' && (
6665
<div style={styles.options}>
6766
<Button onClick={onContinue}>Continue</Button>
6867
</div>
69-
) : (
70-
<div style={styles.options}>
71-
<Button onClick={onSave}>Save</Button>
72-
</div>
7368
)}
7469
</div>
7570
)

web-app/src/containers/Tutorial/StagePage/index.tsx

+1-10
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ const StageSummaryPageContainer = (props: PageProps) => {
2424
})
2525
}
2626

27-
const onSave = (): void => {
28-
props.send({
29-
type: 'TEST_RUN',
30-
payload: {
31-
stepId: position.stepId,
32-
},
33-
})
34-
}
35-
3627
const onLoadSolution = (): void => {
3728
props.send({ type: 'STEP_SOLUTION_LOAD' })
3829
}
@@ -48,7 +39,7 @@ const StageSummaryPageContainer = (props: PageProps) => {
4839
})
4940
stage.status = progress.stages[position.stageId] ? 'COMPLETE' : 'ACTIVE'
5041

51-
return <Stage stage={stage} onContinue={onContinue} onSave={onSave} onLoadSolution={onLoadSolution} />
42+
return <Stage stage={stage} onContinue={onContinue} onLoadSolution={onLoadSolution} />
5243
}
5344

5445
export default StageSummaryPageContainer

web-app/src/services/channel/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ class Channel {
5353
case 'TEST_FAIL':
5454
this.machineSend(action)
5555
return
56-
case 'TEST_RUN':
57-
console.log('TEST_RUN')
56+
case 'TEST_RUNNING':
5857
this.machineSend(action)
5958
return
6059
case 'TEST_ERROR':

web-app/src/services/state/actions/editor.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ export default {
5454
type: 'EDITOR_TUTORIAL_CONTINUE_CONFIG',
5555
})
5656
},
57-
testStart(context: CR.MachineContext, event: CR.MachineEvent) {
58-
console.log('EDITOR: TEST_RUN')
59-
const {stepId} = event.payload
60-
channel.editorSend({
61-
type: 'TEST_RUN',
62-
payload: {
63-
stepId,
64-
}
65-
})
66-
},
57+
// testStart(context: CR.MachineContext, event: CR.MachineEvent) {
58+
// console.log('EDITOR: TEST_RUN')
59+
// const {stepId} = event.payload
60+
// // channel.editorSend({
61+
// // type: 'TEST_RUN',
62+
// // payload: {
63+
// // stepId,
64+
// // }
65+
// // })
66+
// },
6767
loadLevel(context: CR.MachineContext): void {
6868
const level: G.Level = selectors.currentLevel(context)
6969
if (level.setup) {

web-app/src/services/state/machine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
111111
states: {
112112
Normal: {
113113
on: {
114-
TEST_RUN: 'TestRunning',
114+
TEST_RUNNING: 'TestRunning',
115115
STEP_SOLUTION_LOAD: {
116116
actions: ['editorLoadSolution'],
117117
},

0 commit comments

Comments
 (0)