mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
removed endpoint step
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
import { IWebhookModalStepProps } from "./WebhookModal";
|
||||
import { useProjectContext } from "contexts/ProjectContext";
|
||||
import { FormControl, FormLabel, TextField, Typography } from "@mui/material";
|
||||
|
||||
export default function Step1Endpoint({
|
||||
webhookObject,
|
||||
setWebhookObject,
|
||||
}: IWebhookModalStepProps) {
|
||||
const { settings, tableState } = useProjectContext();
|
||||
return (
|
||||
<FormControl component="fieldset" required>
|
||||
<FormLabel component="legend" className="visually-hidden">
|
||||
Endpoint
|
||||
</FormLabel>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
{" "}
|
||||
<Typography>
|
||||
{" "}
|
||||
{`${settings?.rowyRunUrl}/whs/${tableState?.tablePath}/`}
|
||||
</Typography>{" "}
|
||||
<TextField
|
||||
value={webhookObject.endpoint}
|
||||
onChange={(e) =>
|
||||
setWebhookObject({ ...webhookObject, endpoint: e.target.value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
||||
23
src/components/Table/TableHeader/Webhooks/Step1Secret.tsx
Normal file
23
src/components/Table/TableHeader/Webhooks/Step1Secret.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { IWebhookModalStepProps } from "./WebhookModal";
|
||||
import { useProjectContext } from "contexts/ProjectContext";
|
||||
import { FormControl, FormLabel, TextField, Typography } from "@mui/material";
|
||||
|
||||
export default function Step1Endpoint({
|
||||
webhookObject,
|
||||
setWebhookObject,
|
||||
}: IWebhookModalStepProps) {
|
||||
return (
|
||||
<FormControl component="fieldset">
|
||||
<FormLabel component="legend" className="visually-hidden">
|
||||
Secret
|
||||
</FormLabel>
|
||||
<TextField
|
||||
fullWidth
|
||||
value={webhookObject.secret}
|
||||
onChange={(e) =>
|
||||
setWebhookObject({ ...webhookObject, secret: e.target.value })
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { IWebhookModalStepProps } from "./WebhookModal";
|
||||
import _sortBy from "lodash/sortBy";
|
||||
|
||||
import MultiSelect from "@rowy/multiselect";
|
||||
import { ListItemIcon } from "@mui/material";
|
||||
|
||||
import { useProjectContext } from "contexts/ProjectContext";
|
||||
import { FieldType } from "constants/fields";
|
||||
import { getFieldProp } from "components/fields";
|
||||
|
||||
export default function Step2Auth({
|
||||
webhookObject,
|
||||
setWebhookObject,
|
||||
}: IWebhookModalStepProps) {
|
||||
return <>provides different fields based on the webhookType</>;
|
||||
}
|
||||
@@ -19,10 +19,9 @@ import ExpandIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||
import InlineOpenInNewIcon from "components/InlineOpenInNewIcon";
|
||||
|
||||
import Modal, { IModalProps } from "components/Modal";
|
||||
import Step1Triggers from "./Step1Endpoint";
|
||||
import Step2RequiredFields from "./Step2Auth";
|
||||
import Step3Conditions from "./Step3Conditions";
|
||||
import Step4Body from "./Step4Parser";
|
||||
import Step1Secret from "./Step1Secret";
|
||||
import Step2Conditions from "./Step2Conditions";
|
||||
import Step3Body from "./Step3Parser";
|
||||
|
||||
import { useConfirmation } from "components/ConfirmationDialog";
|
||||
|
||||
@@ -121,7 +120,6 @@ export default function WebhookModal({
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={6}>
|
||||
<FormControlLabel
|
||||
control={
|
||||
@@ -170,32 +168,19 @@ export default function WebhookModal({
|
||||
>
|
||||
<Step>
|
||||
<StepButton onClick={() => setActiveStep(0)}>
|
||||
Endpoint URL
|
||||
Verification
|
||||
<ExpandIcon />
|
||||
</StepButton>
|
||||
<StepContent>
|
||||
<Typography gutterBottom>
|
||||
Set the endpoint URL for the webhook.
|
||||
Set the verification secret for the webhook.
|
||||
</Typography>
|
||||
<Step1Triggers {...stepProps} />
|
||||
<Step1Secret {...stepProps} />
|
||||
</StepContent>
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
<StepButton onClick={() => setActiveStep(1)}>
|
||||
Authentication
|
||||
<ExpandIcon />
|
||||
</StepButton>
|
||||
<StepContent>
|
||||
<Typography gutterBottom>
|
||||
Set the authentication configuration for the webhook.
|
||||
</Typography>
|
||||
<Step2RequiredFields {...stepProps} />
|
||||
</StepContent>
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
<StepButton onClick={() => setActiveStep(2)}>
|
||||
Conditions (optional)
|
||||
<ExpandIcon />
|
||||
</StepButton>
|
||||
@@ -206,12 +191,12 @@ export default function WebhookModal({
|
||||
<code>true</code> if you do not want to write additional
|
||||
logic.
|
||||
</Typography>
|
||||
<Step3Conditions {...stepProps} />
|
||||
<Step2Conditions {...stepProps} />
|
||||
</StepContent>
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
<StepButton onClick={() => setActiveStep(3)}>
|
||||
<StepButton onClick={() => setActiveStep(2)}>
|
||||
Parser
|
||||
<ExpandIcon />
|
||||
</StepButton>
|
||||
@@ -232,7 +217,7 @@ export default function WebhookModal({
|
||||
<InlineOpenInNewIcon />
|
||||
</Link>
|
||||
</Typography>
|
||||
<Step4Body {...stepProps} />
|
||||
<Step3Body {...stepProps} />
|
||||
</StepContent>
|
||||
</Step>
|
||||
</Stepper>
|
||||
@@ -251,7 +236,6 @@ export default function WebhookModal({
|
||||
} else if (!validation.parser) {
|
||||
warningMessage = "Webhook body is not valid";
|
||||
}
|
||||
|
||||
if (warningMessage) {
|
||||
requestConfirmation({
|
||||
title: "Validation failed",
|
||||
|
||||
Reference in New Issue
Block a user