Wrong fields in the Activity entries

stable
Alejandro Alonso 2015-09-30 12:19:40 +02:00 committed by Juanfran
parent e19ce59427
commit c7070dc96b
2 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,14 @@ debounce = @.taiga.debounce
module = angular.module("taigaCommon") module = angular.module("taigaCommon")
IGNORED_FIELDS = {
"userstories.userstory": [
"watchers", "kanban_order", "backlog_order", "sprint_order", "finish_date"
]
"tasks.task": [
"watchers", "us_order", "taskboard_order"
]
}
############################################################################# #############################################################################
## History Directive (Main) ## History Directive (Main)
@ -254,6 +262,10 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c
return templateChangeGeneric({name:name, from:from, to: to}) return templateChangeGeneric({name:name, from:from, to: to})
renderChangeEntries = (change) -> renderChangeEntries = (change) ->
changeModel = change.key.split(":")[0]
if IGNORED_FIELDS[changeModel]?
change.values_diff = _.removeKeys(change.values_diff, IGNORED_FIELDS[changeModel])
return _.map(change.values_diff, (value, field) -> renderChangeEntry(field, value)) return _.map(change.values_diff, (value, field) -> renderChangeEntry(field, value))
renderChangesHelperText = (change) -> renderChangesHelperText = (change) ->

View File

@ -185,6 +185,13 @@ defineImmutableProperty = (obj, name, fn) =>
return fn_result return fn_result
} }
_.mixin
removeKeys: (obj, keys) ->
_.chain([keys]).flatten().reduce(
(obj, key) ->
delete obj[key]; obj
, obj).value()
taiga = @.taiga taiga = @.taiga
taiga.nl2br = nl2br taiga.nl2br = nl2br
taiga.bindMethods = bindMethods taiga.bindMethods = bindMethods