Commit 04944648 authored by Corinna Wiesner's avatar Corinna Wiesner

Add tooltip to guests count in Users Statistics

Add tooltip to clarify that guests count as free on Ultimate licenses.
parent 796cd50d
......@@ -16,5 +16,8 @@
= s_('AdminArea|Users with highest role')
%strong
= 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
= 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
end
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
visit admin_dashboard_stats_path
......
......@@ -1281,6 +1281,9 @@ msgstr ""
msgid "Admin notes"
msgstr ""
msgid "AdminArea|Included Free in license"
msgstr ""
msgid "AdminArea|Stop all jobs"
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