GlennRicaud / data-toolbox-app

Apache License 2.0
11 stars 1 forks source link

Get rid of inline Javascript in the widget template #69

Closed alansemenov closed 2 years ago

alansemenov commented 2 years ago

Hi Glenn,

We are enforcing Content Security Policy in Content Studio, which means that inline Javascript will stop working in widgets after the upcoming 4.1.0 release. This script has to be replaced.

Suggested fix:

  1. Implement a service that returns required config object (example)

  2. Pass url of the service as a data attribute to the client-side JS asset (example)

  3. Inside the JS asset, get config service url from the data attribute and fetch config from the service (example). In this last example we use lib-admin-ui to fetch the config, but you can use simple fetch API.

GlennRicaud commented 2 years ago

Hei Alan,

Thanks for the heads-up. I will do that tomorrow :+1:

GlennRicaud commented 2 years ago

Fixed in DT 5.0.24