Skip to content

Commit

Permalink
Merge pull request #223 from Kitware/more-fix-pyfr-simput
Browse files Browse the repository at this point in the history
More fix pyfr simput
  • Loading branch information
jourdain committed Mar 9, 2016
2 parents 04ebdb2 + 8ac4661 commit 632b5ea
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/pages/Preferences/AWS/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({

Expand Down Expand Up @@ -113,7 +115,7 @@ export default React.createClass({
return (
<div className={ style.rootContainer }>
<Toolbar
breadcrumb={breadcrumb}
breadcrumb={ awsBreadCrumb }
title="AWS EC2"
actions={[{ name: 'add', icon: style.addIcon }]}
onAction={this.addItem}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Preferences/Cluster/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { breadcrumb } from '..';

import style from 'HPCCloudStyle/PageWithMenu.mcss';

const clusterBreadCrumb = Object.assign({}, breadcrumb, { active: 1 });

const STATUS_TO_ICON = {
error: style.statusErrorIcon,
creating: style.statusCreatingIcon,
Expand Down Expand Up @@ -182,7 +184,7 @@ export default React.createClass({
return (
<div className={ style.rootContainer }>
<Toolbar
breadcrumb={ breadcrumb }
breadcrumb={ clusterBreadCrumb }
title="Clusters"
actions={[{ name: 'add', icon: style.addIcon }]}
onAction={this.addItem}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Preferences/User/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { breadcrumb } from '..';

import style from 'HPCCloudStyle/PageWithMenu.mcss';

const userBreadCrumb = Object.assign({}, breadcrumb, { active: 0 });

export default React.createClass({

displayName: 'Preferences/User',
Expand Down Expand Up @@ -46,7 +48,7 @@ export default React.createClass({
render() {
return (
<div className={ style.rootContainer }>
<Toolbar title="User" breadcrumb={breadcrumb} />
<Toolbar title="User" breadcrumb={userBreadCrumb} />
<div className={ style.container }>
<ActiveList
className={ style.menu }
Expand Down
1 change: 1 addition & 0 deletions src/pages/Preferences/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const breadcrumb = {
style.clusterIcon,
style.ec2Icon,
],
active: -1,
};

export default React.createClass({
Expand Down
7 changes: 6 additions & 1 deletion src/panels/Toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export default React.createClass({
render() {
return (
<nav className={ style.container }>
<Breadcrumb className={ style.breadcrumb } paths={ this.props.breadcrumb.paths } icons={ this.props.breadcrumb.icons } />
<Breadcrumb
className={ style.breadcrumb }
paths={ this.props.breadcrumb.paths }
icons={ this.props.breadcrumb.icons }
active={ this.props.breadcrumb.active }
/>

<div className={ style.title }>
{ this.props.title }
Expand Down
6 changes: 4 additions & 2 deletions src/widgets/Breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@ export default React.createClass({
displayName: 'LinkIcon',

propTypes: {
active: React.PropTypes.number,
className: React.PropTypes.string,
icons: React.PropTypes.array,
paths: React.PropTypes.array,
},

getDefaultProps() {
return {
active: -1,
icons: DEFAULT_BREADCRUMB_ICONS,
};
},

render() {
return (
<div className={ this.props.className }>
{this.props.paths.map((path, index) =>
<LinkIcon key={index} to={path} icon={this.props.icons[index]} />
{ this.props.paths.map((path, index) =>
<LinkIcon key={index} to={path} icon={this.props.icons[index]} className={ index === this.props.active ? style.activeBreadCrumb : ''} />
)}
</div>);
},
Expand Down
9 changes: 8 additions & 1 deletion src/widgets/LinkIcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<Link to={this.props.to}><i className={this.props.icon}></i></Link>);
return (<Link to={this.props.to}><i className={ [this.props.icon, this.props.className].join(' ') }></i></Link>);
},
});
10 changes: 7 additions & 3 deletions src/workflows/pyfr/components/steps/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
});

Expand Down
4 changes: 4 additions & 0 deletions style/Theme.mcss
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,7 @@
composes: breadCrumbIcon;
composes: fa-question from 'font-awesome/css/font-awesome.css';
}

.activeBreadCrumb {
color: #18e !important;
}

0 comments on commit 632b5ea

Please sign in to comment.