Skip to content

Commit 9a3fb2e

Browse files
author
Lucas Rebscher
committed
#279 Simplify File > New > Blank and update Tutorials list
1 parent a243d33 commit 9a3fb2e

2 files changed

Lines changed: 19 additions & 23 deletions

File tree

webapp/components/topbar/menuConfiguration.js

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import {
1717
showNetwork,
1818
setTheme,
1919
} from '../../redux/actions/general';
20-
import { TOPBAR_CONSTANTS, MODEL_STATE, THEMES } from '../../constants';
20+
import {
21+
TOPBAR_CONSTANTS, MODEL_STATE, THEMES, TUTORIALS_LIST,
22+
} from '../../constants';
2123

2224
const checkedIcon = 'fa fa-check secondary';
2325

@@ -69,15 +71,6 @@ const firstItemStyle = {
6971
hover: { ...topLevelMenuItemStyle.hover, ...firstItemCustom },
7072
};
7173

72-
const tutorialsList = {
73-
tut1: 'Tut 1: Simple cell network',
74-
tut2: 'Tut 2: Detailed cell network',
75-
tut3: 'Tut 3a: Multiscale network (low IP3)',
76-
tut3_ip3high: 'Tut 3b: Multiscale network (high IP3)',
77-
tut3_norxd: 'Tut 3c: Multiscale network (no RxD) (edited)',
78-
tut_osc: 'Tut 4: Simple oscillatory network',
79-
};
80-
8174
export const getTutorials = () => {
8275
const { tuts } = window;
8376
if (!tuts) {
@@ -88,7 +81,7 @@ export const getTutorials = () => {
8881
const tutName = tutFile.replace('.py', '')
8982
.replace('gui', '')
9083
.replace('_', '');
91-
const tutLabel = tutorialsList[tutName] !== undefined ? tutorialsList[tutName] : tutName;
84+
const tutLabel = TUTORIALS_LIST[tutName] !== undefined ? TUTORIALS_LIST[tutName] : tutName;
9285
return {
9386
label: tutLabel,
9487
icon: '',
@@ -162,16 +155,10 @@ export default {
162155
{
163156
label: 'New',
164157
icon: '',
165-
list: [
166-
{
167-
label: 'Blank',
168-
icon: '',
169-
action: {
170-
handlerAction: 'redux',
171-
parameters: [openTopbarDialog, TOPBAR_CONSTANTS.NEW_MODEL],
172-
},
173-
},
174-
],
158+
action: {
159+
handlerAction: 'redux',
160+
parameters: [openTopbarDialog, TOPBAR_CONSTANTS.NEW_MODEL],
161+
},
175162
},
176163
{
177164
label: 'Open...',
@@ -296,7 +283,8 @@ export const getViewMenu = (props) => {
296283
const networkAction = () => {
297284
if (instantiate && props.automaticSimulation) {
298285
return createAndSimulateNetwork;
299-
} if (instantiate) {
286+
}
287+
if (instantiate) {
300288
return createNetwork;
301289
}
302290
return showNetwork;

webapp/constants.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const MODEL_STATE = {
1414
NOT_INSTANTIATED: 'NOT_INSTANTIATED',
1515
INSTANTIATED: 'INSTANTIATED',
1616
SIMULATED: 'SIMULATED',
17-
1817
};
1918

2019
export const NETPYNE_COMMANDS = {
@@ -389,3 +388,12 @@ export const EDIT_WIDGETS = {
389388
pos: 7,
390389
},
391390
};
391+
392+
export const TUTORIALS_LIST = {
393+
tut1: 'Tut 1: Simple cell network',
394+
tut2: 'Tut 2: Detailed cell network',
395+
tut3: 'Tut 3a: Multiscale network (low IP3)',
396+
tut3_ip3high: 'Tut 3b: Multiscale network (high IP3)',
397+
tut3_norxd: 'Tut 3c: Multiscale network (no RxD)',
398+
tut_osc: 'Tut 4: Simple oscillatory network',
399+
};

0 commit comments

Comments
 (0)