Skip to content

Commit

Permalink
Add commitMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Catsync committed Apr 26, 2018
1 parent 84097cd commit 3ec5261
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/views/artisans/BulkLevelEditComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ div.container
.campaign(v-if="campaignHandle")
h2 Campaign: {{ campaignHandle }} ({{ numLevels }} levels)
p {{ campaign.description }}
span Commit Message:
input.commit(v-model="commitMessage" ref="commitInput")
.level(v-for="level in levels")
bulk-level-editor-component(
v-bind:level="level"
Expand Down Expand Up @@ -31,6 +33,7 @@ module.exports = Vue.extend({
campaignToLoad: ''
campaign: {}
levels: {}
commitMessage: ''
computed:
numLevels: -> if @campaign?.levels then _.keys(@campaign.levels).length else 0
created: co.wrap ->
Expand All @@ -48,6 +51,10 @@ module.exports = Vue.extend({
Vue.set(@levels, original, levelData)
saveLevel: co.wrap (level) ->
console.log "SAVE LEVEL", level
unless @commitMessage
@$refs.commitInput.focus()
return
level.commitMessage = @commitMessage
yield api.levels.save(level)
levelData = yield api.levels.getByOriginal(level.original)
Vue.set(@levels, level.original, levelData)
Expand All @@ -58,5 +65,7 @@ module.exports = Vue.extend({
<style lang="sass">
#bulk-level-edit-view
.commit
width: 75%
margin-bottom: 10px
</style>

0 comments on commit 3ec5261

Please sign in to comment.