feat(core-flows,product,types): scoped variant images (#13623)

* wip(product): variant images

* fix: return type

* wip: repo and list approach

* fix: redo repo method, make test pass

* fix: change getVariantImages impl

* feat: update test

* feat: API and core flows layer

* wip: integration spec

* fix: deterministic test

* chore: refactor and simplify, cleanup, remove repo method

* wip: batch add all images to all vairants

* fix: remove, expand testing

* refactor: pass variants instead of refetch

* chore: expand integration test

* feat: test multi assign route

* fix: remove `/admin/products/:id/variants/images` route

* feat: batch images to variant endpoint

* fix: length assertion

* feat: variant thumbnail

* fix: send variant thumbnail by default

* fix: product export test assertion

* fix: test

* feat: variant thumbnail on line item

* fix: add missing list and count method, update types

* feat: optimise variant images lookups

* feat: thumbnail management in core flows

* fix: typos, type, build

* feat: cascade delete to pivot table, rm unused unused fields

* feat(dashboard): variant images management UI (#13670)

* 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>

* fix: table name in migration

* chore: update changesets

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Frane Polić
2025-10-26 15:15:40 +01:00
committed by GitHub
co-authored by Oli Juhl
parent bafd006094
commit 4757281677
57 changed files with 3323 additions and 80 deletions
@@ -450,6 +450,12 @@
"idCopiedToClipboard": {
"type": "string"
},
"editVariantImages": {
"type": "string"
},
"editImages": {
"type": "string"
},
"addReason": {
"type": "string"
},
@@ -530,6 +536,8 @@
"continue",
"continueWithEmail",
"idCopiedToClipboard",
"editVariantImages",
"editImages",
"addReason",
"addNote",
"reset",
@@ -1912,6 +1920,9 @@
"editHint": {
"type": "string"
},
"manageImageVariants": {
"type": "string"
},
"makeThumbnail": {
"type": "string"
},
@@ -1969,11 +1980,27 @@
},
"successToast": {
"type": "string"
},
"variantImages": {
"type": "string"
},
"showAvailableImages": {
"type": "string"
},
"availableImages": {
"type": "string"
},
"selectToAdd": {
"type": "string"
},
"removeSelected": {
"type": "string"
}
},
"required": [
"label",
"editHint",
"manageImageVariants",
"makeThumbnail",
"uploadImagesLabel",
"uploadImagesHint",
@@ -1988,7 +2015,57 @@
"downloadImageLabel",
"deleteImageLabel",
"emptyState",
"successToast"
"successToast",
"variantImages",
"showAvailableImages",
"availableImages",
"selectToAdd",
"removeSelected"
],
"additionalProperties": false
},
"variantMedia": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"manageVariants": {
"type": "string"
},
"addToMultipleVariants": {
"type": "string"
},
"manageVariantsDescription": {
"type": "string"
},
"successToast": {
"type": "string"
},
"emptyState": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"description": {
"type": "string"
},
"action": {
"type": "string"
}
},
"required": ["header", "description", "action"],
"additionalProperties": false
}
},
"required": [
"label",
"manageVariants",
"addToMultipleVariants",
"manageVariantsDescription",
"successToast",
"emptyState"
],
"additionalProperties": false
},
@@ -2736,6 +2813,7 @@
"editOptions",
"editPrices",
"media",
"variantMedia",
"discountableHint",
"noSalesChannels",
"variantCount_one",
@@ -7678,6 +7756,7 @@
"campaign",
"method",
"allocation",
"allocationTooltip",
"addCondition",
"clearAll",
"taxInclusive",
@@ -122,6 +122,8 @@
"continue": "Continue",
"continueWithEmail": "Continue with Email",
"idCopiedToClipboard": "ID copied to clipboard",
"editVariantImages": "Edit variant images",
"editImages": "Edit images",
"addReason": "Add Reason",
"addNote": "Add Note",
"reset": "Reset",
@@ -506,6 +508,7 @@
"media": {
"label": "Media",
"editHint": "Add media to the product to showcase it in your storefront.",
"manageImageVariants": "Manage associated variants",
"makeThumbnail": "Make thumbnail",
"uploadImagesLabel": "Upload images",
"uploadImagesHint": "Drag and drop images here or click to upload.",
@@ -521,10 +524,27 @@
"deleteImageLabel": "Delete current image",
"emptyState": {
"header": "No media yet",
"description": "Add media to the product to showcase it in your storefront.",
"description": "Add media to showcase it in your storefront.",
"action": "Add media"
},
"successToast": "Media was successfully updated."
"successToast": "Media was successfully updated.",
"variantImages": "Variant images",
"showAvailableImages": "Show available images",
"availableImages": "Available images",
"selectToAdd": "Select to add to variant",
"removeSelected": "Remove Selected"
},
"variantMedia": {
"label": "Variant Media",
"manageVariants": "Manage variants",
"addToMultipleVariants": "Add to multiple variants",
"manageVariantsDescription": "Manage associated variants for the image",
"successToast": "Image variants successfully updated.",
"emptyState": {
"header": "No media yet",
"description": "Add media to the variant to showcase it in your storefront.",
"action": "Add media"
}
},
"discountableHint": "When unchecked, discounts will not be applied to this product.",
"noSalesChannels": "Not available in any sales channels",