Skip to content

Commit

Permalink
Changed new stories to be top ranked in story list view
Browse files Browse the repository at this point in the history
  • Loading branch information
psaalton authored and betelgeuse committed Feb 16, 2012
1 parent 1a206e0 commit 7a616f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/fi/hut/soberit/agilefant/business/impl/StoryBusinessImpl.java
Expand Up @@ -183,9 +183,9 @@ public Story updateStoryRanks(Story story) {
}

private void createStoryRanks(Story story, Backlog backlog) {
if(!(backlog instanceof Product)) {
if(!(backlog instanceof Product)) {
this.storyRankBusiness.rankToBottom(story, backlog);
if (backlog instanceof Iteration) {
if (backlog instanceof Iteration) {
this.storyRankBusiness.rankToBottom(story, backlog.getParent());
}
}
Expand Down Expand Up @@ -261,8 +261,14 @@ public Story create(Story dataItem, Integer backlogId,
Set<Integer> responsibleIds, List<String> labelNames) throws IllegalArgumentException,
ObjectNotFoundException {

Story persisted = this.persistNewStory(dataItem, backlogId, responsibleIds);
storyHierarchyBusiness.moveToBottom(persisted);
Story persisted = this.persistNewStory(dataItem, backlogId, responsibleIds);

//old - prevents tree view from exploding until it's fixed
storyHierarchyBusiness.moveToBottom(persisted);

//new
storyRankBusiness.rankToHead(persisted, backlogBusiness.retrieve(backlogId));

this.labelBusiness.createStoryLabels(labelNames, persisted.getId());
return persisted;
}
Expand Down
1 change: 1 addition & 0 deletions web/static/js/dynamics/model/StoryModel.js
Expand Up @@ -186,6 +186,7 @@ StoryModel.prototype._saveData = function(id, changedData) {
if(!id) {
possibleBacklog.addStory(object);
object.callListeners(new DynamicsEvents.AddEvent(object));
possibleBacklog.callListeners(new DynamicsEvents.RankChanged(possibleBacklog,"story"));
}
},
error: function(xhr, status, error) {
Expand Down

0 comments on commit 7a616f5

Please sign in to comment.