-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add placeholder to price cells in product list #4972
Conversation
🦋 Changeset detectedLatest commit: 96506e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
You could put logic when click price into handleRowAnchor
and handleRowClick
ane there
params.append(`0[s0.${ProductFilterKeys.channel}]`, ""); | ||
|
||
history.replace({ search: params.toString() }); |
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.
suggestion: This will not work when someone has already selected some filters
.changeset/selfish-walls-sit.md
Outdated
"saleor-dashboard": minor | ||
--- | ||
|
||
Product list no longer show a dash instead of product's price when channel is not selected. Instead 'Select channel' shortcut was added meaning that you can now use it to open filters window with 'channel' already 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.
It can be simpler and a bit shorter:
You can now open channel selection by clicking "Select channel" within any price cell on the product list. This means the dash "-" sign is no longer displayed there
const params = new URLSearchParams(search); | ||
|
||
const filtersIndices = Array.from(params.keys()) | ||
.map(key => { |
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.
this whole map can be a dedicated function, the name will indicate what you map to
|
||
const handlePriceClick = (productId: string) => { | ||
if (!productId) return; | ||
|
||
history.replace({ search: getPriceClickSearchParams(history.location.search) }); | ||
|
||
filterWindow.setOpen(true); | ||
}; |
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.
issue: you just smuggled here the price-related logic, to the component that is already large and mixing a variety of contexts. You can create hook for it instead and use it here to encapsulate that logic
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.
the hook could return for you an adapter as well so the preparation of it also could be moved
1 failed and 2 flaky tests on run #6249 ↗︎
Details:
cypress/e2e/products/productsList/filteringProducts.js • 1 failed test • UI - Electron
apps.js • 1 flaky test • UI - Electron
configuration/shippingMethods/channelsInShipping.js • 1 flaky test • UI - Electron
Review all test suite changes for PR #4972 ↗︎ |
What type of PR is this?
Related Issues or Documents
Usage Instructions, Screenshots, Recordings
Have you written tests?
[Optional] Description