-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Feat] Navigation Backend #4683
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] Navigation Backend #4683
Conversation
imports/plugins/core/navigation/server/no-meteor/schemas/schema.graphql
Outdated
Show resolved
Hide resolved
imports/plugins/core/navigation/server/no-meteor/schemas/schema.graphql
Outdated
Show resolved
Hide resolved
imports/plugins/core/navigation/server/no-meteor/schemas/schema.graphql
Outdated
Show resolved
Hide resolved
…into feat-4682-dancastellon-navigation
|
@dancastellon is this still in progress? |
|
@spencern It is, but only in between some of my enterprise client work. I'm close to being finished on a task for a client. I'll checkin with @zenweasel as to whether I can make more progress here or should focus on another client task. |
…rce/reaction into feat-4682-dancastellon-navigation
|
@dancastellon What's the current status of this PR? |
|
@mikemurray This is ready for review. Thanks! |
|
@dancastellon There are still some outstanding comments from @aldeed that are marked as |
|
@mikemurray Updated |
|
@aldeed Do you have any more things to review on this PR? |
|
@dancastellon @mikemurray Some GraphQL integration tests are failing on CI. Let me know if you need help debugging. |
…rce/reaction into feat-4682-dancastellon-navigation
|
@aldeed I fixed the integration tests, but in CI I'm getting this error - |
|
@dancastellon I don't know why that happens but I've seen in locally sometimes, too. The free port finder finds a non-free port. It only has one job and it can't even do that properly! 😄 Anyway, I plan to rewrite how that works, which should fix it. For now, feel free to ignore |
aldeed
left a comment
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 have only skimmed this since my initial review, but I'll let @mikemurray do the final review
mikemurray
left a comment
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.
👍
Resolves #4682 and #4418
Impact: major
Type: feature
Issue
Currently Reaction's navigation only supports tags. We need a way to define and load a navigation that supports both tags and arbitrary links.
Solution
This PR introduces 2 new collections - NavigationTrees and NavigationItems - as well as a GraphQL backend for defining and loading trees and items.
Breaking changes
None
Testing
Migration that creates a default navigation
On first startup, a default navigation tree with a single "Home" item will be created for each shop in the database. To confirm, follow these steps:
shopIddraftItemsanditemsfields are arrays with a single item:Shop queries to load defaultNavigationTreeId and defaultNavigationTree
Two new queries are added to the
primaryShopquery -defaultNavigationTreeIdanddefaultNavigationTree. To confirm:Mutation to create a navigation item
Operator query to load navigation items
sortOrder: ascto query args (after shopId) to return oldest firstUpdate Navigation Item mutation
Delete navigation item mutation
Update navigation tree mutation
Publish navigation changes mutation
This mutation publishes changes to the tree structure, and any content changes on items in the tree. 1. Confirm in DB that 2 of the navigation items you created have empty
dataarrays andhasUnpublishedChanges= true2. Confirm the navigation tree itself has only 1 element in its
itemsarray. This is the "Home" item that was created by the migration3. Run this query to publish changes:
draftItemswere copied toitemsand thathasUnpublishedChanges= falsedraftDatahas been copied todataandhasPublishedChanges= false for all navigation itemsLoad navigation tree query