SAP / SAP/spartacus-docs

Simplify SmartEdit setup

Open
#795 0 comments 0 reactions 1 assignee View on GitHub

@Xymmer is already working on this.

Since Sep 2, 2020.

Dominant language
HTML
Stars
11
Forks
22
Avg merge
7d 3h
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.

https://sap.github.io/spartacus-docs/smartEdit-setup-instructions-for-spartacus/

The current guide warrants an unnecessary change to angular.json and also isn't very clear on data-smartedit-allow-origin

Describe the solution you'd like

  • You can streamline it by copying the webApplicationInjector to src/assets, since the whole folder is configured as asset already.

    cp .../hybris/bin/modules/smartedit/smarteditaddon/acceleratoraddon/web/webroot/_ui/shared/common/js/webApplicationInjector.js src/assets
    
  • Explain that data-smartedit-allow-origin:

    • allows for multiple whitelist entries, separated by ,
    • supports patterns (* matches a component of a hostname)

    Here is an example configuration that works for local development and the standard endpoints of a ccv2 subscription at the same time:

    <script id="smartedit-injector" src="assets/webApplicationInjector.js" 
        data-smartedit-allow-origin="localhost:9002,*.*.model-t.cc.commerce.ondemand.com:443"></script>
    

Describe alternatives you've considered

Additional context

It's just a minor improvement, but let's make it as easy as possible for everyone.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.