Skip to content

Commit

Permalink
Merge pull request #926 from scottsut/fix_invite
Browse files Browse the repository at this point in the history
fix: add validation to invite form
  • Loading branch information
scottsut authored Mar 3, 2022
2 parents 0339f43 + 6f40e6f commit ba407d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const InviteForm = memo(
const [options, setOptions] = useState<ValueType[]>([]);
const formRef = useRef<FormInstance>();
const t = useI18NPrefix('member.form');
const tgv = useI18NPrefix('global.validation');

const debouncedSearchUser = useMemo(() => {
const searchUser = async (val: string) => {
Expand Down Expand Up @@ -79,7 +80,12 @@ export const InviteForm = memo(
afterClose={onAfterClose}
ref={formRef}
>
<Form.Item name="emails">
<Form.Item
name="emails"
rules={[
{ required: true, message: `${t('email')}${tgv('required')}` },
]}
>
<Select<ValueType>
mode="tags"
placeholder={t('search')}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@
"remove": "Remove"
},
"form": {
"email": "Email",
"search": "Search or paste the emails of invited members",
"needConfirm": "Need email confirmation"
},
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@
"remove": "移除"
},
"form": {
"email": "邮箱",
"search": "请搜索或粘贴被邀请成员邮箱",
"needConfirm": "需要被邀请成员邮件确认"
},
Expand Down

0 comments on commit ba407d7

Please sign in to comment.