From 5a5c37b505cb0fa0405f64011bb0e654124c4f0b Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Wed, 9 Mar 2016 13:41:42 -0700 Subject: [PATCH 1/2] fix(BreadCrumb): Fix breadcrumb usage for preference using Active color closes: #172 --- src/pages/Preferences/AWS/index.js | 4 +++- src/pages/Preferences/Cluster/index.js | 4 +++- src/pages/Preferences/User/index.js | 4 +++- src/pages/Preferences/index.js | 1 + src/panels/Toolbar/index.js | 7 ++++++- src/widgets/Breadcrumb/index.js | 6 ++++-- src/widgets/LinkIcon/index.js | 9 ++++++++- style/Theme.mcss | 4 ++++ 8 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/pages/Preferences/AWS/index.js b/src/pages/Preferences/AWS/index.js index 8577662e..fc2f85c4 100644 --- a/src/pages/Preferences/AWS/index.js +++ b/src/pages/Preferences/AWS/index.js @@ -9,6 +9,8 @@ import { breadcrumb } from '..'; import style from 'HPCCloudStyle/PageWithMenu.mcss'; +const awsBreadCrumb = Object.assign({}, breadcrumb, { active: 2 }); + /* eslint-disable no-alert */ export default React.createClass({ @@ -113,7 +115,7 @@ export default React.createClass({ return (
- +
- +
{ this.props.title } diff --git a/src/widgets/Breadcrumb/index.js b/src/widgets/Breadcrumb/index.js index 082f8a64..47b9fece 100644 --- a/src/widgets/Breadcrumb/index.js +++ b/src/widgets/Breadcrumb/index.js @@ -18,6 +18,7 @@ export default React.createClass({ displayName: 'LinkIcon', propTypes: { + active: React.PropTypes.number, className: React.PropTypes.string, icons: React.PropTypes.array, paths: React.PropTypes.array, @@ -25,6 +26,7 @@ export default React.createClass({ getDefaultProps() { return { + active: -1, icons: DEFAULT_BREADCRUMB_ICONS, }; }, @@ -32,8 +34,8 @@ export default React.createClass({ render() { return (
- {this.props.paths.map((path, index) => - + { this.props.paths.map((path, index) => + )}
); }, diff --git a/src/widgets/LinkIcon/index.js b/src/widgets/LinkIcon/index.js index be134776..9d999acf 100644 --- a/src/widgets/LinkIcon/index.js +++ b/src/widgets/LinkIcon/index.js @@ -5,11 +5,18 @@ export default React.createClass({ displayName: 'LinkIcon', propTypes: { + className: React.PropTypes.string, icon: React.PropTypes.string, to: React.PropTypes.string, }, + getDefaultProps() { + return { + className: '', + }; + }, + render() { - return (); + return (); }, }); diff --git a/style/Theme.mcss b/style/Theme.mcss index 1727016a..cfc0161b 100644 --- a/style/Theme.mcss +++ b/style/Theme.mcss @@ -162,3 +162,7 @@ composes: breadCrumbIcon; composes: fa-question from 'font-awesome/css/font-awesome.css'; } + +.activeBreadCrumb { + color: #18e !important; +} From 8ac466165ab59542f800a0e71d2d962a457c933f Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Wed, 9 Mar 2016 13:42:58 -0700 Subject: [PATCH 2/2] fix(Simput): Fix serialization/deserialization issue with simput model --- src/workflows/pyfr/components/steps/Input/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/workflows/pyfr/components/steps/Input/index.js b/src/workflows/pyfr/components/steps/Input/index.js index aefb286b..c693252c 100644 --- a/src/workflows/pyfr/components/steps/Input/index.js +++ b/src/workflows/pyfr/components/steps/Input/index.js @@ -93,11 +93,15 @@ export default React.createClass({ metadata: { model: JSON.stringify(jsonData) }, }).then((resp) => { var newSim = deepClone(this.props.simulation); - newSim.steps[this.props.step].metadata.model = jsonData; + newSim.steps[this.props.step].metadata.model = JSON.stringify(jsonData); client.invalidateSimulation(newSim); }); } else { - jsonData = JSON.parse(jsonData); + if (typeof jsonData === 'string') { + jsonData = JSON.parse(jsonData); + } else { + console.log('Can not convert jsonData (?)', jsonData); + } } // Push model to state @@ -116,7 +120,7 @@ export default React.createClass({ metadata: { model: JSON.stringify(jsonData) }, }).then((resp) => { var newSim = deepClone(this.props.simulation); - newSim.steps[this.props.step].metadata.model = jsonData; + newSim.steps[this.props.step].metadata.model = JSON.stringify(jsonData); client.invalidateSimulation(newSim); });