Skip to content

Commit ee6df04

Browse files
committed
[grid] Lint fixes
[skip ci]
1 parent f3094e7 commit ee6df04

16 files changed

Lines changed: 262 additions & 219 deletions

File tree

javascript/grid-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"analyze": "source-map-explorer 'build/static/js/*.js'",
2828
"test": "react-scripts test --watchAll=false --transformIgnorePatterns 'node_modules/(?!(@novnc)/)'",
2929
"eject": "react-scripts eject",
30-
"lint": "ts-standard && eslint --ext '.js,.ts,.tsx' src"
30+
"lint": "ts-standard && eslint --ext '.js,.ts,.tsx' src",
31+
"lint-fix": "ts-standard --fix && eslint --ext '.js,.ts,.tsx' src"
3132
},
3233
"eslintConfig": {
3334
"extends": "react-app"

javascript/grid-ui/src/App.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ class App extends React.Component<AppProps, AppState> {
129129
const maxSession = error !== undefined ? 0 : data?.grid?.maxSession ?? 0
130130
const sessionCount = error !== undefined ? 0 : data?.grid?.sessionCount ?? 0
131131
const nodeCount = error !== undefined ? 0 : data?.grid?.nodeCount ?? 0
132-
const sessionQueueSize = error !== undefined ? 0
132+
const sessionQueueSize = error !== undefined
133+
? 0
133134
: data?.grid?.sessionQueueSize ?? 0
134135

135136
const topBarSubheader = error ?? data?.grid?.version
@@ -155,13 +156,13 @@ class App extends React.Component<AppProps, AppState> {
155156
<main className={classes.content}>
156157
<Container maxWidth={false} className={classes.container}>
157158
<Routes>
158-
<Route path="/sessions" element={<Sessions {...this.props}/>}/>
159-
<Route path="/help" element={<Help {...this.props}/>}/>
160-
<Route path="/" element={<Overview {...this.props}/>}/>
161-
<Route path="*" element={<Help {...this.props}/>}/>
159+
<Route path='/sessions' element={<Sessions {...this.props} />} />
160+
<Route path='/help' element={<Help {...this.props} />} />
161+
<Route path='/' element={<Overview {...this.props} />} />
162+
<Route path='*' element={<Help {...this.props} />} />
162163
</Routes>
163164
</Container>
164-
<Footer/>
165+
<Footer />
165166
</main>
166167
</div>
167168
</ApolloProvider>

javascript/grid-ui/src/components/LiveView/LiveView.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ interface LiveViewProps {
3737
* The URL for which to create a remote VNC connection.
3838
* Should include the protocol, host, port, and path.
3939
*/
40-
url?: string,
40+
url?: string
4141
/**
4242
* Customize the CSS styles of the canvas element with an object.
4343
*/
44-
style?: object,
44+
style?: object
4545
/**
4646
* Specify if the remote session should be scaled locally so it fits its
4747
* container. When disabled it will be centered if the remote session is
4848
* smaller than its container, or handled according to `clipViewport` if it
4949
* is larger. Default is false.
5050
*/
51-
scaleViewport?: boolean,
51+
scaleViewport?: boolean
5252
/**
5353
* Callback to close the Live View when the PasswordDialog is prompted and
5454
* the user clicks 'Cancel'
@@ -57,7 +57,7 @@ interface LiveViewProps {
5757
}
5858

5959
interface PasswordDialogState {
60-
open: boolean,
60+
open: boolean
6161
message: string
6262
}
6363

@@ -175,11 +175,12 @@ class LiveView extends React.Component<LiveViewProps, PasswordDialogState> {
175175
onMouseEnter={this.handleMouseEnter}
176176
onMouseLeave={this.handleMouseLeave}
177177
>
178-
<PasswordDialog title={'LiveView (VNC) Password'}
179-
open={open}
180-
setOpen={this.handlePasswordDialog}
181-
onConfirm={this.handleCredentialsEntered}
182-
onCancel={this.handlePasswordDialogClose}
178+
<PasswordDialog
179+
title='LiveView (VNC) Password'
180+
open={open}
181+
setOpen={this.handlePasswordDialog}
182+
onConfirm={this.handleCredentialsEntered}
183+
onCancel={this.handlePasswordDialogClose}
183184
>
184185
{message}
185186
</PasswordDialog>

javascript/grid-ui/src/components/LiveView/PasswordDialog.tsx

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ const useStyles = makeStyles((theme: Theme) =>
3838
createStyles({
3939
root: {
4040
display: 'flex',
41-
flexWrap: 'wrap',
41+
flexWrap: 'wrap'
4242
},
4343
margin: {
44-
margin: theme.spacing(1),
44+
margin: theme.spacing(1)
4545
},
4646
withoutLabel: {
47-
marginTop: theme.spacing(3),
47+
marginTop: theme.spacing(3)
4848
},
4949
textField: {
50-
width: '25ch',
51-
},
52-
}),
50+
width: '25ch'
51+
}
52+
})
5353
)
5454

5555
interface State {
56-
amount: string;
57-
password: string;
58-
weight: string;
59-
weightRange: string;
60-
showPassword: boolean;
56+
amount: string
57+
password: string
58+
weight: string
59+
weightRange: string
60+
showPassword: boolean
6161
}
6262

6363
const PasswordDialog = (props) => {
@@ -68,7 +68,7 @@ const PasswordDialog = (props) => {
6868
password: '',
6969
weight: '',
7070
weightRange: '',
71-
showPassword: false,
71+
showPassword: false
7272
})
7373
const handleChange = (prop: keyof State) => (event: React.ChangeEvent<HTMLInputElement>) => {
7474
setValues({ ...values, [prop]: event.target.value })
@@ -81,57 +81,62 @@ const PasswordDialog = (props) => {
8181
event.preventDefault()
8282
}
8383
return (
84-
<Dialog open={open}
85-
onClose={() => setOpen(false)}
86-
aria-labelledby={'password-dialog'}
84+
<Dialog
85+
open={open}
86+
onClose={() => setOpen(false)}
87+
aria-labelledby='password-dialog'
8788
>
88-
<DialogTitle id={'password-dialog'}>{title}</DialogTitle>
89+
<DialogTitle id='password-dialog'>{title}</DialogTitle>
8990
<DialogContent>
9091
<DialogContentText>
9192
{children}
9293
</DialogContentText>
9394
<FormControl className={clsx(classes.margin, classes.textField)}>
9495
<InputLabel
95-
htmlFor="standard-adornment-password">
96+
htmlFor='standard-adornment-password'
97+
>
9698
Password
9799
</InputLabel>
98100
<Input
99-
id="standard-adornment-password"
101+
id='standard-adornment-password'
100102
autoFocus
101-
margin="dense"
103+
margin='dense'
102104
type={values.showPassword ? 'text' : 'password'}
103105
value={values.password}
104106
fullWidth
105107
onChange={handleChange('password')}
106108
endAdornment={
107-
<InputAdornment position="end">
109+
<InputAdornment position='end'>
108110
<IconButton
109-
aria-label="toggle password visibility"
111+
aria-label='toggle password visibility'
110112
onClick={handleClickShowPassword}
111113
onMouseDown={handleMouseDownPassword}
112114
>
113-
{values.showPassword ? <Visibility/> : <VisibilityOff/>}
115+
{values.showPassword ? <Visibility /> : <VisibilityOff />}
114116
</IconButton>
115117
</InputAdornment>
116118
}
117119
/>
118120
</FormControl>
119121
</DialogContent>
120122
<DialogActions>
121-
<Button variant={'contained'}
122-
onClick={() => {
123-
setOpen(false)
124-
onCancel()
125-
}}
126-
color={'secondary'}>
123+
<Button
124+
variant='contained'
125+
onClick={() => {
126+
setOpen(false)
127+
onCancel()
128+
}}
129+
color='secondary'
130+
>
127131
Cancel
128132
</Button>
129-
<Button variant={'contained'}
130-
onClick={() => {
131-
setOpen(false)
132-
onConfirm(values.password)
133-
}}
134-
color={'primary'}
133+
<Button
134+
variant='contained'
135+
onClick={() => {
136+
setOpen(false)
137+
onConfirm(values.password)
138+
}}
139+
color='primary'
135140
>
136141
Accept
137142
</Button>

javascript/grid-ui/src/components/NavBar/NavBar.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const useStyles = (theme: Theme): StyleRules => createStyles(
8383
})
8484

8585
function ListItemLink (props): JSX.Element {
86-
return <ListItem button component="a" {...props} />
86+
return <ListItem button component='a' {...props} />
8787
}
8888

8989
function NavBarBottom (props): JSX.Element {
@@ -107,9 +107,9 @@ function NavBarBottom (props): JSX.Element {
107107
<div>
108108
<Box p={3} m={1} className={classes.queueBackground}>
109109
<Typography
110-
align="center"
110+
align='center'
111111
gutterBottom
112-
variant="h4"
112+
variant='h4'
113113
>
114114
Queue size: {sessionQueueSize}
115115
</Typography>
@@ -164,27 +164,27 @@ class NavBar extends React.Component<NavBarProps, {}> {
164164
<Divider />
165165
<List>
166166
<div>
167-
<ListItemLink href="#">
167+
<ListItemLink href='#'>
168168
<ListItemIcon>
169-
<DashboardIcon/>
169+
<DashboardIcon />
170170
</ListItemIcon>
171-
<ListItemText primary="Overview"/>
171+
<ListItemText primary='Overview' />
172172
</ListItemLink>
173-
<ListItemLink href="#/sessions">
173+
<ListItemLink href='#/sessions'>
174174
<ListItemIcon>
175-
<AssessmentIcon/>
175+
<AssessmentIcon />
176176
</ListItemIcon>
177-
<ListItemText primary="Sessions"/>
177+
<ListItemText primary='Sessions' />
178178
</ListItemLink>
179-
<ListItemLink href="#/help">
179+
<ListItemLink href='#/help'>
180180
<ListItemIcon>
181-
<HelpIcon/>
181+
<HelpIcon />
182182
</ListItemIcon>
183-
<ListItemText primary="Help"/>
183+
<ListItemText primary='Help' />
184184
</ListItemLink>
185185
</div>
186186
</List>
187-
<Box flexGrow={1}/>
187+
<Box flexGrow={1} />
188188
{open && (
189189
<NavBarBottom
190190
classes={classes}

javascript/grid-ui/src/components/Node/Node.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Node extends React.Component<NodeProps, {}> {
7070
<CardContent className={classes.paddingContent}>
7171
<Grid
7272
container
73-
justifyContent="space-between"
73+
justifyContent='space-between'
7474
spacing={1}
7575
>
7676
<Grid item xs={10}>

javascript/grid-ui/src/components/Node/NodeLoad.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class NodeLoad extends React.Component<{ node: NodeInfo }, {}> {
4747
<Grid item xs={12}>
4848
<Grid
4949
container
50-
justifyContent="space-between"
50+
justifyContent='space-between'
5151
spacing={2}
5252
>
5353
<Grid item xs={3}>

javascript/grid-ui/src/components/Node/Stereotypes.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,18 @@ class Stereotypes extends React.Component<StereotypesProps, {}> {
5656
function CreateStereotypeGridItem (slotStereotype: StereotypeInfo, index: any): JSX.Element {
5757
return (
5858
<Grid item key={index}>
59-
<Grid container alignItems="center" spacing={1}>
59+
<Grid container alignItems='center' spacing={1}>
6060
<Tooltip
61-
title={JSON.stringify(slotStereotype.rawData.stereotype) ?? ''}>
62-
<Badge badgeContent={slotStereotype.slotCount} color={'primary'}
63-
className={classes.boxStyle}>
61+
title={JSON.stringify(slotStereotype.rawData.stereotype) ?? ''}
62+
>
63+
<Badge
64+
badgeContent={slotStereotype.slotCount} color='primary'
65+
className={classes.boxStyle}
66+
>
6467
<Grid item className={classes.browserVersion}>
65-
<OsLogo osName={slotStereotype.platformName} size={Size.XS}/>
66-
<BrowserLogo browserName={slotStereotype.browserName}/>
67-
<Typography variant="caption">
68+
<OsLogo osName={slotStereotype.platformName} size={Size.XS} />
69+
<BrowserLogo browserName={slotStereotype.browserName} />
70+
<Typography variant='caption'>
6871
{slotStereotype.browserVersion}
6972
</Typography>
7073
</Grid>

0 commit comments

Comments
 (0)