-
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
Reordering products in collection #5327
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: cd4f055 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 |
Waiting for core fix with ordering. |
Differences Found✅ No packages or licenses were added. SummaryExpand
|
This pull request is stale because it has been open 14 days with no activity. |
This PR request has been closed because it has been stalled for 2 days with no activity. You are still welcome to reopen it and continue from where you finished. Best regards Saleor team |
@@ -0,0 +1,28 @@ | |||
import { createSvgIcon } from "@material-ui/core/utils"; |
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.
question: do we want to use material anymore?
The API needs to take items in the same order as they came, and the reversed one when we move items down (negative position). | ||
This function is designed to keep that order. |
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.
"and the reversed one when we move items down"
I don't quite get this part - could you maybe add an example do this comment? 😅
|
||
return ( | ||
<GridTable.Row | ||
__height="1px" |
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: __height="1px"
looks weird, could you use for example height:auto
or add a comment why 1px?
<GridTable.Col __width="100px" /> | ||
</GridTable.Colgroup> | ||
<GridTable.Body> | ||
{Array.from({ length: numberOfRows }, (_, index) => ( |
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.
nitpeak: showing 100 skeleton rows when users have only few product assigns is IMO overkill, I'd show no more than 10
import { useCollectionId } from "./useCollectionId"; | ||
import { useProductEdges } from "./useProductEdges"; | ||
|
||
const createOptimisticResponseForEdges = (collectionId: string, edges: any) => ({ |
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: IMO you could find better type than edges: any
demo.mov