Commit 6ef72ed5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '333229-display-issue-weight-in-milestone-cards' into 'master'

Show issue weights on Milestone view lists

See merge request gitlab-org/gitlab!64874
parents 8c7fae1f 16451a17
......@@ -65,15 +65,32 @@ $status-box-line-height: 26px;
line-height: $line-height-base;
padding: 14px 16px;
display: flex;
justify-content: space-between;
.title {
flex: 1;
flex-grow: 2;
}
.counter {
flex: 0;
padding-left: 16px;
.issuable-count-weight {
white-space: nowrap;
.counter,
.weight {
color: var(--gray-500, $gray-500);
font-weight: $gl-font-weight-bold;
}
}
&.text-white {
.issuable-count-weight svg {
fill: $white;
}
.issuable-count-weight .counter,
.weight {
color: var(--white, $white);
}
}
}
}
......
......@@ -25,3 +25,5 @@
= link_to polymorphic_path(issuable_type_args, { milestone_title: @milestone.title, assignee_id: assignee.id, state: 'all' }),
class: 'has-tooltip', title: _("Assigned to %{assignee_name}") % { assignee_name: assignee.name }, data: { container: 'body' } do
- image_tag(avatar_icon_for_user(assignee, 16), class: "avatar s16", alt: '')
= render_if_exists "shared/milestones/issuable_weight", issuable: issuable
......@@ -4,11 +4,15 @@
.card
.card-header{ class: panel_class }
.title
= title
- if show_counter
.counter
= number_with_delimiter(issuables.length)
.header.gl-mb-2
.title
= title
.issuable-count-weight.gl-ml-3
- if show_counter
%span.counter
= sprite_icon('issues', css_class: 'gl-vertical-align-text-bottom')
= number_with_delimiter(issuables.length)
= render_if_exists "shared/milestones/issuables_weight", issuables: issuables
- class_prefix = dom_class(issuables).pluralize
%ul{ class: "content-list milestone-#{class_prefix}-list", id: "#{class_prefix}-list-#{id}" }
......
- issuable = local_assigns.fetch(:issuable)
- return unless issuable.weight_available?
- return unless issuable.weight?
%span.issuable-number
= sprite_icon('weight', css_class: 'gl-vertical-align-text-bottom')
= issuable.weight
- issuables = local_assigns.fetch(:issuables)
- issuables_with_weight = issuables.select(&:weight_available?).map(&:weight).compact
- return if issuables_with_weight.empty?
%span.weight.gl-ml-3
= sprite_icon('weight', css_class: 'gl-vertical-align-text-bottom')
= issuables_with_weight.sum
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment