Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ba8cfc95
Commit
ba8cfc95
authored
May 04, 2021
by
Jiaan Louw
Committed by
Max Woolf
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix badge variants in admin/users table
parent
c1ad0bb9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
app/helpers/users_helper.rb
app/helpers/users_helper.rb
+1
-1
ee/app/helpers/ee/users_helper.rb
ee/app/helpers/ee/users_helper.rb
+1
-1
ee/changelogs/unreleased/326714-fix-minor-admin-users-vue-issues.yml
...gs/unreleased/326714-fix-minor-admin-users-vue-issues.yml
+5
-0
ee/spec/helpers/users_helper_spec.rb
ee/spec/helpers/users_helper_spec.rb
+4
-4
spec/helpers/users_helper_spec.rb
spec/helpers/users_helper_spec.rb
+1
-1
No files found.
app/helpers/users_helper.rb
View file @
ba8cfc95
...
...
@@ -100,7 +100,7 @@ module UsersHelper
badges
<<
blocked_user_badge
(
user
)
if
user
.
blocked?
badges
<<
{
text:
s_
(
'AdminUsers|Admin'
),
variant:
'success'
}
if
user
.
admin?
badges
<<
{
text:
s_
(
'AdminUsers|External'
),
variant:
'secondary'
}
if
user
.
external?
badges
<<
{
text:
s_
(
"AdminUsers|It's you!"
),
variant:
nil
}
if
current_user
==
user
badges
<<
{
text:
s_
(
"AdminUsers|It's you!"
),
variant:
'muted'
}
if
current_user
==
user
end
end
...
...
ee/app/helpers/ee/users_helper.rb
View file @
ba8cfc95
...
...
@@ -15,7 +15,7 @@ module EE
if
!::
Gitlab
.
com?
&&
user
.
using_license_seat?
it_s_you_index
=
badges
.
index
{
|
badge
|
badge
[
:text
]
==
"It's you!"
}
||
-
1
badges
.
insert
(
it_s_you_index
,
{
text:
s_
(
'AdminUsers|Is using seat'
),
variant:
'
light
'
})
badges
.
insert
(
it_s_you_index
,
{
text:
s_
(
'AdminUsers|Is using seat'
),
variant:
'
neutral
'
})
end
end
end
...
...
ee/changelogs/unreleased/326714-fix-minor-admin-users-vue-issues.yml
0 → 100644
View file @
ba8cfc95
---
title
:
Fix badge variants in admin/users table
merge_request
:
60592
author
:
type
:
fixed
ee/spec/helpers/users_helper_spec.rb
View file @
ba8cfc95
...
...
@@ -58,7 +58,7 @@ RSpec.describe UsersHelper do
expect
(
subject
).
to
eq
(
[
{
text:
'Admin'
,
variant:
'success'
},
{
text:
"It's you!"
,
variant:
nil
}
{
text:
"It's you!"
,
variant:
'muted'
}
]
)
end
...
...
@@ -85,14 +85,14 @@ RSpec.describe UsersHelper do
expect
(
subject
).
to
eq
(
[
{
text:
'Admin'
,
variant:
'success'
},
{
text:
'Is using seat'
,
variant:
'
light
'
},
{
text:
"It's you!"
,
variant:
nil
}
{
text:
'Is using seat'
,
variant:
'
neutral
'
},
{
text:
"It's you!"
,
variant:
'muted'
}
]
)
end
end
it
{
expect
(
subject
).
to
eq
([
text:
'Is using seat'
,
variant:
'
light
'
])
}
it
{
expect
(
subject
).
to
eq
([
text:
'Is using seat'
,
variant:
'
neutral
'
])
}
end
context
'when user does not use a license seat'
do
...
...
spec/helpers/users_helper_spec.rb
View file @
ba8cfc95
...
...
@@ -160,7 +160,7 @@ RSpec.describe UsersHelper do
it
'returns the "It\'s You" badge'
do
badges
=
helper
.
user_badges_in_admin_section
(
user
)
expect
(
filter_ee_badges
(
badges
)).
to
eq
([
text:
"It's you!"
,
variant:
nil
])
expect
(
filter_ee_badges
(
badges
)).
to
eq
([
text:
"It's you!"
,
variant:
"muted"
])
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment