Remove now unused history loading code and event handlers.
From issue, task and userstory details modules.stable
parent
7246c049c2
commit
3f1eff581d
|
@ -105,19 +105,6 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
||||||
}
|
}
|
||||||
@scope.nextUrl = @navUrls.resolve("project-issues-detail", ctx)
|
@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: ->
|
loadInitialData: ->
|
||||||
params = {
|
params = {
|
||||||
pslug: @params.pslug
|
pslug: @params.pslug
|
||||||
|
@ -132,8 +119,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProject())
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @q.all([@.loadIssue(),
|
.then(=> @q.all([@.loadIssue(),
|
||||||
@.loadAttachments(@scope.issueId),
|
@.loadAttachments(@scope.issueId)]))
|
||||||
@.loadHistory()]))
|
|
||||||
|
|
||||||
block: ->
|
block: ->
|
||||||
@rootscope.$broadcast("block", @scope.issue)
|
@rootscope.$broadcast("block", @scope.issue)
|
||||||
|
@ -188,26 +174,6 @@ IssueDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
|
||||||
$loading.start(target)
|
$loading.start(target)
|
||||||
$tgrepo.save($scope.issue).then(onSuccess, onError)
|
$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}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",
|
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",
|
||||||
|
|
|
@ -91,22 +91,6 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
|
||||||
}
|
}
|
||||||
@scope.nextUrl = @navUrls.resolve("project-tasks-detail", ctx)
|
@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: ->
|
loadInitialData: ->
|
||||||
params = {
|
params = {
|
||||||
pslug: @params.pslug
|
pslug: @params.pslug
|
||||||
|
@ -126,7 +110,6 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @.loadTask())
|
.then(=> @.loadTask())
|
||||||
.then(=> @.loadAttachments(@scope.taskId))
|
.then(=> @.loadAttachments(@scope.taskId))
|
||||||
.then(=> @.loadHistory())
|
|
||||||
|
|
||||||
block: ->
|
block: ->
|
||||||
@rootscope.$broadcast("block", @scope.task)
|
@rootscope.$broadcast("block", @scope.task)
|
||||||
|
@ -181,26 +164,6 @@ TaskDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
|
||||||
$loading.start(target)
|
$loading.start(target)
|
||||||
$tgrepo.save($scope.task).then(onSuccess, onError)
|
$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}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgTaskDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",
|
module.directive("tgTaskDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",
|
||||||
|
|
|
@ -106,26 +106,6 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
|
||||||
@scope.tasks = tasks
|
@scope.tasks = tasks
|
||||||
return 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: ->
|
loadInitialData: ->
|
||||||
params = {
|
params = {
|
||||||
pslug: @params.pslug
|
pslug: @params.pslug
|
||||||
|
@ -141,8 +121,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
|
||||||
.then(=> @.loadUsersAndRoles())
|
.then(=> @.loadUsersAndRoles())
|
||||||
.then(=> @q.all([@.loadUs(),
|
.then(=> @q.all([@.loadUs(),
|
||||||
@.loadTasks(),
|
@.loadTasks(),
|
||||||
@.loadAttachments(@scope.usId),
|
@.loadAttachments(@scope.usId)]))
|
||||||
@.loadHistory()]))
|
|
||||||
block: ->
|
block: ->
|
||||||
@rootscope.$broadcast("block", @scope.us)
|
@rootscope.$broadcast("block", @scope.us)
|
||||||
|
|
||||||
|
@ -198,26 +177,6 @@ UsDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
|
||||||
$loading.start(target)
|
$loading.start(target)
|
||||||
$tgrepo.save($scope.us).then(onSuccess, onError)
|
$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}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgUsDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls", "$tgLoading", UsDirective])
|
module.directive("tgUsDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls", "$tgLoading", UsDirective])
|
||||||
|
|
Loading…
Reference in New Issue