Skip to content

Feature/reset #389

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
send reset from client
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jul 12, 2020
commit cb798547499f84b968b38639c2536b57f859c1b5
12 changes: 6 additions & 6 deletions src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,17 @@ class Channel implements Channel {
case 'EDITOR_RUN_TEST':
vscode.commands.executeCommand(COMMANDS.RUN_TEST, action?.payload)
return
case 'EDITOR_RUN_RESET_SCRIPT':
const tutorial: TT.Tutorial | null = this.context.tutorial.get()
case 'EDITOR_RUN_RESET':
// reset to timeline
// 1. get last pass commit
// 2. load timeline until last pass commit

// if tutorial.config.reset.command, run it
const tutorial: TT.Tutorial | null = this.context.tutorial.get()
if (tutorial?.config?.reset?.command) {
await exec({ command: tutorial.config.reset.command })
}
return
case 'EDITOR_RUN_RESET_TO_LAST_PASS':
return
case 'EDITOR_RUN_RESET_TO_TIMELINE':
return
default:
logger(`No match for action type: ${actionType}`)
return
Expand Down
6 changes: 3 additions & 3 deletions web-app/src/containers/Tutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import StepProgress from './components/StepProgress'
import { DISPLAY_RUN_TEST_BUTTON } from '../../environment'
import formatLevels from './formatLevels'
// import SettingsPage from './containers/Settings'
// import Reset from './components/Reset'
import Reset from './components/Reset'

const styles = {
header: {
Expand Down Expand Up @@ -95,7 +95,7 @@ const TutorialPage = (props: PageProps) => {
}

const onReset = (): void => {
// TODO
props.send({ type: 'RUN_RESET' })
}

const [menuVisible, setMenuVisible] = React.useState(false)
Expand Down Expand Up @@ -148,7 +148,7 @@ const TutorialPage = (props: PageProps) => {

{/* Center */}
<div css={{ flex: 1, display: 'flex', justifyContent: 'center' }}>
{/* <Reset onReset={onReset} disabled={processes.length > 0} /> */}
<Reset onReset={onReset} disabled={processes.length > 0} />
</div>

{/* Right */}
Expand Down
4 changes: 2 additions & 2 deletions web-app/src/services/state/actions/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ export default (editorSend: any) => ({
payload: { position: context.position },
})
},
runResetScript() {
runReset() {
editorSend({
type: 'EDITOR_RUN_RESET_SCRIPT',
type: 'EDITOR_RUN_RESET',
})
},
})
4 changes: 2 additions & 2 deletions web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export const createMachine = (options: any) => {
RUN_TEST: {
actions: ['runTest'],
},
RESET_SCRIPT: {
actions: ['runResetScript'],
RUN_RESET: {
actions: ['runReset'],
},
},
},
Expand Down