@@ -9,25 +9,24 @@ import DialogActions from '@material-ui/core/DialogActions';
99import DialogContent from '@material-ui/core/DialogContent' ;
1010import DialogContentText from '@material-ui/core/DialogContentText' ;
1111import DialogTitle from '@material-ui/core/DialogTitle' ;
12- import Utils from '../../../Utils' ;
1312import { withStyles } from '@material-ui/core/styles' ;
13+ import Utils from '../../../Utils' ;
1414
1515class NetPyNECellRule extends React . Component {
16-
1716 constructor ( props ) {
1817 super ( props ) ;
1918 this . state = {
2019 currentName : props . name ,
2120 errorMessage : undefined ,
22- errorDetails : undefined
21+ errorDetails : undefined ,
2322 } ;
2423 }
2524
26- handleRenameChange = event => {
27- var storedValue = this . props . name ;
28- var newValue = Utils . nameValidation ( event . target . value ) ;
29- var updateCondition = this . props . renameHandler ( newValue ) ;
30- var triggerCondition = Utils . handleUpdate ( updateCondition , newValue , event . target . value , this , 'CellRule' ) ;
25+ handleRenameChange = ( event ) => {
26+ const storedValue = this . props . name ;
27+ const newValue = Utils . nameValidation ( event . target . value ) ;
28+ const updateCondition = this . props . renameHandler ( newValue ) ;
29+ const triggerCondition = Utils . handleUpdate ( updateCondition , newValue , event . target . value , this , 'CellRule' ) ;
3130
3231 if ( triggerCondition ) {
3332 this . triggerUpdate ( ( ) => {
@@ -53,9 +52,9 @@ class NetPyNECellRule extends React.Component {
5352 }
5453
5554 postProcessMenuItems ( pythonData , selected ) {
56- return pythonData . map ( name => (
55+ return pythonData . map ( ( name ) => (
5756 < MenuItem
58- id = { name + ' MenuItem' }
57+ id = { ` ${ name } MenuItem` }
5958 key = { name }
6059 checked = { selected . indexOf ( name ) > - 1 }
6160 value = { name }
@@ -67,29 +66,32 @@ class NetPyNECellRule extends React.Component {
6766
6867 render ( ) {
6968 const { classes } = this . props ;
70- var dialogPop = ( this . state . errorMessage !== undefined ? (
71- < Dialog
72- open = { true }
73- style = { { whiteSpace : 'pre-wrap' } } >
74- < DialogTitle id = "alert-dialog-title" > { this . state . errorMessage } </ DialogTitle >
75- < DialogContent style = { { overflow : 'auto' } } >
76- < DialogContentText id = "alert-dialog-description" >
77- { this . state . errorDetails }
78- </ DialogContentText >
79- </ DialogContent >
80- < DialogActions >
81- < Button
82- variant = "contained"
83- color = "primary"
84- onClick = { ( ) => this . setState ( {
85- errorMessage : undefined ,
86- errorDetails : undefined
87- } ) }
88- > BACK</ Button >
89- </ DialogActions >
90- </ Dialog >
91- )
92- : undefined
69+ const dialogPop = ( this . state . errorMessage !== undefined ? (
70+ < Dialog
71+ open
72+ style = { { whiteSpace : 'pre-wrap' } }
73+ >
74+ < DialogTitle id = "alert-dialog-title" > { this . state . errorMessage } </ DialogTitle >
75+ < DialogContent style = { { overflow : 'auto' } } >
76+ < DialogContentText id = "alert-dialog-description" >
77+ { this . state . errorDetails }
78+ </ DialogContentText >
79+ </ DialogContent >
80+ < DialogActions >
81+ < Button
82+ variant = "contained"
83+ color = "primary"
84+ onClick = { ( ) => this . setState ( {
85+ errorMessage : undefined ,
86+ errorDetails : undefined ,
87+ } ) }
88+ >
89+ BACK
90+ </ Button >
91+ </ DialogActions >
92+ </ Dialog >
93+ )
94+ : undefined
9395 ) ;
9496 return (
9597 < div >
@@ -101,15 +103,17 @@ class NetPyNECellRule extends React.Component {
101103 value = { this . state . currentName }
102104 disabled = { this . renaming }
103105 label = "The name of the cell type"
104- id = { ' cellRuleName' }
106+ id = " cellRuleName"
105107 />
106108
107109 < Box m = { 1 } >
108110 < Button
109111 variant = "contained"
110112 color = "secondary"
111113 onClick = { ( ) => this . props . HandleAddNewSection ( ) }
112- > Add new section</ Button >
114+ >
115+ Add new section
116+ </ Button >
113117 </ Box >
114118
115119 </ div >
@@ -121,18 +125,18 @@ class NetPyNECellRule extends React.Component {
121125
122126const styles = ( {
123127 shape,
124- spacing
128+ spacing,
125129} ) => ( {
126130 expandable : {
127131 borderRadius : shape . borderRadius ,
128132 backgroundColor : 'inherit' ,
129133 paddingTop : spacing ( 2 ) ,
130- '&::before' : { content : 'unset' }
134+ '&::before' : { content : 'unset' } ,
131135 } ,
132136 root : {
133137 display : 'flex' ,
134- flexDirection : 'column'
135- }
138+ flexDirection : 'column' ,
139+ } ,
136140} ) ;
137141
138142export default withStyles ( styles ) ( NetPyNECellRule ) ;
0 commit comments