Repository navigation
feat: add filter and selected tag for pending approval - #3001
eduardoformiga merged 2 commits into
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.
LGTM!
I tested it and worked as expected.
| type: 'toggleFacet', | ||
| payload: { | ||
| key: 'pendingMyApproval', | ||
| value: 'true', |
There was a problem hiding this comment.
This shouldn't be false here?
There was a problem hiding this comment.
I used true because when setFacet creates the facet, it will create it with true if it doesn’t already exist. Then, when I want to turn it off, I look for the toggle using the facet with the value true. The toggleFacet will remove that facet with the value true and revert it to the initial state, which is false.
I could use only setFacet, but then the facet would persist in the URL even when the value is false. This way, it only shows up in the URL when it’s true.
Adds a new "Pending Approval" filter to the MyAccount orders page, allowing users to quickly filter orders that require their approval. - New toggle filter: Added "Pending Approval" as the first filter option in the orders filter slider - Toggle switch: Users can turn on/off the filter to show only pending approval orders - URL integration: Filter state is reflected in the URL (?pendingApproval=true) - Selected tag: When active, shows "Pending my approval" tag below the search bar - Go to /account/orders - Open filter slider and verify "Pending Approval" is the first option - Toggle the switch and click "Apply" - Check URL - should include ?pendingApproval=true - Verify tag appears - "Pending my approval" tag should show below search bar - Test removal - click "×" on tag or "Clear All" to remove filter - Test direct URL - navigate to /account/orders?pendingApproval=true and verify filter is active [SFS-2618](https://vtex-dev.atlassian.net/browse/SFS-2618) | List | Filter | |-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| |  |  | [SFS-2618]: https://vtex-dev.atlassian.net/browse/SFS-2618?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
) ## What's the purpose of this pull request? Adds a new "Pending Approval" filter to the MyAccount orders page, allowing users to quickly filter orders that require their approval. ## How it works? - New toggle filter: Added "Pending Approval" as the first filter option in the orders filter slider - Toggle switch: Users can turn on/off the filter to show only pending approval orders - URL integration: Filter state is reflected in the URL (?pendingApproval=true) - Selected tag: When active, shows "Pending my approval" tag below the search bar ## How to test it? - Go to /account/orders - Open filter slider and verify "Pending Approval" is the first option - Toggle the switch and click "Apply" - Check URL - should include ?pendingApproval=true - Verify tag appears - "Pending my approval" tag should show below search bar - Test removal - click "×" on tag or "Clear All" to remove filter - Test direct URL - navigate to /account/orders?pendingApproval=true and verify filter is active ## Starter deploy preview vtex-sites/b2bfaststoredev.store#358 ## References [SFS-2618](https://vtex-dev.atlassian.net/browse/SFS-2618) | List | Filter | | - | - | |  |  | [SFS-2618]: https://vtex-dev.atlassian.net/browse/SFS-2618?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [SFS-2618]: https://vtex-dev.atlassian.net/browse/SFS-2618?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Artur Santiago <[email protected]>
) ## What's the purpose of this pull request? Adds a new "Pending Approval" filter to the MyAccount orders page, allowing users to quickly filter orders that require their approval. ## How it works? - New toggle filter: Added "Pending Approval" as the first filter option in the orders filter slider - Toggle switch: Users can turn on/off the filter to show only pending approval orders - URL integration: Filter state is reflected in the URL (?pendingApproval=true) - Selected tag: When active, shows "Pending my approval" tag below the search bar ## How to test it? - Go to /account/orders - Open filter slider and verify "Pending Approval" is the first option - Toggle the switch and click "Apply" - Check URL - should include ?pendingApproval=true - Verify tag appears - "Pending my approval" tag should show below search bar - Test removal - click "×" on tag or "Clear All" to remove filter - Test direct URL - navigate to /account/orders?pendingApproval=true and verify filter is active ## Starter deploy preview vtex-sites/b2bfaststoredev.store#358 ## References [SFS-2618](https://vtex-dev.atlassian.net/browse/SFS-2618) | List | Filter | | - | - | |  |  | [SFS-2618]: https://vtex-dev.atlassian.net/browse/SFS-2618?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [SFS-2618]: https://vtex-dev.atlassian.net/browse/SFS-2618?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Artur Santiago <[email protected]>
What's the purpose of this pull request?
Adds a new "Pending Approval" filter to the MyAccount orders page, allowing users to quickly filter orders that require their approval.
How it works?
How to test it?
References
SFS-2618