Skip to content

Commit 178d32f

Browse files
authored
Merge pull request #779 from MetaCell/feature/iframe-throttling-fix-rebase
Cherry picked iframe visibility changes after rebase
2 parents 038eb64 + e96c366 commit 178d32f

9 files changed

Lines changed: 1386 additions & 1162 deletions

File tree

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM node:14 as jsbuild
22

33
ENV FOLDER=netpyne
4-
RUN echo "no-cache 2023-7-14"
54

65
WORKDIR $FOLDER/webapp
76
COPY webapp/package.json .
@@ -12,10 +11,6 @@ RUN yarn install --network-timeout 1000000000
1211
COPY webapp .
1312
RUN yarn build-dev
1413

15-
RUN rm -Rf node_modules/*
16-
17-
18-
1914
###
2015
FROM jupyter/base-notebook:hub-1.5.0
2116
ENV NB_UID=jovyan

k8s/cf_values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ hub:
1414
c.Spawner.notebook_dir = '/opt/workspace'
1515
c.Spawner.default_url = '/geppetto'
1616
spawner: >-
17-
c.Spawner.args = ["--library=netpyne_ui"]
17+
c.Spawner.args = ["--library=netpyne_ui", "--NotebookApp.default_url=/geppetto"]
1818
singleuser:
1919
storage:
2020
type: none

tests/frontend/e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "NetPyNe UI tests",
55
"license": "unlicensed",
66
"scripts": {
7-
"test": "jest --verbose",
7+
"test": "jest --verbose Tut#1_smoke && jest --verbose ExperimentManager_Tut#1",
88
"EEG_Dipole_test": "jest --verbose EEG_and_Dipole_Tut#1 ",
99
"Experiment_Manager_test": "jest --verbose ExperimentManager_Tut#1 ",
1010
"Tutorial_1_test":"jest --verbose Tut#1_smoke ",

utilities/install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def main(netpyne_branch, workspace_branch, geppetto_branch=None, skipNpm=False,
171171
_ = config['NotebookApp']['tornado_settings']
172172
except KeyError:
173173
config['NotebookApp']['tornado_settings'] = {}
174+
config['NotebookApp']['tornado_settings']['headers'] = { 'Content-Security-Policy': "frame-ancestors 'self' http: https: http://localhost:8081 *" }
174175
config['NotebookApp']['tornado_settings']['gzip'] = True
175176
f.seek(0)
176177
json.dump(config, f, indent=4, sort_keys=True)

webapp/Main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require('./css/flexlayout.less');
3434
require('./css/tree.less');
3535

3636
ReactDOM.render(
37-
<div>
37+
<div id="iframefix">
3838
<MuiThemeProvider theme={theme}>
3939
<Provider store={store}>
4040
<LoadingSpinner />

webapp/components/general/NetPyNEPythonConsole.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,19 @@ export class NetPyNEPythonConsole extends Component {
7070
return currentNotebookValues ;
7171
}
7272

73+
componentDidUpdate (prevProps) {
74+
document.getElementById('pythonConsoleFrame').parentElement.parentElement.style.display = 'block';
75+
}
76+
7377
shouldComponentUpdate (nextProps) {
74-
if (this.props.extensionLoaded !== nextProps.extensionLoaded) {
75-
return true;
76-
}
78+
7779
if (nextProps.notebookVisible)
7880
{
7981
var iframeWindow = this.container.contentWindow;
8082
iframeWindow.onblur = this.handleIframeBlur ;
8183
iframeWindow.onfocus = this.handleIframeFocus ;
8284
}
83-
return false;
85+
return true;
8486
}
8587

8688
handleIframeBlur = (event) => {

webapp/test-frame/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>IFrame NePyNE-UI</title>
5+
</head>
6+
<body>
7+
8+
<h2>IFrame NePyNE-UI</h2>
9+
10+
<!-- IFrame element -->
11+
<iframe src="http://localhost:8081" width="1200" height="1200">
12+
<!-- Alternative content for browsers that do not support iframes -->
13+
<p>Your browser does not support iframes.</p>
14+
</iframe>
15+
16+
</body>
17+
</html>

webapp/webpack.config.dev.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ extended.devServer = {
77
port: 8081,
88
inline: true,
99
publicPath: '/geppetto/build',
10-
1110
proxy: [
1211
{
1312
path: '/',

webapp/yarn.lock

Lines changed: 1359 additions & 1149 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)