@@ -66,6 +66,17 @@ const LABEL_STYLE = {
66
66
marginBottom : "0.15rem" ,
67
67
marginTop : "0.15rem"
68
68
} ;
69
+ /// Move login to navbar
70
+ const NAV_LOGIN_STYLE = {
71
+ position : 'fixed' ,
72
+ top : '5px' ,
73
+ right : '20px' ,
74
+ zIndex : '2000'
75
+ } ;
76
+ const NAV_LOGIN_FEEDBACK_STYLE = {
77
+ position : "absolute" ,
78
+ right : "210px"
79
+ } ;
69
80
70
81
/// REACT COMPONENT ///////////////////////////////////////////////////////////
71
82
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -100,21 +111,35 @@ class SessionShell extends UNISYS.Component {
100
111
let gid = `\u00A0${ decoded . groupId } ` ;
101
112
let subid = decoded . subId ? `USER\u00A0${ decoded . subId } ` : "" ;
102
113
return (
103
- < FormGroup row style = { GROUP_STYLE } >
104
- < Col sm = { 3 } >
105
- < Label style = { LABEL_STYLE } className = "small" >
106
- GROUP{ gid }
107
- < br />
108
- { subid }
109
- </ Label >
110
- </ Col >
111
- < Col sm = { 9 } className = "text-right" >
112
- < Label style = { LABEL_STYLE } className = "small" >
113
- { classproj } -< strong > { decoded . hashedId } </ strong >
114
- </ Label >
115
- </ Col >
116
- </ FormGroup >
114
+ < div row style = { NAV_LOGIN_STYLE } >
115
+ < Label style = { LABEL_STYLE } className = "small" >
116
+ GROUP{ gid } :
117
+ < br />
118
+ { subid }
119
+ </ Label >
120
+ < Label style = { LABEL_STYLE } className = "small" >
121
+ { classproj } -< strong > { decoded . hashedId } </ strong >
122
+ </ Label >
123
+ </ div >
117
124
) ;
125
+
126
+ // Old Form above NodeSelector
127
+ // return (
128
+ // <FormGroup row style={GROUP_STYLE} style={{position:'fixed',top:'5px',right:'5px',zIndex:'2000'}}>
129
+ // <Col sm={3}>
130
+ // <Label style={LABEL_STYLE} className="small">
131
+ // GROUP{gid}
132
+ // <br />
133
+ // {subid}
134
+ // </Label>
135
+ // </Col>
136
+ // <Col sm={9} className="text-right">
137
+ // <Label style={LABEL_STYLE} className="small">
138
+ // {classproj}-<strong>{decoded.hashedId}</strong>
139
+ // </Label>
140
+ // </Col>
141
+ // </FormGroup>
142
+ // );
118
143
} else {
119
144
return < p > ERROR:renderLoggedIn didn't get valid decoded object</ p > ;
120
145
}
@@ -126,46 +151,59 @@ class SessionShell extends UNISYS.Component {
126
151
let { token, classId, projId, groupId, subId, hashedId, isValid } = this . state ;
127
152
if ( token ) token = token . toUpperCase ( ) ;
128
153
let formFeedback , tip , input ;
129
- tip = "type group ID" ;
130
- if ( classId ) tip = "scanning for valid code..." ;
131
- if ( projId ) tip = "waiting for valid code..." ;
132
- if ( groupId ) tip = "waiting for extra ID..." ;
154
+ tip = "Type group ID" ;
155
+ if ( classId ) tip = "Scanning for valid code..." ;
156
+ if ( projId ) tip = "Waiting for valid code..." ;
157
+ if ( groupId ) tip = "Waiting for extra ID..." ;
133
158
if ( hashedId ) {
134
159
if ( hashedId . length >= 3 ) {
135
160
if ( ! groupId ) tip = `'${ token } ' is an invalid code` ;
136
161
else {
137
- if ( subId ) tip = `login in as GROUP ${ groupId } ${ subId } ` ;
138
- else tip = `login as GROUP ${ groupId } or add -ID<num>` ;
162
+ if ( subId ) tip = `Login in as GROUP ${ groupId } ${ subId } ` ;
163
+ else tip = `Login as GROUP ${ groupId } or add -ID<num>` ;
139
164
}
140
165
}
141
166
}
142
167
if ( groupId ) {
143
168
if ( subId === 0 ) {
144
169
tip = `e.g. ${ classId } -${ projId } -${ hashedId } followed by -ID<num>` ;
145
170
input = < Input invalid name = "sessionToken" id = "sessionToken" bsSize = "sm" style = { INPUT_STYLE } className = "text-right" placeholder = "CLASSID-PROJID-CODE" onChange = { this . handleChange } />
146
- formFeedback = < FormFeedback className = "text-right" > < small > { tip } </ small > </ FormFeedback >
171
+ formFeedback = < FormFeedback style = { NAV_LOGIN_FEEDBACK_STYLE } className = "text-right" > < small > { tip } </ small > </ FormFeedback >
147
172
} else {
148
173
input = < Input valid name = "sessionToken" id = "sessionToken" bsSize = "sm" style = { INPUT_STYLE } className = "text-right" placeholder = "CLASSID-PROJID-CODE" onChange = { this . handleChange } />
149
- formFeedback = < FormFeedback valid className = "text-right" > < small > { tip } </ small > </ FormFeedback >
174
+ formFeedback = < FormFeedback valid style = { NAV_LOGIN_FEEDBACK_STYLE } className = "text-right" > < small > { tip } </ small > </ FormFeedback >
150
175
}
151
176
} else {
152
177
input = < Input invalid name = "sessionToken" id = "sessionToken" bsSize = "sm" style = { INPUT_STYLE } className = "text-right" placeholder = "CLASSID-PROJID-CODE" onChange = { this . handleChange } />
153
- formFeedback = < FormFeedback className = "text-right" > < small > { tip } </ small > </ FormFeedback >
178
+ formFeedback = < FormFeedback style = { NAV_LOGIN_FEEDBACK_STYLE } className = "text-right" > < small > { tip } </ small > </ FormFeedback >
154
179
}
155
180
156
181
return (
157
- < Form onSubmit = { this . onSubmit } >
182
+ < Form onSubmit = { this . onSubmit } style = { NAV_LOGIN_STYLE } >
158
183
< FormGroup row >
159
- < Col >
160
184
< InputGroup >
161
185
< InputGroupAddon addonType = "prepend" > < Button style = { { fontSize :'10px' } } color = "secondary" size = "sm" disabled = { ! isValid } onSubmit = { this . onSubmit } > LOGIN</ Button > </ InputGroupAddon >
162
186
{ input }
163
187
{ formFeedback }
164
188
</ InputGroup >
165
- </ Col >
166
189
</ FormGroup >
167
190
</ Form >
168
191
) ;
192
+
193
+ // Old Form above NodeSelector
194
+ // return (
195
+ // <Form onSubmit={this.onSubmit} style={{position:'fixed',top:'5px',right:'5px',zIndex:'2000'}}>
196
+ // <FormGroup row>
197
+ // <Col>
198
+ // <InputGroup>
199
+ // {formFeedback}
200
+ // <InputGroupAddon addonType="prepend"><Button style={{fontSize:'10px'}} color="secondary" size="sm" disabled={!isValid} onSubmit={this.onSubmit}>LOGIN</Button></InputGroupAddon>
201
+ // {input}
202
+ // </InputGroup>
203
+ // </Col>
204
+ // </FormGroup>
205
+ // </Form>
206
+ // );
169
207
}
170
208
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
171
209
componentWillMount ( ) {
0 commit comments