mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
added format command and added trailing commas to reduce conflicts
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
StringEnum,
|
||||
StringIdentifier,
|
||||
Type,
|
||||
registerCustomTypeboxKinds
|
||||
registerCustomTypeboxKinds,
|
||||
} from "core/utils";
|
||||
import { TRIGGERS } from "flows/flows-schema";
|
||||
import { forwardRef, useState } from "react";
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
type Modal2Ref,
|
||||
ModalBody,
|
||||
ModalFooter,
|
||||
ModalTitle
|
||||
ModalTitle,
|
||||
} from "../../../components/modal/Modal2";
|
||||
import { Step, Steps, useStepContext } from "../../../components/steps/Steps";
|
||||
|
||||
@@ -31,7 +31,7 @@ const triggerNames = Object.keys(TRIGGERS) as unknown as (keyof typeof TRIGGERS)
|
||||
const schema = Type.Object({
|
||||
name: StringIdentifier,
|
||||
trigger: StringEnum(triggerNames),
|
||||
mode: StringEnum(["async", "sync"])
|
||||
mode: StringEnum(["async", "sync"]),
|
||||
});
|
||||
|
||||
export const FlowCreateModal = forwardRef<Modal2Ref>(function FlowCreateModal(props, ref) {
|
||||
@@ -63,15 +63,15 @@ export function StepCreate() {
|
||||
watch,
|
||||
control,
|
||||
register,
|
||||
formState: { isValid, errors }
|
||||
formState: { isValid, errors },
|
||||
} = useForm({
|
||||
resolver: typeboxResolver(schema),
|
||||
defaultValues: {
|
||||
name: "",
|
||||
trigger: "manual",
|
||||
mode: "async"
|
||||
mode: "async",
|
||||
},
|
||||
mode: "onSubmit"
|
||||
mode: "onSubmit",
|
||||
});
|
||||
|
||||
async function onSubmit(data: Static<typeof schema>) {
|
||||
@@ -80,9 +80,9 @@ export function StepCreate() {
|
||||
trigger: {
|
||||
type: data.trigger,
|
||||
config: {
|
||||
mode: data.mode
|
||||
}
|
||||
}
|
||||
mode: data.mode,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
console.log("errors", errors);
|
||||
@@ -106,7 +106,7 @@ export function StepCreate() {
|
||||
data={[
|
||||
{ label: "Manual", value: "manual" },
|
||||
{ label: "HTTP", value: "http" },
|
||||
{ label: "Event", value: "event" }
|
||||
{ label: "Event", value: "event" },
|
||||
]}
|
||||
control={control}
|
||||
/>
|
||||
@@ -115,7 +115,7 @@ export function StepCreate() {
|
||||
name="mode"
|
||||
data={[
|
||||
{ label: "Async", value: "async" },
|
||||
{ label: "Sync", value: "sync" }
|
||||
{ label: "Sync", value: "sync" },
|
||||
]}
|
||||
control={control}
|
||||
/>
|
||||
@@ -125,7 +125,7 @@ export function StepCreate() {
|
||||
<ModalFooter
|
||||
next={{
|
||||
type: "submit",
|
||||
disabled: !isValid
|
||||
disabled: !isValid,
|
||||
}}
|
||||
nextLabel="Create"
|
||||
prev={{ onClick: stepBack }}
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
flowToNodes,
|
||||
useFlowCanvas,
|
||||
useFlowCanvasState,
|
||||
useFlowSelector
|
||||
useFlowSelector,
|
||||
} from "ui/modules/flows/hooks/use-flow";
|
||||
import { JsonViewer } from "../../components/code/JsonViewer";
|
||||
import { routes, useGoBack, useNavigate } from "../../lib/routes";
|
||||
@@ -59,7 +59,7 @@ function FlowsEditInner() {
|
||||
const viewport = {
|
||||
zoom: 1,
|
||||
x: rect?.width ? rect.width * 0.1 : 0,
|
||||
y: rect?.height ? rect.height / 2 - triggerHeight / 2 - offset : 0
|
||||
y: rect?.height ? rect.height / 2 - triggerHeight / 2 - offset : 0,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -79,18 +79,18 @@ function FlowsEditInner() {
|
||||
onDropNewNode={(node) => ({
|
||||
...node,
|
||||
type: "select",
|
||||
data: { label: "" }
|
||||
data: { label: "" },
|
||||
})}
|
||||
onDropNewEdge={(edge) => ({
|
||||
...edge,
|
||||
style: {
|
||||
strokeWidth: 2
|
||||
strokeWidth: 2,
|
||||
},
|
||||
markerEnd: {
|
||||
type: MarkerType.ArrowClosed,
|
||||
width: 10,
|
||||
height: 10
|
||||
}
|
||||
height: 10,
|
||||
},
|
||||
})}
|
||||
>
|
||||
<FlowPanels />
|
||||
@@ -202,7 +202,7 @@ const Debugger = () => {
|
||||
title="Context"
|
||||
json={{
|
||||
name: $flow.name,
|
||||
...$flow.data
|
||||
...$flow.data,
|
||||
}}
|
||||
expand={expand}
|
||||
/>
|
||||
@@ -211,7 +211,7 @@ const Debugger = () => {
|
||||
title="State"
|
||||
json={{
|
||||
name: state.name,
|
||||
...state.flow
|
||||
...state.flow,
|
||||
}}
|
||||
expand={expand}
|
||||
/>
|
||||
@@ -225,9 +225,9 @@ const Debugger = () => {
|
||||
(n) =>
|
||||
_setState((prev) => ({
|
||||
...prev,
|
||||
store: { ...prev.store, expand: n }
|
||||
store: { ...prev.store, expand: n },
|
||||
})),
|
||||
250
|
||||
250,
|
||||
)}
|
||||
/>
|
||||
</Tabs.Panel>
|
||||
|
||||
@@ -19,7 +19,7 @@ export function FlowsList() {
|
||||
trigger: flow.trigger.type,
|
||||
mode: flow.trigger.config.mode,
|
||||
tasks: Object.keys(flow.tasks).length,
|
||||
start_task: flow.startTask?.name
|
||||
start_task: flow.startTask?.name,
|
||||
}));
|
||||
|
||||
function handleClick(row) {
|
||||
|
||||
Reference in New Issue
Block a user