feat(core-flows,product,types): scoped variant images#13623
feat(core-flows,product,types): scoped variant images#13623olivermrbl merged 45 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 09838ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
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 |
olivermrbl
left a comment
There was a problem hiding this comment.
Overall LGTM, nice work
packages/core/core-flows/src/product/workflows/batch-image-variants.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/product/workflows/batch-image-variants.ts
Outdated
Show resolved
Hide resolved
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 17. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
| * add: ["variant_123", "variant_456"] | ||
| * }) | ||
| */ | ||
| export const addImageToVariantsStep = createStep( |
There was a problem hiding this comment.
Could we not make one step for both here? We have a step that adds one image to multiple variants and one that adds multiple images to one variant. Why not merge the 2 steps? We could pass a list of images and a list of variants and do it all in one go no?
There was a problem hiding this comment.
Or am I missing something? I feel like the remove scenario is similar too
There was a problem hiding this comment.
hmm, and what would behaviour be if we pass {images_ids: [i1,i2,i3], variant_ids: [v1,v2,v3]}? We add each image to each variant and delete combinations of image x variant for remove?
think this is one of those cases where a bit of duplication is ok for simpler, specific api, but no strong opinion
There was a problem hiding this comment.
Yes, this is what I would imagine. No strong opinion either. I believe the customer/customer group duplicated. So leave it as is its fine:)
* wip(dashboard): setup variant media form * wip: cleanup table and images, wip check handler * feat: proper sidebar functionallity * fefat: add js-sdk and hooks * feat: allow only one selection * wip: lazy load variants in the table * feat: new variants management for images on product details * chore: refactor * wip: variant details page work * fix: cleanup media section, fix issues and types * feat: correct scoped images, cleanup in edit modal * feat: js sdk and hooks, filter out product images on variant details, labels, add API call and wrap UI * chore: cleanup * refacto: rename route * feat: thumbnail functionallity * fix: refresh checked after revalidation load * fix: rm unused, refactor type * Create thirty-clocks-refuse.md * feat: new add remove variant media layout * feat: new image add UX --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
What
This PR introduces the ability to associate product images with specific product variants, enabling more granular image management for products with multiple variants.
Scoped Image Management: Images can now be associated with specific variants instead of being global to the product
Bulk Operations: Batch add/remove variant associations for efficient management
API Changes
POST /admin/products/:id/variants/:variant_id/images/batch- Batch manage image associations for a variantPOST /admin/products/:id/images/:image_id/variants/batch- Batch manage variant associations for an imageProduct Module Changes
imagesmany-to-many relationshipvariantsmany-to-many relationshipthumbnailaddImageToVariant()- Associate images with specific variantsremoveImageFromVariant()- Remove image-variant associationsgetVariantImages()- Retrieve images for variants - (general product images + variant specific images)Core Flows Changes
CLOSES CORE-1214
CLOSES CORE-1215
CLOSES CORE-1216
Related PRs: