Skip to content

Commit 9ab4ce2

Browse files
CedarCooperSbethm
andauthored
Merge pull request #56 from oslabs-beta/scout
Co-authored-by: Sarah Moosa <[email protected]>
2 parents 33b8347 + 38a25f3 commit 9ab4ce2

File tree

7 files changed

+41
-26
lines changed

7 files changed

+41
-26
lines changed

src/components/Login.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
//MUI Elements
1212
import TextField from '@mui/material/TextField';
1313
import Button from '@mui/material/Button';
14+
import { grey } from '@mui/material/colors';
15+
1416

1517
// @ts-ignore
1618
import Docketeer from '../../assets/docketeer-title.png';
@@ -99,7 +101,7 @@
99101
id='username'
100102
label='Username'
101103
variant='outlined'
102-
104+
value= 'sysadmin'
103105
/>
104106
<br />
105107
<br />
@@ -108,7 +110,7 @@
108110
label='Password'
109111
type='password'
110112
variant='outlined'
111-
113+
value ='belugas'
112114
/>
113115
<br />
114116
{/* * Login Button * */}
@@ -119,12 +121,27 @@
119121
size='medium'
120122
onClick={() => handleLogin}
121123
sx={{
122-
m: 1
124+
marginTop: 1,
125+
marginBottom:1
123126
}}
124127
>
125128
Login
126129
</Button>
127-
<button className='btn-signup' onClick={ () => navigate('/signup') }>New SysAdmin Sign Up</button>
130+
<br/>
131+
<Button
132+
variant= 'contained'
133+
// color='grey'
134+
size='small'
135+
onClick={()=> navigate('/userSignup')}
136+
sx={{
137+
color:'#1976d2',
138+
background:'white',
139+
marginTop:1
140+
}}
141+
>
142+
Register New Sysadmin
143+
</Button>
144+
<br/>
128145
</form>
129146
</div>
130147
</div>

src/components/SignUp.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import FormControl from '@mui/material/FormControl';
1313
import Visibility from '@mui/icons-material/Visibility';
1414
import VisibilityOff from '@mui/icons-material/VisibilityOff';
1515
import PasswordStrengthBar from 'react-password-strength-bar';
16-
import RadioGroup from "@mui/material/RadioGroup";
17-
import Radio from "@mui/material/Radio";
18-
import FormControlLabel from '@mui/material/FormControlLabel';
16+
1917

2018
// Helper Functions
2119
import {
@@ -25,13 +23,6 @@ import {
2523
checkPhone,
2624
} from "./helper/newUserHelper";
2725

28-
// this will store the value from the user role
29-
let valueRole = '3';
30-
//setting value of the RadioGroup MUI Component to the one selected by the user
31-
const handleSelect = (event: React.ChangeEvent<HTMLInputElement>) => {
32-
valueRole = (event.target as HTMLInputElement).value;
33-
}
34-
3526
const SignUp = () => {
3627
const navigate = useNavigate();
3728
const [values, setValues] = useState({
@@ -49,6 +40,7 @@ const SignUp = () => {
4940
showPassword: !values.showPassword,
5041
});
5142
};
43+
5244
return (
5345
<div className='renderContainers'>
5446
<div className='header'>
@@ -155,8 +147,10 @@ const SignUp = () => {
155147
label='Phone'
156148
variant='outlined'
157149
required
150+
inputProps={{maxLength: 12 }}
151+
158152
onChange={() => {
159-
checkPhone(document.getElementById('signupPhone').value);
153+
checkPhone(document.getElementById('signupPhone')?.value);
160154
}}
161155
sx={{
162156
m: 1
@@ -174,7 +168,8 @@ const SignUp = () => {
174168
m: 1
175169
}}
176170
>
177-
Back</Button>
171+
Back
172+
</Button>
178173
<Button
179174
variant='contained'
180175
size='medium'

src/components/display/NewUserDisplay.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,26 @@ const NewUserDisplay = () => {
178178
m: 1
179179
}}
180180
/>
181-
<FormControl>
181+
182+
<br />
183+
<span id='phone-alert' style={{marginLeft:10}}></span>
184+
<br />
185+
<FormControl>
182186
<RadioGroup
183187
id="new-user-role"
184188
row
185189
defaultValue="3"
186190
onChange={handleSelect}
191+
sx={{
192+
m: 1
193+
}}
187194
>
188195
<FormControlLabel value="1" control={<Radio />} label="System Admin"></FormControlLabel>
189196
<FormControlLabel value="2" control={<Radio />} label="Admin"></FormControlLabel>
190197
<FormControlLabel value="3" control={<Radio />} label="User"></FormControlLabel>
191198
</RadioGroup>
192-
</FormControl>
193-
<br />
194-
<span id='phone-alert'></span>
195-
<br />
199+
</FormControl>
200+
<br/>
196201
<Button
197202
variant='contained'
198203
size='medium'

src/components/helper/newUserHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import store from '../../renderer/store';
66
import * as actions from '../../redux/actions/actions';
77
import React from 'react';
88

9-
export const handleNewUser = (e: React.SyntheticEvent, roleID: string) => {
9+
export const handleNewUser = (e: React.SyntheticEvent, roleID?: string) => {
1010
e.preventDefault();
11-
1211
const username = (<HTMLInputElement>document.getElementById('signupUsername')).value;
1312
const password = (<HTMLInputElement>document.getElementById('signupPassword')).value;
1413
const confirmationPassword = (<HTMLInputElement>document.getElementById(

src/components/login/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,5 @@ const Login = () => {
145145
</div>
146146
);
147147
};
148-
148+
}
149149
export default Login;

src/components/tabs/Users.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const UserTable = () => {
3939
]);
4040

4141
const handleRoleChange = (event) => {
42-
console.log('userl', userList)
4342
const id = event.id;
4443
const role = event.props.value;
4544

src/renderer/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const App = () => {
1313
<Routes>
1414
<Route path='/login' element={<Login />} />
1515
<Route path='/' element={<Authentication />} />
16-
<Route path='/signup' element={<SignUp />} />
16+
<Route path='/userSignup' element={<SignUp />} />
1717
<Route path='/app/*' element={<RenderViews />} />
1818
</Routes>
1919
);

0 commit comments

Comments
 (0)