filter by issue type
parent
0e8e3f5788
commit
18d5fd0427
|
@ -176,6 +176,16 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
obj.selected = true if isSelected("tags", obj.id)
|
obj.selected = true if isSelected("tags", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
@scope.filters.types = _.map data.types, (t) =>
|
||||||
|
obj = {
|
||||||
|
id: t[0],
|
||||||
|
name: @scope.issueTypeById[t[0]].name,
|
||||||
|
color: @scope.issueTypeById[t[0]].color
|
||||||
|
count: t[1],
|
||||||
|
type: "types"
|
||||||
|
}
|
||||||
|
obj.selected = true if isSelected("types", obj.id)
|
||||||
|
return obj
|
||||||
|
|
||||||
@rootscope.$broadcast("filters:loaded", @scope.filters)
|
@rootscope.$broadcast("filters:loaded", @scope.filters)
|
||||||
return data
|
return data
|
||||||
|
@ -200,6 +210,8 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
name = "assigned_to"
|
name = "assigned_to"
|
||||||
else if name == "statuses"
|
else if name == "statuses"
|
||||||
name = "status"
|
name = "status"
|
||||||
|
else if name == "types"
|
||||||
|
name = "type"
|
||||||
@scope.httpParams[name] = values
|
@scope.httpParams[name] = values
|
||||||
|
|
||||||
promise = @rs.issues.list(@scope.projectId, @scope.httpParams).then (data) =>
|
promise = @rs.issues.list(@scope.projectId, @scope.httpParams).then (data) =>
|
||||||
|
@ -512,7 +524,6 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
tags = $scope.filters[target.data("type")]
|
tags = $scope.filters[target.data("type")]
|
||||||
|
|
||||||
renderFilters(_.reject(tags, "selected"))
|
renderFilters(_.reject(tags, "selected"))
|
||||||
showFilters(target.attr("title"), target.data("type"))
|
showFilters(target.attr("title"), target.data("type"))
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@ section.filters
|
||||||
span.title status
|
span.title status
|
||||||
div.filters-cats
|
div.filters-cats
|
||||||
ul
|
ul
|
||||||
|
li
|
||||||
|
a(href="", title="Type", data-type="types")
|
||||||
|
span.title Type
|
||||||
|
span.icon.icon-arrow-right
|
||||||
li
|
li
|
||||||
a(href="", title="Status", data-type="statuses")
|
a(href="", title="Status", data-type="statuses")
|
||||||
span.title Status
|
span.title Status
|
||||||
|
|
Loading…
Reference in New Issue