Organize directories
This commit is contained in:
parent
8a91c9b89b
commit
4898382f78
433 changed files with 0 additions and 0 deletions
|
|
@ -1,52 +0,0 @@
|
|||
import {
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
Edit,
|
||||
ArrayInput,
|
||||
SimpleFormIterator,
|
||||
regex,
|
||||
required,
|
||||
EditProps,
|
||||
FormDataConsumer,
|
||||
} from "react-admin";
|
||||
import { BackendTypeInput, BackendIdInput, HttpMethodInput } from "./shared";
|
||||
|
||||
const WebhookTitle = ({ record }) => {
|
||||
let title = "";
|
||||
if (record) title = record.name ? record.name : record.email;
|
||||
return <span>Webhook {title}</span>;
|
||||
};
|
||||
|
||||
const WebhookEdit = (props: EditProps) => {
|
||||
return (
|
||||
// @ts-expect-error: Missing props
|
||||
<Edit title={<WebhookTitle />} {...props}>
|
||||
<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>
|
||||
</Edit>
|
||||
);
|
||||
};
|
||||
|
||||
export default WebhookEdit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue