@W-18669892 - Add Inventory Filter to PLP #2546
@W-18669892 - Add Inventory Filter to PLP #2546shauryemahajanSF merged 13 commits intofeature/shop-in-storefrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Signed-off-by: shauryemahajanSF <143645277+shauryemahajanSF@users.noreply.github.com>
| @@ -426,225 +427,240 @@ const ProductList = (props) => { | |||
| return <meta name={id} content={value} key={id} /> | |||
| })} | |||
| </Helmet> | |||
There was a problem hiding this comment.
The only changes in this file is adding inventory filter and moving showNoResults check down to the product grid so that filters can still be set/unset when no products show up. The other code is unchanged, just un-indented.
| }, | ||
| "empty_search_results.info.cant_find_anything_for_category": { | ||
| "defaultMessage": "We couldn’t find anything for {category}. Try searching for a product or {link}." | ||
| "defaultMessage": "We couldn't find anything for {category}. Try searching for a product or {link}." |
There was a problem hiding this comment.
agree the acute accent is weird here, but why fix it as part of this PR?
There was a problem hiding this comment.
oops accident
|
|
||
| try { | ||
| const storeInfoKey = `store_${siteId}` | ||
| const storeInfo = JSON.parse(window.localStorage.getItem(storeInfoKey) || 'null') |
There was a problem hiding this comment.
aside: the reliance on localStorage as the source of truth for our initial PRs troubles me when the end solution was moving the state provider up the DOM. hopefully this at least encapsulates it somewhat...
There was a problem hiding this comment.
Yup see what you're saying, luckily its just defined here - I'll start on store location provider right after this so shouldn't be too bad.
|
|
||
| const isChecked = selectedFilters?.ilids !== undefined | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
I believe this is the common piece, which we will handle in refactor story
|
@shauryemahajanSF just curious on adding the skip changelog label for this change, do we need to make a note of this in the changelog file? |
| })) | ||
|
|
||
| jest.mock('@salesforce/retail-react-app/app/components/store-locator-modal', () => { | ||
| // eslint-disable-next-line react/prop-types |
There was a problem hiding this comment.
Why was there a need to disable the linting check?
There was a problem hiding this comment.
Without this we get linting errors around prop validation, but we don't need to define props here since its just a unit test
Was thinking we can just have a concise changelog when we merge into develop |
| setSelectedStore(storeInfo) | ||
|
|
||
| // Apply the filter when a store is selected from the locator | ||
| toggleFilter({value: storeInfo.inventoryId}, 'ilids', false, false) |
There was a problem hiding this comment.
Should we have a future WI, where we dont add the ilids refinement in the URL params?
There was a problem hiding this comment.
Good idea, added the WI here: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002G0eEcYAJ/view
|
@shauryemahajanSF - dont you need a changelog.md file |
snilakandan13
left a comment
There was a problem hiding this comment.
looks good, the ilids in a future PR will no longer be added to URL parameter
Description
This PR adds a Shop by Availability filter on the PLP that allows shoppers to view products based on their selected store. Additionally, no results page still shows filters so that they can be unchecked so a user can return back to the previous state easily.
PLP.Inventory.Filter.mp4
Notes:
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization