Fixed not assigned group at group -> user assignment.

This commit is contained in:
Martin Edenhofer 2017-02-13 04:48:50 +01:00
parent dd75a20c6e
commit bc60edddf5
2 changed files with 7 additions and 3 deletions

View file

@ -126,11 +126,12 @@ class App.TicketOverview extends App.Controller
# clean scale # clean scale
action = @hoveredBatchEntry.attr('data-action') action = @hoveredBatchEntry.attr('data-action')
id = @hoveredBatchEntry.attr('data-id') id = @hoveredBatchEntry.attr('data-id')
groupId = @hoveredBatchEntry.attr('data-group-id')
items = @el.find('[name="bulk"]:checked') items = @el.find('[name="bulk"]:checked')
@hoveredBatchEntry.removeAttr('style') @hoveredBatchEntry.removeAttr('style')
@cleanUpDrag(true) @cleanUpDrag(true)
@performBatchAction items, action, id @performBatchAction items, action, id, groupId
@batchDragger.velocity @batchDragger.velocity
properties: properties:
scale: 0 scale: 0
@ -172,7 +173,7 @@ class App.TicketOverview extends App.Controller
easing: 'ease-in-out' easing: 'ease-in-out'
duration: 300 duration: 300
performBatchAction: (items, action, id) -> performBatchAction: (items, action, id, groupId) ->
if action is 'macro' if action is 'macro'
@batchCount = items.length @batchCount = items.length
@batchCountIndex = 0 @batchCountIndex = 0
@ -201,6 +202,8 @@ class App.TicketOverview extends App.Controller
#console.log "perform action #{action} with id #{id} on ", $(item).val() #console.log "perform action #{action} with id #{id} on ", $(item).val()
ticket = App.Ticket.find($(item).val()) ticket = App.Ticket.find($(item).val())
ticket.owner_id = id ticket.owner_id = id
if !_.isEmpty(groupId)
ticket.group_id = groupId
ticket.save( ticket.save(
done: (r) => done: (r) =>
@batchCountIndex++ @batchCountIndex++
@ -411,6 +414,7 @@ class App.TicketOverview extends App.Controller
@batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')( @batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')(
users: users users: users
groups: [] groups: []
groupId: groupId
)) ))
# then adjust the size of the group that it almost overlaps the batch-assign box # then adjust the size of the group that it almost overlaps the batch-assign box

View file

@ -1,5 +1,5 @@
<% for user in @users: %> <% for user in @users: %>
<div class="batch-overlay-assign-entry js-batch-overlay-entry" data-action="user_assign" data-id="<%= user.id %>"> <div class="batch-overlay-assign-entry js-batch-overlay-entry" data-action="user_assign" data-id="<%= user.id %>" data-group-id="<%= @groupId %>">
<div class="js-batch-hover-target"><%- user.avatar(80) %></div> <div class="js-batch-hover-target"><%- user.avatar(80) %></div>
<div class="batch-overlay-assign-entry-name"><%- user.displayName() %></div> <div class="batch-overlay-assign-entry-name"><%- user.displayName() %></div>
</div> </div>