Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 598 forks source link

Limiting the parsys in touch UI only works with static templates but not with editable templates #1359

Closed kwin closed 6 years ago

kwin commented 6 years ago

Required Information

Expected Behavior

The limiting of the parsys should work for both pages derived from static templates (using the classical design mode) or from editable template (using the content policies)

Actual Behavior

Due to the logic in https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/d0dba514c95be3bb980eefa47fa59fb0e6606ed2/content/src/main/content/jcr_root/apps/acs-commons/touchui-widgets/configure-limit-parsys/touchui-limit-parsys.js#L31 only design properties are supported but not content policy properties. For content policies although the designDialogSrc is set its parametrization looks completely different (i.e. it does not contain a URL parameter called content).

Steps to Reproduce

Just try to limit a parsys on a page based on an editable template leveraging e.g. https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/tree/master/content/src/content/jcr_root/apps/core/wcm/components/page/v1/page. For example create a we-retail page.

kwin commented 6 years ago

The logic for retrieving the limit property should rather be similar to /libs/cq/gui/components/authoring/editors/clientlibs/core/js/storage/components.js and its _findAllowedComponentsFromDesign method. The JS object ns.pageDesign actually already contains all properties from the content policy or the design. So it it just a matter of extracting it from there, without a server round-trip.