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
12ae35f8
Commit
12ae35f8
authored
Apr 23, 2021
by
Angelo Gulina
Committed by
Scott Hampton
Apr 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SuperSonics: unlimited users
parent
3ca18ac9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_details_user_info.vue
...ud_licenses/components/subscription_details_user_info.vue
+3
-2
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
...ssets/javascripts/pages/admin/cloud_licenses/constants.js
+1
-0
ee/spec/frontend/admin/cloud_licenses/components/subscription_details_user_info_spec.js
...icenses/components/subscription_details_user_info_spec.js
+23
-5
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_details_user_info.vue
View file @
12ae35f8
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
maximumUsersTitle
,
maximumUsersTitle
,
usersInSubscriptionText
,
usersInSubscriptionText
,
usersInSubscriptionTitle
,
usersInSubscriptionTitle
,
usersInSubscriptionUnlimited
,
usersOverSubscriptionText
,
usersOverSubscriptionText
,
usersOverSubscriptionTitle
,
usersOverSubscriptionTitle
,
}
from
'
../constants
'
;
}
from
'
../constants
'
;
...
@@ -44,7 +45,7 @@ export default {
...
@@ -44,7 +45,7 @@ export default {
},
},
computed
:
{
computed
:
{
usersInSubscription
()
{
usersInSubscription
()
{
return
this
.
subscription
.
usersInLicenseCount
;
return
this
.
subscription
.
usersInLicenseCount
??
usersInSubscriptionUnlimited
;
},
},
billableUsers
()
{
billableUsers
()
{
return
this
.
subscription
.
billableUsersCount
;
return
this
.
subscription
.
billableUsersCount
;
...
@@ -62,7 +63,7 @@ export default {
...
@@ -62,7 +63,7 @@ export default {
<
template
>
<
template
>
<section
class=
"row"
>
<section
class=
"row"
>
<div
class=
"col-md-6 gl-mb-5"
>
<div
class=
"col-md-6 gl-mb-5"
>
<gl-card
data-testid=
"users-in-
license
"
>
<gl-card
data-testid=
"users-in-
subscription
"
>
<header>
<header>
<h2>
{{
usersInSubscription
}}
</h2>
<h2>
{{
usersInSubscription
}}
</h2>
<h5
class=
"gl-font-weight-normal text-uppercase"
>
<h5
class=
"gl-font-weight-normal text-uppercase"
>
...
...
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
View file @
12ae35f8
...
@@ -13,6 +13,7 @@ export const manageSubscriptionButtonText = s__('SuperSonics|Manage');
...
@@ -13,6 +13,7 @@ export const manageSubscriptionButtonText = s__('SuperSonics|Manage');
export
const
syncSubscriptionButtonText
=
s__
(
'
SuperSonics|Sync subscription details
'
);
export
const
syncSubscriptionButtonText
=
s__
(
'
SuperSonics|Sync subscription details
'
);
export
const
copySubscriptionIdButtonText
=
__
(
'
Copy
'
);
export
const
copySubscriptionIdButtonText
=
__
(
'
Copy
'
);
export
const
subscriptionTypeText
=
__
(
'
%{type} License
'
);
export
const
subscriptionTypeText
=
__
(
'
%{type} License
'
);
export
const
usersInSubscriptionUnlimited
=
__
(
'
Unlimited
'
);
export
const
detailsLabels
=
{
export
const
detailsLabels
=
{
address
:
__
(
'
Address
'
),
address
:
__
(
'
Address
'
),
company
:
__
(
'
Company
'
),
company
:
__
(
'
Company
'
),
...
...
ee/spec/frontend/admin/cloud_licenses/components/subscription_details_user_info_spec.js
View file @
12ae35f8
...
@@ -21,6 +21,8 @@ describe('Subscription Details User Info', () => {
...
@@ -21,6 +21,8 @@ describe('Subscription Details User Info', () => {
let
wrapper
;
let
wrapper
;
const
itif
=
(
condition
)
=>
(
condition
?
it
:
it
.
skip
);
const
itif
=
(
condition
)
=>
(
condition
?
it
:
it
.
skip
);
const
findSubscriptionText
=
()
=>
wrapper
.
findByTestId
(
'
users-in-subscription
'
).
find
(
'
h2
'
).
text
();
const
createComponent
=
(
props
=
{},
stubGlSprintf
=
false
)
=>
{
const
createComponent
=
(
props
=
{},
stubGlSprintf
=
false
)
=>
{
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
...
@@ -42,11 +44,11 @@ describe('Subscription Details User Info', () => {
...
@@ -42,11 +44,11 @@ describe('Subscription Details User Info', () => {
});
});
describe
.
each
`
describe
.
each
`
testId | info | title | text | link
testId
| info | title | text | link
${
'
users-in-
license
'
}
|
${
'
10
'
}
|
${
usersInSubscriptionTitle
}
|
${
usersInSubscriptionText
}
|
${
false
}
${
'
users-in-
subscription
'
}
|
${
'
10
'
}
|
${
usersInSubscriptionTitle
}
|
${
usersInSubscriptionText
}
|
${
false
}
${
'
billable-users
'
}
|
${
'
8
'
}
|
${
billableUsersTitle
}
|
${
billableUsersText
}
|
${
billableUsersURL
}
${
'
billable-users
'
}
|
${
'
8
'
}
|
${
billableUsersTitle
}
|
${
billableUsersText
}
|
${
billableUsersURL
}
${
'
maximum-users
'
}
|
${
'
8
'
}
|
${
maximumUsersTitle
}
|
${
maximumUsersText
}
|
${
false
}
${
'
maximum-users
'
}
|
${
'
8
'
}
|
${
maximumUsersTitle
}
|
${
maximumUsersText
}
|
${
false
}
${
'
users-over-license
'
}
|
${
'
0
'
}
|
${
usersOverSubscriptionTitle
}
|
${
usersOverSubscriptionText
}
|
${
trueUpURL
}
${
'
users-over-license
'
}
|
${
'
0
'
}
|
${
usersOverSubscriptionTitle
}
|
${
usersOverSubscriptionText
}
|
${
trueUpURL
}
`
(
'
with data for $card
'
,
({
testId
,
info
,
title
,
text
,
link
})
=>
{
`
(
'
with data for $card
'
,
({
testId
,
info
,
title
,
text
,
link
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
();
...
@@ -80,4 +82,20 @@ describe('Subscription Details User Info', () => {
...
@@ -80,4 +82,20 @@ describe('Subscription Details User Info', () => {
expect
(
findUseCard
().
findComponent
(
GlLink
).
exists
()).
toBe
(
link
);
expect
(
findUseCard
().
findComponent
(
GlLink
).
exists
()).
toBe
(
link
);
});
});
});
});
describe
(
'
Users is subscription
'
,
()
=>
{
it
(
'
should display the value when present
'
,
()
=>
{
const
subscription
=
{
...
license
.
ULTIMATE
,
usersInLicenseCount
:
0
};
createComponent
({
subscription
});
expect
(
findSubscriptionText
()).
toBe
(
'
0
'
);
});
it
(
'
should display Unlimited when users in license is null
'
,
()
=>
{
const
subscription
=
{
...
license
.
ULTIMATE
,
usersInLicenseCount
:
null
};
createComponent
({
subscription
});
expect
(
findSubscriptionText
()).
toBe
(
'
Unlimited
'
);
});
});
});
});
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