adobe / commerce-cif-connector

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

CIF-1446: Preview with Product in page editor - preview URL must conform to UrlProvider configuration #131

Closed hbacila closed 4 years ago

hbacila commented 4 years ago

Use PreviewServlet from cif-core-components to prepare and redirect to preview Url.

This PR is used in conjunction with https://github.com/adobe/aem-core-cif-components/pull/305

Description

The preview with product / category now uses the PreviewServlet to construct the preview Url based on UrlProvider configuration. The servlet will also do a redirect to the preview Url.

The preview servlet url is /bin/wcm/cif.PREVIEW_SELECTOR.html where PREVIEW_SELECTOR is:

Related Issue

https://github.com/adobe/aem-core-cif-components/pull/305

Motivation and Context

Current implementation does not satisfy custom UrlProvider templates.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #131 into master will increase coverage by 2.46%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #131      +/-   ##
============================================
+ Coverage     85.31%   87.77%   +2.46%     
- Complexity      492      500       +8     
============================================
  Files            35       35              
  Lines          1920     1914       -6     
  Branches        299      299              
============================================
+ Hits           1638     1680      +42     
+ Misses          144       99      -45     
+ Partials        138      135       -3     
Flag Coverage Δ Complexity Δ
#integration 48.72% <ø> (+38.13%) 256.00 <ø> (+208.00)
#karma 96.55% <100.00%> (+3.83%) 0.00 <0.00> (ø)
#unittests 83.88% <ø> (ø) 484.00 <ø> (ø)
Impacted Files Coverage Δ Complexity Δ
...oring/editor/pagepreview/clientlibs/pagepreview.js 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...mmerce/graphql/magento/GraphqlDataServiceImpl.java 92.73% <0.00%> (+1.11%) 66.00% <0.00%> (ø%)
.../commerce/graphql/search/CatalogSearchSupport.java 86.48% <0.00%> (+2.70%) 12.00% <0.00%> (ø%)
...aphql/resource/GraphqlResourceProviderFactory.java 98.00% <0.00%> (+4.00%) 12.00% <0.00%> (+1.00%)
...mnisearch/ProductsSuggestionOmniSearchHandler.java 89.88% <0.00%> (+4.49%) 14.00% <0.00%> (+2.00%)
...e/renderconditions/IsProductDetailPageServlet.java 92.85% <0.00%> (+4.76%) 13.00% <0.00%> (+1.00%)
.../cq/commerce/graphql/resource/ProductResource.java 90.00% <0.00%> (+5.00%) 16.00% <0.00%> (+1.00%)
...erce/graphql/resource/GraphqlResourceProvider.java 88.23% <0.00%> (+5.88%) 12.00% <0.00%> (+1.00%)
...cq/commerce/graphql/resource/CategoryResource.java 92.85% <0.00%> (+10.71%) 9.00% <0.00%> (+1.00%)
...omponents/common/cifpicker/clientlibs/cifpicker.js 93.33% <0.00%> (+13.33%) 0.00% <0.00%> (ø%)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 56c4b12...d49f8c7. Read the comment docs.