Skip to content

Commit

Permalink
Merge pull request #13876 from dmarcoux/request-workflow-redesign-con…
Browse files Browse the repository at this point in the history
…versation-information-hierarchy

Follow information hierarchy in conversation timeline
  • Loading branch information
Dany Marcoux committed Feb 23, 2023
2 parents 6ecbad8 + 4e36121 commit 06cfce6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
18 changes: 18 additions & 0 deletions src/api/app/assets/stylesheets/webui/timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,26 @@
position: relative;
left: $timeline-offset; // The avatars of users involved in timeline items will be displayed on the timeline border

.d-inline-flex i:first-child {
padding-top: $avatars-counter-size / 2;
height: $avatars-counter-size;
@extend .bg-white;

// Align specific icons with the timeline border, this differs depending on the icon shape
&.fa-code-commit {
padding-left: $timeline-border-width / 2;
}
&.fa-check, &.fa-comment {
padding-left: $timeline-border-width;
}
&.fa-circle, &.fa-times {
padding-left: $timeline-border-width * 2;
}
}

$timeline-item-avatar-margin: 0.5rem;
img.avatars-counter {
margin-left: $timeline-item-avatar-margin;
margin-right: $timeline-item-avatar-margin;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.d-inline-flex
%i.fas.fa-lg.fa-comment.text-dark{ title: 'Comment' }
= helpers.image_tag_for(comment.user, size: 35, custom_class: 'rounded-circle bg-light border border-gray-400 avatars-counter')
%p
%i.fas.fa-comment.text-dark{ title: 'Comment' }
= link_to(helpers.realname_with_login(comment.user), user_path(comment.user))
wrote
= link_to("#comment-#{comment.id}", title: l(comment.created_at.utc), name: "comment-#{comment.id}") do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.d-inline-flex
= icon
= helpers.image_tag_for(element.user, size: 36, custom_class: 'rounded-circle bg-light border border-gray-400 avatars-counter')
%p
= icon
= link_to(helpers.realname_with_login(element.user), user_path(element.user))
- if element.instance_of?(HistoryElement::RequestSuperseded)
superseded this request with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def initialize(element:)
def icon
case @element.type.demodulize
when 'ReviewAccepted', 'RequestAccepted'
tag.i(nil, class: 'fas fa-check text-success')
tag.i(nil, class: 'fas fa-lg fa-check text-success')
when 'ReviewDeclined', 'RequestDeclined'
tag.i(nil, class: 'fas fa-times text-danger')
tag.i(nil, class: 'fas fa-lg fa-times text-danger')
when 'RequestReviewAdded'
tag.i(nil, class: 'fas fa-2xs fa-circle text-warning')
tag.i(nil, class: 'fas fa-sm fa-circle text-warning')
else
tag.i(nil, class: 'fas fa-code-commit text-dark')
tag.i(nil, class: 'fas fa-lg fa-code-commit text-dark')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
.timeline.pb-2.ms-3{ data: { comment_counter: local_assigns[:comment_counter_id] } }
.timeline-item
.d-inline-flex
%i.fas.fa-lg.fa-code-commit.text-dark
- creator = User.find_by_login(bs_request.creator) || User.nobody
= image_tag_for(creator, size: 35, custom_class: 'rounded-circle bg-light border border-gray-400 avatars-counter')
%p
%i.fas.fa-code-commit.text-dark
= link_to(realname_with_login(creator), user_path(creator))
created this request
= link_to('#request-creation', title: I18n.l(bs_request.created_at.utc), name: 'request-creation') do
Expand Down

0 comments on commit 06cfce6

Please sign in to comment.