-
Notifications
You must be signed in to change notification settings - Fork 3
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(breadcrumbs): Refactor breadcrumbs to remove path filter #186
Conversation
user?.isCms && | ||
user.user?.["custom:cms-roles"].includes(UserRoles.HELPDESK) | ||
? "cmsStatus.keyword" | ||
: "stateStatus.keyword", |
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.
Ooops! Lemme remove this, this was leftover from helping Wale lol
return ( | ||
<SimplePageContainer> | ||
<BreadCrumbs options={BREAD_CRUMB_CONFIG_NEW_SUBMISSION} /> | ||
<BreadCrumbs options={NEW_SUBMISSION_CRUMBS(location.pathname)} /> |
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.
Love this little function here to build out the option. I'm always a big fan of declarative code
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.
Love it. Great work Kevin
🎉 This PR is included in version 1.5.0-val.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Purpose
Previously, breadcrumbs filtered out the options array with the following line:
That means any crumb where the route wasn't present in the current path would be filtered out and not shown. This PR removes that filter and leaves the crumb config array in the hands of the developer since not every breadcrumb needs to be directly related to the path. This PR also refactors the config for the New Submission breadcrumb options so that it can be built dynamic via the current path.
Linked Issues to Close
None
Approach
A config's available items are explicitly the responsibility of the config. The component no longer will filter any out, it'll only sort them based on order.
Assorted Notes/Considerations/Learning
None