Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
43936a00
Commit
43936a00
authored
Sep 13, 2019
by
Tyler Amos
Committed by
Douglas Barbosa Alexandre
Sep 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include active user count in Users over License
Remove additional text if current user count exceeds historical.
parent
afb60f4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
7 deletions
+46
-7
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+4
-0
ee/app/views/admin/licenses/_breakdown.html.haml
ee/app/views/admin/licenses/_breakdown.html.haml
+7
-7
ee/changelogs/unreleased/8418-maximum-users-should-always-reflect-current-counts.yml
...18-maximum-users-should-always-reflect-current-counts.yml
+5
-0
ee/spec/helpers/license_helper_spec.rb
ee/spec/helpers/license_helper_spec.rb
+30
-0
No files found.
ee/app/helpers/license_helper.rb
View file @
43936a00
...
...
@@ -18,6 +18,10 @@ module LicenseHelper
HistoricalData
.
max_historical_user_count
end
def
current_active_user_count
License
.
current
&
.
current_active_users_count
||
0
end
def
license_message
(
signed_in:
signed_in?
,
is_admin:
current_user
&
.
admin?
)
return
unless
current_license
return
unless
signed_in
...
...
ee/app/views/admin/licenses/_breakdown.html.haml
View file @
43936a00
...
...
@@ -6,9 +6,9 @@
-
else
-
licensed_users
=
'Unlimited'
-
historical
=
max_historical_user_count
-
if
historical
&&
restricted
&&
historical
>
restricted
-
users_over_license
=
historical
-
restricted
-
maximum_user_count
=
[
max_historical_user_count
,
current_active_user_count
].
max
-
if
restricted
&&
maximum_user_count
>
restricted
-
users_over_license
=
maximum_user_count
-
restricted
-
else
-
users_over_license
=
0
...
...
@@ -37,10 +37,10 @@
.well-segment.well-centered
%h3
.center
Maximum Users:
=
number_with_delimiter
historical
=
number_with_delimiter
maximum_user_count
%hr
This is the highest peak of users on your installation since the license started, and
this is the minimum
number you need to purchase when you renew your license.
This is the highest peak of users on your installation since the license started, and
this is the minimum
number you need to purchase when you renew your license.
.col-sm-4
.info-well.dark-well
.well-segment.well-centered
...
...
@@ -52,4 +52,4 @@
%a
{
href:
'https://about.gitlab.com/licensing-faq/'
}
true-up model
has a retroactive charge for these users at the next renewal. If you want to update your
license sooner to prevent this, please contact
#{
mail_to
'renewals@gitlab.com'
}
.
%a
{
href:
'https://support.gitlab.com'
}
Support
.
ee/changelogs/unreleased/8418-maximum-users-should-always-reflect-current-counts.yml
0 → 100644
View file @
43936a00
---
title
:
Maximum Users metric in Admin Dashboard includes current active user count
merge_request
:
15810
author
:
type
:
added
ee/spec/helpers/license_helper_spec.rb
View file @
43936a00
...
...
@@ -68,4 +68,34 @@ describe LicenseHelper do
expect
(
guest_user_count
).
to
eq
(
User
.
active
.
count
-
User
.
active
.
excluding_guests
.
count
)
end
end
describe
'#max_historical_user_count'
do
it
'returns the max historical user count'
do
count
=
5
expect
(
HistoricalData
).
to
receive
(
:max_historical_user_count
).
and_return
(
count
)
expect
(
max_historical_user_count
).
to
eq
(
count
)
end
end
describe
'#current_active_user_count'
do
context
'when current license is set'
do
it
'returns the current_active_users_count for the current license'
do
license
=
double
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
count
=
5
allow
(
license
).
to
receive
(
:current_active_users_count
).
and_return
(
count
)
expect
(
current_active_user_count
).
to
eq
(
count
)
end
end
context
'when current license is not set'
do
it
'returns 0'
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
expect
(
current_active_user_count
).
to
eq
(
0
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment