Revize 669ffe38
Přidáno uživatelem Jaroslav Hrubý před asi 2 roky(ů)
webapp/components/modals/EditUserModal.tsx | ||
---|---|---|
38 | 38 |
role: values.role, |
39 | 39 |
}; |
40 | 40 |
if (userInfo.id) { |
41 |
await userController.userUserIdPut(userInfo.id, req); |
|
41 |
userController.userUserIdPut(userInfo.id, req).then((r) => { |
|
42 |
ShowToast( |
|
43 |
'Úprava uživatele proběhla úspěšně', |
|
44 |
'success', |
|
45 |
3000, |
|
46 |
'top-end' |
|
47 |
); |
|
48 |
onCancel(); |
|
49 |
}); |
|
42 | 50 |
} |
43 |
onCancel(); |
|
44 | 51 |
}; |
45 | 52 |
|
46 | 53 |
const onFinishFailed = (errorInfo: any) => { |
... | ... | |
54 | 61 |
visible={true} |
55 | 62 |
onCancel={handleCancel} |
56 | 63 |
footer={null} |
64 |
centered |
|
57 | 65 |
> |
58 | 66 |
<Form |
59 | 67 |
onFinish={onFinish} |
... | ... | |
62 | 70 |
labelCol={{ span: 4 }} |
63 | 71 |
layout="horizontal" |
64 | 72 |
> |
65 |
<Form.Item |
|
66 |
label="" |
|
67 |
name="role" |
|
68 |
rules={[ |
|
69 |
{ |
|
70 |
required: true, |
|
71 |
message: 'Prosím vyberte roli', |
|
72 |
}, |
|
73 |
]} |
|
74 |
> |
|
75 |
<Radio.Group> |
|
73 |
<Form.Item label="" name="role"> |
|
74 |
<Radio.Group defaultValue={userInfo.role}> |
|
76 | 75 |
<Radio.Button value={ERole.Annotator}>Anotátor</Radio.Button> |
77 | 76 |
<Radio.Button value={ERole.Administrator}>Admin</Radio.Button> |
78 | 77 |
</Radio.Group> |
... | ... | |
89 | 88 |
> |
90 | 89 |
<Input placeholder="Uživatelské jméno" /> |
91 | 90 |
</Form.Item> |
92 |
<Form.Item |
|
93 |
name="password" |
|
94 |
rules={[{ required: true, message: 'Prosím zadejte heslo' }]} |
|
95 |
> |
|
96 |
<Input.Password placeholder="Heslo" /> |
|
97 |
</Form.Item> |
|
98 |
|
|
99 | 91 |
<Form.Item |
100 | 92 |
name="name" |
101 | 93 |
initialValue={userInfo.name} |
Také k dispozici: Unified diff
Refactoring after code review