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
3f6766e4
Commit
3f6766e4
authored
Feb 17, 2020
by
Corinna Wiesner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bot count to Users statistics in Admin Area
Break down total user count by showing how many bots exist.
parent
46afb71c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
1 deletion
+20
-1
ee/app/controllers/ee/admin/dashboard_controller.rb
ee/app/controllers/ee/admin/dashboard_controller.rb
+1
-0
ee/app/views/admin/dashboard/stats.html.haml
ee/app/views/admin/dashboard/stats.html.haml
+6
-0
ee/changelogs/unreleased/add_bot_count.yml
ee/changelogs/unreleased/add_bot_count.yml
+5
-0
ee/spec/features/admin/admin_dashboard_spec.rb
ee/spec/features/admin/admin_dashboard_spec.rb
+5
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/controllers/ee/admin/dashboard_controller.rb
View file @
3f6766e4
...
@@ -18,6 +18,7 @@ module EE
...
@@ -18,6 +18,7 @@ module EE
def
stats
def
stats
@roles_count
=
::
ProjectAuthorization
.
roles_stats
@roles_count
=
::
ProjectAuthorization
.
roles_stats
@bot_count
=
::
User
.
bots
.
count
end
end
# The license section may time out if the number of users is
# The license section may time out if the number of users is
...
...
ee/app/views/admin/dashboard/stats.html.haml
View file @
3f6766e4
...
@@ -21,3 +21,9 @@
...
@@ -21,3 +21,9 @@
=
sprite_icon
(
'question'
,
size:
16
)
=
sprite_icon
(
'question'
,
size:
16
)
%td
%td
=
row
[
'amount'
]
=
row
[
'amount'
]
%tr
%td
=
s_
(
'AdminArea|Bots'
)
%td
=
@bot_count
ee/changelogs/unreleased/add_bot_count.yml
0 → 100644
View file @
3f6766e4
---
title
:
Add bot count to Users statistics in Admin Area
merge_request
:
25355
author
:
type
:
added
ee/spec/features/admin/admin_dashboard_spec.rb
View file @
3f6766e4
...
@@ -17,6 +17,9 @@ describe 'Admin Dashboard' do
...
@@ -17,6 +17,9 @@ describe 'Admin Dashboard' do
project1
.
add_reporter
(
user
)
project1
.
add_reporter
(
user
)
project2
.
add_developer
(
user
)
project2
.
add_developer
(
user
)
create
(
:user
,
bot_type: :support_bot
)
create
(
:user
,
bot_type: :alert_bot
)
sign_in
(
create
(
:admin
))
sign_in
(
create
(
:admin
))
end
end
...
@@ -63,11 +66,12 @@ describe 'Admin Dashboard' do
...
@@ -63,11 +66,12 @@ describe 'Admin Dashboard' do
end
end
end
end
it
'show
correct amount of users per role'
do
it
'show
s correct amounts of users per role'
,
:aggregate_failures
do
visit
admin_dashboard_stats_path
visit
admin_dashboard_stats_path
expect
(
page
).
to
have_content
(
'Users with highest role developer 2'
)
expect
(
page
).
to
have_content
(
'Users with highest role developer 2'
)
expect
(
page
).
to
have_content
(
'Users with highest role reporter 1'
)
expect
(
page
).
to
have_content
(
'Users with highest role reporter 1'
)
expect
(
page
).
to
have_content
(
'Bots 2'
)
end
end
end
end
end
end
...
...
locale/gitlab.pot
View file @
3f6766e4
...
@@ -1281,6 +1281,9 @@ msgstr ""
...
@@ -1281,6 +1281,9 @@ msgstr ""
msgid "Admin notes"
msgid "Admin notes"
msgstr ""
msgstr ""
msgid "AdminArea|Bots"
msgstr ""
msgid "AdminArea|Included Free in license"
msgid "AdminArea|Included Free in license"
msgstr ""
msgstr ""
...
...
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