Fix filtering by unassigned and other related bugs on issues list.
parent
94750d8358
commit
3d13682071
|
@ -55,7 +55,7 @@ class FiltersMixin
|
||||||
selectFilter: (name, value, load=false) ->
|
selectFilter: (name, value, load=false) ->
|
||||||
params = @location.search()
|
params = @location.search()
|
||||||
if params[name] != undefined and name != "page"
|
if params[name] != undefined and name != "page"
|
||||||
existing = _.map(taiga.toString(params[name]).split(","), trim)
|
existing = _.map(taiga.toString(params[name]).split(","), (x) -> trim(x))
|
||||||
existing.push(taiga.toString(value))
|
existing.push(taiga.toString(value))
|
||||||
existing = _.compact(existing)
|
existing = _.compact(existing)
|
||||||
value = joinStr(",", _.uniq(existing))
|
value = joinStr(",", _.uniq(existing))
|
||||||
|
@ -76,7 +76,7 @@ class FiltersMixin
|
||||||
if value is undefined or value is null
|
if value is undefined or value is null
|
||||||
delete params[name]
|
delete params[name]
|
||||||
|
|
||||||
parsedValues = _.map(taiga.toString(params[name]).split(","), trim)
|
parsedValues = _.map(taiga.toString(params[name]).split(","), (x) -> trim(x))
|
||||||
newValues = _.reject(parsedValues, (x) -> x == taiga.toString(value))
|
newValues = _.reject(parsedValues, (x) -> x == taiga.toString(value))
|
||||||
newValues = _.compact(newValues)
|
newValues = _.compact(newValues)
|
||||||
|
|
||||||
|
|
|
@ -386,6 +386,11 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
filters = $scope.filters[type]
|
filters = $scope.filters[type]
|
||||||
filter = _.find(filters, {id:id})
|
filter = _.find(filters, {id:id})
|
||||||
filter.selected = (not filter.selected)
|
filter.selected = (not filter.selected)
|
||||||
|
|
||||||
|
# Convert id to null as string for properly
|
||||||
|
# put null value on url parameters
|
||||||
|
id = "null" if id is null
|
||||||
|
|
||||||
if filter.selected
|
if filter.selected
|
||||||
selectedFilters.push(filter)
|
selectedFilters.push(filter)
|
||||||
$scope.$apply ->
|
$scope.$apply ->
|
||||||
|
@ -433,7 +438,7 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
|
|
||||||
id = target.data("id")
|
id = target.data("id") or null
|
||||||
type = target.data("type")
|
type = target.data("type")
|
||||||
toggleFilterSelection(type, id)
|
toggleFilterSelection(type, id)
|
||||||
|
|
||||||
|
@ -442,11 +447,10 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
if target.hasClass("active")
|
if target.hasClass("active")
|
||||||
target.removeClass("active")
|
target.removeClass("active")
|
||||||
# target.css("background-color")
|
|
||||||
else
|
else
|
||||||
target.addClass("active")
|
target.addClass("active")
|
||||||
|
|
||||||
id = target.data("id")
|
id = target.data("id") or null
|
||||||
type = target.data("type")
|
type = target.data("type")
|
||||||
toggleFilterSelection(type, id)
|
toggleFilterSelection(type, id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue