@@ -34,6 +34,7 @@ interface Props {
34
34
trials: { [ string ] : Trial } ;
35
35
timelines: { } ;
36
36
subject: string ;
37
+ group: string ;
37
38
session: number ;
38
39
deviceType: DEVICES ;
39
40
isEEGEnabled: boolean ;
@@ -42,6 +43,7 @@ interface Props {
42
43
43
44
interface State {
44
45
isInputModalOpen: boolean ;
46
+ isGroupInputModalOpen: boolean ;
45
47
}
46
48
47
49
export default class Run extends Component < Props , State > {
@@ -52,18 +54,21 @@ export default class Run extends Component<Props, State> {
52
54
handleStartExperiment : ( ) => void ;
53
55
handleTimeline : ( ) => void ;
54
56
handleCloseInputModal : ( ) => void ;
57
+ handleCloseGroupInputModal : ( ) => void ;
55
58
handleClean : ( ) => void ;
56
59
57
60
constructor ( props : Props ) {
58
61
super ( props ) ;
59
62
this . state = {
60
- isInputModalOpen : props . subject . length === 0
63
+ isInputModalOpen : props . subject . length === 0 ,
64
+ isGroupInputModalOpen : false
61
65
} ;
62
66
this . handleSubjectEntry = debounce ( this . handleSubjectEntry , 500 ) . bind ( this ) ;
63
67
this . handleSessionEntry = debounce ( this . handleSessionEntry , 500 ) . bind ( this ) ;
64
68
this . handleStartExperiment = this . handleStartExperiment . bind ( this ) ;
65
69
this . handleTimeline = this . handleTimeline . bind ( this ) ;
66
70
this . handleCloseInputModal = this . handleCloseInputModal . bind ( this ) ;
71
+ this . handleCloseGroupInputModal = this . handleCloseGroupInputModal . bind ( this ) ;
67
72
}
68
73
69
74
componentDidMount ( ) {
@@ -94,6 +99,11 @@ export default class Run extends Component<Props, State> {
94
99
this . setState ( { isInputModalOpen : false } ) ;
95
100
}
96
101
102
+ handleCloseGroupInputModal ( name : string ) {
103
+ this . props . experimentActions . setGroup ( name ) ;
104
+ this . setState ( { isGroupInputModalOpen : false } ) ;
105
+ }
106
+
97
107
handleTimeline ( ) {
98
108
let injectionFunction = ( ) => null ;
99
109
if ( this . props . isEEGEnabled ) {
@@ -144,6 +154,7 @@ export default class Run extends Component<Props, State> {
144
154
basic
145
155
textAlign = "left"
146
156
className = { styles . descriptionContainer }
157
+ vertical
147
158
>
148
159
< Header as = "h1" > { this . props . type } </ Header >
149
160
< Segment basic className = { styles . infoSegment } >
@@ -157,6 +168,19 @@ export default class Run extends Component<Props, State> {
157
168
onClick = { ( ) => this . setState ( { isInputModalOpen : true } ) }
158
169
/>
159
170
</ Segment >
171
+
172
+ < Segment basic className = { styles . infoSegment } >
173
+ Group Name: < b > { this . props . group } </ b >
174
+ < Button
175
+ basic
176
+ circular
177
+ size = "huge"
178
+ icon = "edit"
179
+ className = { styles . closeButton }
180
+ onClick = { ( ) => this . setState ( { isGroupInputModalOpen : true } ) }
181
+ />
182
+ </ Segment >
183
+
160
184
< Segment basic className = { styles . infoSegment } >
161
185
Session Number: < b > { this . props . session } </ b >
162
186
</ Segment >
@@ -175,7 +199,7 @@ export default class Run extends Component<Props, State> {
175
199
}
176
200
return (
177
201
< ExperimentWindow settings = { {
178
- script : this . props . type ,
202
+ script : this . props . paradigm ,
179
203
on_finish : ( csv ) => {
180
204
this . props . experimentActions . stop ( { data : csv } ) ;
181
205
}
@@ -201,6 +225,12 @@ export default class Run extends Component<Props, State> {
201
225
onExit = { ( ) => this . setState ( { isInputModalOpen : false } ) }
202
226
header = "Enter Subject Name"
203
227
/>
228
+ < InputModal
229
+ open = { this . state . isGroupInputModalOpen }
230
+ onClose = { this . handleCloseGroupInputModal }
231
+ onExit = { ( ) => this . setState ( { isGroupInputModalOpen : false } ) }
232
+ header = "Enter Group Name"
233
+ />
204
234
</ div >
205
235
) ;
206
236
}
0 commit comments