From 63815fc1294f569efcbc87de75de758db258721e Mon Sep 17 00:00:00 2001 From: Santiago Date: Tue, 18 May 2021 18:34:16 -0300 Subject: [PATCH] Original implementation of #3617 commit 2b5fcac881c6a77989ea8a59cce87d065f6d4d4a --- app/react/Pages/components/PageViewer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/react/Pages/components/PageViewer.js b/app/react/Pages/components/PageViewer.js index d312737d84b..4a4280eecd6 100644 --- a/app/react/Pages/components/PageViewer.js +++ b/app/react/Pages/components/PageViewer.js @@ -17,7 +17,8 @@ class PageViewer extends Component { const { page, itemLists, datasets } = this.props; const lists = itemLists.toJS(); const originalText = page.getIn(['metadata', 'content']) || ''; - const scriptCode = page.getIn(['metadata', 'script']) || ''; + let scriptCode = page.getIn(['metadata', 'script']) || ''; + scriptCode = `var datasets=${JSON.stringify(datasets)};\r\n${scriptCode}`; return (