1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00
- bugfix
- Alert message added(Private planet/Team member)
This commit is contained in:
Rokt33r
2015-08-24 13:45:28 +09:00
parent bfdf691bed
commit 15133d00c7
6 changed files with 52 additions and 37 deletions

View File

@@ -50,6 +50,7 @@ module.exports = React.createClass({
} }
}, },
handleSubmit: function () { handleSubmit: function () {
this.setState({errorMessage: null}, function () {
Hq Hq
.addMember(this.props.team.name, { .addMember(this.props.team.name, {
userName: this.state.userName, userName: this.state.userName,
@@ -62,6 +63,10 @@ module.exports = React.createClass({
}.bind(this)) }.bind(this))
.catch(function (err) { .catch(function (err) {
console.error(err) console.error(err)
if (err.status === 403) {
this.setState({errorMessage: err.response.body.message})
}
}.bind(this))
}) })
}, },
handleChange: function (value) { handleChange: function (value) {
@@ -88,6 +93,8 @@ module.exports = React.createClass({
role role
</div> </div>
{this.state.errorMessage != null ? (<p className='errorAlert'>{this.state.errorMessage}</p>) : null}
<button onClick={this.handleSubmit} className='submitButton'><i className='fa fa-check'/></button> <button onClick={this.handleSubmit} className='submitButton'><i className='fa fa-check'/></button>
</div> </div>
) )

View File

@@ -71,16 +71,6 @@ module.exports = React.createClass({
openPlanetCreateModal: function () { openPlanetCreateModal: function () {
this.openModal(PlanetCreateModal, {transitionTo: this.transitionTo}) this.openModal(PlanetCreateModal, {transitionTo: this.transitionTo})
}, },
handleKeyDown: function (e) {
if (this.state.currentUser == null) return
if (e.metaKey && e.keyCode > 48 && e.keyCode < 58) {
var planet = this.state.currentUser.Planets[e.keyCode - 49]
if (planet != null) {
this.transitionTo('planet', {userName: planet.userName, planetName: planet.name})
}
e.preventDefault()
}
},
toggleProfilePopup: function () { toggleProfilePopup: function () {
this.openProfilePopup() this.openProfilePopup()
}, },

View File

@@ -42,6 +42,7 @@ module.exports = React.createClass({
} }
}, },
handleSubmit: function () { handleSubmit: function () {
this.setState({errorMessage: null}, function () {
Hq.createPlanet(this.state.ownerName, this.state.planet) Hq.createPlanet(this.state.ownerName, this.state.planet)
.then(function (res) { .then(function (res) {
var planet = res.body var planet = res.body
@@ -56,6 +57,10 @@ module.exports = React.createClass({
}.bind(this)) }.bind(this))
.catch(function (err) { .catch(function (err) {
console.error(err) console.error(err)
if (err.status === 403) {
this.setState({errorMessage: err.response.body.message})
}
}.bind(this))
}) })
}, },
render: function () { render: function () {
@@ -81,6 +86,8 @@ module.exports = React.createClass({
</select> </select>
</div> </div>
{this.state.errorMessage != null ? (<p className='errorAlert'>{this.state.errorMessage}</p>) : null}
<button onClick={this.handleSubmit} className='submitButton'> <button onClick={this.handleSubmit} className='submitButton'>
<i className='fa fa-check'/> <i className='fa fa-check'/>
</button> </button>

View File

@@ -196,7 +196,6 @@
border-radius 5px border-radius 5px
float left float left
.LaunchModal .LaunchModal
.modal-tab .modal-tab
text-align center text-align center
@@ -314,6 +313,14 @@
height 55px height 55px
circle() circle()
btnPrimary() btnPrimary()
.errorAlert
alertError()
padding 12px 10px
border-radius 5px
text-align center
display block
width 360px
margin 0 auto 15px
.ContactModal .ContactModal
padding 15px padding 15px

View File

@@ -178,6 +178,10 @@ function makeNewMainWindow () {
mainWindow.loadUrl('file://' + __dirname + '/browser/main/index.electron.html') mainWindow.loadUrl('file://' + __dirname + '/browser/main/index.electron.html')
mainWindow.webContents.on('new-window', function (e) {
e.preventDefault()
})
mainWindow.on('closed', function () { mainWindow.on('closed', function () {
console.log('main closed') console.log('main closed')
mainWindow = null mainWindow = null

View File

@@ -1,6 +1,6 @@
{ {
"name": "boost", "name": "boost",
"version": "0.2.3", "version": "0.2.5",
"description": "Boost App", "description": "Boost App",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {