@@ -26,7 +26,11 @@ import isEmpty from 'lodash/isEmpty';
2626import React from 'react' ;
2727import { connect } from 'react-redux' ;
2828import { compose } from 'recompose' ;
29- import { StyleRulesCallback , withStyles , WithStyles } from '@material-ui/core/styles' ;
29+ import {
30+ StyleRulesCallback ,
31+ withStyles ,
32+ WithStyles
33+ } from '@material-ui/core/styles' ;
3034import AppBar from '@material-ui/core/AppBar' ;
3135import Toolbar from '@material-ui/core/Toolbar' ;
3236import Typography from '@material-ui/core/Typography' ;
@@ -40,18 +44,20 @@ import { createAjv } from '@jsonforms/core/lib/util/validator';
4044
4145const ajv = createAjv ( ) ;
4246
43- const styles : StyleRulesCallback < 'root' | 'flex' | 'rightIcon' | 'button' > = theme => ( {
47+ const styles : StyleRulesCallback <
48+ 'root' | 'flex' | 'rightIcon' | 'button'
49+ > = theme => ( {
4450 root : {
45- flexGrow : 1 ,
51+ flexGrow : 1
4652 } ,
4753 flex : {
48- flex : 1 ,
54+ flex : 1
4955 } ,
5056 rightIcon : {
51- marginLeft : theme . spacing . unit ,
57+ marginLeft : Number ( theme . spacing )
5258 } ,
5359 button : {
54- margin : theme . spacing . unit ,
60+ margin : Number ( theme . spacing )
5561 }
5662} ) ;
5763
@@ -63,14 +69,17 @@ interface EditorBarProps {
6369
6470interface EditorBarState {
6571 exportDialog : {
66- open : boolean
72+ open : boolean ;
6773 } ;
6874}
6975
70- class EditorBar extends
71- React . Component < EditorBarProps & WithStyles < 'root' | 'flex' | 'rightIcon' | 'button' > ,
72- EditorBarState > {
73- constructor ( props : EditorBarProps & WithStyles < 'root' | 'flex' | 'rightIcon' | 'button' > ) {
76+ class EditorBar extends React . Component <
77+ EditorBarProps & WithStyles < 'root' | 'flex' | 'rightIcon' | 'button' > ,
78+ EditorBarState
79+ > {
80+ constructor (
81+ props : EditorBarProps & WithStyles < 'root' | 'flex' | 'rightIcon' | 'button' >
82+ ) {
7483 super ( props ) ;
7584 this . state = {
7685 exportDialog : {
@@ -97,8 +106,9 @@ class EditorBar extends
97106
98107 handleDownload = ( ) => {
99108 const a = document . createElement ( 'a' ) ;
100- const file = new Blob ( [ JSON . stringify ( this . props . rootData , null , 2 ) ] ,
101- { type : 'application/json' } ) ;
109+ const file = new Blob ( [ JSON . stringify ( this . props . rootData , null , 2 ) ] , {
110+ type : 'application/json'
111+ } ) ;
102112 a . href = URL . createObjectURL ( file ) ;
103113 a . download = 'download.json' ;
104114 a . click ( ) ;
@@ -132,7 +142,9 @@ class EditorBar extends
132142 return ;
133143 }
134144 } else {
135- console . error ( 'Something went wrong! The file is an ArrayBuffer instead of a string.' ) ;
145+ console . error (
146+ 'Something went wrong! The file is an ArrayBuffer instead of a string.'
147+ ) ;
136148 }
137149 if ( ! isEmpty ( readData ) ) {
138150 const valid = ajv . validate ( schema , readData ) ;
@@ -159,7 +171,11 @@ class EditorBar extends
159171 < Typography variant = 'h6' color = 'inherit' className = { classes . flex } >
160172 User and Task Editor
161173 </ Typography >
162- < Button component = 'label' className = { classes . button } color = 'inherit' >
174+ < Button
175+ component = 'label'
176+ className = { classes . button }
177+ color = 'inherit'
178+ >
163179 Open Data File
164180 < FolderOpen className = { classes . rightIcon } />
165181 < input
@@ -180,11 +196,14 @@ class EditorBar extends
180196 open = { this . state . exportDialog . open }
181197 onClose = { this . handleExportDialogClose }
182198 />
183- < Button className = { classes . button } color = 'inherit' onClick = { this . handleDownload } >
199+ < Button
200+ className = { classes . button }
201+ color = 'inherit'
202+ onClick = { this . handleDownload }
203+ >
184204 Download Model
185205 < FileDownload className = { classes . rightIcon } />
186206 </ Button >
187-
188207 </ Toolbar >
189208 </ AppBar >
190209 </ div >
@@ -207,5 +226,8 @@ const mapDispatchToProps = (dispatch: any) => ({
207226
208227export default compose < any , any > (
209228 withStyles ( styles , { name : 'EditorBar' } ) ,
210- connect ( mapStateToProps , mapDispatchToProps )
229+ connect (
230+ mapStateToProps ,
231+ mapDispatchToProps
232+ )
211233) ( EditorBar ) ;
0 commit comments