-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
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 8ca9b4a
tweak
havenbarnes ccc913b
Update UI snapshots for `chromium` (7)
github-actions[bot] 0da72ff
Update UI snapshots for `chromium` (7)
github-actions[bot] 0b57bc1
feat(messaging): add drag n drop workflow builder UI
havenbarnes 36ba665
tweak
havenbarnes 722076b
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes a3450b6
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes b5e811a
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes bbbbbee
tweak
havenbarnes 37c76ad
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes e94ec49
tweak
havenbarnes 9373e57
Update UI snapshots for `chromium` (5)
github-actions[bot] 7909419
tweak
havenbarnes 9f5a0ad
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes a3ce57a
Update UI snapshots for `chromium` (5)
github-actions[bot] 54110fd
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes dedecf5
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes fa2d7b5
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes 7a4b495
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes f89cfc8
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes 6b7a896
stash
havenbarnes 7e6e9af
tweak
havenbarnes ba0bba8
stash
havenbarnes 9080335
tweak
havenbarnes 72d8e6b
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes f998e76
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes c562f80
Rename to shared types and added hogflows
benjackwhite a87d2d3
stash
havenbarnes 113c96d
Fixes
benjackwhite 0aafac5
Merge branch 'master' into messaging-workflow-frontend
benjackwhite df773a1
stash
havenbarnes 636a2b5
multiple-edge spacing working well now
havenbarnes 42c3e7b
multiple-edge spacing working well now
havenbarnes 4ba1a9e
working e2e, needs some cleanup
havenbarnes c0540fa
remove unnecessary diff
havenbarnes bc81fe4
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 03848be
Fix
benjackwhite 749caf7
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes e868589
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 86163de
tweak
havenbarnes a468b16
tweak
havenbarnes fbc54dc
tweak
havenbarnes 01cddbf
tweak
havenbarnes ddbdbda
tweak
havenbarnes 8b54cf9
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes dd42f27
update lockfile
havenbarnes 0fa7fdb
temp move directory to bust build cache
havenbarnes 00d61d4
move directory back
havenbarnes ead4d8c
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes 73ec889
Update UI snapshots for `chromium` (1)
github-actions[bot] 3e0bb40
create hogflow models and migrations
MoustafaEid ac5031b
Fix
benjackwhite 3e24785
fix: Messaging Workflow model (#33147)
benjackwhite 7c99800
merge master into branch
MoustafaEid 6e55e7d
add campaign scene for top level routing
havenbarnes 00be4cd
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes fe61946
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes cf12dbe
Update UI snapshots for `chromium` (1)
github-actions[bot] 15f8f23
fix typecheck
havenbarnes 9bd3fbd
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes c90c8cb
cleanup
havenbarnes c0924d1
tweak
havenbarnes 33c8faf
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes f8cc8bf
fix linter
havenbarnes c1ee3ec
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes b6fdfb4
feat(messaging): add trigger, conversion goal, and exit condition UX …
havenbarnes c2c783b
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 4adf8bb
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes 4bcc19f
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 408f836
fix conflicts, address comment, delete old types
havenbarnes c938eca
cleanup
havenbarnes f0438f6
cleanup
havenbarnes 90b531a
Update posthog/models/test/test_hog_flow.py
havenbarnes 90ff048
Update posthog/models/__init__.py
havenbarnes 93592f9
tweak
havenbarnes 8ef36ce
tweak
havenbarnes e0b1db2
Update UI snapshots for `chromium` (2)
github-actions[bot] d4f5115
Update UI snapshots for `chromium` (2)
github-actions[bot] fee91e1
Merge branch 'master' into messaging-workflow-frontend
havenbarnes 868b505
fix migration script
havenbarnes bee9359
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes a7ee710
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 73eca0a
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes c86d76f
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes 64c5145
Merge branch 'master' into messaging-workflow-frontend
havenbarnes 94d97a3
Merge branch 'master' into messaging-workflow-frontend
havenbarnes fe93ffb
update import statements in plugin server
havenbarnes 82832ea
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes 47e8673
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes e712ca8
update lockfile
havenbarnes a48d85e
rebase off #31999
havenbarnes bd40043
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 7155e73
Merge branch 'messaging-workflow-frontend' of https://github.com/Post…
havenbarnes aa1d437
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes af2ea79
chore(messaging): Cleanup tree nav and campaign breadcrumbs (#33336)
havenbarnes 98da881
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes 13c2ab7
Update UI snapshots for `chromium` (2)
github-actions[bot] c3e0e51
rebase off master hogflow types
havenbarnes 8355b95
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes a4b3c1e
fix typecheck
havenbarnes fd0a58b
Merge branch 'master' into messaging-workflow-frontend-reactflow
havenbarnes 03e2ad0
add zod to frontend
havenbarnes 21c96d0
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 5d67f88
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 856e332
Update UI snapshots for `chromium` (2)
github-actions[bot] 19df861
Update UI snapshots for `chromium` (2)
github-actions[bot] 78bd367
tweak
havenbarnes ff78927
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 6b68f35
Update UI snapshots for `chromium` (2)
github-actions[bot] e606ad6
Merge branch 'master' of https://github.com/PostHog/posthog into mess…
havenbarnes 12188c0
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 18c6675
try adding zod to messaging package.json
havenbarnes b64b22c
Update UI snapshots for `chromium` (2)
github-actions[bot] 76ba5b8
see if cross-package import is causing the CI issues
havenbarnes c86e8c7
Merge branch 'messaging-workflow-frontend-reactflow' of https://githu…
havenbarnes 312951b
chore(messaging,cdp): refactor HogFunctionInputs->CyclotronJobInputs,…
havenbarnes e457f89
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes b1654f3
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes bf881bd
add zod-ified input schema to not loosen types in monorepo too much
havenbarnes 7144f1c
fix more typecheck failures
havenbarnes 7704fc5
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes 16968f2
stash
havenbarnes 1bc7609
fix mapping types to be hogfunction specific
havenbarnes 89a8075
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 428ecc0
Update UI snapshots for `chromium` (2)
github-actions[bot] 54e9a7f
Update UI snapshots for `chromium` (2)
github-actions[bot] 7711cc6
fix typecheck, move inputs/inputs_schema into the right place
havenbarnes 0ced23f
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 7cd3336
fix typecheck, move inputs/inputs_schema into the right place
havenbarnes 6e8041e
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes eed2ff7
fix types for input components, hoist up hog function logic props
havenbarnes ddceead
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 871d4b9
Update UI snapshots for `chromium` (2)
github-actions[bot] 52a1b93
Update UI snapshots for `chromium` (2)
github-actions[bot] c5ea1d8
tweak
havenbarnes a30b615
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 01266e0
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 646f726
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 1403a58
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes d0cf426
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 0d787c4
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 7edae72
stash
havenbarnes 77fdd09
tweak
havenbarnes c1b79fd
tweak
havenbarnes 10e4a6d
Update UI snapshots for `chromium` (1)
github-actions[bot] 48620a6
Update UI snapshots for `chromium` (2)
github-actions[bot] db9ad33
Update UI snapshots for `chromium` (2)
github-actions[bot] 1b7c5db
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 548ebdd
hoist more props
havenbarnes a86d21d
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 6451e99
clean up logic files
havenbarnes e79a11a
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes fb7f17e
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 48575e1
fix more typecheck failures
havenbarnes f420b34
Update UI snapshots for `chromium` (2)
github-actions[bot] 2ecf5ca
Fixes
benjackwhite 70621d5
Fixes
benjackwhite 2bf2f7e
Fixes
benjackwhite 5c84fe1
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
benjackwhite d6865b8
Update UI snapshots for `chromium` (2)
github-actions[bot] a7473ba
Fixes
benjackwhite 2baa7e3
Fixes
benjackwhite ce334f8
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
benjackwhite 4b95aa7
Fixes
benjackwhite 9bb8c4d
format
benjackwhite 071d1f0
Update UI snapshots for `chromium` (2)
github-actions[bot] 3a02b8a
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 2bc99ae
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes b5cfbb7
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes 343f8ac
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes bae5feb
Update UI snapshots for `chromium` (1)
github-actions[bot] fc2714a
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 336f605
tweak
havenbarnes 0f64698
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes 3b0e419
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 0a1afc9
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes 175ce81
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
havenbarnes 08ebbaf
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes cc8cf3e
Merge branch 'hogfunctioninputs-hogflows-refactor' of https://github.…
havenbarnes 89fd1e6
rm screenshot diffs
havenbarnes 7e52e54
Merge branch 'master' into hogfunctioninputs-hogflows-refactor
havenbarnes fa77c44
Merge branch 'hogfunctioninputs-hogflows-refactor' into hogflow-input…
havenbarnes 9a8e919
fixes and cleanup
havenbarnes 1feec93
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes e1be1da
tweak
havenbarnes 9869708
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 20dc69a
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes ef30860
Merge branch 'master' into hogflow-inputs-ux
havenbarnes a6cf65e
fix typegen issue for now
havenbarnes a0eb6e8
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes 5822273
Merge branch 'master' of https://github.com/PostHog/posthog into hogf…
havenbarnes 9998887
Merge branch 'master' into hogflow-inputs-ux
havenbarnes dc718e5
fix typecheck failure
havenbarnes 9150bd7
Merge branch 'hogflow-inputs-ux' of https://github.com/PostHog/postho…
havenbarnes f2f154d
Fixes
benjackwhite 7946102
Fixes
benjackwhite cea5655
Fixes
benjackwhite bec4f42
Fixes
benjackwhite 7b6255d
Update UI snapshots for `chromium` (2)
github-actions[bot] 9560fde
Update UI snapshots for `chromium` (2)
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+210 Bytes
(100%)
...__snapshots__/scenes-app-insights-funnels--funnel-top-to-bottom-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 0 additions & 89 deletions
89
frontend/src/scenes/hog-functions/configuration/HogFunctionInputLogic.ts
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
...src/scenes/hog-functions/configuration/components/hogFunctionTemplateSuggestionsLogic.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
products/messaging/frontend/Campaigns/Workflows/Nodes/NodeDetailsPanel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|
||
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
products/messaging/frontend/Campaigns/Workflows/Nodes/StepDetails.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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