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

Commitf2f515e

Browse files
authored
Merge pull requestcoderoad#406 from coderoad/feature/style-improvements
Feature/style improvements
2 parentsf88b66d +b682318 commitf2f515e

File tree

5 files changed

+47
-63
lines changed

5 files changed

+47
-63
lines changed

‎web-app/src/components/Message/index.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎web-app/src/components/ProcessMessages/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importMessagefrom'../Message'
1+
import{Message}from'@alifd/next'
22
import*asReactfrom'react'
33
import*asTfrom'typings'
44
import{css,jsx}from'@emotion/core'
@@ -22,7 +22,9 @@ const ProcessMessages = ({ processes }: Props) => {
2222
return(
2323
<divcss={styles.container}>
2424
{processes.map((process)=>(
25-
<Messagekey={process.title}type="loading"size="medium"title={process.title}content={process.description}/>
25+
<Messagekey={process.title}type="notice"iconType="loading"size="medium"title={process.title}>
26+
{process.description}
27+
</Message>
2628
))}
2729
</div>
2830
)

‎web-app/src/containers/Tutorial/formatLevels.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,33 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output
4545
status='ACTIVE'
4646
}
4747
if(step.subtasks&&step.subtasks){
48-
subtasks=step.subtasks.map((subtask:string,subtaskIndex:number)=>{
49-
letsubtaskStatus:T.ProgressStatus='INCOMPLETE'
50-
// task is complete, subtasks must be complete
51-
if(status==='COMPLETE'){
52-
subtaskStatus='COMPLETE'
53-
// task is active, check which are complete from test results
54-
}elseif(status==='ACTIVE'){
55-
subtaskStatus=!!(testStatus?.summary&&testStatus.summary[subtaskIndex]) ?'COMPLETE' :'ACTIVE'
56-
}
57-
return{
58-
name:subtask,
59-
status:subtaskStatus,
60-
}
61-
})
48+
if(Object.keys(testStatus?.summary||{}).length!==step.subtasks.length){
49+
// test result count and subtask count don't match
50+
// something is wrong with the tutorial
51+
// NOTE: hacky temp solution as should be caught by tutorial creators / build tools
52+
subtasks=[
53+
{
54+
name:
55+
'ERROR: subtasks and test results have a different number of results. This is likely an error with the tutorial.',
56+
status:'ACTIVE'as'ACTIVE',
57+
},
58+
]
59+
}else{
60+
subtasks=step.subtasks.map((subtask:string,subtaskIndex:number)=>{
61+
letsubtaskStatus:T.ProgressStatus='INCOMPLETE'
62+
// task is complete, subtasks must be complete
63+
if(status==='COMPLETE'){
64+
subtaskStatus='COMPLETE'
65+
// task is active, check which are complete from test results
66+
}elseif(status==='ACTIVE'){
67+
subtaskStatus=!!(testStatus?.summary&&testStatus.summary[subtaskIndex]) ?'COMPLETE' :'ACTIVE'
68+
}
69+
return{
70+
name:subtask,
71+
status:subtaskStatus,
72+
}
73+
})
74+
}
6275
}
6376
return{ ...step, status, subtasks}
6477
}),

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,13 @@ const TutorialPage = (props: PageProps) => {
179179
{/* Left */}
180180
<divcss={{flex:1}}>
181181
{DISPLAY_RUN_TEST_BUTTON&&level.status!=='COMPLETE' ?(
182-
<Buttonstyle={{marginLeft:'1rem'}}type="primary"onClick={onRunTest}disabled={disableOptions}>
183-
Run
182+
<Button
183+
style={{marginLeft:'1rem',width:'3rem'}}
184+
type="primary"
185+
onClick={onRunTest}
186+
disabled={disableOptions}
187+
>
188+
{props.state==='Level.TestRunning' ?<Icontype="loading"size="small"/> :'Run'}
184189
</Button>
185190
) :null}
186191
</div>

‎web-app/stories/Tutorial.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,12 @@ storiesOf('Tutorial', module)
180180
}
181181
return<Tutorialstate="Completed"context={lastLevel}send={action('send')}/>
182182
})
183+
.add('1.1 Loading',()=>{
184+
constfirstLevel={
185+
...context,
186+
processes:[{title:'Process',description:'A process here',status:'RUNNING'}],
187+
position:{levelId:'1',stepId:'1.2'},
188+
progress:{levels:{},steps:{},complete:false},
189+
}
190+
return<Tutorialstate="Level.Normal"context={firstLevel}send={action('send')}/>
191+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp