Fixing lost comments in issue

stable
Alejandro Alonso 2014-08-28 13:11:35 +02:00
parent 9b857c172e
commit 466d04bf65
4 changed files with 13 additions and 8 deletions

View File

@ -115,18 +115,23 @@ class RepositoryService extends taiga.Service
return @http.get(url, params, httpOptions).then (data) => return @http.get(url, params, httpOptions).then (data) =>
return _.map(data.data, (x) => @model.make_model(name, x)) return _.map(data.data, (x) => @model.make_model(name, x))
queryOne: (name, id, params) -> queryOne: (name, id, params, options={}) ->
url = @urls.resolve(name) url = @urls.resolve(name)
url = "#{url}/#{id}" if id url = "#{url}/#{id}" if id
httpOptions = {headers: {}}
if not options.enablePagination
httpOptions.headers["x-disable-pagination"] = "1"
return @http.get(url, params).then (data) => return @http.get(url, params, httpOptions).then (data) =>
return @model.make_model(name, data.data) return @model.make_model(name, data.data)
queryOneRaw: (name, id, params) -> queryOneRaw: (name, id, params, options={}) ->
url = @urls.resolve(name) url = @urls.resolve(name)
url = "#{url}/#{id}" if id url = "#{url}/#{id}" if id
httpOptions = {headers: {}}
return @http.get(url, params).then (data) => if not options.enablePagination
httpOptions.headers["x-disable-pagination"] = "1"
return @http.get(url, params, httpOptions).then (data) =>
return data.data return data.data
queryPaginated: (name, params) -> queryPaginated: (name, params) ->

View File

@ -111,7 +111,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai
delete historyResult.values_diff.description_diff delete historyResult.values_diff.description_diff
@scope.history = history.results @scope.history = history.results
@scope.comments = _.filter(history.results, (item) -> item.comment != "") @scope.comments = _.filter(history, (item) -> item.comment != "")
loadInitialData: -> loadInitialData: ->
params = { params = {

View File

@ -105,7 +105,7 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig
delete historyResult.values_diff.description_diff delete historyResult.values_diff.description_diff
@scope.history = history.results @scope.history = history.results
@scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") @scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "")
loadInitialData: -> loadInitialData: ->
params = { params = {

View File

@ -116,7 +116,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin,
delete historyResult.values_diff.description_diff delete historyResult.values_diff.description_diff
@scope.history = history.results @scope.history = history.results
@scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") @scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "")
loadInitialData: -> loadInitialData: ->
params = { params = {