Skip to content

Commit 5654680

Browse files
author
rodriguez-facundo
committed
#136 Styling FileBrowser
1 parent ba5a1db commit 5654680

11 files changed

Lines changed: 874 additions & 28 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ def deleteParam(self, model, label):
512512
return False
513513

514514
def validateFunction(self, functionString):
515+
if isinstance(functionString, (float, int)):
516+
return True
515517
return validateFunction(functionString, self.netParams.__dict__)
516518

517519
def exportHLS(self, args):

webapp/Main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jQuery(function () {
1717
require('./css/material.less');
1818
require('./css/traceback.less');
1919
require('./css/flexlayout.less');
20+
require('./css/tree.less');
2021

2122
const store = configureStore();
2223

webapp/components/general/FileBrowser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Tree from 'geppetto-client/js/components/interface/tree/Tree'
2+
import Tree from '@geppettoengine/geppetto-client/js/components/interface/tree/Tree'
33
import Utils from '../../Utils';
44
import Button from '@material-ui/core/Button';
55
import { changeNodeAtPath } from 'react-sortable-tree';
@@ -142,7 +142,7 @@ export default class FileBrowser extends React.Component {
142142
onClose={() => this.props.onRequestClose()}
143143
>
144144
<DialogContent>
145-
<div style={{ marginBottom: '15px' }}>
145+
<div style={{ marginBottom: '15px', color: 'white' }}>
146146
<b>{selectMessage}</b>
147147
These paths are relative to:<br/>
148148
<div className="flex-row fx-center ">

webapp/components/general/HTMLViewer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ class CustomHTMLViewer extends Component {
5252
adjustSVGSize () {
5353
const svg = this.getSvgComponent()
5454
if (svg) {
55+
const width = (this.dimensions.width - 20) > 0 ? `${this.dimensions.width - 20}px` : '0px'
56+
const height = (this.dimensions.height - 20) > 0 ? `${this.dimensions.height - 20}px` : '0px'
5557
svg.removeAttribute('width');
5658
svg.removeAttribute('height');
57-
svg.setAttribute('width', `${this.dimensions.width - 20}px`);
58-
svg.setAttribute('height', `${this.dimensions.height - 20}px`);
59+
svg.setAttribute('width', width);
60+
svg.setAttribute('height', height);
5961
}
6062

6163
}

webapp/components/layout/layoutConf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"children": [
1717
{
1818
"type": "row",
19-
"weight": 80,
19+
"weight": 65,
2020
"children": [
2121
{
2222
"type": "tabset",
@@ -30,7 +30,7 @@
3030
},
3131
{
3232
"type": "row",
33-
"weight": 20,
33+
"weight": 35,
3434
"children": [
3535
{
3636
"type": "tabset",

webapp/components/layout/simulateLayoutConf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"children": [
3030
{
3131
"type": "row",
32-
"weight": 60,
32+
"weight": 65,
3333
"children": [
3434
{
3535
"type": "tabset",
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"type": "row",
46-
"weight": 40,
46+
"weight": 35,
4747
"children": [
4848
{
4949
"type": "tabset",

webapp/components/settings/NetPyNETabs.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ class NetPyNETabs extends React.Component {
4848
}
4949
handleChange = tab => {
5050
if (tab == "define") {
51-
this.props.editModel();
52-
this.setState({ editTab: true })
51+
if (!this.props.editMode) {
52+
this.props.editModel();
53+
this.setState({ editTab: true })
54+
}
55+
5356
} else {
54-
this.rightTabAction();
55-
this.setState({ editTab: false })
57+
if (this.props.editMode) {
58+
this.rightTabAction();
59+
this.setState({ editTab: false })
60+
}
5661
}
5762
};
5863

webapp/components/settings/actions/NewModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class NewModel extends React.Component {
1717
title={"Create new model"}
1818
{...this.props}
1919
>
20-
<h4>The current model will be deleted</h4>
20+
<h4 style={{ color: 'white' }}>The current model will be deleted</h4>
2121
</ActionDialog>
2222
)
2323
}

webapp/components/settings/actions/UploadDownloadFiles.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import FileBrowser from '../../general/FileBrowser';
1414

1515
import { withStyles } from '@material-ui/core/styles';
1616

17-
const styles = ({ spacing, typography, zIndex }) => ({
17+
const styles = ({ spacing, typography, zIndex, palette }) => ({
18+
root: { color: palette.common.white },
1819
container: {
1920
marginTop: spacing(2),
2021
display: 'flex',
@@ -200,7 +201,7 @@ class UploadDownloadFile extends React.Component {
200201
switch (mode) {
201202
case 'UPLOAD':
202203
var content = (
203-
<div>
204+
<div className={classes.root}>
204205
<div className={classes.container}>
205206
<div >
206207
<input
@@ -221,7 +222,7 @@ class UploadDownloadFile extends React.Component {
221222
break;
222223
case 'DOWNLOAD':
223224
var content = (
224-
<div>
225+
<div className={classes.root}>
225226
<div className={classes.container}>
226227
<IconButton
227228
className={classes.icon}

0 commit comments

Comments
 (0)