@@ -32,6 +32,7 @@ const ExecutionRow = ({
32
32
production
33
33
} ) => {
34
34
const [ showData , setShowData ] = useState ( false )
35
+ const [ showExpanded , setShowExpanded ] = useState ( false )
35
36
const [ loadingRerun , setLoadingRerun ] = useState ( false )
36
37
37
38
const getDistance = startedAt =>
@@ -54,6 +55,7 @@ const ExecutionRow = ({
54
55
}
55
56
} )
56
57
58
+ const onExpand = ( ) => setShowExpanded ( ! showExpanded )
57
59
const onToggle = ( ) => setShowData ( ! showData )
58
60
59
61
const onRerun = ( replaceScreenshots = false , index ) => {
@@ -75,73 +77,96 @@ const ExecutionRow = ({
75
77
76
78
return (
77
79
< Fragment >
78
- < div className = "mc-mb-3" >
79
- < div className = "mc-mb-4" >
80
- { startedAt && < p > { `${ distance } ago` } </ p > }
81
- < div >
82
- < span > status: </ span >
83
- < StatusBadge status = { status } small />
84
- </ div >
85
- { startedAt && (
86
- < Timer startDate = { startedAt } endDate = { endedAt } >
87
- { ( minutes , seconds ) => (
88
- < p >
89
- duration: { minutes } :{ seconds }
90
- </ p >
80
+ < Flex alignItems = "flex-start" justifyContent = "space-between" >
81
+ < div >
82
+ < div className = "mc-mb-3" >
83
+ < div className = "mc-mb-4" >
84
+ { startedAt && < p > { `${ distance } ago` } </ p > }
85
+ < p > { `test: ${ test } ` } </ p >
86
+ { startedAt && (
87
+ < Timer startDate = { startedAt } endDate = { endedAt } >
88
+ { ( minutes , seconds ) => (
89
+ < p >
90
+ duration: { minutes } :{ seconds }
91
+ </ p >
92
+ ) }
93
+ </ Timer >
91
94
) }
92
- </ Timer >
93
- ) }
95
+ < Flex >
96
+ < span > status: </ span >
97
+ < span className = "mc-ml-2" >
98
+ < StatusBadge status = { status } small />
99
+ </ span >
100
+ </ Flex >
101
+ </ div >
102
+ </ div >
103
+
104
+ < Anchor className = "mc-my-4" onClick = { onExpand } >
105
+ { ! showExpanded ? 'More' : 'Less' }
106
+ </ Anchor >
94
107
</ div >
95
- < p > { `id: ${ id } ` } </ p >
96
- < p > { `test: ${ test } ` } </ p >
97
- < p >
98
- URL:{ ' ' }
99
- < a
100
- className = "mc-text--link"
101
- href = { url }
102
- target = "_blank"
103
- rel = "noopener noreferrer"
104
- >
105
- { url }
106
- </ a >
107
- </ p >
108
- { repositoryName && repositoryOwner && (
109
- < p > repository: { `${ repositoryOwner } /${ repositoryName } ` } </ p >
110
- ) }
111
- { repositoryRef && < p > ref: { repositoryRef } </ p > }
112
- { user && (
108
+
109
+ < div >
113
110
< Flex >
114
- < span > user: </ span >
115
- { user && (
116
- < Fragment >
117
- < Avatar
118
- className = "mc-mx-2"
119
- src = { `https://github.com/${ user } .png` }
120
- width = "26px"
121
- height = "26px"
122
- />
123
- < a
124
- className = "mc-text--link"
125
- href = { `https://github.com/${ user } ` }
126
- target = "_blank"
127
- rel = "noopener noreferrer"
128
- >
129
- { user }
130
- </ a >
131
- </ Fragment >
111
+ { rerunEnabled && (
112
+ < Button onClick = { onRerun } loading = { loadingRerun } >
113
+ Rerun
114
+ </ Button >
115
+ ) }
116
+ { ! ! testResults && (
117
+ < Button kind = "secondary" className = "mc-ml-2" onClick = { onToggle } >
118
+ Toggle Results
119
+ </ Button >
132
120
) }
133
121
</ Flex >
134
- ) }
135
- { production && < p className = "mc-mt-4" > Only for production</ p > }
136
- { rerunEnabled && (
137
- < Button className = "mc-mt-4" onClick = { onRerun } loading = { loadingRerun } >
138
- RERUN
139
- </ Button >
140
- ) }
141
- </ div >
122
+ </ div >
123
+ </ Flex >
124
+ { showExpanded && (
125
+ < div className = "mc-mt-2" >
126
+ < p > { `id: ${ id } ` } </ p >
127
+ < p >
128
+ URL:{ ' ' }
129
+ < a
130
+ className = "mc-text--link"
131
+ href = { url }
132
+ target = "_blank"
133
+ rel = "noopener noreferrer"
134
+ >
135
+ { url }
136
+ </ a >
137
+ </ p >
138
+ { repositoryName && repositoryOwner && (
139
+ < p > repository: { `${ repositoryOwner } /${ repositoryName } ` } </ p >
140
+ ) }
141
+ { repositoryRef && < p > ref: { repositoryRef } </ p > }
142
+ { user && (
143
+ < Flex >
144
+ < span > user: </ span >
145
+ { user && (
146
+ < Fragment >
147
+ < Avatar
148
+ className = "mc-mx-2"
149
+ src = { `https://github.com/${ user } .png` }
150
+ width = "26px"
151
+ height = "26px"
152
+ />
153
+ < a
154
+ className = "mc-text--link"
155
+ href = { `https://github.com/${ user } ` }
156
+ target = "_blank"
157
+ rel = "noopener noreferrer"
158
+ >
159
+ { user }
160
+ </ a >
161
+ </ Fragment >
162
+ ) }
163
+ </ Flex >
164
+ ) }
165
+ { production && < p className = "mc-mt-4" > Only for production</ p > }
166
+ </ div >
167
+ ) }
142
168
{ ! ! testResults && (
143
169
< Fragment >
144
- < Anchor onClick = { onToggle } > Toggle results</ Anchor >
145
170
{ showData && (
146
171
< ResultWrapper className = "mc-p-4 mc-my-3" >
147
172
< TestResults
0 commit comments