Skip to content

Commit

Permalink
add RAZZLE_JUPYTER_ORIGIN
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Jan 29, 2024
1 parent 5b360e6 commit d4f0ff1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/AppExtras/Jupyter.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';
import { withCookies } from 'react-cookie';
import config from '@plone/volto/registry';

const Jupyter = (props) => {
const { cookies } = props;
Expand All @@ -17,7 +18,7 @@ const Jupyter = (props) => {
location,
},
},
'*',
config.settings.jupyterOrigin,
);
}, [location, auth_token, inIframe]);

Expand Down
3 changes: 2 additions & 1 deletion src/Utils/Jupyter.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { mapKeys } from 'lodash';
import { Button, Modal, ModalActions, ModalHeader } from 'semantic-ui-react';
import config from '@plone/volto/registry';

let chClosed = false;

Expand Down Expand Up @@ -41,7 +42,7 @@ const Jupyter = (props) => {
{
type: 'jupyter-ch:getContent',
},
'*',
config.settings.jupyterOrigin,
);
}, [inIframe]);

Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const applyConfig = (config) => {
config.widgets.id.visualization = VisualizationWidget;
config.widgets.views.id.visualization = VisualizationViewWidget;

config.settings.jupyterOrigin = process.env.RAZZLE_JUPYTER_ORIGIN || '*';

//add chart icon to visualization content type in /contents view
config.settings.contentIcons.visualization = {
attributes: {
Expand Down

0 comments on commit d4f0ff1

Please sign in to comment.