SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
738 stars 383 forks source link

Improvement for SmartEdit contract for slots #371

Closed Xymmer closed 5 years ago

Xymmer commented 5 years ago

Current contract was added in dynamic-slot.component.html. We want to generate slot contract in dynamic-slot.component.ts. Also check, if no cmsTicketId (SPA not started from smart edit), do not add contract.

Xymmer commented 5 years ago

Example:

<smartedit-element
   class="smartEditComponent"
   data-smartedit-component-id="Section1Slot-Homepage"
   data-smartedit-component-type="ContentSlot"
   data-smartedit-catalog-version-uuid="electronicsContentCatalog/Staged"
   data-smartedit-component-uuid="eyJpdGVtSWQiOiJTZWN0aW9uMVNsb3QtSG9tZXBhZ2UiLCJjYXRhbG9nSWQiOiJlbGVjdHJvbmljc0NvbnRlbnRDYXRhbG9nIiwiY2F0YWxvZ1ZlcnNpb24iOiJTdGFnZWQifQ==" data-smartedit-element-uuid="c4ee82b2-6a20-4bb8-969f-071e9de0febc"
   ... >
WeizhengSap commented 5 years ago

PR: https://github.com/SAP/cloud-commerce-spartacus-storefront/pull/703