openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sandbox.js has hard dependency on root folder

Open FiddleBe opened this issue 7 years ago • 5 comments

OpenUI5 version: all

Browser/version (+device/version): all

URL (minimal example if possible): https://fiddlewookie.github.io/Launchpad/

Steps to reproduce the problem:

  1. The launchpad is hosted on the path /launchpad.
  2. The config file is hosted on /Launchpad/appConfig/fioriSandboxConfig.json
  3. The standard sandbox.js script looks for the config on /appConfig/fioriSandboxConfig.json (hard coded)

What is the expected result? expected result would be that the sandbox.json takes into account the relative path instead of the root path.

What happens instead? The fiori sandbox.js looks for the config file starting from the root. Consequence is, it doesn't find it, and the launchpad fails to launch.

Any other information? (attach screenshot if possible) image

FiddleBe avatar Nov 27 '19 12:11 FiddleBe

Hello @FiddleBe , Thank you for sharing this finding. I've created an internal incident 1980466949. The status of the issue will be updated here in GitHub.

Regards, Tsanislav

tsanislavgatev avatar Nov 27 '19 13:11 tsanislavgatev

The launchpad should be correctly configured. Otherwise, it will fail to load.

That means, the sap-ushell-sandbox-config URL parameter should be provided.

No action.

ulasenka avatar Nov 28 '19 09:11 ulasenka

Closed as a non-issue

ulasenka avatar Nov 28 '19 09:11 ulasenka

Hi @FiddleBe,

The sandbox mode of FLP is not for productive use! It should only be used for local development. For local development, it should be sufficient to set the URL parameter. An alternative to this would be:

  1. Place the config inside a script tag e.g:
<script>
    window["sap-ushell-config"] = {
        ... 
    }
</script>
  1. Use CDM instead of sandbox. You can look up the CDM schema online.

Keep in mind, that the SAP Fiori Launchpad is not part of OpenUI5. It is only available in SAPUI5. To get official support for the SAP Fiori Launchpad please open a ticket in the SAP Support Portal.

Best regards Sebastian SAP Fiori Launchpad - Development

bastilimbach avatar Nov 28 '19 09:11 bastilimbach

Hi @bastilimbach ,

We don't use it productively. We use it for development, testing,and sharing ideas, plugins and open source apps. We've made a showcase on github, which is directly testable via git-pages (and can be used as test-template). That way, other SAP customers can immediately see how a plugin or app works. (even if it's under a test-launchpad, at least it gives an idea) But git-pages hosts everything under a path (the name of the project). And since the sandbox.js loads it's appconfig from the root, it ignores the path under which it's accessible.

We've foreseen a hack to automatically inject the url parameter, because I feel that it shouldn't be the user/tester/whatever's responsibility to manually add the config-parameter. Especially when the solution might be as simple as changing "/appConfig/fioriSandboxConfig.json" to "./appConfig/fioriSandboxConfig.json". imo relative paths should be desirable over fixed paths.

FiddleBe avatar Nov 28 '19 09:11 FiddleBe