Skip to content

Commit 62bb2cd

Browse files
committed
587: Add roles radio group
1 parent c3595a2 commit 62bb2cd

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/client/src/pages/UserManagement/Components/Dialog/NewUserDialog.jsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
buildUsernameValidation
2020
} from '../../Validations';
2121
import useAlert from "../../../../hooks/useAlert";
22+
import RolesRadioGroup from "../RolesRadioGroup";
2223

2324

2425
export default function NewUserDialog(props) {
@@ -99,18 +100,6 @@ export default function NewUserDialog(props) {
99100
{(responseError || errors.username) && // This is a little janky... Could be improved upon.
100101
<Typography color="error">{responseError || errors.username.message}</Typography>
101102
}
102-
<TextField
103-
{...register("role")}
104-
margin="dense"
105-
id="role-input"
106-
label="Role - user/admin"
107-
onBlur={() => trigger("role")}
108-
variant="standard"
109-
fullWidth
110-
/>
111-
{errors.role &&
112-
<Typography color="error">{errors.role.message}</Typography>
113-
}
114103
<TextField
115104
{...register("password")}
116105
margin="dense"
@@ -135,6 +124,10 @@ export default function NewUserDialog(props) {
135124
{errors.confirmPassword &&
136125
<Typography color="error">{errors.confirmPassword.message}</Typography>
137126
}
127+
<RolesRadioGroup id="roles-radio-group" register={register} />
128+
{errors.role &&
129+
<Typography color="error">{errors.role.message}</Typography>
130+
}
138131
<DialogActions>
139132
<Button
140133
onClick={onClose}

0 commit comments

Comments
 (0)