Commit 8ad0cc16 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'add_tooltip_to_guests_in_users_statistics' into 'master'

Add tooltip to guests count in Users Statistics

See merge request gitlab-org/gitlab!25433
parents 90b7f0b4 04944648
...@@ -16,5 +16,8 @@ ...@@ -16,5 +16,8 @@
= s_('AdminArea|Users with highest role') = s_('AdminArea|Users with highest role')
%strong %strong
= row['kind'] = row['kind']
- if row['kind'] == 'guest' && License.current&.exclude_guests_from_active_count?
%span.has-tooltip{ data: { container: 'body' }, title: s_('AdminArea|Included Free in license') }
= sprite_icon('question', size: 16)
%td %td
= row['amount'] = row['amount']
---
title: Add tooltip to guests count in Users Statistics
merge_request: 25433
author:
type: added
...@@ -21,6 +21,48 @@ describe 'Admin Dashboard' do ...@@ -21,6 +21,48 @@ describe 'Admin Dashboard' do
end end
describe 'Roles stats' do describe 'Roles stats' do
context 'for tooltip' do
let(:create_guest) { false }
before do
allow(License).to receive(:current).and_return(license)
if create_guest
project = create(:project_empty_repo)
guest_user = create(:user)
project.add_guest(guest_user)
end
visit admin_dashboard_stats_path
end
context 'when license is empty' do
let(:license) { nil }
it { expect(page).not_to have_css('span.has-tooltip') }
end
context 'when license is on a plan Ultimate' do
let(:license) { create(:license, plan: License::ULTIMATE_PLAN) }
context 'when guests do not exist' do
it { expect(page).not_to have_css('span.has-tooltip') }
end
context 'when guests exist' do
let(:create_guest) { true }
it { expect(page).to have_css('span.has-tooltip') }
end
end
context 'when license is on a plan other than Ultimate' do
let(:license) { create(:license, plan: License::PREMIUM_PLAN) }
it { expect(page).not_to have_css('span.has-tooltip') }
end
end
it 'show correct amount of users per role' do it 'show correct amount of users per role' do
visit admin_dashboard_stats_path visit admin_dashboard_stats_path
......
...@@ -1281,6 +1281,9 @@ msgstr "" ...@@ -1281,6 +1281,9 @@ msgstr ""
msgid "Admin notes" msgid "Admin notes"
msgstr "" msgstr ""
msgid "AdminArea|Included Free in license"
msgstr ""
msgid "AdminArea|Stop all jobs" msgid "AdminArea|Stop all jobs"
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