Fix bug #1088: Incorrect order of USs in backlog page

stable
David Barragán Merino 2014-09-24 19:41:30 +02:00
parent a167a1a6dc
commit 044ad0b090
3 changed files with 9 additions and 3 deletions

View File

@ -116,6 +116,10 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
loadSprints: ->
return @rs.sprints.list(@scope.projectId).then (sprints) =>
# NOTE: Fix order of USs because the filter orderBy does not work propertly in partials files
for sprint in sprints
sprint.user_stories = _.sortBy(sprint.user_stories, "sprint_order")
@scope.sprints = sprints
@scope.sprintsCounter = sprints.length
@scope.sprintsById = groupBy(sprints, (x) -> x.id)
@ -147,7 +151,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
return @rs.userstories.listUnassigned(@scope.projectId, @scope.httpParams)
return promise.then (userstories) =>
@scope.userstories = userstories
# NOTE: Fix order of USs because the filter orderBy does not work propertly in the partials files
@scope.userstories = _.sortBy(userstories, "backlog_order")
@.generateFilters()
@.filterVisibleUserstories()

View File

@ -1,4 +1,4 @@
div.row.us-item-row(ng-repeat="us in visibleUserstories|orderBy:order track by us.id", tg-draggable, ng-class="{blocked: us.is_blocked}")
div.row.us-item-row(ng-repeat="us in visibleUserstories track by us.id", tg-draggable, ng-class="{blocked: us.is_blocked}")
div.user-stories
div.tags-block(tg-colorize-tags="us.tags", tg-colorize-tags-type="backlog")
div.user-story-name

View File

@ -28,7 +28,7 @@ section.sprints
span.description total
div.sprint-progress-bar(tg-progress-bar="100 * sprint.closed_points / total_points")
div.sprint-table(tg-sprint-sortable)
div.row.milestone-us-item-row(ng-repeat="us in sprint.user_stories|orderBy:order track by us.id")
div.row.milestone-us-item-row(ng-repeat="us in sprint.user_stories track by us.id")
div.column-us.width-8
a.us-name.clickable(tg-nav="project-userstories-detail:project=project.slug,ref=us.ref", title="")
span(tg-bo-ref="us.ref")