Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

andrzejewsky
Copy link
Member

@andrzejewsky andrzejewsky commented Dec 19, 2024

  • Added DnD reordering for products within a collection
  • Ability to change the items per page for these products
  • A bit of refactoring for fetching data, now separated query fetches the products itself which does no reload entire page when operating the products only (eg. when paginate)
demo.mov

Copy link

changeset-bot bot commented Dec 19, 2024

🦋 Changeset detected

Latest commit: cd4f055

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

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

@andrzejewsky
Copy link
Member Author

Waiting for core fix with ordering.

Copy link

github-actions bot commented Dec 19, 2024

Differences Found

✅ No packages or licenses were added.

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
BlueOak-1.0.0 1
Packages
  • path-scurry
CC0-1.0 1
Packages
  • type-fest
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
WTFPL 1
Packages
  • opener
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
<<missing>> 3
Packages
  • busboy
  • saleor-dashboard
  • streamsearch
BSD-2-Clause 24
Packages
  • @typescript-eslint/parser
  • @typescript-eslint/typescript-estree
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • nth-check
  • stringify-object
  • And 4 more...
BSD-3-Clause 45
Packages
  • @humanwhocodes/object-schema
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • charenc
  • chroma-js
  • crypt
  • diff
  • esquery
  • exenv
  • And 25 more...
Apache-2.0 46
Packages
  • @ampproject/remapping
  • @editorjs/editorjs
  • @humanwhocodes/config-array
  • @humanwhocodes/module-importer
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @swc/core
  • @swc/core-darwin-arm64
  • @swc/core-darwin-x64
  • @swc/core-linux-arm-gnueabihf
  • @swc/core-linux-arm64-gnu
  • @swc/core-linux-arm64-musl
  • @swc/core-linux-x64-gnu
  • @swc/core-linux-x64-musl
  • @swc/core-win32-arm64-msvc
  • @swc/core-win32-ia32-msvc
  • @swc/core-win32-x64-msvc
  • @swc/counter
  • aria-query
  • And 26 more...
ISC 50
Packages
  • @esbuild-plugins/node-globals-polyfill
  • @istanbuljs/load-nyc-config
  • @saleor/app-sdk
  • anymatch
  • boolbase
  • browser-stdout
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • inflight
  • inherits
  • ini
  • And 30 more...
MIT 1123
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-simple-access
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1103 more...

@github-actions github-actions bot temporarily deployed to pr-5327 December 19, 2024 15:36 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 December 23, 2024 11:51 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 December 23, 2024 12:37 Destroyed
Copy link

github-actions bot commented Jan 7, 2025

This pull request is stale because it has been open 14 days with no activity.

@github-actions github-actions bot added the stale label Jan 7, 2025
Copy link

github-actions bot commented Jan 9, 2025

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

@github-actions github-actions bot closed this Jan 9, 2025
@andrzejewsky andrzejewsky reopened this Jan 17, 2025
@github-actions github-actions bot temporarily deployed to pr-5327 January 17, 2025 10:02 Destroyed
@andrzejewsky andrzejewsky marked this pull request as ready for review January 17, 2025 15:53
@andrzejewsky andrzejewsky requested a review from a team as a code owner January 17, 2025 15:53
@andrzejewsky andrzejewsky requested review from Cloud11PL and removed request for lkostrowski January 17, 2025 15:53
@github-actions github-actions bot temporarily deployed to pr-5327 January 17, 2025 15:54 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 January 20, 2025 14:24 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 January 20, 2025 16:40 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 January 28, 2025 15:39 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 January 28, 2025 16:00 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5327 January 28, 2025 16:14 Destroyed
@@ -0,0 +1,28 @@
import { createSvgIcon } from "@material-ui/core/utils";
Copy link
Member

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?

Comment on lines +8 to +9
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.
Copy link
Member

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"
Copy link
Member

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) => (
Copy link
Member

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) => ({
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants