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

Commit5c682a2

Browse files
committed
add processes ui to loading page
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent526f5c9 commit5c682a2

File tree

4 files changed

+44
-21
lines changed

4 files changed

+44
-21
lines changed

‎web-app/src/components/ProcessMessages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { css, jsx } from '@emotion/core'
55
importTestMessagefrom'./TestMessage'
66

77
interfaceProps{
8-
testStatus:T.TestStatus|null
8+
testStatus?:T.TestStatus|null
99
processes:T.ProcessEvent[]
1010
}
1111

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react'
22
import*asTfrom'typings'
33
import{css,jsx}from'@emotion/core'
44
importLoadingfrom'../../components/Loading'
5+
importProcessMessagesfrom'components/ProcessMessages'
56

67
interfaceProps{
78
text:string
@@ -12,11 +13,19 @@ const styles = {
1213
page:{
1314
position:'relative'as'relative',
1415
display:'flex',
16+
flexDirection:'column',
1517
alignItems:'center',
1618
justifyContent:'center',
1719
height:'100%',
1820
width:'100%',
1921
},
22+
processes:{
23+
padding:'0 1rem',
24+
position:'fixed'as'fixed',
25+
bottom:0,
26+
left:0,
27+
right:0,
28+
},
2029
}
2130

2231
constLoadingPage=({ text, processes}:Props)=>{
@@ -37,11 +46,14 @@ const LoadingPage = ({ text, processes }: Props) => {
3746
returnnull
3847
}
3948

40-
constmessage:string=processes&&processes.length ?processes[0].title :text
41-
4249
return(
4350
<divcss={styles.page}>
44-
<Loadingmessage={message}/>
51+
<Loadingmessage={text}/>
52+
{processes&&processes.length&&(
53+
<divcss={styles.processes}>
54+
<ProcessMessagesprocesses={processes}/>
55+
</div>
56+
)}
4557
</div>
4658
)
4759
}

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ export const createMachine = (options: any) => {
2929
processes:[],
3030
testStatus:null,
3131
},
32+
on:{
33+
// track commands
34+
COMMAND_START:{
35+
actions:['commandStart'],
36+
},
37+
COMMAND_SUCCESS:{
38+
actions:['commandSuccess'],
39+
},
40+
COMMAND_FAIL:{
41+
actions:['commandFail'],
42+
},
43+
ERROR:{
44+
// TODO: missing clearError
45+
actions:['setError'],
46+
},
47+
},
3248
states:{
3349
Setup:{
3450
initial:'Startup',
@@ -121,22 +137,6 @@ export const createMachine = (options: any) => {
121137
Tutorial:{
122138
id:'tutorial',
123139
initial:'Level',
124-
on:{
125-
// track commands
126-
COMMAND_START:{
127-
actions:['commandStart'],
128-
},
129-
COMMAND_SUCCESS:{
130-
actions:['commandSuccess'],
131-
},
132-
COMMAND_FAIL:{
133-
actions:['commandFail'],
134-
},
135-
ERROR:{
136-
// TODO: missing clearError
137-
actions:['setError'],
138-
},
139-
},
140140
states:{
141141
LoadNext:{
142142
id:'tutorial-load-next',

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import{storiesOf}from'@storybook/react'
2+
import*asTfrom'../../typings'
23
importReactfrom'react'
34
importLoadingPagefrom'../src/containers/Loading'
45
importSideBarDecoratorfrom'./utils/SideBarDecorator'
56

67
storiesOf('Components',module)
78
.addDecorator(SideBarDecorator)
8-
.add('Loading',()=><LoadingPagetext="Content"context={{}}/>)
9+
.add('Loading',()=><LoadingPagetext="Content"/>)
10+
.add('Loading processes',()=>{
11+
constprocesses:T.ProcessEvent[]=[
12+
{
13+
title:'title',
14+
description:'description...',
15+
status:'RUNNING',
16+
},
17+
]
18+
return<LoadingPagetext="Content"processes={processes}/>
19+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp