Repository navigation
feat: order list placed by filter-SFS-2702 - #2988
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
eduardoformiga
left a comment
There was a problem hiding this comment.
Good job! I left a couple of comments, but most of them are non-blocking, just reminders for future integrations.
| import type { SelectedFacet } from 'src/sdk/search/useMyAccountFilter' | ||
|
|
||
| type Shopper = { | ||
| purchase_agent_id: string |
There was a problem hiding this comment.
🎗️ It will come as userId from the shopper entity, and we'll send it as purchase_agent_id to the OMS API. We don't need to change the mock, just to remember afterward.
| const selectedId = useMemo( | ||
| () => selected.find((f) => f.key === 'purchaseAgentId')?.value, | ||
| [selected] | ||
| ) |
There was a problem hiding this comment.
just 1 so far, after we can select multiple.
There was a problem hiding this comment.
Yes, i have done as in the figma for now
| const filtered = useMemo(() => { | ||
| const q = query.trim().toLowerCase() | ||
| if (!q) return mockShoppers | ||
| return mockShoppers.filter( | ||
| (s) => | ||
| s.name.toLowerCase().includes(q) || s.email.toLowerCase().includes(q) | ||
| ) | ||
| }, [query]) |
There was a problem hiding this comment.
🎗️ reminder: replace this with the API call afterward.
We're deciding on how to filter shoppers already (using wildcard and firstName, lastName, but in this task let's keep the mock 😉
|
|
||
| const placedByTag = purchaseAgentId && ( | ||
| <div key={`placed-by-${purchaseAgentId}`} data-fs-list-orders-selected-tag> | ||
| <span>Placed by: {purchaseAgentId}</span> |
There was a problem hiding this comment.
🎗️ will be the name instead of purchaseAgentId in the future.
## What's the purpose of this pull request? Revert changes from - #2988 since the approach to filter shopper changes to use text field instead of selected filter in the drawer. ## details remove purchaseAgentId filter and related components from `MyAccountListOrders`. This update removes the purchaseAgentId filter and its associated components from the MyAccountListOrders section. The changes include: - Deleting the MyAccountFilterFacetPlacedBy component and its styles. - Adjusting the MyAccountListOrders and MyAccountSelectedTags components to eliminate references to purchaseAgentId. - Cleaning up related styles and imports to streamline the codebase. These modifications aim to simplify the order filtering process and improve overall maintainability.
Revert changes from - #2988 since the approach to filter shopper changes to use text field instead of selected filter in the drawer. remove purchaseAgentId filter and related components from `MyAccountListOrders`. This update removes the purchaseAgentId filter and its associated components from the MyAccountListOrders section. The changes include: - Deleting the MyAccountFilterFacetPlacedBy component and its styles. - Adjusting the MyAccountListOrders and MyAccountSelectedTags components to eliminate references to purchaseAgentId. - Cleaning up related styles and imports to streamline the codebase. These modifications aim to simplify the order filtering process and improve overall maintainability.
What’s the purpose of this pull request?
How it works?
How to test it?
Starters Deploy Preview
References
SFS-2702
Figma