-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix: search in custom mode #806
Conversation
Custom mode searching did not work after the react-router 6 updates
path.indexOf(buildPath(VALIDATOR_ROUTE, { identifier: '' })) === 0 | ||
|
||
// NOTE: for submenus, remove `path` field and add `children` array of objects | ||
export const navigationConfig: NavigationMenuAnyRoute[] = [ |
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.
Moved to fix circular dependencies.
@@ -0,0 +1,29 @@ | |||
import { buildPath } from '../shared/routing' |
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.
There's no code change in this file, right (just moving)? I did a quick skim and it doesn't look like it, but I figured I should confirm
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 is a new file. Its contents came from routes.ts to prevent circular dependencies caused by import routes into the Search component.
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.
please add a test
I spent an hour trying to get tests setup. I tried switching to the |
Can you add a TODO then? |
return 'ledgers' | ||
return { | ||
type: 'ledgers', | ||
path: buildPath(LEDGER_ROUTE, { identifier: id }), |
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.
Should this id be .toUpperCase()
like the other IDs?
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.
Overall LGTM, couple spots I had questions about, but I don't think they impact the change.
High Level Overview of Change
Custom mode searching did not work after the react-router 6 updates.
Type of Change
Test Plan
Adding tests for custom mode proved tricky. Want to get this fix out sooner.