@@ -45,8 +45,17 @@ const validationSchema = Yup.object({
45
45
username : nameValidator ( Language . usernameLabel ) ,
46
46
} )
47
47
48
- const authMethodSelect = ( title : string , value : string ) => {
49
- return < MenuItem value = { value } > { title } </ MenuItem >
48
+ const authMethodSelect = (
49
+ title : string ,
50
+ value : string ,
51
+ description : string ,
52
+ ) => {
53
+ return (
54
+ < MenuItem id = { value } value = { value } >
55
+ { title }
56
+ { /* TODO: Add description */ }
57
+ </ MenuItem >
58
+ )
50
59
}
51
60
52
61
export const CreateUserForm : FC <
@@ -72,15 +81,39 @@ export const CreateUserForm: FC<
72
81
73
82
const methods = [ ]
74
83
if ( authMethods ?. password . enabled ) {
75
- methods . push ( authMethodSelect ( "Password" , "password" ) )
84
+ methods . push (
85
+ authMethodSelect (
86
+ "Password" ,
87
+ "password" ,
88
+ "User can provide their email and password to login." ,
89
+ ) ,
90
+ )
76
91
}
77
92
if ( authMethods ?. oidc . enabled ) {
78
- methods . push ( authMethodSelect ( "OIDC" , "oidc" ) )
93
+ methods . push (
94
+ authMethodSelect (
95
+ "OIDC" ,
96
+ "oidc" ,
97
+ "Uses an OIDC provider to authenticate the user." ,
98
+ ) ,
99
+ )
79
100
}
80
101
if ( authMethods ?. github . enabled ) {
81
- methods . push ( authMethodSelect ( "Github" , "github" ) )
102
+ methods . push (
103
+ authMethodSelect (
104
+ "Github" ,
105
+ "github" ,
106
+ "Uses github oauth to authenticate the user." ,
107
+ ) ,
108
+ )
82
109
}
83
- methods . push ( authMethodSelect ( "None" , "none" ) )
110
+ methods . push (
111
+ authMethodSelect (
112
+ "None" ,
113
+ "none" ,
114
+ "User authentication is disabled. This user an only be used if an api token is created for them." ,
115
+ ) ,
116
+ )
84
117
85
118
return (
86
119
< FullPageForm title = "Create user" >
@@ -118,7 +151,9 @@ export const CreateUserForm: FC<
118
151
id = "login_type"
119
152
value = { form . values . login_type }
120
153
label = "Login Type"
121
- onChange = { form . handleChange }
154
+ onChange = { async ( e ) => {
155
+ await form . setFieldValue ( "login_type" , e . target . value )
156
+ } }
122
157
>
123
158
{ methods }
124
159
</ Select >
0 commit comments