Skip to content

Commit

Permalink
feat: show alert when no name entered
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan committed Apr 12, 2021
1 parent 8a2625b commit 9e3d4d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/pages/Service/components/Step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ const Step1: React.FC<ServiceModule.Step1PassProps> = ({
return (
<>
<Form {...FORM_LAYOUT} form={form}>
<Form.Item name="name" label={formatMessage({ id: 'component.global.name' })} required>
<Form.Item name="name" label={formatMessage({ id: 'component.global.name' })} required rules={[
{
required: true,
message: formatMessage({ id: 'page.service.fields.name.required' })
}
]}>
<Input disabled={disabled} placeholder={formatMessage({ id: 'page.service.fields.name.required' })} />
</Form.Item>
<Form.Item name="desc" label={formatMessage({ id: 'component.global.description' })}>
Expand Down

0 comments on commit 9e3d4d4

Please sign in to comment.