diff --git a/webviz_config/_theme_class.py b/webviz_config/_theme_class.py index 9ea9f24c..489c4ecb 100644 --- a/webviz_config/_theme_class.py +++ b/webviz_config/_theme_class.py @@ -12,7 +12,7 @@ def __init__(self, theme_name: str): self._csp = { "default-src": "'none'", - "connect-src": "'self'", + "connect-src": ["'self'", "data:"], "style-src": ["'self'", "'unsafe-inline'"], # [1] "script-src": ["'self'", "blob:", "'unsafe-eval'"], # [blob: 2] [eval: 3] "img-src": ["'self'", "data:", "blob:"], # [4] diff --git a/webviz_config/templates/copy_data_template.py.jinja2 b/webviz_config/templates/copy_data_template.py.jinja2 index 957d5330..0c3d8944 100644 --- a/webviz_config/templates/copy_data_template.py.jinja2 +++ b/webviz_config/templates/copy_data_template.py.jinja2 @@ -24,6 +24,8 @@ theme = webviz_config.WebvizConfigTheme("{{ theme_name }}") theme.from_json((Path(__file__).resolve().parent / "theme_settings.json").read_text()) theme.plotly_theme_layout_update({{ options.plotly_theme }}) +dash._dash_renderer._set_react_version("18.3.1") + app = dash.Dash() app.config.suppress_callback_exceptions = True diff --git a/webviz_config/templates/webviz_template.py.jinja2 b/webviz_config/templates/webviz_template.py.jinja2 index 4f3cbd9a..afe9c236 100644 --- a/webviz_config/templates/webviz_template.py.jinja2 +++ b/webviz_config/templates/webviz_template.py.jinja2 @@ -14,7 +14,7 @@ from pathlib import Path from uuid import uuid4 -from dash import html, dcc, Dash, Input, Output, callback, callback_context +from dash import html, dcc, Dash, Input, Output, callback, callback_context, _dash_renderer import webviz_core_components as wcc from flask_talisman import Talisman import webviz_config @@ -40,6 +40,8 @@ theme = webviz_config.WebvizConfigTheme("{{ theme_name }}") theme.from_json((Path(__file__).resolve().parent / "theme_settings.json").read_text()) theme.plotly_theme_layout_update({{ options.plotly_theme }}) +_dash_renderer._set_react_version("18.3.1") + app = Dash( name=__name__, external_stylesheets=theme.external_stylesheets,