mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: refactor connector form
This commit is contained in:
@@ -19,6 +19,8 @@ export default function AutoDnsConnectorForm({form, onCreate}: {
|
||||
onCreate: (values: Connector) => void
|
||||
}) {
|
||||
|
||||
form.setFieldValue('provider', ConnectorProvider.AutoDNS)
|
||||
|
||||
return (
|
||||
<Form
|
||||
{...formItemLayoutWithOutLabel}
|
||||
@@ -28,9 +30,6 @@ export default function AutoDnsConnectorForm({form, onCreate}: {
|
||||
wrapperCol={{span: 14}}
|
||||
onFinish={onCreate}
|
||||
>
|
||||
<Form.Item name='provider' hidden>
|
||||
<Input value={ConnectorProvider.AutoDNS}/>
|
||||
</Form.Item>
|
||||
<Alert
|
||||
message={t`This provider does not provide a list of supported TLD. Please double check if the domain you want to register is supported.`}
|
||||
type='warning'
|
||||
|
||||
@@ -19,6 +19,8 @@ export default function GandiConnectorForm({form, onCreate}: {
|
||||
onCreate: (values: Connector) => void
|
||||
}) {
|
||||
|
||||
form.setFieldValue('provider', ConnectorProvider.Gandi)
|
||||
|
||||
return (
|
||||
<Form
|
||||
{...formItemLayoutWithOutLabel}
|
||||
@@ -28,10 +30,6 @@ export default function GandiConnectorForm({form, onCreate}: {
|
||||
wrapperCol={{span: 14}}
|
||||
onFinish={onCreate}
|
||||
>
|
||||
<Form.Item name='provider' hidden>
|
||||
<Input value={ConnectorProvider.Gandi}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t`Personal Access Token (PAT)`}
|
||||
name={['authData', 'token']}
|
||||
|
||||
@@ -19,6 +19,9 @@ export default function NamecheapConnectorForm({form, onCreate}: {
|
||||
onCreate: (values: Connector) => void
|
||||
}) {
|
||||
|
||||
|
||||
form.setFieldValue('provider', ConnectorProvider.Namecheap)
|
||||
|
||||
return (
|
||||
<Form
|
||||
{...formItemLayoutWithOutLabel}
|
||||
@@ -28,10 +31,6 @@ export default function NamecheapConnectorForm({form, onCreate}: {
|
||||
wrapperCol={{span: 14}}
|
||||
onFinish={onCreate}
|
||||
>
|
||||
<Form.Item name='provider' hidden>
|
||||
<Input value={ConnectorProvider.Namecheap}/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t`Username`}
|
||||
name={['authData', 'ApiUser']}
|
||||
|
||||
@@ -19,6 +19,8 @@ export default function NamecomConnectorForm({form, onCreate}: {
|
||||
onCreate: (values: Connector) => void
|
||||
}) {
|
||||
|
||||
form.setFieldValue('provider', ConnectorProvider["Name.com"])
|
||||
|
||||
return (
|
||||
<Form
|
||||
{...formItemLayoutWithOutLabel}
|
||||
@@ -28,9 +30,6 @@ export default function NamecomConnectorForm({form, onCreate}: {
|
||||
wrapperCol={{span: 14}}
|
||||
onFinish={onCreate}
|
||||
>
|
||||
<Form.Item name='provider' hidden>
|
||||
<Input value={ConnectorProvider["Name.com"]}/>
|
||||
</Form.Item>
|
||||
<Alert
|
||||
message={t`This provider does not provide a list of supported TLD. Please double check if the domain you want to register is supported.`}
|
||||
type='warning'
|
||||
|
||||
@@ -22,6 +22,8 @@ export default function OvhCloudConnectorForm({form, onCreate}: {
|
||||
const [open, setOpen] = useState(false)
|
||||
const [ovhPricingModeValue, setOvhPricingModeValue] = useState<string | undefined>()
|
||||
|
||||
form.setFieldValue('provider', ConnectorProvider.OVHcloud)
|
||||
|
||||
const ovhFields = {
|
||||
appKey: t`Application key`,
|
||||
appSecret: t`Application secret`,
|
||||
@@ -53,10 +55,6 @@ export default function OvhCloudConnectorForm({form, onCreate}: {
|
||||
wrapperCol={{span: 14}}
|
||||
onFinish={onCreate}
|
||||
>
|
||||
<Form.Item name='provider' hidden>
|
||||
<Input value={ConnectorProvider.OVHcloud}/>
|
||||
</Form.Item>
|
||||
|
||||
{
|
||||
Object.keys(ovhFields).map(fieldName => <Form.Item
|
||||
key={ovhFields[fieldName as keyof typeof ovhFields]}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import {Button, Checkbox, Form, Typography} from "antd"
|
||||
import {Button, Checkbox, Form, Input, Typography} from "antd"
|
||||
import {t} from "ttag"
|
||||
import React from "react"
|
||||
|
||||
export function DefaultConnectorFormItems({tosLink}: { tosLink: string }) {
|
||||
return <>
|
||||
<Form.Item name="provider" noStyle>
|
||||
<Input type="hidden" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
valuePropName='checked'
|
||||
label={t`API Terms of Service`}
|
||||
|
||||
Reference in New Issue
Block a user