Skip to content

Commit

Permalink
Fixed not assigned group at group -> user assignment.
Browse files Browse the repository at this point in the history
  • Loading branch information
martini committed Feb 13, 2017
1 parent dd75a20 commit bc60edd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/assets/javascripts/app/controllers/ticket_overview.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ class App.TicketOverview extends App.Controller
# clean scale
action = @hoveredBatchEntry.attr('data-action')
id = @hoveredBatchEntry.attr('data-id')
groupId = @hoveredBatchEntry.attr('data-group-id')
items = @el.find('[name="bulk"]:checked')
@hoveredBatchEntry.removeAttr('style')
@cleanUpDrag(true)

@performBatchAction items, action, id
@performBatchAction items, action, id, groupId
@batchDragger.velocity
properties:
scale: 0
Expand Down Expand Up @@ -172,7 +173,7 @@ class App.TicketOverview extends App.Controller
easing: 'ease-in-out'
duration: 300

performBatchAction: (items, action, id) ->
performBatchAction: (items, action, id, groupId) ->
if action is 'macro'
@batchCount = items.length
@batchCountIndex = 0
Expand Down Expand Up @@ -201,6 +202,8 @@ class App.TicketOverview extends App.Controller
#console.log "perform action #{action} with id #{id} on ", $(item).val()
ticket = App.Ticket.find($(item).val())
ticket.owner_id = id
if !_.isEmpty(groupId)
ticket.group_id = groupId
ticket.save(
done: (r) =>
@batchCountIndex++
Expand Down Expand Up @@ -411,6 +414,7 @@ class App.TicketOverview extends App.Controller
@batchAssignGroupInner.html $(App.view('ticket_overview/batch_overlay_user_group')(
users: users
groups: []
groupId: groupId
))

# then adjust the size of the group that it almost overlaps the batch-assign box
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% 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="batch-overlay-assign-entry-name"><%- user.displayName() %></div>
</div>
Expand Down

0 comments on commit bc60edd

Please sign in to comment.