Issue 2748 - add us reference in task timeline

stable
Juanfran 2015-06-01 10:15:22 +02:00
parent 0404d28aa3
commit 1a64e7d74e
3 changed files with 19 additions and 1 deletions

View File

@ -1171,6 +1171,7 @@
"US_UPDATED": "{{username}} has updated the attribute \"{{field_name}}\" of the US {{obj_name}}",
"ISSUE_UPDATED": "{{username}} has updated the attribute \"{{field_name}}\" of the Issue {{obj_name}}",
"TASK_UPDATED": "{{username}} has updated the attribute \"{{field_name}}\" of the Task {{obj_name}}",
"TASK_UPDATED_WITH_US": "{{username}} has updated the attribute \"{{field_name}}\" of the Task {{obj_name}} which belongs to the US {{us_name}}",
"WIKI_UPDATED": "{{username}} has update the Wiki page {{obj_name}}",
"NEW_COMMENT_US": "{{username}} has commented in the US {{obj_name}}",
"NEW_COMMENT_ISSUE": "{{username}} has commented in the Issue {{obj_name}}",

View File

@ -41,6 +41,16 @@ class UserTimelineItemTitle
return @._getLink(url, timeline.data.milestone.name)
else if param == 'us_name'
obj = @._getTimelineObj(timeline, event).userstory
event_us = {obj: 'parent_userstory'}
url = @._getDetailObjUrl(event_us)
text = '#' + obj.ref + ' ' + obj.subject
return @._getLink(url, text)
else if param == 'obj_name'
obj = @._getTimelineObj(timeline, event)
url = @._getDetailObjUrl(event)
@ -63,6 +73,7 @@ class UserTimelineItemTitle
"wikipage": ["project-wiki-page", ":project=vm.activity.project.slug,slug=vm.activity.obj.slug"],
"task": ["project-tasks-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.ref"],
"userstory": ["project-userstories-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.ref"],
"parent_userstory": ["project-userstories-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.userstory.ref"],
"milestone": ["project-taskboard", ":project=vm.activity.project.slug,sprint=vm.activity.obj.slug"]
}

View File

@ -144,9 +144,15 @@ timelineType = (timeline, event) ->
},
{ # TaskUpdated
check: (timeline, event) ->
return event.obj == 'task' && event.type == 'change'
return event.obj == 'task' && event.type == 'change' && !timeline.data.task.userstory
key: 'TIMELINE.TASK_UPDATED',
translate_params: ['username', 'field_name', 'obj_name']
},
{ # TaskUpdated with US
check: (timeline, event) ->
return event.obj == 'task' && event.type == 'change' && timeline.data.task.userstory
key: 'TIMELINE.TASK_UPDATED_WITH_US',
translate_params: ['username', 'field_name', 'obj_name', 'us_name']
}
]