8000 feat(messaging): start using Hogflow inputs in workflow editor by havenbarnes · Pull Request #33678 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(messaging): start using Hogflow inputs in workflow editor #33678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 201 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
b3a0d79
chore(messaging): add typedefs for messaging workflows
havenbarnes May 7, 2025
8ca9b4a
tweak
havenbarnes May 7, 2025
ccc913b
Update UI snapshots for `chromium` (7)
github-actions[bot] May 7, 2025
0da72ff
Update UI snapshots for `chromium` (7)
github-actions[bot] May 7, 2025
0b57bc1
feat(messaging): add drag n drop workflow builder UI
havenbarnes May 7, 2025
36ba665
tweak
havenbarnes May 7, 2025
722076b
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 7, 2025
a3450b6
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 7, 2025
b5e811a
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 7, 2025
bbbbbee
tweak
havenbarnes May 7, 2025
37c76ad
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 7, 2025
e94ec49
tweak
havenbarnes May 8, 2025
9373e57
Update UI snapshots for `chromium` (5)
github-actions[bot] May 8, 2025
7909419
tweak
havenbarnes May 8, 2025
9f5a0ad
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 8, 2025
a3ce57a
Update UI snapshots for `chromium` (5)
github-actions[bot] May 8, 2025
54110fd
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 8, 2025
dedecf5
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 8, 2025
fa2d7b5
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 8, 2025
7a4b495
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 8, 2025
f89cfc8
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 8, 2025
6b7a896
stash
havenbarnes May 9, 2025
7e6e9af
tweak
havenbarnes May 9, 2025
ba0bba8
stash
havenbarnes May 14, 2025
9080335
tweak
havenbarnes May 17, 2025
72d8e6b
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes May 17, 2025
f998e76
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes May 17, 2025
c562f80
Rename to shared types and added hogflows
benjackwhite May 20, 2025
a87d2d3
stash
havenbarnes May 20, 2025
113c96d
Fixes
benjackwhite May 23, 2025
0aafac5
Merge branch 'master' into messaging-workflow-frontend
benjackwhite May 23, 2025
df773a1
stash
havenbarnes May 29, 2025
636a2b5
multiple-edge spacing working well now
havenbarnes Jun 1, 2025
42c3e7b
multiple-edge spacing working well now
havenbarnes Jun 1, 2025
4ba1a9e
working e2e, needs some cleanup
havenbarnes Jun 2, 2025
c0540fa
remove unnecessary diff
havenbarnes Jun 2, 2025
bc81fe4
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 2, 2025
03848be
Fix
benjackwhite Jun 3, 2025
749caf7
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 3, 2025
e868589
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 3, 2025
86163de
tweak
havenbarnes Jun 3, 2025
a468b16
tweak
havenbarnes Jun 3, 2025
fbc54dc
tweak
havenbarnes Jun 3, 2025
01cddbf
tweak
havenbarnes Jun 3, 2025
ddbdbda
tweak
havenbarnes Jun 3, 2025
8b54cf9
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 3, 2025
dd42f27
update lockfile
havenbarnes Jun 3, 2025
0fa7fdb
temp move directory to bust build cache
havenbarnes Jun 3, 2025
00d61d4
move directory back
havenbarnes Jun 3, 2025
ead4d8c
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes Jun 3, 2025
73ec889
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 3, 2025
3e0bb40
create hogflow models and migrations
MoustafaEid Jun 4, 2025
ac5031b
Fix
benjackwhite Jun 4, 2025
3e24785
fix: Messaging Workflow model (#33147)
benjackwhite Jun 4, 2025
7c99800
merge master into branch
MoustafaEid Jun 4, 2025
6e55e7d
add campaign scene for top level routing
havenbarnes Jun 5, 2025
00be4cd
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 5, 2025
fe61946
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 6, 2025
cf12dbe
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 6, 2025
15f8f23
fix typecheck
havenbarnes Jun 6, 2025
9bd3fbd
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 6, 2025
c90c8cb
cleanup
havenbarnes Jun 6, 2025
c0924d1
tweak
havenbarnes Jun 6, 2025
33c8faf
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes Jun 6, 2025
f8cc8bf
fix linter
havenbarnes Jun 6, 2025
c1ee3ec
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 6, 2025
b6fdfb4
feat(messaging): add trigger, conversion goal, and exit condition UX …
havenbarnes Jun 6, 2025
c2c783b
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 9, 2025
4adf8bb
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes Jun 9, 2025
4bcc19f
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 9, 2025
408f836
fix conflicts, address comment, delete old types
havenbarnes Jun 9, 2025
c938eca
cleanup
havenbarnes Jun 9, 2025
f0438f6
cleanup
havenbarnes Jun 9, 2025
90b531a
Update posthog/models/test/test_hog_flow.py
havenbarnes Jun 9, 2025
90ff048
Update posthog/models/__init__.py
havenbarnes Jun 9, 2025
93592f9
tweak
havenbarnes Jun 9, 2025
8ef36ce
tweak
havenbarnes Jun 9, 2025
e0b1db2
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 9, 2025
d4f5115
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 9, 2025
fee91e1
Merge branch 'master' into messaging-workflow-frontend
havenbarnes Jun 9, 2025
868b505
fix migration script
havenbarnes Jun 9, 2025
bee9359
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes Jun 9, 2025
a7ee710
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 9, 2025
73eca0a
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes Jun 9, 2025
c86d76f
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes Jun 9, 2025
64c5145
Merge branch 'master' into messaging-workflow-frontend
havenbarnes Jun 9, 2025
94d97a3
Merge branch 'master' into messaging-workflow-frontend
havenbarnes Jun 9, 2025
fe93ffb
update import statements in plugin server
havenbarnes Jun 9, 2025
82832ea
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes Jun 9, 2025
47e8673
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 9, 2025
e712ca8
update lockfile
havenbarnes Jun 9, 2025
a48d85e
rebase off #31999
havenbarnes Jun 9, 2025
bd40043
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 9, 2025
7155e73
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes Jun 9, 2025
aa1d437
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 10, 2025
af2ea79
chore(messaging): Cleanup tree nav and campaign breadcrumbs (#33336)
havenbarnes Jun 10, 2025
98da881
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes Jun 10, 2025
13c2ab7
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 10, 2025
c3e0e51
rebase off master hogflow types
havenbarnes Jun 10, 2025
8355b95
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 10, 2025
a4b3c1e
fix typecheck
havenbarnes Jun 10, 2025
fd0a58b
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes Jun 10, 2025
03e2ad0
add zod to frontend
havenbarnes Jun 10, 2025
21c96d0
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 10, 2025
5d67f88
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 10, 2025
856e332
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 10, 2025
19df861
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 10, 2025
78bd367
tweak
havenbarnes Jun 10, 2025
ff78927
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 10, 2025
6b68f35
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 10, 2025
e606ad6
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes Jun 10, 2025
12188c0
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 10, 2025
18c6675
try adding zod to messaging package.json
havenbarnes Jun 10, 2025
b64b22c
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 10, 2025
76ba5b8
see if cross-package import is causing the CI issues
havenbarnes Jun 10, 2025
c86e8c7
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes Jun 10, 2025
312951b
chore(messaging,cdp): refactor HogFunctionInputs->CyclotronJobInputs,…
havenbarnes Jun 10, 2025
e457f89
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 10, 2025
b1654f3
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 10, 2025
bf881bd
add zod-ified input schema to not loosen types in monorepo too much
havenbarnes Jun 10, 2025
7144f1c
fix more typecheck failures
havenbarnes Jun 11, 2025
7704fc5
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 11, 2025
16968f2
stash
havenbarnes Jun 11, 2025
1bc7609
fix mapping types to be hogfunction specific
havenbarnes Jun 11, 2025
89a8075
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 11, 2025
428ecc0
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 11, 2025
54e9a7f
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 11, 2025
7711cc6
fix typecheck, move inputs/inputs_schema into the right place
havenbarnes Jun 11, 2025
0ced23f
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 11, 2025
7cd3336
fix typecheck, move inputs/inputs_schema into the right place
havenbarnes Jun 11, 2025
6e8041e
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 11, 2025
eed2ff7
fix types for input components, hoist up hog function logic props
havenbarnes Jun 11, 2025
ddceead
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 11, 2025
871d4b9
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 11, 2025
52a1b93
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 11, 2025
c5ea1d8
tweak
havenbarnes Jun 12, 2025
a30b615
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 12, 2025
01266e0
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 12, 2025
646f726
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 12, 2025
1403a58
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 12, 2025
d0cf426
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 12, 2025
0d787c4
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 12, 2025
7edae72
stash
havenbarnes Jun 13, 2025
77fdd09
tweak
havenbarnes Jun 13, 2025
c1b79fd
tweak
havenbarnes Jun 13, 2025
10e4a6d
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 13, 2025
48620a6
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2025
db9ad33
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2025
1b7c5db
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 13, 2025
548ebdd
hoist more props
havenbarnes Jun 13, 2025
a86d21d
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 13, 2025
6451e99
clean up logic files
havenbarnes Jun 13, 2025
e79a11a
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes Jun 13, 2025
fb7f17e
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 13, 2025
48575e1
fix more typecheck failures
havenbarnes Jun 13, 2025
f420b34
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2025
2ecf5ca
Fixes
benjackwhite Jun 16, 2025
70621d5
Fixes
benjackwhite Jun 16, 2025
2bf2f7e
Fixes
benjackwhite Jun 16, 2025
5c84fe1
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
benjackwhite Jun 16, 2025
d6865b8
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 16, 2025
a7473ba
Fixes
benjackwhite Jun 16, 2025
2baa7e3
Fixes
benjackwhite Jun 16, 2025
ce334f8
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
benjackwhite Jun 16, 2025
4b95aa7
Fixes
benjackwhite Jun 16, 2025
9bb8c4d
format
benjackwhite Jun 16, 2025
071d1f0
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 16, 2025
3a02b8a
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 16, 2025
2bc99ae
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 16, 2025
b5cfbb7
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 16, 2025
343f8ac
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 16, 2025
bae5feb
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 16, 2025
fc2714a
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 16, 2025
336f605
tweak
havenbarnes Jun 16, 2025
0f64698
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes Jun 16, 2025
3b0e419
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 16, 2025
0a1afc9
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 16, 2025
175ce81
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
havenbarnes Jun 16, 2025
08ebbaf
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 16, 2025
cc8cf3e
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes Jun 16, 2025
89fd1e6
rm screenshot diffs
havenbarnes Jun 16, 2025
7e52e54
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes Jun 16, 2025
fa77c44
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
havenbarnes Jun 16, 2025
9a8e919
fixes and cleanup
havenbarnes Jun 16, 2025
1feec93
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes Jun 16, 2025
e1be1da
tweak
havenbarnes Jun 17, 2025
9869708
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 17, 2025
20dc69a
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 17, 2025
ef30860
Merge branch 'master' into hogflow-inputs-ux
havenbarnes Jun 17, 2025
a6cf65e
fix typegen issue for now
havenbarnes Jun 17, 2025
a0eb6e8
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes Jun 17, 2025
5822273
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes Jun 17, 2025
9998887
Merge branch 'master' into hogflow-inputs-ux
havenbarnes Jun 17, 2025
dc718e5
fix typecheck failure
havenbarnes Jun 17, 2025
9150bd7
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes Jun 17, 2025
f2f154d
Fixes
benjackwhite Jun 18, 2025
7946102
Fixes
benjackwhite Jun 18, 2025
cea5655
Fixes
benjackwhite Jun 18, 2025
bec4f42
Fixes
benjackwhite Jun 18, 2025
7b6255d
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2025
9560fde
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ import { CyclotronJobInputIntegration } from './integrations/CyclotronJobInputIn
import { CyclotronJobInputIntegrationField } from './integrations/CyclotronJobInputIntegrationField'
import { CyclotronJobInputConfiguration } from './types'

const INPUT_TYPE_LIST = ['string', 'number', 'boolean', 'dictionary', 'choice', 'json', 'integration', 'email'] as const

export type CyclotronJobInputsProps = {
configuration: CyclotronJobInputConfiguration
onInputSchemaChange: (schema: CyclotronJobInputSchemaType[]) => void
onInputChange: (key: string, input: CyclotronJobInputType) => void
onInputSchemaChange?: (schema: CyclotronJobInputSchemaType[]) => void
showSource: boolean
}

Expand Down Expand Up @@ -88,8 +90,6 @@ export function CyclotronJobInputs({
)
}

const typeList = ['string', 'number', 'boolean', 'dictionary', 'choice', 'json', 'integration', 'email'] as const

function JsonConfigField(props: {
input: CyclotronJobInputType
onChange?: (input: CyclotronJobInputType) => void
Expand Down Expand Up @@ -400,7 +400,7 @@ function CyclotronJobInputSchemaControls({
<div className="flex flex-wrap flex-1 gap-2 items-center">
<LemonSelect
size="small"
options={typeList.map((type) => ({
options={INPUT_TYPE_LIST.map((type) => ({
label: capitalizeFirstLetter(type),
value: type,
}))}
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function formatJsonValue(value: any): string {
}

export const cyclotronJobInputLogic = kea<cyclotronJobInputLogicType>({
path: ['components', 'cyclotron-jobs', 'cyclotronJobInputLogic'],
path: ['lib', 'components', 'CyclotronJob', 'cyclotronJobInputLogic'],
props: {} as CyclotronJobInputLogicProps,
key: (props: CyclotronJobInputLogicProps) => `json_validation_${props.fieldKey}`,

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface EmailTemplaterLogicProps {

export const emailTemplaterLogic = kea<emailTemplaterLogicType>([
props({} as EmailTemplaterLogicProps),
path(() => ['scenes', 'pipeline', 'hogfunctions', 'emailTemplaterLogic']),
path(['scenes', 'hog-functions', 'email-templater', 'emailTemplaterLogic']),
actions({
setEmailEditorRef: (emailEditorRef: EditorRef | null) => ({ emailEditorRef }),
onEmailEditorReady: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { IconTrash, IconX } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
import { getOutgoers, Node, Panel, useEdges, useNodes } from '@xyflow/react'
import { Form } from 'kea-forms'
import { CyclotronJobInputs } from 'lib/components/CyclotronJob/CyclotronJobInputs'
import { capitalizeFirstLetter } from 'lib/utils'

import type { HogFlowAction } from '../types'
import { nodeLogic } from './nodeLogic'
import { getNodeInputsSchema } from './utils'

export function NodeDetailsPanel({
node,
onChange,
onDelete,
onClose,
}: {
node: Node<HogFlowAction>
onChange: (node: Node<HogFlowAction>) => void
onDelete: (node: Node<HogFlowAction>) => void
onClose: () => void
}): JSX.Element {
const nodes = useNodes()
const edges = useEdges()

const canBeDeleted = (): boolean => {
const outgoingNodes = getOutgoers(node, nodes, edges)
if (outgoingNodes.length === 1) {
return true
}

return new Set(outgoingNodes.map((node) => node.id)).size === 1
}
Comment on lines +26 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: the canBeDeleted logic appears to have an edge case - it returns true if there's 1 outgoing node OR if all outgoing nodes have the same ID, which seems contradictory to the warning about cleaning up branching steps


const handleInputChange = (key: string, value: any): void => {
onChange({
...node,
data: {
...node.data,
config: {
...node.data.config,
inputs: {
...node.data.config.inputs,
[key]: value,
},
},
},
})
}

return (
<Panel position="top-right">
<Form
logic={nodeLogic}
props={{ node }}
formKey="inputs"
className="bg-surface-primary rounded-md shadow-md p-4 gap-2 flex flex-col z-10 min-w-[300px] max-w-[500px] max-h-3/4 overflow-y-scroll"
>
<div className="flex justify-between items-center">
<h3 className="font-semibold">Edit {capitalizeFirstLetter(node.data.type)} step</h3>
<div className="flex gap-1 items-center">
{node.deletable && (
<LemonButton
size="small"
status="danger"
=> onDelete(node)}
icon={<IconTrash />}
disabledReason={canBeDeleted() ? undefined : 'Clean up branching steps first'}
/>
)}
<LemonButton size="small" icon={<IconX />} aria-label="close" />
</div>
</div>
<div className="flex flex-col gap-2">
<CyclotronJobInputs
configuration={{
inputs: node.data.config.inputs,
inputs_schema: getNodeInputsSchema(node.data),
}}
>
showSource={false}
/>
</div>
</Form>
</Panel>
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IconBolt, IconDecisionTree, IconHourglass, IconLeave, IconPlus, IconRevert, IconSend } from '@posthog/icons'
import { Handle, useUpdateNodeInternals } from '@xyflow/react'
import { capitalizeFirstLetter } from 'lib/utils'
import { useEffect } from 'react'

import type { HogFlowAction } from '../types'
Expand Down Expand Up @@ -58,7 +59,9 @@ function BaseNode({ id, icon, selected, type, data, children }: NodeProps): JSX.
>
<div className="flex items-center justify-center gap-1">
{icon}
<div className="text-xs">{data.name}</div>
<div className="text-xs">
{data.config.inputs.name?.value || capitalizeFirstLetter(type || 'Untitled')}
</div>
</div>
{children}
{handles?.map((handle) => (
Expand Down

This file was deleted.

Loading
Loading
0