Skip to content

Commit

Permalink
Fixed prepath bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mitraman committed Aug 26, 2017
1 parent 9d22972 commit 47b96da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ module.exports = function(config) {
}
]
},
stats: {
assets: false,
warnings: true,
errors: true,
errorDetails: true
},
resolve: {
extensions: ['', '.js', '.jsx']
},
Expand Down
6 changes: 6 additions & 0 deletions src/js/modules/Sketch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,15 @@ export default class extends React.Component{
{word: 'word 4', sketches: []}
]

let prePath = '';
if( this.state.selectedNode.id ) {
prePath = this.state.treeHash[this.state.selectedNode.id].fullpath;
}

let EditPane = this.state.selectedNode ?
<NodeEditor
node={this.state.selectedNode}
prePath ={prePath}
uriChangeHandler={(id,val)=>{this.uriChanged(id,val)}}
dataChangeHandler={(id,key,fields)=>{this.dataChanged(id,key,fields)}}
/> : <div/>;
Expand Down
4 changes: 1 addition & 3 deletions src/js/modules/sketch/NodeEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ export default class extends React.Component{
super(props);
this.state = {
url: this.props.node.name,
prePath : this.props.node.prePath + '/',
requestParams: '?'
}
}

componentWillReceiveProps(nextProps){
if(nextProps.node.id != this.props.node.id) {
this.setState({url: nextProps.node.name});
this.setState({prePath: nextProps.node.prePath});
}
}

Expand Down Expand Up @@ -49,7 +47,7 @@ export default class extends React.Component{
<div>
<form>
<div className="input-group form-group-sm">
<span className="input-group-addon" id="basic-addon1">{this.state.prePath}</span>
<span className="input-group-addon" id="basic-addon1">{this.props.prePath}</span>
<input
className="form-control"
type="text"
Expand Down

0 comments on commit 47b96da

Please sign in to comment.