Fix more build errors

This commit is contained in:
Darren Clarke 2023-03-15 12:17:43 +00:00
parent 1bdc1e60db
commit 30ce47826f
61 changed files with 1161 additions and 541 deletions

View file

@ -22,35 +22,30 @@ import { BackendTypeInput, BackendIdInput, HttpMethodInput } from "./shared";
<SelectInput optionText="number" />
</ReferenceInput>
*/
const WebhookCreate = (props: CreateProps) => {
return (
<Create {...props} title="Create Webhooks">
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[
required(),
regex(/^[\w-]+$/, "validation.headerName"),
]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
};
const WebhookCreate = (props: CreateProps) => (
<Create {...props} title="Create Webhooks">
<SimpleForm>
<TextInput source="name" validate={[required()]} />
<BackendTypeInput />
<FormDataConsumer subscription={{ values: true }}>
{BackendIdInput}
</FormDataConsumer>
<TextInput
source="endpointUrl"
validate={[required(), regex(/^https?:\/\/[^/]+/, "validation.url")]}
/>
<HttpMethodInput />
<ArrayInput source="headers">
<SimpleFormIterator>
<TextInput
source="header"
validate={[required(), regex(/^[\w-]+$/, "validation.headerName")]}
/>
<TextInput source="value" validate={[required()]} />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
export default WebhookCreate;