@@ -32,8 +32,11 @@ const CREATE_NETWORK = 'CREATE NETWORK';
3232const CREATE_AND_SIMULATE = 'CREATE AND SIMULATE' ;
3333const SIMULATE = 'SIMULATE' ;
3434const BACK_TO_EDIT = 'BACK TO EDIT' ;
35+ const BACK_TO_EXPLORER = 'GO TO EXPLORER' ;
36+ const UPDATE_NETWORK = 'UPDATE NETWORK' ;
3537
3638const editOptions = [ CREATE_NETWORK , CREATE_AND_SIMULATE , SIMULATE ] ;
39+ const instantiatedEditOptions = [ UPDATE_NETWORK , CREATE_AND_SIMULATE , SIMULATE ] ;
3740const exploreOptions = [ SIMULATE , CREATE_AND_SIMULATE ] ;
3841
3942class SwitchPageButton extends Component {
@@ -43,7 +46,7 @@ class SwitchPageButton extends Component {
4346 }
4447
4548 handleClick = ( selectedOption ) => {
46- if ( selectedOption === CREATE_NETWORK ) {
49+ if ( selectedOption === CREATE_NETWORK || selectedOption === UPDATE_NETWORK ) {
4750 this . props . createNetwork ( ) ;
4851 } else if ( selectedOption === SIMULATE ) {
4952 if ( this . props . experimentInDesign ) {
@@ -64,43 +67,37 @@ class SwitchPageButton extends Component {
6467 }
6568 } ;
6669
67- getExploreLabel ( ) {
68- const {
69- automaticInstantiation,
70- automaticSimulation,
71- } = this . props ;
72- const instantiate = automaticInstantiation || this . props . modelState === MODEL_STATE . NOT_INSTANTIATED ;
73- if ( instantiate && automaticSimulation ) {
74- return TOPBAR_CONSTANTS . CREATE_AND_SIMULATE_NETWORK ;
75- }
76- if ( instantiate ) {
77- return TOPBAR_CONSTANTS . CREATE_NETWORK ;
78- }
79- if ( automaticSimulation ) {
80- console . debug ( 'Bad option combination: can\'t auto simulate without auto instantiate' ) ;
81- }
82- return TOPBAR_CONSTANTS . EXPLORE_EXISTING_NETWORK ;
83- }
84-
8570 render ( ) {
8671 const {
8772 classes,
8873 editModelPage,
74+ modelState
8975 } = this . props ;
76+ const instantiated = modelState == MODEL_STATE . INSTANTIATED ;
9077 return (
9178 < div className = { classes . container } >
9279 { editModelPage
9380 ? (
94- < SplitButton
95- options = { editOptions }
96- handleClick = { ( selectedOption ) => this . handleClick ( selectedOption ) }
97- icon = { (
98- < span style = { { marginRight : '5px' } } >
99- < Icon name = "rocket" />
100- </ span >
101- ) }
102- skipIconFor = { CREATE_NETWORK }
103- />
81+ < >
82+ < Button
83+ variant = "contained"
84+ onClick = { ( ) => this . handleClick ( BACK_TO_EXPLORER ) }
85+ startIcon = { < Icon name = "screen" selected = { false } /> }
86+ disabled = { ! instantiated }
87+ >
88+ { BACK_TO_EXPLORER }
89+ </ Button >
90+ < SplitButton
91+ options = { instantiated ? instantiatedEditOptions : editOptions }
92+ handleClick = { ( selectedOption ) => this . handleClick ( selectedOption ) }
93+ icon = { (
94+ < span style = { { marginRight : '5px' } } >
95+ < Icon name = "rocket" />
96+ </ span >
97+ ) }
98+ skipIconFor = { CREATE_NETWORK }
99+ />
100+ </ >
104101 )
105102 : (
106103 < >
0 commit comments