-
Notifications
You must be signed in to change notification settings - Fork 75
feat: order list placed by filter-SFS-2702 #2988
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
|
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. |
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Outdated
Show resolved
Hide resolved
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Show resolved
Hide resolved
eduardoformiga
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎗️ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just 1 so far, after we can select multiple.
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.
Yes, i have done as in the figma for now
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Outdated
Show resolved
Hide resolved
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Show resolved
Hide resolved
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎗️ 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 😉
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Outdated
Show resolved
Hide resolved
...stOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/MyAccountFilterFacetPlacedBy.tsx
Show resolved
Hide resolved
...nt/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetPlacedBy/styles.scss
Show resolved
Hide resolved
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎗️ will be the name instead of purchaseAgentId in the future.
...omponents/account/orders/MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx
Outdated
Show resolved
Hide resolved
## 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.
What’s the purpose of this pull request?
How it works?
How to test it?
Starters Deploy Preview
References
SFS-2702
Figma