Remove now unused history loading code and event handlers.

From issue, task and userstory details modules.
stable
Andrey Antukh 2014-09-07 12:32:20 +02:00
parent 7246c049c2
commit 3f1eff581d
3 changed files with 2 additions and 114 deletions

View File

@ -105,19 +105,6 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
}
@scope.nextUrl = @navUrls.resolve("project-issues-detail", ctx)
loadHistory: =>
return @rs.issues.history(@scope.issueId).then (history) =>
for historyResult in history
# If description was modified take only the description_html field
if historyResult.values_diff.description?
historyResult.values_diff.description = historyResult.values_diff.description_diff
delete historyResult.values_diff.description_html
delete historyResult.values_diff.description_diff
@scope.history = history
@scope.comments = _.filter(history, (item) -> item.comment != "")
loadInitialData: ->
params = {
pslug: @params.pslug
@ -132,8 +119,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
return promise.then(=> @.loadProject())
.then(=> @.loadUsersAndRoles())
.then(=> @q.all([@.loadIssue(),
@.loadAttachments(@scope.issueId),
@.loadHistory()]))
@.loadAttachments(@scope.issueId)]))
block: ->
@rootscope.$broadcast("block", @scope.issue)
@ -188,26 +174,6 @@ IssueDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
$loading.start(target)
$tgrepo.save($scope.issue).then(onSuccess, onError)
$el.on "click", ".add-comment a.button-green", (event) ->
event.preventDefault()
$el.find(".comment-list").addClass("activeanimation")
onSuccess = ->
$ctrl.loadHistory()
onError = ->
$confirm.notify("error")
$tgrepo.save($scope.issue).then(onSuccess, onError)
$el.on "focus", ".add-comment textarea", (event) ->
$(this).addClass('active')
$el.on "click", ".us-activity-tabs li a", (event) ->
$el.find(".us-activity-tabs li a").toggleClass("active")
$el.find(".us-activity section").toggleClass("hidden")
return {link:link}
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",

View File

@ -91,22 +91,6 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
}
@scope.nextUrl = @navUrls.resolve("project-tasks-detail", ctx)
loadHistory: =>
return @rs.tasks.history(@scope.taskId).then (history) =>
_.each history, (historyResult) ->
#If description was modified take only the description_html field
if historyResult.values_diff.description?
historyResult.values_diff.description = historyResult.values_diff.description_diff
if historyResult.values_diff.is_iocaine
historyResult.values_diff.is_iocaine = _.map(historyResult.values_diff.is_iocaine, (v) -> {true: 'Yes', false: 'No'}[v])
delete historyResult.values_diff.description_html
delete historyResult.values_diff.description_diff
@scope.history = history
@scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "")
loadInitialData: ->
params = {
pslug: @params.pslug
@ -126,7 +110,6 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
.then(=> @.loadUsersAndRoles())
.then(=> @.loadTask())
.then(=> @.loadAttachments(@scope.taskId))
.then(=> @.loadHistory())
block: ->
@rootscope.$broadcast("block", @scope.task)
@ -181,26 +164,6 @@ TaskDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
$loading.start(target)
$tgrepo.save($scope.task).then(onSuccess, onError)
$el.on "click", ".add-comment a.button-green", (event) ->
event.preventDefault()
$el.find(".comment-list").addClass("activeanimation")
onSuccess = ->
$ctrl.loadHistory()
onError = ->
$confirm.notify("error")
$tgrepo.save($scope.task).then(onSuccess, onError)
$el.on "focus", ".add-comment textarea", (event) ->
$(this).addClass('active')
$el.on "click", ".us-activity-tabs li a", (event) ->
$el.find(".us-activity-tabs li a").toggleClass("active")
$el.find(".us-activity section").toggleClass("hidden")
return {link:link}
module.directive("tgTaskDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",

View File

@ -106,26 +106,6 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
@scope.tasks = tasks
return tasks
loadHistory: =>
return @rs.userstories.history(@scope.usId).then (history) =>
for historyResult in history
# If description was modified take only the description_html field
if historyResult.values_diff.description?
historyResult.values_diff.description = historyResult.values_diff.description_diff
if historyResult.values_diff.client_requirement
historyResult.values_diff.client_requirement = _.map(historyResult.values_diff.client_requirement, (v) -> {true: 'Yes', false: 'No'}[v])
if historyResult.values_diff.team_requirement
historyResult.values_diff.team_requirement = _.map(historyResult.values_diff.team_requirement, (v) -> {true: 'Yes', false: 'No'}[v])
delete historyResult.values_diff.description_html
delete historyResult.values_diff.description_diff
@scope.history = history
@scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "")
return history
loadInitialData: ->
params = {
pslug: @params.pslug
@ -141,8 +121,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
.then(=> @.loadUsersAndRoles())
.then(=> @q.all([@.loadUs(),
@.loadTasks(),
@.loadAttachments(@scope.usId),
@.loadHistory()]))
@.loadAttachments(@scope.usId)]))
block: ->
@rootscope.$broadcast("block", @scope.us)
@ -198,26 +177,6 @@ UsDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
$loading.start(target)
$tgrepo.save($scope.us).then(onSuccess, onError)
$el.on "click", ".add-comment a.button-green", (event) ->
event.preventDefault()
$el.find(".comment-list").addClass("activeanimation")
onSuccess = ->
$ctrl.loadHistory()
onError = ->
$confirm.notify("error")
$tgrepo.save($scope.us).then(onSuccess, onError)
$el.on "focus", ".add-comment textarea", (event) ->
$(this).addClass('active')
$el.on "click", ".us-activity-tabs li a", (event) ->
$el.find(".us-activity-tabs li a").toggleClass("active")
$el.find(".us-activity section").toggleClass("hidden")
return {link:link}
module.directive("tgUsDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls", "$tgLoading", UsDirective])