Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedeb01b

Browse files
committed
use stepId to validate progress
1 parent17c6661 commitedeb01b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

‎src/Channel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class Channel implements Channel {
2222
console.log('RECEIVED:',actionType)
2323
switch(actionType){
2424
case'TEST_RUN':
25-
vscode.commands.executeCommand('coderoad.run_test')
25+
26+
vscode.commands.executeCommand('coderoad.run_test',action.payload)
2627
return
2728
case'TUTORIAL_CONFIG':
2829
tutorialConfig(action.payload)

‎src/editor/commands.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,26 @@ export const createCommands = ({vscodeExt}: CreateCommandProps) => {
5252

5353
webview.createOrShow(column)
5454
},
55-
[COMMANDS.RUN_TEST]:()=>{
55+
[COMMANDS.RUN_TEST]:({stepId}:{stepId:string})=>{
5656
console.log('run test webview',Object.keys(webview))
5757
runTest({
5858
onSuccess:()=>{
5959
console.log('COMMAND TEST_PASS')
60-
webview.send({type:'TEST_PASS'})
60+
webview.send({type:'TEST_PASS',payload:{stepId}})
6161
vscode.window.showInformationMessage('PASS')
6262
},
6363
onFail:()=>{
6464
console.log('COMMAND TEST_FAIL')
65-
webview.send({type:'TEST_FAIL'})
65+
webview.send({type:'TEST_FAIL',payload:{stepId}})
6666
vscode.window.showWarningMessage('FAIL')
6767
},
68+
onError:()=>{
69+
console.log('COMMAND TEST_ERROR')
70+
webview.send({type:'TEST_ERROR',payload:[stepId]})
71+
},
6872
onRun:()=>{
6973
console.log('COMMAND TEST_RUN')
70-
webview.send({type:'TEST_RUN'})
74+
webview.send({type:'TEST_RUN',payload:{stepId}})
7175
}
7276
})
7377
},

‎web-app/src/services/state/actions/context.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,10 @@ export default {
104104
//@ts-ignore
105105
updateStepProgress:assign({
106106
progress:(context:CR.MachineContext,event:CR.MachineEvent):CR.Progress=>{
107-
108107
// update progress by tracking completed
109108
constcurrentProgress:CR.Progress=context.progress
110109

111-
// TODO: should use event id, to verify not multiple successes jumping one
112-
// const stepId = event.payload.stepId
113-
const{stepId}=context.position
110+
const{stepId}=event.payload
114111

115112
currentProgress.steps[stepId]=true
116113

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp