Commit a532b938 authored by Doug Stull's avatar Doug Stull

Add license overview to admin dashboard

- better visibility
parent 269b182a
...@@ -110,10 +110,6 @@ ...@@ -110,10 +110,6 @@
.dark-well { .dark-well {
background-color: $gray-normal; background-color: $gray-normal;
.btn {
width: 100%;
}
} }
.card.card-body-centered { .card.card-body-centered {
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
.admin-dashboard.gl-mt-3 .admin-dashboard.gl-mt-3
.row .row
.col-sm-4 .col-sm-4
.info-well.dark-well .info-well.dark-well.flex-fill
.well-segment.well-centered .well-segment.well-centered
= link_to admin_projects_path do = link_to admin_projects_path do
%h3.text-center %h3.text-center
Projects: Projects:
= approximate_count_with_delimiters(@counts, Project) = approximate_count_with_delimiters(@counts, Project)
%hr %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 .col-sm-4
.info-well.dark-well .info-well.dark-well
.well-segment.well-centered .well-segment.well-centered
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
= approximate_count_with_delimiters(@counts, User) = approximate_count_with_delimiters(@counts, User)
%hr %hr
.btn-group.d-flex{ role: 'group' } .btn-group.d-flex{ role: 'group' }
= link_to 'New user', new_admin_user_path, class: "btn btn-success" = 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' = link_to s_('AdminArea|Users statistics'), admin_dashboard_stats_path, class: 'btn btn-primary gl-w-full'
.col-sm-4 .col-sm-4
.info-well.dark-well .info-well.dark-well
.well-segment.well-centered .well-segment.well-centered
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
Groups: Groups:
= approximate_count_with_delimiters(@counts, Group) = approximate_count_with_delimiters(@counts, Group)
%hr %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 .row
.col-md-4 .col-md-4
#js-admin-statistics-container #js-admin-statistics-container
......
...@@ -22,9 +22,7 @@ module LicenseHelper ...@@ -22,9 +22,7 @@ module LicenseHelper
return unless license.present? return unless license.present?
return unless license.exclude_guests_from_active_count? return unless license.exclude_guests_from_active_count?
content_tag :p do 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.")
"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 end
def current_license_title def current_license_title
......
...@@ -15,10 +15,28 @@ ...@@ -15,10 +15,28 @@
- true_up_link_start = '<a href="%{url}">'.html_safe % { url: true_up_url } - true_up_link_start = '<a href="%{url}">'.html_safe % { url: true_up_url }
- link_end = '</a>'.html_safe - link_end = '</a>'.html_safe
.license-panel.gl-mt-3 .license-panel.gl-mt-5
.d-flex.pb-2 .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 .col-sm-6.d-flex.pl-0
.info-well.dark-well .info-well.dark-well.gl-mb-0
.well-segment.well-centered .well-segment.well-centered
%h3.center %h3.center
= _('Users in License:') = _('Users in License:')
...@@ -32,7 +50,7 @@ ...@@ -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 } = _('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) = seats_calculation_message(@license)
.col-sm-6.d-flex.pr-0 .col-sm-6.d-flex.pr-0
.info-well.dark-well .info-well.dark-well.gl-mb-0
.well-segment.well-centered .well-segment.well-centered
%h3.center %h3.center
= _('Active Users:') = _('Active Users:')
...@@ -40,9 +58,9 @@ ...@@ -40,9 +58,9 @@
%hr %hr
%p %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.') = _('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 .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 .well-segment.well-centered
%h3.center %h3.center
= _('Maximum Users:') = _('Maximum Users:')
...@@ -50,7 +68,7 @@ ...@@ -50,7 +68,7 @@
%hr %hr
= _('This is the highest peak of users on your installation since the license started.') = _('This is the highest peak of users on your installation since the license started.')
.col-sm-6.d-flex.pr-0 .col-sm-6.d-flex.pr-0
.info-well.dark-well .info-well.dark-well.gl-mb-0
.well-segment.well-centered .well-segment.well-centered
%h3.center %h3.center
= _('Users over License:') = _('Users over License:')
......
...@@ -30,18 +30,7 @@ ...@@ -30,18 +30,7 @@
%strong= time_ago_with_tooltip @license.starts_at %strong= time_ago_with_tooltip @license.starts_at
%li %li
%span.light %span.light
- if @license.expired? = render 'license_status'
= _('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')
- if @license.expired? - if @license.expired?
%span.badge.badge-danger.float-right %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 ...@@ -106,8 +106,8 @@ RSpec.describe LicenseHelper do
context 'and guest are excluded from the active count' do context 'and guest are excluded from the active count' do
let(:exclude_guests) { true } let(:exclude_guests) { true }
it 'returns a tag with the message' do it 'returns 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>") 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
end end
......
...@@ -33,6 +33,16 @@ RSpec.describe 'admin/dashboard/index.html.haml' do ...@@ -33,6 +33,16 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect(rendered).to have_content /An alert.*Users in License/ expect(rendered).to have_content /An alert.*Users in License/
end 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 it 'includes license breakdown' do
render render
...@@ -47,7 +57,7 @@ RSpec.describe 'admin/dashboard/index.html.haml' do ...@@ -47,7 +57,7 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
it 'does not show content' do it 'does not show content' do
render render
expect(rendered).not_to have_content('Users in License:') expect(rendered).not_to have_content 'Users in License:'
end end
end end
end end
...@@ -14244,6 +14244,9 @@ msgstr "" ...@@ -14244,6 +14244,9 @@ msgstr ""
msgid "License ID:" msgid "License ID:"
msgstr "" msgstr ""
msgid "License overview"
msgstr ""
msgid "License-Check" msgid "License-Check"
msgstr "" msgstr ""
...@@ -14370,6 +14373,9 @@ msgstr "" ...@@ -14370,6 +14373,9 @@ msgstr ""
msgid "Licensed to" msgid "Licensed to"
msgstr "" msgstr ""
msgid "Licensed to:"
msgstr ""
msgid "Licenses" msgid "Licenses"
msgstr "" msgstr ""
...@@ -26961,6 +26967,9 @@ msgstr "" ...@@ -26961,6 +26967,9 @@ msgstr ""
msgid "Users were successfully added." msgid "Users were successfully added."
msgstr "" 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." 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 "" 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