Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
include event filter form
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Kracht <[email protected]>
  • Loading branch information
stefan-kracht committed Jan 10, 2024
1 parent 44c648b commit bfc0f2c
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Table, TableBody, TableCell, TableRow } from "~/design/Table";
import { UseFormReturn, useFieldArray } from "react-hook-form";
import {
getAclConfigAtIndex,
getEventFilterConfigAtIndex,
getJsInboundConfigAtIndex,
getRequestConvertConfigAtIndex,
} from "../utils";
Expand All @@ -21,6 +22,7 @@ import { AclForm } from "./AclForm";
import Button from "~/design/Button";
import { Card } from "~/design/Card";
import { EndpointFormSchemaType } from "../../../schema";
import { EventFilterForm } from "./EventFilterForm";
import { InboundPluginFormSchemaType } from "../../../schema/plugins/inbound/schema";
import { JsInboundForm } from "./JsInboundForm";
import { Plus } from "lucide-react";
Expand Down Expand Up @@ -51,7 +53,7 @@ export const InboundPluginForm: FC<InboundPluginFormProps> = ({ form }) => {
const [selectedPlugin, setSelectedPlugin] =
useState<InboundPluginFormSchemaType["type"]>();

const { jsInbound, requestConvert, acl } = inboundPluginTypes;
const { jsInbound, requestConvert, acl, eventFilter } = inboundPluginTypes;

const pluginsCount = fields.length;
const formId = "inboundPluginForm";
Expand Down Expand Up @@ -202,7 +204,6 @@ export const InboundPluginForm: FC<InboundPluginFormProps> = ({ form }) => {
}}
/>
)}

{selectedPlugin === acl && (
<AclForm
formId={formId}
Expand All @@ -218,6 +219,21 @@ export const InboundPluginForm: FC<InboundPluginFormProps> = ({ form }) => {
}}
/>
)}
{selectedPlugin === eventFilter && (
<EventFilterForm
formId={formId}
defaultConfig={getEventFilterConfigAtIndex(fields, editIndex)}
onSubmit={(configuration) => {
setDialogOpen(false);
if (editIndex === undefined) {
addPlugin(configuration);
} else {
editPlugin(editIndex, configuration);
}
setEditIndex(undefined);
}}
/>
)}
</ModalWrapper>
</Dialog>
);
Expand Down

0 comments on commit bfc0f2c

Please sign in to comment.