Fix more build errors
This commit is contained in:
parent
1bdc1e60db
commit
30ce47826f
61 changed files with 1161 additions and 541 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -13,39 +13,34 @@ import { BackendTypeInput, BackendIdInput, HttpMethodInput } from "./shared";
|
|||
|
||||
const WebhookTitle = ({ record }: any) => {
|
||||
let title = "";
|
||||
if (record) title = record.name ? record.name : record.email;
|
||||
if (record) title = record.name ?? record.email;
|
||||
return <span>Webhook {title}</span>;
|
||||
};
|
||||
|
||||
const WebhookEdit = (props: EditProps) => {
|
||||
return (
|
||||
<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>
|
||||
);
|
||||
};
|
||||
const WebhookEdit = (props: EditProps) => (
|
||||
<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;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,4 @@
|
|||
import {
|
||||
List,
|
||||
Datagrid,
|
||||
DateField,
|
||||
TextField,
|
||||
ReferenceField,
|
||||
ListProps,
|
||||
} from "react-admin";
|
||||
import { List, Datagrid, DateField, TextField, ListProps } from "react-admin";
|
||||
import { BackendIdField } from "./shared";
|
||||
|
||||
const WebhookList = (props: ListProps) => (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue