Commit ecfbb963 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'member_timeago' into 'master'

Add information when member joined a team

## What does this MR do?
It adds timeago label by every member on team page
## Are there points in the code the reviewer needs to double check?

Yes, maybe design is not OK, please check.

## Why was this MR needed?

It's useful information

## What are the relevant issue numbers?

## Screenshots (if relevant)

![joxi_screenshot_1467820915126](/uploads/9e5657443a10a9fe204367d7b6749b1f/joxi_screenshot_1467820915126.png)



See merge request !5116
parents de073cf5 b37b7dee
...@@ -47,6 +47,7 @@ v 8.10.0 (unreleased) ...@@ -47,6 +47,7 @@ v 8.10.0 (unreleased)
- Handle custom Git hook result in GitLab UI - Handle custom Git hook result in GitLab UI
- Allow '?', or '&' for label names - Allow '?', or '&' for label names
- Fix importer for GitHub Pull Requests when a branch was reused across Pull Requests - Fix importer for GitHub Pull Requests when a branch was reused across Pull Requests
- Add date when user joined the team on the member page
v 8.9.5 v 8.9.5
- Add more debug info to import/export and memory killer. !5108 - Add more debug info to import/export and memory killer. !5108
......
...@@ -137,6 +137,15 @@ ul.content-list { ...@@ -137,6 +137,15 @@ ul.content-list {
padding-top: 1px; padding-top: 1px;
float: right; float: right;
> .control-text {
margin-right: $gl-padding-top;
line-height: 40px;
&:last-child {
margin-right: 0;
}
}
> .btn, > .btn,
> .btn-group { > .btn-group {
margin-right: $gl-padding-top; margin-right: $gl-padding-top;
......
...@@ -3,71 +3,74 @@ ...@@ -3,71 +3,74 @@
- user = member.user - user = member.user
%li.js-toggle-container{ class: dom_class(member), id: dom_id(member) } %li.js-toggle-container{ class: dom_class(member), id: dom_id(member) }
%span{ class: ("list-item-name" if show_controls) } - if show_roles
- if user .controls
= image_tag avatar_icon(user, 24), class: "avatar s24", alt: '' %strong.control-text= member.human_access
%strong - if show_controls
= link_to user.name, user_path(user) - if !user && can?(current_user, action_member_permission(:admin, member), member.source)
%span.cgray= user.username
- if user == current_user
%span.label.label-success It's you
- if user.blocked?
%label.label.label-danger
%strong Blocked
- if member.request?
%span.cgray
– Requested
= time_ago_with_tooltip(member.requested_at)
- else
= image_tag avatar_icon(member.invite_email, 24), class: "avatar s24", alt: ''
%strong= member.invite_email
%span.cgray
– Invited
- if member.created_by
by
= link_to member.created_by.name, user_path(member.created_by)
= time_ago_with_tooltip(member.created_at)
- if show_controls && can?(current_user, action_member_permission(:admin, member), member.source)
= link_to 'Resend invite', polymorphic_path([:resend_invite, member]), = link_to 'Resend invite', polymorphic_path([:resend_invite, member]),
method: :post, method: :post,
class: 'btn-xs btn' class: 'btn'
- if show_roles
%span.pull-right
%strong= member.human_access
- if show_controls
- if can?(current_user, action_member_permission(:update, member), member) - if can?(current_user, action_member_permission(:update, member), member)
= button_tag icon('pencil'), = button_tag icon('pencil'),
type: 'button', type: 'button',
class: 'btn-xs btn btn-grouped inline js-toggle-button', class: 'btn inline js-toggle-button',
title: 'Edit access level' title: 'Edit access level'
- if member.request? - if member.request?
 
= link_to icon('check inverse'), polymorphic_path([:approve_access_request, member]), = link_to icon('check inverse'), polymorphic_path([:approve_access_request, member]),
method: :post, method: :post,
class: 'btn-xs btn btn-success', class: 'btn btn-success',
title: 'Grant access' title: 'Grant access'
- if can?(current_user, action_member_permission(:destroy, member), member) - if can?(current_user, action_member_permission(:destroy, member), member)
 
- if current_user == user - if current_user == user
= link_to icon('sign-out', text: 'Leave'), polymorphic_path([:leave, member.source, :members]), = link_to icon('sign-out', text: 'Leave'), polymorphic_path([:leave, member.source, :members]),
method: :delete, method: :delete,
data: { confirm: leave_confirmation_message(member.source) }, data: { confirm: leave_confirmation_message(member.source) },
class: 'btn-xs btn btn-remove' class: 'btn btn-remove'
- else - else
= link_to icon('trash'), member, = link_to icon('trash'), member,
remote: true, remote: true,
method: :delete, method: :delete,
data: { confirm: remove_member_message(member) }, data: { confirm: remove_member_message(member) },
class: 'btn-xs btn btn-remove', class: 'btn btn-remove',
title: remove_member_title(member) title: remove_member_title(member)
%span{ class: ("list-item-name" if show_controls) }
- if user
= image_tag avatar_icon(user, 40), class: "avatar s40", alt: ''
%strong
= link_to user.name, user_path(user)
%span.cgray= user.username
- if user == current_user
%span.label.label-success It's you
- if user.blocked?
%label.label.label-danger
%strong Blocked
.cgray
- if member.request?
Requested
= time_ago_with_tooltip(member.requested_at)
- else
Joined #{time_ago_with_tooltip(member.created_at)}
- else
= image_tag avatar_icon(member.invite_email, 40), class: "avatar s40", alt: ''
%strong= member.invite_email
.cgray
Invited
- if member.created_by
by
= link_to member.created_by.name, user_path(member.created_by)
= time_ago_with_tooltip(member.created_at)
- if show_roles
.edit-member.hide.js-toggle-content .edit-member.hide.js-toggle-content
%br %br
= form_for member, remote: true do |f| = form_for member, remote: true do |f|
......
...@@ -62,7 +62,8 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps ...@@ -62,7 +62,8 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
step 'I should see "johndoe@gitlab.com" in team list in every project as "Reporter"' do step 'I should see "johndoe@gitlab.com" in team list in every project as "Reporter"' do
page.within ".group-users-list" do page.within ".group-users-list" do
expect(page).to have_content "johndoe@gitlab.com – Invited by" expect(page).to have_content "johndoe@gitlab.com"
expect(page).to have_content "Invited by"
expect(page).to have_content "Reporter" expect(page).to have_content "Reporter"
end end
end end
......
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