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

Commit8c3e5a6

Browse files
committed
rebuild after large changes
1 parentc88d7cd commit8c3e5a6

File tree

17 files changed

+253
-268
lines changed

17 files changed

+253
-268
lines changed

‎src/actions/setupActions.ts

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,38 @@ const setupActions = async (workspaceRoot: vscode.WorkspaceFolder, {commands, co
4545
}
4646

4747
// run command
48-
awaitrunCommands(commands)
48+
if(commands){
49+
awaitrunCommands(commands)
50+
}
4951

5052
// open files
51-
for(constfilePathoffiles){
52-
try{
53-
// TODO: figure out why this does not work
54-
// try {
55-
// const absoluteFilePath = join(workspaceRoot.uri.path, filePath)
56-
// const doc = await vscode.workspace.openTextDocument(absoluteFilePath)
57-
// await vscode.window.showTextDocument(doc, vscode.ViewColumn.One)
58-
// // there are times when initialization leave the panel behind any files opened
59-
// // ensure the panel is redrawn on the right side first
60-
// // webview.createOrShow()
61-
// } catch (error) {
62-
// console.log(`Failed to open file ${filePath}`, error)
63-
// }
64-
constwr=vscode.workspace.rootPath
65-
if(!wr){
66-
thrownewError('No workspace root path')
53+
if(files){
54+
for(constfilePathoffiles){
55+
try{
56+
// TODO: figure out why this does not work
57+
// try {
58+
// const absoluteFilePath = join(workspaceRoot.uri.path, filePath)
59+
// const doc = await vscode.workspace.openTextDocument(absoluteFilePath)
60+
// await vscode.window.showTextDocument(doc, vscode.ViewColumn.One)
61+
// // there are times when initialization leave the panel behind any files opened
62+
// // ensure the panel is redrawn on the right side first
63+
// // webview.createOrShow()
64+
// } catch (error) {
65+
// console.log(`Failed to open file ${filePath}`, error)
66+
// }
67+
constwr=vscode.workspace.rootPath
68+
if(!wr){
69+
thrownewError('No workspace root path')
70+
}
71+
constabsoluteFilePath=join(wr,filePath)
72+
constdoc=awaitvscode.workspace.openTextDocument(absoluteFilePath)
73+
awaitvscode.window.showTextDocument(doc,vscode.ViewColumn.One)
74+
// there are times when initialization leave the panel behind any files opened
75+
// ensure the panel is redrawn on the right side first
76+
vscode.commands.executeCommand('coderoad.open_webview')
77+
}catch(error){
78+
console.log(`Failed to open file${filePath}`,error)
6779
}
68-
constabsoluteFilePath=join(wr,filePath)
69-
constdoc=awaitvscode.workspace.openTextDocument(absoluteFilePath)
70-
awaitvscode.window.showTextDocument(doc,vscode.ViewColumn.One)
71-
// there are times when initialization leave the panel behind any files opened
72-
// ensure the panel is redrawn on the right side first
73-
vscode.commands.executeCommand('coderoad.open_webview')
74-
}catch(error){
75-
console.log(`Failed to open file${filePath}`,error)
7680
}
7781
}
7882
}

‎src/channel/state/Progress.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Storage from '../../services/storage'
66

77
constdefaultValue:CR.Progress={
88
levels:{},
9-
stages:{},
109
steps:{},
1110
complete:false
1211
}

‎src/services/git/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function loadCommit(commit: string): Promise<void> {
4242

4343
/*
4444
save commit
45-
git commit -am '${level}/${stage}/${step} complete'
45+
git commit -am '${level}/${step} complete'
4646
*/
4747

4848
exportasyncfunctionsaveCommit(message:string):Promise<void>{

‎web-app/src/Routes.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import ContinuePage from './containers/Continue'
88
importNewPagefrom'./containers/New'
99
importSummaryPagefrom'./containers/Tutorial/SummaryPage'
1010
importLevelSummaryPagefrom'./containers/Tutorial/LevelPage'
11-
importStageSummaryPagefrom'./containers/Tutorial/StagePage'
1211
importCompletedPagefrom'./containers/Tutorial/CompletedPage'
1312

1413
const{ Route}=Router
@@ -40,9 +39,6 @@ const Routes = () => {
4039
<Routepath="Tutorial.Level">
4140
<LevelSummaryPagesend={tempSend}context={{}asCR.MachineContext}/>
4241
</Route>
43-
<Routepath="Tutorial.Stage">
44-
<StageSummaryPagesend={tempSend}context={{}asCR.MachineContext}/>
45-
</Route>
4642
<Routepath="Tutorial.Completed">
4743
<CompletedPagesend={tempSend}context={{}asCR.MachineContext}/>
4844
</Route>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import*asReactfrom'react'
22
import{Button,Card}from'@alifd/next'
33
import*asCRfrom'typings'
4-
import*asTfrom'typings/graphql'
4+
import*asGfrom'typings/graphql'
55

66
interfaceProps{
7-
tutorial:T.Tutorial
7+
tutorial:G.Tutorial
88
onContinue():void
99
onNew():void
1010
}
@@ -14,8 +14,8 @@ export const ContinuePage = (props: Props) => (
1414
<h3>Continue</h3>
1515
<CardshowTitleBullet={false}contentHeight="auto">
1616
<div>
17-
<h2>{props.tutorial.title}</h2>
18-
<p>{props.tutorial.text}</p>
17+
<h2>{props.tutorial.version.summary.title}</h2>
18+
<p>{props.tutorial.version.summary.description}</p>
1919
<ButtononClick={props.onContinue}>Resume</Button>
2020
</div>
2121
</Card>

‎web-app/src/containers/New/TutorialList/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import*asReactfrom'react'
22

33
importchannelfrom'../../../services/channel'
4-
import*asTfrom'typings/graphql'
4+
import*asGfrom'typings/graphql'
55
importTutorialItemfrom'./TutorialItem'
66

77
interfaceProps{
8-
tutorialList:T.Tutorial[]
8+
tutorialList:G.Tutorial[]
99
}
1010

1111
constTutorialList=(props:Props)=>{
12-
constonSelect=(tutorial:T.Tutorial)=>{
12+
constonSelect=(tutorial:G.Tutorial)=>{
1313
channel.machineSend({
1414
type:'TUTORIAL_START',
1515
payload:{
@@ -19,7 +19,7 @@ const TutorialList = (props: Props) => {
1919
}
2020
return(
2121
<div>
22-
{props.tutorialList.map((tutorial:T.Tutorial)=>(
22+
{props.tutorialList.map((tutorial:G.Tutorial)=>(
2323
<TutorialItem
2424
key={tutorial.id}
2525
onSelect={()=>onSelect(tutorial)}

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

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,71 @@
1-
import{Step}from'@alifd/next'
1+
import{Button,Step}from'@alifd/next'
22
import*asReactfrom'react'
3-
import*asTfrom'typings/graphql'
3+
import*asGfrom'typings/graphql'
44

55
importMarkdownfrom'../../../../components/Markdown'
6-
importLevelStageSummaryfrom'./LevelStageSummary'
6+
importStepDescriptionfrom'./StepDescription'
77

88
conststyles={
9-
card:{},
9+
card:{
10+
padding:0,
11+
},
1012
content:{
1113
padding:'0rem 1rem',
1214
paddingBottom:'1rem',
1315
},
14-
list:{
15-
padding:'0rem',
16-
},
1716
options:{
1817
padding:'0rem 1rem',
1918
},
2019
steps:{
21-
padding:'1rem0.5rem',
20+
padding:'1rem0rem',
2221
},
2322
title:{},
2423
}
2524

2625
interfaceProps{
27-
level:T.Level
28-
onNext():void
26+
level:G.Level
27+
onContinue():void
28+
onLoadSolution():void
2929
}
3030

31-
constLevel=({ level,onNext}:Props)=>{
32-
if(!level||!level.stages){
33-
thrownewError('Nolevel stages found')
31+
constLevel=({ level,onContinue, onLoadSolution}:Props)=>{
32+
if(!level.steps){
33+
thrownewError('NoStage steps found')
3434
}
35-
constactiveIndex=level.stages.findIndex((stage:T.Stage|null)=>stage&&stage.status==='ACTIVE')||0
35+
36+
// grab the active step
37+
constactiveIndex:number=level.steps.findIndex((step:G.Step|null)=>{
38+
returnstep&&step.status==='ACTIVE'
39+
})
40+
3641
return(
3742
<divstyle={styles.card}>
3843
<divstyle={styles.content}>
3944
<h2style={styles.title}>{level.title}</h2>
40-
<Markdown>{level.text||''}</Markdown>
45+
<Markdown>{level.description||''}</Markdown>
4146
</div>
4247
<divstyle={styles.steps}>
43-
<Stepcurrent={activeIndex}direction="ver"animation={false}>
44-
{level.stages.map((stage:T.Stage|null,index:number)=>{
45-
if(!stage){
48+
<Stepcurrent={activeIndex}direction="ver"shape="dot"animationreadOnly>
49+
{level.steps.map((step:G.Step|null,index:number)=>{
50+
if(!step){
4651
returnnull
4752
}
48-
constactive=stage.status==='ACTIVE'
49-
constclickHandler=active
50-
?onNext
51-
:()=>{
52-
/* empty */
53-
}
54-
// note - must add click handler to title, content & step.item
55-
// as all are separated components
5653
return(
5754
<Step.Item
58-
key={stage.id}
59-
style={{backgroundColor:'blue'}}
60-
title={
61-
<spanclassName={active ?'hover-select' :''}onClick={clickHandler}>
62-
{stage.title||`Stage${index+1}`}
63-
</span>
64-
}
65-
content={<LevelStageSummarykey={stage.id}stage={stage}onNext={clickHandler}/>}
66-
onClick={clickHandler}
55+
key={step.id}
56+
title={step.title||`Step${index+1}`}
57+
content={<StepDescriptiontext={step.description}mode={step.status}onLoadSolution={onLoadSolution}/>}
6758
/>
6859
)
6960
})}
7061
</Step>
7162
</div>
63+
64+
{level.status==='COMPLETE'&&(
65+
<divstyle={styles.options}>
66+
<ButtononClick={onContinue}>Continue</Button>
67+
</div>
68+
)}
7269
</div>
7370
)
7471
}
Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
11
import*asReactfrom'react'
22
import*asCRfrom'typings'
33
import*asGfrom'typings/graphql'
4+
import*asselectorsfrom'../../../services/selectors'
45

56
importLevelfrom'./Level'
67

7-
interfaceLevelProps{
8-
level:G.Level
9-
send(action:string):void
10-
}
11-
12-
exportconstLevelSummaryPage=(props:LevelProps)=>{
13-
constonNext=():void=>{
14-
props.send('NEXT')
15-
}
16-
return<Levellevel={props.level}onNext={onNext}/>
17-
}
18-
19-
interfaceContainerProps{
8+
interfacePageProps{
209
context:CR.MachineContext
21-
send(action:string):void
10+
send(action:CR.Action):void
2211
}
2312

24-
constLevelSummaryPageContainer=(props:ContainerProps)=>{
25-
const{tutorial,position, progress}=props.context
13+
constLevelSummaryPageContainer=(props:PageProps)=>{
14+
const{ position, progress}=props.context
2615

27-
if(!tutorial){
28-
thrownewError('Tutorial not found in LevelSummaryPageContainer')
29-
}
16+
constlevel:G.Level=selectors.currentLevel(props.context)
3017

31-
constlevel:G.Level|undefined=tutorial.version.data.levels.find((l:G.Level)=>l.id===position.levelId)
18+
constonContinue=():void=>{
19+
props.send({
20+
type:'LEVEL_NEXT',
21+
payload:{
22+
LevelId:position.levelId,
23+
},
24+
})
25+
}
3226

33-
if(!level){
34-
thrownewError('Level not found in LevelSummaryPageContainer')
27+
constonLoadSolution=():void=>{
28+
props.send({type:'STEP_SOLUTION_LOAD'})
3529
}
3630

37-
level.stages.forEach((stage:G.Stage)=>{
38-
if(stage.id===position.stageId){
39-
stage.status='ACTIVE'
40-
}elseif(progress.stages[stage.id]){
41-
stage.status='COMPLETE'
31+
level.steps.forEach((step:G.Step)=>{
32+
if(progress.steps[step.id]){
33+
step.status='COMPLETE'
34+
}elseif(step.id===position.stepId){
35+
step.status='ACTIVE'
4236
}else{
43-
stage.status='INCOMPLETE'
37+
step.status='INCOMPLETE'
4438
}
4539
})
40+
level.status=progress.levels[position.levelId] ?'COMPLETE' :'ACTIVE'
4641

47-
return<LevelSummaryPagelevel={level}send={props.send}/>
42+
return<Levellevel={level}onContinue={onContinue}onLoadSolution={onLoadSolution}/>
4843
}
4944

5045
exportdefaultLevelSummaryPageContainer

‎web-app/src/containers/Tutorial/LevelPage/Level/LevelStageSummary.tsxrenamed to‎web-app/src/containers/Tutorial/LevelsPage/Level/LevelStageSummary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ const styles = {
2323
}
2424

2525
interfaceProps{
26-
stage:G.Stage
26+
level:G.Level
2727
onNext():void
2828
}
2929

3030
constLevelStageSummary=(props:Props)=>{
31-
const{stage, onNext}=props
32-
constactive=stage.status==='ACTIVE'
31+
const{level, onNext}=props
32+
constactive=level.status==='ACTIVE'
3333
return(
3434
<divstyle={styles.card}className={active ?'hover-select' :''}onClick={onNext}>
3535
<divstyle={styles.left}>
36-
<Markdown>{stage.text||''}</Markdown>
36+
<Markdown>{level.description||''}</Markdown>
3737
</div>
3838
</div>
3939
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp