Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
f883dd9c
Unverified
Commit
f883dd9c
authored
Nov 28, 2022
by
Zeng1998
Committed by
GitHub
Nov 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: create user repeat password (#614)
* feat: create user repeat password * update
parent
d8bf55ef
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
1 deletion
+35
-1
MemberSection.tsx
web/src/components/Settings/MemberSection.tsx
+23
-1
en.json
web/src/locales/en.json
+3
-0
fr.json
web/src/locales/fr.json
+3
-0
vi.json
web/src/locales/vi.json
+3
-0
zh.json
web/src/locales/zh.json
+3
-0
No files found.
web/src/components/Settings/MemberSection.tsx
View file @
f883dd9c
...
@@ -11,6 +11,7 @@ import "../../less/settings/member-section.less";
...
@@ -11,6 +11,7 @@ import "../../less/settings/member-section.less";
interface
State
{
interface
State
{
createUserUsername
:
string
;
createUserUsername
:
string
;
createUserPassword
:
string
;
createUserPassword
:
string
;
repeatUserPassword
:
string
;
}
}
const
PreferencesSection
=
()
=>
{
const
PreferencesSection
=
()
=>
{
...
@@ -19,6 +20,7 @@ const PreferencesSection = () => {
...
@@ -19,6 +20,7 @@ const PreferencesSection = () => {
const
[
state
,
setState
]
=
useState
<
State
>
({
const
[
state
,
setState
]
=
useState
<
State
>
({
createUserUsername
:
""
,
createUserUsername
:
""
,
createUserPassword
:
""
,
createUserPassword
:
""
,
repeatUserPassword
:
""
,
});
});
const
[
userList
,
setUserList
]
=
useState
<
User
[]
>
([]);
const
[
userList
,
setUserList
]
=
useState
<
User
[]
>
([]);
...
@@ -45,11 +47,22 @@ const PreferencesSection = () => {
...
@@ -45,11 +47,22 @@ const PreferencesSection = () => {
});
});
};
};
const
handleRepeatPasswordInputChange
=
(
event
:
React
.
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setState
({
...
state
,
repeatUserPassword
:
event
.
target
.
value
,
});
};
const
handleCreateUserBtnClick
=
async
()
=>
{
const
handleCreateUserBtnClick
=
async
()
=>
{
if
(
state
.
createUserUsername
===
""
||
state
.
createUserPassword
===
""
)
{
if
(
state
.
createUserUsername
===
""
||
state
.
createUserPassword
===
""
)
{
toastHelper
.
error
(
t
(
"message.fill-form"
));
toastHelper
.
error
(
t
(
"message.fill-form"
));
return
;
return
;
}
}
if
(
state
.
createUserPassword
!==
state
.
repeatUserPassword
)
{
toastHelper
.
error
(
t
(
"message.password-not-match"
));
return
;
}
const
userCreate
:
UserCreate
=
{
const
userCreate
:
UserCreate
=
{
username
:
state
.
createUserUsername
,
username
:
state
.
createUserUsername
,
...
@@ -60,13 +73,13 @@ const PreferencesSection = () => {
...
@@ -60,13 +73,13 @@ const PreferencesSection = () => {
try
{
try
{
await
api
.
createUser
(
userCreate
);
await
api
.
createUser
(
userCreate
);
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
toastHelper
.
error
(
error
.
response
.
data
.
message
);
toastHelper
.
error
(
error
.
response
.
data
.
message
);
}
}
await
fetchUserList
();
await
fetchUserList
();
setState
({
setState
({
createUserUsername
:
""
,
createUserUsername
:
""
,
createUserPassword
:
""
,
createUserPassword
:
""
,
repeatUserPassword
:
""
,
});
});
};
};
...
@@ -119,6 +132,15 @@ const PreferencesSection = () => {
...
@@ -119,6 +132,15 @@ const PreferencesSection = () => {
<
span
className=
"field-text"
>
{
t
(
"common.password"
)
}
</
span
>
<
span
className=
"field-text"
>
{
t
(
"common.password"
)
}
</
span
>
<
input
type=
"password"
placeholder=
{
t
(
"common.password"
)
}
value=
{
state
.
createUserPassword
}
onChange=
{
handlePasswordInputChange
}
/>
<
input
type=
"password"
placeholder=
{
t
(
"common.password"
)
}
value=
{
state
.
createUserPassword
}
onChange=
{
handlePasswordInputChange
}
/>
</
div
>
</
div
>
<
div
className=
"input-form-container"
>
<
span
className=
"field-text"
>
{
t
(
"common.repeat-password-short"
)
}
</
span
>
<
input
type=
"password"
placeholder=
{
t
(
"common.repeat-password"
)
}
value=
{
state
.
repeatUserPassword
}
onChange=
{
handleRepeatPasswordInputChange
}
/>
</
div
>
<
div
className=
"btns-container"
>
<
div
className=
"btns-container"
>
<
button
onClick=
{
handleCreateUserBtnClick
}
>
{
t
(
"common.create"
)
}
</
button
>
<
button
onClick=
{
handleCreateUserBtnClick
}
>
{
t
(
"common.create"
)
}
</
button
>
</
div
>
</
div
>
...
...
web/src/locales/en.json
View file @
f883dd9c
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
"about"
:
"About"
,
"about"
:
"About"
,
"email"
:
"Email"
,
"email"
:
"Email"
,
"password"
:
"Password"
,
"password"
:
"Password"
,
"repeat-password-short"
:
"Repeat"
,
"repeat-password"
:
"Repeat the password"
,
"new-password"
:
"New password"
,
"new-password"
:
"New password"
,
"repeat-new-password"
:
"Repeat the new password"
,
"repeat-new-password"
:
"Repeat the new password"
,
"username"
:
"Username"
,
"username"
:
"Username"
,
...
@@ -181,6 +183,7 @@
...
@@ -181,6 +183,7 @@
"change-memo-created-time"
:
"Change memo created time"
,
"change-memo-created-time"
:
"Change memo created time"
,
"memo-not-found"
:
"Memo not found."
,
"memo-not-found"
:
"Memo not found."
,
"fill-all"
:
"Please fill in all fields."
,
"fill-all"
:
"Please fill in all fields."
,
"password-not-match"
:
"Passwords do not match."
,
"new-password-not-match"
:
"New passwords do not match."
,
"new-password-not-match"
:
"New passwords do not match."
,
"image-load-failed"
:
"Image load failed"
,
"image-load-failed"
:
"Image load failed"
,
"fill-form"
:
"Please fill out this form"
,
"fill-form"
:
"Please fill out this form"
,
...
...
web/src/locales/fr.json
View file @
f883dd9c
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
"about"
:
"À propos"
,
"about"
:
"À propos"
,
"email"
:
"Email"
,
"email"
:
"Email"
,
"password"
:
"Mot de passe"
,
"password"
:
"Mot de passe"
,
"repeat-password-short"
:
"Repeat"
,
"repeat-password"
:
"Repeat the password"
,
"new-password"
:
"Nouveau mot de passe"
,
"new-password"
:
"Nouveau mot de passe"
,
"repeat-new-password"
:
"Répétez le nouveau mot de passe"
,
"repeat-new-password"
:
"Répétez le nouveau mot de passe"
,
"username"
:
"Nom d'utilisateur"
,
"username"
:
"Nom d'utilisateur"
,
...
@@ -182,6 +184,7 @@
...
@@ -182,6 +184,7 @@
"login-failed"
:
"Connexion échouée"
,
"login-failed"
:
"Connexion échouée"
,
"signup-failed"
:
"L'inscription a échoué"
,
"signup-failed"
:
"L'inscription a échoué"
,
"user-not-found"
:
"Utilisateur introuvable"
,
"user-not-found"
:
"Utilisateur introuvable"
,
"password-not-match"
:
"Passwords do not match."
,
"password-changed"
:
"Mot de passe modifié"
,
"password-changed"
:
"Mot de passe modifié"
,
"private-only"
:
"Ce mémo est uniquement privé."
,
"private-only"
:
"Ce mémo est uniquement privé."
,
"copied"
:
"Copié"
,
"copied"
:
"Copié"
,
...
...
web/src/locales/vi.json
View file @
f883dd9c
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
"about"
:
"Thông Tin"
,
"about"
:
"Thông Tin"
,
"email"
:
"Email"
,
"email"
:
"Email"
,
"password"
:
"Mật khẩu"
,
"password"
:
"Mật khẩu"
,
"repeat-password-short"
:
"Repeat"
,
"repeat-password"
:
"Repeat the password"
,
"new-password"
:
"Mật khẩu mới"
,
"new-password"
:
"Mật khẩu mới"
,
"repeat-new-password"
:
"Nhập lại mật khẩu mới"
,
"repeat-new-password"
:
"Nhập lại mật khẩu mới"
,
"username"
:
"Tên đăng nhập"
,
"username"
:
"Tên đăng nhập"
,
...
@@ -181,6 +183,7 @@
...
@@ -181,6 +183,7 @@
"login-failed"
:
"Đăng nhập thất bại"
,
"login-failed"
:
"Đăng nhập thất bại"
,
"signup-failed"
:
"Đăng ký thất bại"
,
"signup-failed"
:
"Đăng ký thất bại"
,
"user-not-found"
:
"Không tìm thấy người dùng này"
,
"user-not-found"
:
"Không tìm thấy người dùng này"
,
"password-not-match"
:
"Passwords do not match."
,
"password-changed"
:
"Mật khẩu đã được thay đổi"
,
"password-changed"
:
"Mật khẩu đã được thay đổi"
,
"private-only"
:
"Memo này có trạng thái riêng tư."
,
"private-only"
:
"Memo này có trạng thái riêng tư."
,
"copied"
:
"Đã sao chép"
,
"copied"
:
"Đã sao chép"
,
...
...
web/src/locales/zh.json
View file @
f883dd9c
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
"about"
:
"关于"
,
"about"
:
"关于"
,
"email"
:
"邮箱"
,
"email"
:
"邮箱"
,
"password"
:
"密码"
,
"password"
:
"密码"
,
"repeat-password-short"
:
"重复密码"
,
"repeat-password"
:
"重复密码"
,
"new-password"
:
"新密码"
,
"new-password"
:
"新密码"
,
"repeat-new-password"
:
"重复新密码"
,
"repeat-new-password"
:
"重复新密码"
,
"username"
:
"用户名"
,
"username"
:
"用户名"
,
...
@@ -181,6 +183,7 @@
...
@@ -181,6 +183,7 @@
"change-memo-created-time"
:
"更改 Memo 创建时间"
,
"change-memo-created-time"
:
"更改 Memo 创建时间"
,
"memo-not-found"
:
"找不到 Memo。"
,
"memo-not-found"
:
"找不到 Memo。"
,
"fill-all"
:
"请填写所有字段。"
,
"fill-all"
:
"请填写所有字段。"
,
"password-not-match"
:
"密码不一致。"
,
"new-password-not-match"
:
"新密码不匹配。"
,
"new-password-not-match"
:
"新密码不匹配。"
,
"image-load-failed"
:
"图片加载失败"
,
"image-load-failed"
:
"图片加载失败"
,
"fill-form"
:
"请填写此表单"
,
"fill-form"
:
"请填写此表单"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment