Commit a532b938 authored by Doug Stull's avatar Doug Stull

Add license overview to admin dashboard

- better visibility
parent 269b182a
......@@ -110,10 +110,6 @@
.dark-well {
background-color: $gray-normal;
.btn {
width: 100%;
}
}
.card.card-body-centered {
......
......@@ -13,14 +13,14 @@
.admin-dashboard.gl-mt-3
.row
.col-sm-4
.info-well.dark-well
.info-well.dark-well.flex-fill
.well-segment.well-centered
= link_to admin_projects_path do
%h3.text-center
Projects:
= approximate_count_with_delimiters(@counts, Project)
%hr
= link_to('New project', new_project_path, class: "btn btn-success")
= link_to('New project', new_project_path, class: "btn btn-success gl-w-full")
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
......@@ -30,8 +30,8 @@
= approximate_count_with_delimiters(@counts, User)
%hr
.btn-group.d-flex{ role: 'group' }
= link_to 'New user', new_admin_user_path, class: "btn btn-success"
= link_to s_('AdminArea|Users statistics'), admin_dashboard_stats_path, class: 'btn btn-primary'
= link_to 'New user', new_admin_user_path, class: "btn btn-success gl-w-full"
= link_to s_('AdminArea|Users statistics'), admin_dashboard_stats_path, class: 'btn btn-primary gl-w-full'
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
......@@ -40,7 +40,7 @@
Groups:
= approximate_count_with_delimiters(@counts, Group)
%hr
= link_to 'New group', new_admin_group_path, class: "btn btn-success"
= link_to 'New group', new_admin_group_path, class: "btn btn-success gl-w-full"
.row
.col-md-4
#js-admin-statistics-container
......
......@@ -22,9 +22,7 @@ module LicenseHelper
return unless license.present?
return unless license.exclude_guests_from_active_count?
content_tag :p do
"Users with a Guest role or those who don't belong to a Project or Group will not use a seat from your license."
end
s_("Users with a Guest role or those who don't belong to a Project or Group will not use a seat from your license.")
end
def current_license_title
......
......@@ -15,10 +15,28 @@
- true_up_link_start = '<a href="%{url}">'.html_safe % { url: true_up_url }
- link_end = '</a>'.html_safe
.license-panel.gl-mt-3
.d-flex.pb-2
.license-panel.gl-mt-5
.gl-mb-5.info-well.dark-well
.gl-display-flex.gl-justify-content-space-between.gl-align-items-center.gl-p-5
%div
%h4.gl-mt-0
= _('License overview')
%p.gl-mb-0
= sprite_icon('license', css_class: 'gl-fill-gray-700')
%span.gl-ml-3
= _('Plan:')
%strong= @license.plan.capitalize
%span.gl-ml-5
= render 'admin/licenses/license_status'
%span.gl-ml-5
= _('Licensed to:')
%strong= @license.licensee['Name']
= "(#{@license.licensee['Email']})"
%div
= link_to 'View details', admin_license_path, class: "btn btn-secondary"
.d-flex.gl-mb-5
.col-sm-6.d-flex.pl-0
.info-well.dark-well
.info-well.dark-well.gl-mb-0
.well-segment.well-centered
%h3.center
= _('Users in License:')
......@@ -32,7 +50,7 @@
= _('The %{link_start}true-up model%{link_end} allows having more users, and additional users will incur a retroactive charge on renewal.').html_safe % { link_start: true_up_link_start, link_end: link_end }
= seats_calculation_message(@license)
.col-sm-6.d-flex.pr-0
.info-well.dark-well
.info-well.dark-well.gl-mb-0
.well-segment.well-centered
%h3.center
= _('Active Users:')
......@@ -40,9 +58,9 @@
%hr
%p
= _('This is the number of currently active users on your installation, and this is the minimum number you need to purchase when you renew your license.')
.d-flex.pb-3
.d-flex.gl-pb-5
.col-sm-6.d-flex.pl-0
.info-well.dark-well.flex-fill
.info-well.dark-well.flex-fill.gl-mb-0
.well-segment.well-centered
%h3.center
= _('Maximum Users:')
......@@ -50,7 +68,7 @@
%hr
= _('This is the highest peak of users on your installation since the license started.')
.col-sm-6.d-flex.pr-0
.info-well.dark-well
.info-well.dark-well.gl-mb-0
.well-segment.well-centered
%h3.center
= _('Users over License:')
......
......@@ -30,18 +30,7 @@
%strong= time_ago_with_tooltip @license.starts_at
%li
%span.light
- if @license.expired?
= _('Expired:')
- else
= _('Expires:')
- if @license.will_expire? && !@license.expired?
- if @license.trial?
%strong.has-tooltip{ title: @license.expires_at.to_formatted_s(:long), data: { placement: 'top' } }
= _('Free trial will expire in %{days}' % { days: pluralize(@license.remaining_days, 'day') })
- else
%strong= time_ago_with_tooltip(@license.expires_at)
- else
%strong= _('Never')
= render 'license_status'
- if @license.expired?
%span.badge.badge-danger.float-right
......
- if @license.expired?
= _('Expired:')
- else
= _('Expires:')
- if @license.will_expire? && !@license.expired?
- if @license.trial?
%strong.has-tooltip{ title: @license.expires_at.to_formatted_s(:long), data: { placement: 'top' } }
= _('Free trial will expire in %{days}' % { days: pluralize(@license.remaining_days, 'day') })
- else
%strong= time_ago_with_tooltip(@license.expires_at)
- else
%strong= _('Never')
---
title: Add a License overview section to the Admin dashboard
merge_request: 40009
author:
type: added
......@@ -106,8 +106,8 @@ RSpec.describe LicenseHelper do
context 'and guest are excluded from the active count' do
let(:exclude_guests) { true }
it 'returns a tag with the message' do
expect(subject).to eq("<p>Users with a Guest role or those who don&#39;t belong to a Project or Group will not use a seat from your license.</p>")
it 'returns the message' do
expect(subject).to eq("Users with a Guest role or those who don't belong to a Project or Group will not use a seat from your license.")
end
end
......
......@@ -33,6 +33,16 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect(rendered).to have_content /An alert.*Users in License/
end
it 'includes license overview' do
render
expect(rendered).to have_content "License overview"
expect(rendered).to have_content "Plan:"
expect(rendered).to have_content "Expires:"
expect(rendered).to have_content "Licensed to:"
expect(rendered).to have_link 'View details', href: admin_license_path
end
it 'includes license breakdown' do
render
......@@ -47,7 +57,7 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
it 'does not show content' do
render
expect(rendered).not_to have_content('Users in License:')
expect(rendered).not_to have_content 'Users in License:'
end
end
end
......@@ -14244,6 +14244,9 @@ msgstr ""
msgid "License ID:"
msgstr ""
msgid "License overview"
msgstr ""
msgid "License-Check"
msgstr ""
......@@ -14370,6 +14373,9 @@ msgstr ""
msgid "Licensed to"
msgstr ""
msgid "Licensed to:"
msgstr ""
msgid "Licenses"
msgstr ""
......@@ -26961,6 +26967,9 @@ msgstr ""
msgid "Users were successfully added."
msgstr ""
msgid "Users with a Guest role or those who don't belong to a Project or Group will not use a seat from your license."
msgstr ""
msgid "Users with a Guest role or those who don't belong to any projects or groups don't count towards seats in use."
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