diff --git a/app/coffee/modules/base/repository.coffee b/app/coffee/modules/base/repository.coffee index f6f222b9..7f841e89 100644 --- a/app/coffee/modules/base/repository.coffee +++ b/app/coffee/modules/base/repository.coffee @@ -115,18 +115,23 @@ class RepositoryService extends taiga.Service return @http.get(url, params, httpOptions).then (data) => return _.map(data.data, (x) => @model.make_model(name, x)) - queryOne: (name, id, params) -> + queryOne: (name, id, params, options={}) -> url = @urls.resolve(name) 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) - queryOneRaw: (name, id, params) -> + queryOneRaw: (name, id, params, options={}) -> url = @urls.resolve(name) url = "#{url}/#{id}" if id - - return @http.get(url, params).then (data) => + httpOptions = {headers: {}} + if not options.enablePagination + httpOptions.headers["x-disable-pagination"] = "1" + return @http.get(url, params, httpOptions).then (data) => return data.data queryPaginated: (name, params) -> diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index bccca5b3..df1f964c 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -111,7 +111,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin, tai delete historyResult.values_diff.description_diff @scope.history = history.results - @scope.comments = _.filter(history.results, (item) -> item.comment != "") + @scope.comments = _.filter(history, (item) -> item.comment != "") loadInitialData: -> params = { diff --git a/app/coffee/modules/tasks/detail.coffee b/app/coffee/modules/tasks/detail.coffee index 122b4918..29442381 100644 --- a/app/coffee/modules/tasks/detail.coffee +++ b/app/coffee/modules/tasks/detail.coffee @@ -105,7 +105,7 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin, taig delete historyResult.values_diff.description_diff @scope.history = history.results - @scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") + @scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "") loadInitialData: -> params = { diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee index fc8e300c..a502f7de 100644 --- a/app/coffee/modules/userstories/detail.coffee +++ b/app/coffee/modules/userstories/detail.coffee @@ -116,7 +116,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin, delete historyResult.values_diff.description_diff @scope.history = history.results - @scope.comments = _.filter(history.results, (historyEntry) -> historyEntry.comment != "") + @scope.comments = _.filter(history, (historyEntry) -> historyEntry.comment != "") loadInitialData: -> params = {