adobe / commerce-cif-connector

AEM Commerce connector for Magento and GraphQL
Apache License 2.0
43 stars 27 forks source link

Drag&Drop a Product onto a page, renders a path #85

Closed geertsmichael closed 4 years ago

geertsmichael commented 4 years ago

Expected Behaviour

When dragging a Product on a page, from the "Product Content Finder" in Touch UI. It renders a path to "/var/commerce/products/magento-products/men/tops-men/MH02". When configuring the path from the dialog, just the product SKUs is used "MH02".

Schermafbeelding 2020-01-22 om 16 56 41

Steps to Reproduce

  1. Install the archetype - 0.6.2 containing the Venia site
  2. Open any page of the Venia site
  3. Open the Content finder, to show products
  4. Search for "hoodie"
  5. Drag & Drop the first or any random product to the page
  6. A product Teaser component is created
  7. Open the dialog
  8. Issue: It shows a path (e.g. /var/commerce/products/magento-products/men/tops-men/MH02) & the component fails to render
  9. Now select a product from that dialog and choose a product.
  10. Now a sku is used as value for the dialog field.

What is the correct way of defining products in a dialog? Are both ok and should all our components work with both a path & a sku?

Platform and Version

AEM 6.4.5 CIF Connector 0.7.1 CIF Core Component 0.6.0

mhaack commented 4 years ago

Drag & Drop rendering using the path instead of the SKU is actually currently working as designed. The Content/Asset Finder at the moment requires a Sling resource and returns that resource path.

I understand the different behavior is actually not optimal but currently something we can not change easily.

geertsmichael commented 4 years ago

Ok, so CIF components should always work in both ways then (path and sku based)? What is the preferred way for linking to a product in your opinion? If that's SKU, then I propose a PostProcessor to remove the /var/commerce/... part.

mhaack commented 4 years ago

Ok, so CIF components should always work in both ways then (path and sku based)? Yes, at least this applies for all CIF core components.

If that's SKU, then I propose a PostProcessor to remove the /var/commerce/... part. That is not possible ootb we can not simply remove it because a) we still need /var/commerce/products for the product bindings config and b) we can not remove any customer data!

geertsmichael commented 4 years ago

Thank you.