Skip to content

Commit f2163d1

Browse files
committed
Merge branch 'development' of https://github.com/MetaCell/NetPyNE-UI into feature/311_confirmation_dialog
2 parents 1505429 + 0d9dbf8 commit f2163d1

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

webapp/Main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Provider } from 'react-redux';
44
import { MuiThemeProvider } from '@material-ui/core/styles';
55
import * as Sentry from '@sentry/react';
66
import { CaptureConsole } from '@sentry/integrations';
7+
import { LoadingSpinner } from '@metacell/geppetto-meta-client/components';
78
import { NetPyNE } from './components';
89
import theme from './theme';
910
import store from './redux/store';
@@ -33,6 +34,7 @@ ReactDOM.render(
3334
<div>
3435
<MuiThemeProvider theme={theme}>
3536
<Provider store={store}>
37+
<LoadingSpinner />
3638
<NetPyNE />
3739
</Provider>
3840
</MuiThemeProvider>

webapp/redux/middleware/middleware.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
LOAD_TUTORIAL,
2424
RESET_MODEL,
2525
showNetwork,
26-
MODEL_LOADED,
2726
addInstancesToCanvas,
2827
} from '../actions/general';
2928
import { openBackendErrorDialog } from '../actions/errors';
@@ -62,7 +61,7 @@ const pythonCall = async ({
6261
}) => {
6362
const response = await Utils.evalPythonMessage(cmd, [args]);
6463
const errorPayload = processError(response);
65-
GEPPETTO.trigger(GEPPETTO.Events.Hide_spinner);
64+
// GEPPETTO.trigger(GEPPETTO.Events.Hide_spinner);
6665

6766
if (errorPayload) {
6867
throw errorPayload;
@@ -83,7 +82,7 @@ const dehydrateCanvas = () => {
8382

8483
const createSimulateBackendCall = async (cmd, payload, consoleMessage, spinnerType) => {
8584
console.log(consoleMessage);
86-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, spinnerType);
85+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, spinnerType);
8786

8887
const response = await Utils.evalPythonMessage(cmd, [payload]);
8988
console.log('Python response', response);
@@ -94,7 +93,7 @@ const createSimulateBackendCall = async (cmd, payload, consoleMessage, spinnerTy
9493
if (responsePayload) {
9594
throw responsePayload;
9695
} else {
97-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, GEPPETTO.Resources.PARSING_MODEL);
96+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, GEPPETTO.Resources.PARSING_MODEL);
9897

9998
dehydrateCanvas();
10099

@@ -176,10 +175,10 @@ export default (store) => (next) => (action) => {
176175
};
177176

178177
switch (action.type) {
179-
case MODEL_LOADED:
180-
next(GeppettoActions.waitData('Loading the NetPyNE Model', GeppettoActions.clientActions.MODEL_LOADED));
181-
next(action);
182-
break;
178+
// case MODEL_LOADED:
179+
// next(GeppettoActions.waitData('Loading the NetPyNE Model', GeppettoActions.clientActions.MODEL_LOADED));
180+
// next(action);
181+
// break;
183182
case GeppettoActions.clientActions.MODEL_LOADED:
184183
if (store.getState()?.general?.modelState === Constants.MODEL_STATE.NOT_INSTANTIATED) {
185184
const networkPath = window.Instances.getInstance('network');
@@ -206,7 +205,7 @@ export default (store) => (next) => (action) => {
206205
break;
207206
}
208207
case RESET_MODEL: {
209-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, 'Reloading Python Kernel');
208+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, 'Reloading Python Kernel');
210209
IPython.notebook.restart_kernel({ confirm: false })
211210
.then(
212211
() => {
@@ -216,6 +215,7 @@ export default (store) => (next) => (action) => {
216215
break;
217216
}
218217
case CREATE_NETWORK: {
218+
next(GeppettoActions.waitData('Instantiating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
219219
let allParams = true;
220220
ExperimentsApi.getParameters()
221221
.then((params) => {
@@ -250,6 +250,7 @@ export default (store) => (next) => (action) => {
250250
break;
251251
}
252252
case CREATE_SIMULATE_NETWORK: {
253+
next(GeppettoActions.waitData('Simulating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
253254
let allParams = true;
254255
ExperimentsApi.getParameters()
255256
.then((params) => {
@@ -284,6 +285,7 @@ export default (store) => (next) => (action) => {
284285
break;
285286
}
286287
case SIMULATE_NETWORK: {
288+
next(GeppettoActions.waitData('Simulating the NetPyNE Model', GeppettoActions.layoutActions.SET_WIDGETS));
287289
let allParams = true;
288290
ExperimentsApi.getParameters()
289291
.then((params) => {
@@ -341,7 +343,7 @@ export default (store) => (next) => (action) => {
341343
}
342344
case LOAD_TUTORIAL: {
343345
const tutName = action.payload.replace('.py', '');
344-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading tutorial ${tutName}`);
346+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading tutorial ${tutName}`);
345347

346348
const params = {
347349
modFolder: 'mod',
@@ -370,7 +372,7 @@ export default (store) => (next) => (action) => {
370372
break;
371373
}
372374
case CLONE_EXPERIMENT: {
373-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Cloning experiment ${action.payload.name}`);
375+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Cloning experiment ${action.payload.name}`);
374376
pythonCall({
375377
cmd: NETPYNE_COMMANDS.cloneExperiment,
376378
args: action.payload,
@@ -380,7 +382,7 @@ export default (store) => (next) => (action) => {
380382
}
381383
case TRIAL_LOAD_MODEL_SPEC: {
382384
const { name, trial } = action.payload;
383-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading ${trial.name} of experiment ${name}`);
385+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading ${trial.name} of experiment ${name}`);
384386
pythonCall({
385387
cmd: NETPYNE_COMMANDS.viewExperimentResults,
386388
args: { name, trial: trial.id, onlyModelSpecification: true },
@@ -393,7 +395,7 @@ export default (store) => (next) => (action) => {
393395
}
394396
case VIEW_EXPERIMENTS_RESULTS: {
395397
const { name, trial } = action.payload;
396-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading ${trial.name} of experiment ${name}`);
398+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, `Loading ${trial.name} of experiment ${name}`);
397399
pythonCall({
398400
cmd: NETPYNE_COMMANDS.viewExperimentResults,
399401
args: { name, trial: trial.id },
@@ -405,7 +407,7 @@ export default (store) => (next) => (action) => {
405407
}
406408

407409
if (response) {
408-
GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, GEPPETTO.Resources.PARSING_MODEL);
410+
// GEPPETTO.trigger(GEPPETTO.Events.Show_spinner, GEPPETTO.Resources.PARSING_MODEL);
409411
dehydrateCanvas();
410412
GEPPETTO.Manager.loadModel(response);
411413
console.log('Instantiation / Simulation completed.');

0 commit comments

Comments
 (0)