apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
63.08k stars 13.97k forks source link

ENABLE_JAVASCRIPT_CONTROLS use #29883

Closed antonio-tg closed 3 months ago

antonio-tg commented 3 months ago

Bug description

I have Superset 2.1.3 in production and I would like to upgrade to 4.0.2, however a feature that works great in 2.1.3 has been deprecated in 4.0.2, the feature is the option to use JS code in maps, that is:

ENABLE_JAVASCRIPT_CONTROLS

Therefore I would like your help to find an alternative and be able to solve this problem.

How to reproduce the bug

Upgrade from Superset 2.1.3. to 4.0.2

Screenshots/recordings

The map look like this in superset 2.1.3:

mapa_normal

In the newest supeset look equal, but when I place the mouse cursor over the map this happend:

error

I mean this:

An error occurred while rendering the visualization: Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=EvalError%3A%20Refused%20to%20evaluate%20a%20string%20as%20JavaScript%20because%20'unsafe-eval'%20is%20not%20an%20allowed%20source%20of%20script%20in%20the%20following%20Content%20Security%20Policy%20directive%3A%20%22script-src%20'self'%20'strict-dynamic'%20'nonce-7ZywRWntR57icaAOAZiKN_Qp24uqef_N'%22.%0A&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Superset version

4.0.2

Python version

3.9

Node version

16

Browser

Chrome

Additional context

This feature is really important to my users so I'll be so thankful if you could help me with this.

Checklist

harshit2283 commented 3 months ago

Likely due to Talisman, please refer https://github.com/apache/superset/issues/25871#issuecomment-1967064535

antonio-tg commented 3 months ago

Thank you very much dear @harshit2283, your example allow me to solve my problem, only that in my case I'm in superset 4.0.2 so the two changes where made in the same file. solution_bug