diff options
author | James Lopez <james@jameslopez.es> | 2018-11-16 16:09:32 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-01-31 16:52:50 +0100 |
commit | c653921b6f5b1d8b17fa33aa194117ea9446bf28 (patch) | |
tree | 9a57ea8157c19f7dc304e690ace12807beae48da /app/helpers | |
parent | 645f7ee86b138de29245264fea32057bb6060a93 (diff) | |
download | gitlab-ce-c653921b6f5b1d8b17fa33aa194117ea9446bf28.tar.gz |
Add subresources removal to member destroy service
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/members_helper.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index ab4a1ccc0d1..11d5591d509 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -18,12 +18,13 @@ module MembersHelper "remove #{member.user.name} from" end - "#{text} #{action} the #{member.source.human_name} #{member.real_source_type.humanize(capitalize: false)}?" + "#{text} #{action} the #{member.source.human_name} #{source_text(member)}?" end def remove_member_title(member) action = member.request? ? 'Deny access request' : 'Remove user' - "#{action} from #{member.real_source_type.humanize(capitalize: false)}" + + "#{action} from #{source_text(member)}" end def leave_confirmation_message(member_source) @@ -35,4 +36,14 @@ module MembersHelper options = params.slice(:search, :sort).merge(options).permit! "#{request.path}?#{options.to_param}" end + + private + + def source_text(member) + type = member.real_source_type.humanize(capitalize: false) + + return type if member.request? || member.invite? || type != 'group' + + 'group and any subresources' + end end |