Skip to content
Snippets Groups Projects
Commit 97e6c9b4 authored by Valery Sizov's avatar Valery Sizov
Browse files

Wrong access level badge on MR comments

parent c867c225
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -26,6 +26,7 @@ v 8.1.0 (unreleased)
- Show additions/deletions stats on merge request diff
- Remove footer text in emails (Zeger-Jan van de Weg)
- Ensure code blocks are properly highlighted after a note is updated
- Fix wrong access level badge on MR comments
 
v 8.0.3
- Fix URL shown in Slack notifications
Loading
Loading
Loading
Loading
@@ -135,6 +135,10 @@ class ProjectTeam
!!find_member(user_id)
end
 
def human_max_access(user_id)
Gitlab::Access.options.key max_member_access(user_id)
end
def max_member_access(user_id)
access = []
access << project.project_members.find_by(user_id: user_id).try(:access_field)
Loading
Loading
Loading
Loading
@@ -14,10 +14,10 @@
= icon('trash-o')
 
- unless note.system
- member = note.project.team.find_member(note.author.id)
- if member
- access = note.project.team.human_max_access(note.author.id)
- if access
%span.note-role.label
= member.human_access
= access
 
= link_to_member(note.project, note.author, avatar: false)
 
Loading
Loading
Loading
Loading
@@ -66,4 +66,16 @@ describe ProjectTeam do
it { expect(project.team.member?(guest)).to be_truthy }
end
end
describe "#human_max_access" do
it "return master role" do
user = create :user
group = create :group
group.add_users([user.id], GroupMember::MASTER)
project = create(:project, namespace: group)
project.team << [user, :guest]
expect(project.team.human_max_access(user.id)).to eq("Master")
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment