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

Commit0544c56

Browse files
committed
workspace validation progress
1 parent5858c93 commit0544c56

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed

‎typings/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface MachineStateSchema {
7474
LoadStoredTutorial:{}
7575
Start:{}
7676
CheckEmptyWorkspace:{}
77+
NonEmptyWorkspace:{}
7778
RequestEmptyWorkspace:{}
7879
SelectTutorial:{}
7980
LoadTutorialSummary:{}

‎web-app/src/Routes.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import SelectTutorialPage from './containers/SelectTutorial'
77
importOverviewPagefrom'./containers/Overview'
88
importCompletedPagefrom'./containers/Tutorial/CompletedPage'
99
importLevelSummaryPagefrom'./containers/Tutorial/LevelPage'
10+
importSelectEmptyWorkspacefrom'./containers/Check/SelectWorkspace'
1011

1112
constRoutes=()=>{
1213
const{ context, send, Router, Route}=useRouter()
@@ -31,6 +32,9 @@ const Routes = () => {
3132
<Routepath={['Setup.LoadTutorialSummary','Setup.LoadTutorialData','Setup.SetupNewTutorial']}>
3233
<LoadingPagetext="Loading Tutorial..."context={context}/>
3334
</Route>
35+
<Routepath={['Setup.NonEmptyWorkspace','Setup.RequestEmptyWorkspace']}>
36+
<SelectEmptyWorkspacesend={send}/>
37+
</Route>
3438
<Routepath="Setup.Error">
3539
<LoadingPagetext="Error"context={context}/>
3640
</Route>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import*asReactfrom'react'
2+
import*asTfrom'typings'
3+
import{css,jsx}from'@emotion/core'
4+
importButtonfrom'../../components/Button'
5+
6+
conststyles={
7+
container:{
8+
padding:'1rem',
9+
},
10+
}
11+
12+
typeProps={
13+
send:(action:T.Action)=>void
14+
}
15+
16+
constSelectWorkspace=(props:Props)=>{
17+
constonOpenWorkspace=()=>props.send({type:'REQUEST_WORKSPACE'})
18+
return(
19+
<divcss={styles.container}>
20+
<h3>Select or Create An Empty Workspace</h3>
21+
<p>CodeRoad runs Git commands in the background and will change your workspace files.</p>
22+
<br/>
23+
<Buttontype="secondary"onClick={onOpenWorkspace}>
24+
Open a Workspace
25+
</Button>
26+
</div>
27+
)
28+
}
29+
30+
exportdefaultSelectWorkspace

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,16 @@ export const createMachine = (options: any) => {
8282
IS_EMPTY_WORKSPACE:'SelectTutorial',
8383
},
8484
},
85+
NonEmptyWorkspace:{
86+
on:{
87+
REQUEST_WORKSPACE:'RequestEmptyWorkspace',
88+
},
89+
},
8590
RequestEmptyWorkspace:{
8691
onEntry:['requestWorkspaceSelection'],
8792
on:{
8893
WORKSPACE_LOADED:'CheckEmptyWorkspace',
94+
CANCEL:'NonEmptyWorkspace',
8995
},
9096
},
9197
SelectTutorial:{

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import{storiesOf}from'@storybook/react'
2+
import{action}from'@storybook/addon-actions'
3+
importReactfrom'react'
4+
import{css,jsx}from'@emotion/core'
5+
importSelectWorkspacefrom'../src/containers/Check/SelectWorkspace'
6+
importSideBarDecoratorfrom'./utils/SideBarDecorator'
7+
8+
conststyles={
9+
container:{
10+
display:'flex'as'flex',
11+
flexDirection:'column'as'column',
12+
},
13+
}
14+
15+
storiesOf('Check',module)
16+
.addDecorator(SideBarDecorator)
17+
.add('Select Workspace',()=>(
18+
<divcss={styles.container}>
19+
<SelectWorkspacesend={action('send')}/>
20+
</div>
21+
))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp