Commit 3f6766e4 authored by Corinna Wiesner's avatar Corinna Wiesner

Add bot count to Users statistics in Admin Area

Break down total user count by showing how many bots exist.
parent 46afb71c
...@@ -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
......
...@@ -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
---
title: Add bot count to Users statistics in Admin Area
merge_request: 25355
author:
type: added
...@@ -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 'shows 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
......
...@@ -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 ""
......
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