-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: add ordersByAccountId query #4981
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
Conversation
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
…dersByAccountIdQuery
Signed-off-by: Erik Kieckhafer <[email protected]>
imports/plugins/core/orders/server/no-meteor/resolvers/Order/orderStatus.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/queries/ordersByAccountId.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/orders/server/no-meteor/resolvers/Query/ordersByAccountId.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
…dersByAccountIdQuery
…dersByAccountIdQuery
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
|
@aldeed addressed all comments made in this PR (they were just answers to questions I had, nothing has been reviewed officially yet), and this is ready for an actual review. Translations are living on the In other scenarios (Surcharges), we decided that if a language was not provided for translations, we would show nothing. In this case, I've made the decision to show the raw order status (i.e. |
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
…dersByAccountIdQuery
…dersByAccountIdQuery
Signed-off-by: Erik Kieckhafer <[email protected]>
…workflow statuses Signed-off-by: Erik Kieckhafer <[email protected]>
…e supplied Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
imports/plugins/core/orders/server/no-meteor/resolvers/Order/orderSummary.js
Outdated
Show resolved
Hide resolved
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.
@kieckhafer See a few comments. Returning the raw status when there isn't a translation seems fine to me.
imports/plugins/core/orders/server/no-meteor/queries/ordersByAccountId.js
Outdated
Show resolved
Hide resolved
| * @param {Object} context - an object containing the per-request state | ||
| * @param {Object} params - request parameters | ||
| * @param {String} params.accountId - Account ID to search orders for | ||
| * @param {String} params.orderStatus - Workflow status to limit search 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.
It will be more useful and not much extra work to do orderStatuses array rather than just one. Return orders with any of the statuses in the array. (So in UI the filter could be check boxes rather than a single status select.)
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 idea. How do we want to go about the All selection then? Just have all the statuses checked by default?
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.
@rymorgan See above. What are your thoughts on using a multi-select instead of a single dropdown for the Order Status filter?
I don't think it looks that great, might get confusing for the user too.
I think @aldeed's idea of passing an array is best for the server side, but on the client maybe we have pre-set arrays that we pass (at least in our starterkit, other people can do what we want), and continue to use the single select. Thoughts?
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.
Agreed @kieckhafer that a multi-select would likely be confusing to a user. I think it adds an extra bit of complexity to the user experience for not a huge benefit to the user. And actually a detriment to the user if they are confused by the UI. I don't remember seeing this type of behavior on brands that I visit which makes me think we'd be designing something almost all storefronts would eliminate.
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 agree, too. I was thinking more of future operator UI needs.
imports/plugins/core/orders/server/no-meteor/schemas/schema.graphql
Outdated
Show resolved
Hide resolved
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed updated with all changes. Made a comment here regarding multi-select, but that's a discussion for the starterkit anyway.
Resolves #4579
Impact: minor
Type: feature
Issue
While we had
ordersByAccountIdoutlined in our GraphQL schema, we had not yet built out the query to use this.Solution
Add the needed query to be able to use
ordersByAccountIdTesting
Shopscollection, if you'd like to see translations of order statusesquery, and make sure you only get back orders from the correct supplied accountIdstatusdata if translations are not available at all (not in collection), or for the requested language (requestfr)