Add a border to items in the filters of issues-list and backlog
parent
51eb587844
commit
dfe4b81d5c
|
@ -42,14 +42,18 @@ BacklogFiltersDirective = ($log, $location) ->
|
||||||
<a class="single-filter active"
|
<a class="single-filter active"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name" <% if (f.color){ %>style="border-left: 3px solid <%= f.color %>;"<% } %>>
|
||||||
|
<%- f.name %>
|
||||||
|
</span>
|
||||||
<span class="number"><%- f.count %></span>
|
<span class="number"><%- f.count %></span>
|
||||||
</a>
|
</a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<a class="single-filter"
|
<a class="single-filter"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name" <% if (f.color){ %>style="border-left: 3px solid <%= f.color %>;"<% } %>>
|
||||||
|
<%- f.name %>
|
||||||
|
</span>
|
||||||
<span class="number"><%- f.count %></span>
|
<span class="number"><%- f.count %></span>
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
@ -61,7 +65,8 @@ BacklogFiltersDirective = ($log, $location) ->
|
||||||
<a class="single-filter selected"
|
<a class="single-filter selected"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name" <% if (f.color){ %>style="border-left: 3px solid <%= f.color %>;"<% } %>>
|
||||||
|
<%- f.name %></span>
|
||||||
<span class="icon icon-delete"></span>
|
<span class="icon icon-delete"></span>
|
||||||
</a>
|
</a>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
|
@ -156,7 +161,6 @@ BacklogFiltersDirective = ($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")
|
||||||
|
|
||||||
|
|
|
@ -309,13 +309,24 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
|
|
||||||
plainTags = _.flatten(_.map(@scope.userstories, "tags"))
|
plainTags = _.flatten(_.map(@scope.userstories, "tags"))
|
||||||
@scope.filters.tags = _.map _.countBy(plainTags), (v, k) ->
|
@scope.filters.tags = _.map _.countBy(plainTags), (v, k) ->
|
||||||
obj = {id:k, type:"tags", name: k, count:v}
|
obj = {
|
||||||
|
id: k,
|
||||||
|
type: "tags",
|
||||||
|
name: k,
|
||||||
|
count: v
|
||||||
|
}
|
||||||
obj.selected = true if isSelected("tags", obj.id)
|
obj.selected = true if isSelected("tags", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
plainStatuses = _.map(@scope.userstories, "status")
|
plainStatuses = _.map(@scope.userstories, "status")
|
||||||
@scope.filters.statuses = _.map _.countBy(plainStatuses), (v, k) =>
|
@scope.filters.statuses = _.map _.countBy(plainStatuses), (v, k) =>
|
||||||
obj = {id:k, type:"statuses", name: @scope.usStatusById[k].name, count:v}
|
obj = {
|
||||||
|
id: k,
|
||||||
|
type: "statuses",
|
||||||
|
name: @scope.usStatusById[k].name,
|
||||||
|
color: @scope.usStatusById[k].color,
|
||||||
|
count:v
|
||||||
|
}
|
||||||
obj.selected = true if isSelected("statuses", obj.id)
|
obj.selected = true if isSelected("statuses", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
@ -340,8 +351,10 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
|
|
||||||
addNewUs: (type) ->
|
addNewUs: (type) ->
|
||||||
switch type
|
switch type
|
||||||
when "standard" then @rootscope.$broadcast("usform:new", @scope.projectId, @scope.project.default_us_status)
|
when "standard" then @rootscope.$broadcast("usform:new", @scope.projectId,
|
||||||
when "bulk" then @rootscope.$broadcast("usform:bulk", @scope.projectId, @scope.project.default_us_status)
|
@scope.project.default_us_status)
|
||||||
|
when "bulk" then @rootscope.$broadcast("usform:bulk", @scope.projectId,
|
||||||
|
@scope.project.default_us_status)
|
||||||
|
|
||||||
addNewSprint: () ->
|
addNewSprint: () ->
|
||||||
@rootscope.$broadcast("sprintform:create")
|
@rootscope.$broadcast("sprintform:create")
|
||||||
|
@ -585,7 +598,9 @@ UsPointsDirective = ($repo) ->
|
||||||
showPopPoints = () ->
|
showPopPoints = () ->
|
||||||
$el.find(".pop-points-open").remove()
|
$el.find(".pop-points-open").remove()
|
||||||
$el.append(pointsTemplate({ "points": $scope.project.points }))
|
$el.append(pointsTemplate({ "points": $scope.project.points }))
|
||||||
$el.find(".pop-points-open a[data-point-id='#{us.points[updatingSelectedRoleId]}']").addClass("active")
|
dataPointId = us.points[updatingSelectedRoleId]
|
||||||
|
$el.find(".pop-points-open a[data-point-id='#{dataPointId}']").addClass("active")
|
||||||
|
|
||||||
# If not showing role selection let's move to the left
|
# If not showing role selection let's move to the left
|
||||||
if not $el.find(".pop-role:visible").css('left')?
|
if not $el.find(".pop-role:visible").css('left')?
|
||||||
$el.find(".pop-points-open").css('left', '110px')
|
$el.find(".pop-points-open").css('left', '110px')
|
||||||
|
@ -600,7 +615,8 @@ UsPointsDirective = ($repo) ->
|
||||||
return "?" if not val?
|
return "?" if not val?
|
||||||
return val
|
return val
|
||||||
|
|
||||||
_.map(rolePoints, (v, k) -> v.points = undefinedToQuestion($scope.pointsById[us.points[v.id]].value))
|
_.map rolePoints, (v, k) ->
|
||||||
|
v.points = undefinedToQuestion($scope.pointsById[us.points[v.id]].value)
|
||||||
$el.append(selectionTemplate({ "rolePoints": rolePoints }))
|
$el.append(selectionTemplate({ "rolePoints": rolePoints }))
|
||||||
$el.find(".pop-role").show()
|
$el.find(".pop-role").show()
|
||||||
|
|
||||||
|
@ -728,7 +744,8 @@ tgBacklogGraphDirective = ->
|
||||||
lines:
|
lines:
|
||||||
fillColor : "rgba(153,51,51,0.3)"
|
fillColor : "rgba(153,51,51,0.3)"
|
||||||
})
|
})
|
||||||
client_increment_line = _.map(dataToDraw.milestones, (ml) -> -ml['team-increment']-ml['client-increment'])
|
client_increment_line = _.map dataToDraw.milestones, (ml) ->
|
||||||
|
-ml['team-increment'] - ml['client-increment']
|
||||||
data.push({
|
data.push({
|
||||||
data: _.zip(milestonesRange, client_increment_line)
|
data: _.zip(milestonesRange, client_increment_line)
|
||||||
lines:
|
lines:
|
||||||
|
|
|
@ -115,23 +115,44 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
return false
|
return false
|
||||||
|
|
||||||
# Build filters data structure
|
# Build filters data structure
|
||||||
@scope.filters.tags = _.map data.tags, (t) =>
|
@scope.filters.statuses = _.map data.statuses, (t) =>
|
||||||
obj = {id:t[0], name:t[0], count: t[1], type:"tags"}
|
obj = {
|
||||||
obj.selected = true if isSelected("tags", obj.id)
|
id: t[0],
|
||||||
return obj
|
name: @scope.issueStatusById[t[0]].name,
|
||||||
|
color: @scope.issueStatusById[t[0]].color,
|
||||||
@scope.filters.priorities = _.map data.priorities, (t) =>
|
count: t[1],
|
||||||
obj = {id:t[0], name:@scope.priorityById[t[0]].name, count:t[1], type:"priorities"}
|
type: "statuses"}
|
||||||
obj.selected = true if isSelected("priorities", obj.id)
|
obj.selected = true if isSelected("statuses", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@scope.filters.severities = _.map data.severities, (t) =>
|
@scope.filters.severities = _.map data.severities, (t) =>
|
||||||
obj = {id:t[0], name:@scope.severityById[t[0]].name, count:t[1], type:"severities"}
|
obj = {
|
||||||
|
id: t[0],
|
||||||
|
name: @scope.severityById[t[0]].name,
|
||||||
|
color: @scope.severityById[t[0]].color,
|
||||||
|
count: t[1],
|
||||||
|
type: "severities"
|
||||||
|
}
|
||||||
obj.selected = true if isSelected("severities", obj.id)
|
obj.selected = true if isSelected("severities", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
@scope.filters.priorities = _.map data.priorities, (t) =>
|
||||||
|
obj = {
|
||||||
|
id: t[0],
|
||||||
|
name: @scope.priorityById[t[0]].name,
|
||||||
|
color: @scope.priorityById[t[0]].color
|
||||||
|
count: t[1],
|
||||||
|
type: "priorities"
|
||||||
|
}
|
||||||
|
obj.selected = true if isSelected("priorities", obj.id)
|
||||||
|
return obj
|
||||||
|
|
||||||
@scope.filters.assignedTo = _.map data.assigned_to, (t) =>
|
@scope.filters.assignedTo = _.map data.assigned_to, (t) =>
|
||||||
obj = {id:t[0], count:t[1], type:"assignedTo"}
|
obj = {
|
||||||
|
id:t[0],
|
||||||
|
count:t[1],
|
||||||
|
type:"assignedTo"
|
||||||
|
}
|
||||||
if t[0]
|
if t[0]
|
||||||
obj.name = @scope.usersById[t[0]].full_name_display
|
obj.name = @scope.usersById[t[0]].full_name_display
|
||||||
else
|
else
|
||||||
|
@ -140,11 +161,17 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
obj.selected = true if isSelected("assignedTo", obj.id)
|
obj.selected = true if isSelected("assignedTo", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@scope.filters.statuses = _.map data.statuses, (t) =>
|
@scope.filters.tags = _.map data.tags, (t) =>
|
||||||
obj = {id:t[0], name:@scope.issueStatusById[t[0]].name, count:t[1], type:"statuses"}
|
obj = {
|
||||||
obj.selected = true if isSelected("statuses", obj.id)
|
id: t[0],
|
||||||
|
name: t[0],
|
||||||
|
count: t[1],
|
||||||
|
type: "tags"
|
||||||
|
}
|
||||||
|
obj.selected = true if isSelected("tags", obj.id)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
||||||
@rootscope.$broadcast("filters:loaded", @scope.filters)
|
@rootscope.$broadcast("filters:loaded", @scope.filters)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@ -371,14 +398,18 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
<a class="single-filter active"
|
<a class="single-filter active"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name">
|
||||||
|
<%- f.name %>
|
||||||
|
</span>
|
||||||
<span class="number"><%- f.count %></span>
|
<span class="number"><%- f.count %></span>
|
||||||
</a>
|
</a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<a class="single-filter"
|
<a class="single-filter"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name" <% if (f.color){ %>style="border-left: 3px solid <%- f.color %>;"<% } %>>
|
||||||
|
<%- f.name %>
|
||||||
|
</span>
|
||||||
<span class="number"><%- f.count %></span>
|
<span class="number"><%- f.count %></span>
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
@ -390,7 +421,9 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
<a class="single-filter selected"
|
<a class="single-filter selected"
|
||||||
data-type="<%= f.type %>"
|
data-type="<%= f.type %>"
|
||||||
data-id="<%= f.id %>">
|
data-id="<%= f.id %>">
|
||||||
<span class="name"><%- f.name %></span>
|
<span class="name" <% if (f.color){ %>style="border-left: 3px solid <%= f.color %>;"<% } %>>
|
||||||
|
<%- f.name %>
|
||||||
|
</span>
|
||||||
<span class="icon icon-delete"></span>
|
<span class="icon icon-delete"></span>
|
||||||
</a>
|
</a>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
|
@ -454,6 +487,7 @@ IssuesFiltersDirective = ($log, $location) ->
|
||||||
|
|
||||||
# Angular Watchers
|
# Angular Watchers
|
||||||
$scope.$on "filters:loaded", (ctx, filters) ->
|
$scope.$on "filters:loaded", (ctx, filters) ->
|
||||||
|
console.log filters
|
||||||
initializeSelectedFilters(filters)
|
initializeSelectedFilters(filters)
|
||||||
|
|
||||||
selectSubjectFilter = debounce 400, (value) ->
|
selectSubjectFilter = debounce 400, (value) ->
|
||||||
|
|
Loading…
Reference in New Issue