-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Navigate to node from search results #3650
Conversation
ee223e2
to
53441f6
Compare
Removed vultr server and associated DNS entries |
f936cc0
to
842bd00
Compare
842bd00
to
d47fe2a
Compare
const nodePath = | ||
node.type === ComponentType.Answer | ||
? `nodes/${grandparent.id}/nodes/${parent.id}/edit` | ||
: `nodes/${parent.id}/nodes/${node.id}/edit`; |
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.
I think this is the only variance that controls the path used for the modal - please let me know if there's something I've missed here!
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.
This seems right to me here! Only edge case I possibly considered here were "Filters" - but these links work as expected testing on pizza 🙌
Plus very cool fun bonus - Search now makes visible the (wild!) fact that Filter's have a default data field flag
assigned to them via the component's handleSubmit
and later relied on in upcomingCardIds()
:
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.
Ha! Good catch and a fun little easter egg... 🙃
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.
Very good work - can already think of so many other places I want to use getURLForNode
(publish changelogs, validation checks, etc!!) 🎉
const nodePath = | ||
node.type === ComponentType.Answer | ||
? `nodes/${grandparent.id}/nodes/${parent.id}/edit` | ||
: `nodes/${parent.id}/nodes/${node.id}/edit`; |
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.
This seems right to me here! Only edge case I possibly considered here were "Filters" - but these links work as expected testing on pizza 🙌
Plus very cool fun bonus - Search now makes visible the (wild!) fact that Filter's have a default data field flag
assigned to them via the component's handleSubmit
and later relied on in upcomingCardIds()
:
const url = getURLForNode("reservoirDogsAnswer"); | ||
expect(url).toEqual( | ||
"/testTeam/testFlow,tarantinoPortal,moviesPortal/nodes/tarantinoPortal/nodes/tarantinoMovieQuestion/edit", | ||
); |
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.
💪
Just a heads up that there's two minor limitations to this as it's currently written -
Both on my to do list to take a look at! |
Small bug I noticed when working on theopensystemslab/planx-new#3650
What does this PR do?
getPathForNode()
to construct a PlanX relative URLTest flow on Pizza - https://3650.planx.pizza/testing/flow-navigation-search
Prior art - #3460
Screen.Recording.2024-09-11.at.16.25.57.mov
To Do (this PR)
Next step...