mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-23 06:31:58 +00:00
Save button now will display an error box with a custom link to an github issue
This commit is contained in:
@@ -134,18 +134,24 @@ var EditPage = React.createClass({
|
||||
},
|
||||
|
||||
renderSaveButton : function(){
|
||||
//if(this.state.errors){
|
||||
if(this.state.errors){
|
||||
var errMsg = '';
|
||||
try{
|
||||
errMsg += this.state.errors.toString() + '\n\n';
|
||||
errMsg += '```\n' + JSON.stringify(this.state.errors.response.error, null, ' ') + '\n```';
|
||||
}catch(e){}
|
||||
|
||||
|
||||
return <Nav.item className='save error' icon="fa-warning">
|
||||
Oops!
|
||||
<div className='errorContainer'>
|
||||
Looks like there was a problem saving. <br />
|
||||
Report the issue <a target='_blank' href={'https://github.com/stolksdorf/naturalcrit/issues/new?body='+
|
||||
encodeURIComponent(JSON.stringify(this.state.errors, null, ' '))}>
|
||||
Report the issue <a target='_blank' href={'https://github.com/stolksdorf/naturalcrit/issues/new?body='+ encodeURIComponent(errMsg)}>
|
||||
here
|
||||
</a>.
|
||||
</div>
|
||||
</Nav.item>
|
||||
//}
|
||||
}
|
||||
|
||||
if(this.state.isSaving){
|
||||
return <Nav.item className='save' icon="fa-spinner fa-spin">saving...</Nav.item>
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
.editPage{
|
||||
|
||||
.editPage{
|
||||
.navItem.save{
|
||||
width : 75px;
|
||||
text-align : center;
|
||||
&.saved{
|
||||
color : #666;
|
||||
cursor : initial;
|
||||
color : #666;
|
||||
}
|
||||
|
||||
&.error{
|
||||
position : relative;
|
||||
background-color : @red;
|
||||
|
||||
.errorContainer{
|
||||
position : absolute;
|
||||
top : 29px;
|
||||
background-color: #333;
|
||||
padding: 8px;
|
||||
width: 120px;
|
||||
left : -20px;
|
||||
z-index : 1000;
|
||||
width : 120px;
|
||||
padding : 8px;
|
||||
background-color : #333;
|
||||
a{
|
||||
color : @teal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user