Skip to content

Commit 6c42aa2

Browse files
author
rodriguez-facundo
committed
#143 Move filter inside breadcrumb and style
1 parent 06b89e2 commit 6c42aa2

5 files changed

Lines changed: 27 additions & 24 deletions

File tree

webapp/components/definition/populations/NetPyNEPopulations.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import ExpansionPanel from '../../general/ExpansionPanel'
1515

1616
import Dialog from '@material-ui/core/Dialog/Dialog';
1717
import Button from '@material-ui/core/Button';
18+
import Divider from '@material-ui/core/Divider';
1819

1920
export default class NetPyNEPopulations extends React.Component {
2021

@@ -210,15 +211,17 @@ export default class NetPyNEPopulations extends React.Component {
210211
handleClick={this.handleNewPopulation}
211212
/>
212213
</div>
214+
<Divider />
213215
<RulePath text={`netParams.popParams["${this.state.selectedPopulation}"]`}/>
216+
<Divider />
217+
<Filter
218+
value={this.state.filterPopValue}
219+
label="Filter population by name..."
220+
handleFilterChange={newValue => this.setState({ filterPopValue: newValue })}
221+
options={model === undefined ? [] : Object.keys(model)}
222+
/>
214223
</ExpansionPanel>
215-
216-
<Filter
217-
value={this.state.filterPopValue}
218-
label="Filter population by name..."
219-
handleFilterChange={newValue => this.setState({ filterPopValue: newValue })}
220-
options={model === undefined ? [] : Object.keys(model)}
221-
/>
224+
222225

223226
</div>
224227

webapp/components/general/Filter.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ import Tooltip from './Tooltip'
1010

1111
const styles = ({ spacing, shape }) => ({
1212
root: {
13-
marginTop: spacing(1),
14-
marginBottom: spacing(1),
1513
display: 'flex',
1614
backgroundColor: bgRegular,
1715
borderRadius: shape.borderRadius
1816
},
19-
adornment: { display: 'flex', alignItems: 'center', paddingLeft: spacing(1) },
17+
adornment: { display: 'flex', alignItems: 'center', paddingLeft: spacing(1), paddingTop: spacing(1) },
2018
filter: { flex: 1, paddingRight: spacing(1), paddingTop: spacing(1), paddingBottom: spacing(1) },
2119
underline: {
22-
"&&&:before": { borderBottom: "none" },
23-
"&&:after": { borderBottom: "none" }
20+
"&&&:before": { },
21+
"&&:after": { }
2422
},
2523
listbox: { color: 'white', maxHeight: '20vh' }
2624
})
@@ -32,7 +30,7 @@ class Filter extends Component {
3230
return (
3331
<div className={classes.root}>
3432
<div className={classes.adornment}>
35-
<Icon className="fa fa-filter"/>
33+
<Icon className="fa fa-filter" fontSize="small"/>
3634
</div>
3735

3836
<Autocomplete

webapp/components/general/RulePath.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { withStyles } from '@material-ui/core/styles'
88
import Typography from '@material-ui/core/Typography'
99

1010
const styles = ({ spacing, palette }) => ({
11-
root: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%', margin: `0px ${spacing(1)}px ${spacing(1)}px ${spacing(1)}px` },
11+
root: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', margin: `0px ${spacing(1)}px 0px ${spacing(1)}px` },
1212
text: { color: palette.text.secondary },
1313
icon: { marginRight: 2 }
1414
})

webapp/components/settings/Drawer.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,19 @@ export default ({ newWidget, editMode, activateWidget, updateWidget }) => {
6969
const mapItem = ({ name, id }) => {
7070
const widget = layoutManager.getWidget(id);
7171

72-
const item = (<ListItem button key={name} dense disableGutters className={widget ? classes.selected : classes.unselected} onClick={() => createOrFocusWidget(id)}>
73-
<ListItemIcon className={classes.icon}>
74-
<DrawerIcon widgetId={id} selected={widget && widget.status !== WidgetStatus.MINIMIZED} />
75-
</ListItemIcon>
76-
<ListItemText className={classes.text}>
77-
<Typography noWrap>{name}</Typography>
78-
</ListItemText>
79-
</ListItem>)
72+
const item = (
73+
<ListItem button key={name} dense disableGutters className={widget ? classes.selected : classes.unselected} onClick={() => createOrFocusWidget(id)}>
74+
<ListItemIcon className={classes.icon}>
75+
<DrawerIcon widgetId={id} selected={widget && widget.status !== WidgetStatus.MINIMIZED} />
76+
</ListItemIcon>
77+
<ListItemText className={classes.text}>
78+
<Typography noWrap>{name}</Typography>
79+
</ListItemText>
80+
</ListItem>
81+
)
8082

8183
// Show tooltip only when drawer is collapsed
82-
return expand ? item : <Tooltip title={widget.name} placement="right">{item}</Tooltip>
84+
return expand ? item : <Tooltip key={name} title={widget.name} placement="right">{item}</Tooltip>
8385

8486

8587
};

webapp/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default createMuiTheme({
7171
content: { margin: '0px!important', cursor: 'auto' },
7272
expandIcon: { marginRight: 0 }
7373
},
74-
MuiExpansionPanelDetails: { root: { padding: 0, margin: 0, minHeight: 'unset!important' } },
74+
MuiExpansionPanelDetails: { root: { padding: 0, margin: 0, minHeight: 'unset!important', flexDirection: 'column' } },
7575
MuiExpansionPanel: { root: { padding: 0, margin: '0px!important', minHeight: 'unset' } },
7676
MuiAutocomplete: { popupIndicator: { marginRight: 0 } }
7777
}

0 commit comments

Comments
 (0)