mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
v0.2.5
- bugfix - Alert message added(Private planet/Team member)
This commit is contained in:
@@ -50,19 +50,24 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmit: function () {
|
handleSubmit: function () {
|
||||||
Hq
|
this.setState({errorMessage: null}, function () {
|
||||||
.addMember(this.props.team.name, {
|
Hq
|
||||||
userName: this.state.userName,
|
.addMember(this.props.team.name, {
|
||||||
role: this.state.role
|
userName: this.state.userName,
|
||||||
})
|
role: this.state.role
|
||||||
.then(function (res) {
|
})
|
||||||
console.log(res.body)
|
.then(function (res) {
|
||||||
UserStore.Actions.addMember(res.body)
|
console.log(res.body)
|
||||||
this.props.close()
|
UserStore.Actions.addMember(res.body)
|
||||||
}.bind(this))
|
this.props.close()
|
||||||
.catch(function (err) {
|
}.bind(this))
|
||||||
console.error(err)
|
.catch(function (err) {
|
||||||
})
|
console.error(err)
|
||||||
|
if (err.status === 403) {
|
||||||
|
this.setState({errorMessage: err.response.body.message})
|
||||||
|
}
|
||||||
|
}.bind(this))
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleChange: function (value) {
|
handleChange: function (value) {
|
||||||
this.setState({userName: value})
|
this.setState({userName: 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>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,21 +42,26 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSubmit: function () {
|
handleSubmit: function () {
|
||||||
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
this.setState({errorMessage: null}, function () {
|
||||||
.then(function (res) {
|
Hq.createPlanet(this.state.ownerName, this.state.planet)
|
||||||
var planet = res.body
|
.then(function (res) {
|
||||||
|
var planet = res.body
|
||||||
|
|
||||||
PlanetStore.Actions.update(planet)
|
PlanetStore.Actions.update(planet)
|
||||||
|
|
||||||
if (this.props.transitionTo != null) {
|
if (this.props.transitionTo != null) {
|
||||||
this.props.transitionTo('planetHome', {userName: planet.userName, planetName: planet.name})
|
this.props.transitionTo('planetHome', {userName: planet.userName, planetName: planet.name})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.close()
|
this.props.close()
|
||||||
}.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 () {
|
||||||
var teamOptions = this.state.user.Teams.map(function (team) {
|
var teamOptions = this.state.user.Teams.map(function (team) {
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
4
main.js
4
main.js
@@ -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
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user