fix timeline attachments

stable
Juanfran 2015-07-29 11:39:08 +02:00
parent 75137404e3
commit 8b2ac40c42
3 changed files with 6 additions and 4 deletions

View File

@ -20,8 +20,9 @@ class UserTimelineItemController
if type.member if type.member
@.timeline = @.timeline.set('member', type.member(@.timeline)) @.timeline = @.timeline.set('member', type.member(@.timeline))
if @.timeline.hasIn(['data', 'value_diff', 'attachments', 'new']) if @.timeline.getIn(['data', 'value_diff', 'key']) == 'attachments' &&
@.timeline = @.timeline.set('attachments', @.timeline.getIn(['data', 'value_diff', 'attachments', 'new'])) @.timeline.hasIn(['data', 'value_diff', 'value', 'new'])
@.timeline = @.timeline.set('attachments', @.timeline.getIn(['data', 'value_diff', 'value', 'new']))
getObject: (timeline, event) -> getObject: (timeline, event) ->
if timeline.get('data').get(event.obj) if timeline.get('data').get(event.obj)

View File

@ -54,7 +54,8 @@ describe "UserTimelineItemController", ->
id: 2 id: 2
}, },
value_diff: { value_diff: {
attachments: { key: 'attachments',
value: {
new: "fakeAttachment" new: "fakeAttachment"
} }
} }

View File

@ -25,5 +25,5 @@ div.activity-item
span {{::vm.timeline.getIn(['member','user', 'name'])}} span {{::vm.timeline.getIn(['member','user', 'name'])}}
p {{::vm.timeline.getIn(['member','role', 'name'])}} p {{::vm.timeline.getIn(['member','role', 'name'])}}
div(ng-repeat="attachment in vm.timeline.get('attachments')") div(tg-repeat="attachment in vm.timeline.get('attachments')")
div(tg-user-timeline-attachment="attachment") div(tg-user-timeline-attachment="attachment")