8000 workspace validation progress · An0nCrypto/coderoad-vscode@0544c56 · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit 0544c56

Browse files
committed
workspace validation progress
1 parent 5858c93 commit 0544c56

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
import OverviewPage from './containers/Overview'
88
import CompletedPage from './containers/Tutorial/CompletedPage'
99
import LevelSummaryPage from './containers/Tutorial/LevelPage'
10+
import SelectEmptyWorkspace from './containers/Check/SelectWorkspace'
1011

1112
const Routes = () => {
1213
const { context, send, Router, Route } = useRouter()
@@ -31,6 +32,9 @@ const Routes = () => {
3132
<Route path={['Setup.LoadTutorialSummary', 'Setup.LoadTutorialData', 'Setup.SetupNewTutorial']}>
3233
<LoadingPage text="Loading Tutorial..." context={context} />
3334
</Route>
35+
<Route path={['Setup.NonEmptyWorkspace', 'Setup.RequestEmptyWorkspace']}>
36+
<SelectEmptyWorkspace send={send} />
37+
</Route>
3438
<Route path="Setup.Error">
3539
<LoadingPage text="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 * as React from 'react'
2+
import * as T from 'typings'
3+
import { css, jsx } from '@emotion/core'
4+
import Button from '../../components/Button'
5+
6+
const styles = {
7+
container: {
8+
padding: '1rem',
9+
},
10+
}
11+
12+
type Props = {
13+
send: (action: T.Action) => void
14+
}
15+
16+
const SelectWorkspace = (props: Props) => {
17+
const onOpenWorkspace = () => props.send({ type: 'REQUEST_WORKSPACE' })
18+
return (
19+
<div css={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+
<Button type="secondary" onClick={onOpenWorkspace}>
24+
Open a Workspace
25+
</Button>
26+
</div>
27+
)
28+
}
29+
30+
export default SelectWorkspace

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+
import React from 'react'
4+
import { css, jsx } from '@emotion/core'
5+
import SelectWorkspace from '../src/containers/Check/SelectWorkspace'
6+
import SideBarDecorator from './utils/SideBarDecorator'
7+
8+
const styles = {
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+
<div css={styles.container}>
19+
<SelectWorkspace send={action('send')} />
20+
</div>
21+
))

0 commit comments

Comments
 (0)
0