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

Feature/style improvements#406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromfeature/style-improvements
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletionsweb-app/src/components/Message/index.tsx
View file
Open in desktop

This file was deleted.

6 changes: 4 additions & 2 deletionsweb-app/src/components/ProcessMessages/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
importMessagefrom'../Message'
import{Message}from'@alifd/next'
import*asReactfrom'react'
import*asTfrom'typings'
import{css,jsx}from'@emotion/core'
Expand All@@ -22,7 +22,9 @@ const ProcessMessages = ({ processes }: Props) => {
return(
<divcss={styles.container}>
{processes.map((process)=>(
<Messagekey={process.title}type="loading"size="medium"title={process.title}content={process.description}/>
<Messagekey={process.title}type="notice"iconType="loading"size="medium"title={process.title}>
{process.description}
</Message>
))}
</div>
)
Expand Down
41 changes: 27 additions & 14 deletionsweb-app/src/containers/Tutorial/formatLevels.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,20 +45,33 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output
status='ACTIVE'
}
if(step.subtasks&&step.subtasks){
subtasks=step.subtasks.map((subtask:string,subtaskIndex:number)=>{
letsubtaskStatus:T.ProgressStatus='INCOMPLETE'
// task is complete, subtasks must be complete
if(status==='COMPLETE'){
subtaskStatus='COMPLETE'
// task is active, check which are complete from test results
}elseif(status==='ACTIVE'){
subtaskStatus=!!(testStatus?.summary&&testStatus.summary[subtaskIndex]) ?'COMPLETE' :'ACTIVE'
}
return{
name:subtask,
status:subtaskStatus,
}
})
if(Object.keys(testStatus?.summary||{}).length!==step.subtasks.length){
// test result count and subtask count don't match
// something is wrong with the tutorial
// NOTE: hacky temp solution as should be caught by tutorial creators / build tools
subtasks=[
{
name:
'ERROR: subtasks and test results have a different number of results. This is likely an error with the tutorial.',
status:'ACTIVE'as'ACTIVE',
},
]
}else{
subtasks=step.subtasks.map((subtask:string,subtaskIndex:number)=>{
letsubtaskStatus:T.ProgressStatus='INCOMPLETE'
// task is complete, subtasks must be complete
if(status==='COMPLETE'){
subtaskStatus='COMPLETE'
// task is active, check which are complete from test results
}elseif(status==='ACTIVE'){
subtaskStatus=!!(testStatus?.summary&&testStatus.summary[subtaskIndex]) ?'COMPLETE' :'ACTIVE'
}
return{
name:subtask,
status:subtaskStatus,
}
})
}
}
return{ ...step, status, subtasks}
}),
Expand Down
9 changes: 7 additions & 2 deletionsweb-app/src/containers/Tutorial/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -179,8 +179,13 @@ const TutorialPage = (props: PageProps) => {
{/* Left */}
<div css={{ flex: 1 }}>
{DISPLAY_RUN_TEST_BUTTON && level.status !== 'COMPLETE' ? (
<Button style={{ marginLeft: '1rem' }} type="primary" onClick={onRunTest} disabled={disableOptions}>
Run
<Button
style={{ marginLeft: '1rem', width: '3rem' }}
type="primary"
onClick={onRunTest}
disabled={disableOptions}
>
{props.state === 'Level.TestRunning' ? <Icon type="loading" size="small" /> : 'Run'}
</Button>
) : null}
</div>
Expand Down
9 changes: 9 additions & 0 deletionsweb-app/stories/Tutorial.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -180,3 +180,12 @@ storiesOf('Tutorial', module)
}
return<Tutorialstate="Completed"context={lastLevel}send={action('send')}/>
})
.add('1.1 Loading',()=>{
constfirstLevel={
...context,
processes:[{title:'Process',description:'A process here',status:'RUNNING'}],
position:{levelId:'1',stepId:'1.2'},
progress:{levels:{},steps:{},complete:false},
}
return<Tutorialstate="Level.Normal"context={firstLevel}send={action('send')}/>
})

[8]ページ先頭

©2009-2025 Movatter.jp