-
Notifications
You must be signed in to change notification settings - Fork 147
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
BED-5445: Deep linking node search #1182
base: main
Are you sure you want to change the base?
Conversation
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 looks great!! I like the organization and how you did useNodeSearch
I left one comment on a potential solution for the missing adornment! But if we determine its not feasible/doesnt make sense im happy to stamp this as is
packages/javascript/bh-shared-ui/src/hooks/useExploreGraph/useNodeSearch/useNodeSearch.ts
Outdated
Show resolved
Hide resolved
packages/javascript/bh-shared-ui/src/hooks/useExploreGraph/useNodeSearch/useNodeSearch.ts
Show resolved
Hide resolved
const graphQuery = nodeSearchGraphQuery({ primarySearch, searchType }); | ||
const { data: graphData } = useQuery(graphQuery); |
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.
good call keeping this! I realized that if we did use the useExploreGraph
directly here then the matchedNode
below may not return the node that was searched for in the case where the current searched for node doesnt return in the graph results.
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.
Couple comments about build/tests, but functionality is great! Thank you!
import { useQuery } from 'react-query'; | ||
import { SearchValue } from '../../../store'; | ||
import { useExploreParams } from '../../useExploreParams'; | ||
import { nodeSearchGraphQuery } from '../queries'; |
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.
Looks like this introduces a circular dep, I think we just need to specify the import from ../queries/nodeSearch
dispatch(searchbarActions.sourceNodeEdited(edit)); | ||
const handleNodeSelected = (selected?: SearchValue): SourceNodeSelectedAction => | ||
dispatch(searchbarActions.sourceNodeSelected(selected)); | ||
const { searchTerm, selectedItem, editSourceNode, selectSourceNode } = useNodeSearchSwitch(); |
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.
Nit: this will trigger api requests without a handlers in ExploreSearch
tests, mind adding mocks? no worries if not, the warning would go away when we clean up feature flag logic for this epic
Description
Adds single node search functionality to our deep linking implementation on the Explore page. This feature can be tested by enabling the
back_button_support
feature flag. Some other aspects of the Explore page (particularly pathfinding search) may appear temporarily broken when this flag is enabled.Motivation and Context
First search type implemented in the larger deep linking initiative.
This PR addresses: BED-5455
How Has This Been Tested?
Tests have been added to cover the
useNodeSearch
hook that wraps the new query param interactions.Screenshots (optional):
Types of changes
Checklist: