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
319af498
Commit
319af498
authored
Jun 09, 2021
by
Ammar Alakkad
Committed by
Miguel Rincon
Jun 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace legacy license with license file
parent
d4eaa4a8
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
57 deletions
+67
-57
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_card.vue
...loud_licenses/components/subscription_activation_card.vue
+3
-3
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_breakdown.vue
...dmin/cloud_licenses/components/subscription_breakdown.vue
+6
-6
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_details_history.vue
...loud_licenses/components/subscription_details_history.vue
+8
-3
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
...ssets/javascripts/pages/admin/cloud_licenses/constants.js
+5
-4
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
...es/admin/cloud_licences/admin_views_cloud_license_spec.rb
+3
-3
ee/spec/frontend/admin/cloud_licenses/components/subscription_activation_card_spec.js
..._licenses/components/subscription_activation_card_spec.js
+2
-2
ee/spec/frontend/admin/cloud_licenses/components/subscription_breakdown_spec.js
.../cloud_licenses/components/subscription_breakdown_spec.js
+25
-25
ee/spec/frontend/admin/cloud_licenses/components/subscription_details_history_spec.js
..._licenses/components/subscription_details_history_spec.js
+4
-3
ee/spec/frontend/admin/cloud_licenses/mock_data.js
ee/spec/frontend/admin/cloud_licenses/mock_data.js
+4
-4
locale/gitlab.pot
locale/gitlab.pot
+7
-4
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_card.vue
View file @
319af498
<
script
>
import
{
GlCard
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
helpPagePath
}
from
'
~/helpers/help_page_helper
'
;
import
{
activateSubscription
,
howToActivateSubscription
,
uploadL
egacyLicens
e
}
from
'
../constants
'
;
import
{
activateSubscription
,
howToActivateSubscription
,
uploadL
icenseFil
e
}
from
'
../constants
'
;
import
SubscriptionActivationErrors
from
'
./subscription_activation_errors.vue
'
;
import
SubscriptionActivationForm
from
'
./subscription_activation_form.vue
'
;
...
...
@@ -14,7 +14,7 @@ export default {
i18n
:
{
activateSubscription
,
howToActivateSubscription
,
uploadL
egacyLicens
e
,
uploadL
icenseFil
e
,
},
components
:
{
GlCard
,
...
...
@@ -68,7 +68,7 @@ export default {
/>
<
template
#footer
>
<gl-link
v-if=
"licenseUploadPath"
data-testid=
"upload-license-link"
:href=
"licenseUploadPath"
>
{{
$options
.
i18n
.
uploadL
egacyLicens
e
}}
>
{{
$options
.
i18n
.
uploadL
icenseFil
e
}}
</gl-link>
</
template
>
</gl-card>
...
...
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_breakdown.vue
View file @
319af498
...
...
@@ -9,7 +9,7 @@ import {
removeLicense
,
removeLicenseConfirm
,
subscriptionDetailsHeaderText
,
subscriptionType
,
subscriptionType
s
,
syncSubscriptionButtonText
,
uploadLicense
,
}
from
'
../constants
'
;
...
...
@@ -76,10 +76,10 @@ export default {
return
this
.
subscriptionSyncPath
&&
this
.
isCloudType
;
},
canUploadLicense
()
{
return
this
.
licenseUploadPath
&&
this
.
isL
egacy
Type
;
return
this
.
licenseUploadPath
&&
this
.
isL
icenseFile
Type
;
},
canRemoveLicense
()
{
return
this
.
licenseRemovePath
&&
this
.
isL
egacy
Type
;
return
this
.
licenseRemovePath
&&
this
.
isL
icenseFile
Type
;
},
hasSubscription
()
{
return
Boolean
(
Object
.
keys
(
this
.
subscription
).
length
);
...
...
@@ -88,10 +88,10 @@ export default {
return
Boolean
(
this
.
subscriptionList
.
length
);
},
isCloudType
()
{
return
this
.
subscription
.
type
===
subscriptionType
.
CLOUD
;
return
this
.
subscription
.
type
===
subscriptionType
s
.
CLOUD
;
},
isL
egacy
Type
()
{
return
this
.
subscription
.
type
===
subscriptionType
.
LEGACY
;
isL
icenseFile
Type
()
{
return
this
.
subscription
.
type
===
subscriptionType
s
.
LICENSE_FILE
;
},
shouldShowFooter
()
{
return
(
...
...
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_details_history.vue
View file @
319af498
...
...
@@ -2,8 +2,13 @@
import
{
GlBadge
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
kebabCase
}
from
'
lodash
'
;
import
{
capitalizeFirstCharacter
}
from
'
~/lib/utils/text_utility
'
;
import
sprintf
from
'
~/locale/sprintf
'
;
import
{
detailsLabels
,
subscriptionTable
,
subscriptionTypeText
}
from
'
../constants
'
;
import
{
cloudLicenseText
,
detailsLabels
,
licenseFileText
,
subscriptionTable
,
subscriptionTypes
,
}
from
'
../constants
'
;
const
DEFAULT_BORDER_CLASSES
=
'
gl-border-b-1! gl-border-b-gray-100! gl-border-b-solid!
'
;
const
DEFAULT_TH_CLASSES
=
'
gl-bg-white! gl-border-t-0! gl-pb-5! gl-px-5! gl-text-gray-700!
'
;
...
...
@@ -96,7 +101,7 @@ export default {
{
key
:
'
type
'
,
formatter
:
(
v
,
k
,
item
)
=>
sprintf
(
subscriptionTypeText
,
{
type
:
capitalizeFirstCharacter
(
item
.
type
)
})
,
item
.
type
===
subscriptionTypes
.
LICENSE_FILE
?
licenseFileText
:
cloudLicenseText
,
label
:
subscriptionTable
.
type
,
tdAttr
,
tdClass
:
this
.
cellClass
,
...
...
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
View file @
319af498
...
...
@@ -23,7 +23,8 @@ export const licensedToHeaderText = s__('SuperSonics|Licensed to');
export
const
manageSubscriptionButtonText
=
s__
(
'
SuperSonics|Manage
'
);
export
const
syncSubscriptionButtonText
=
s__
(
'
SuperSonics|Sync subscription details
'
);
export
const
copySubscriptionIdButtonText
=
__
(
'
Copy
'
);
export
const
subscriptionTypeText
=
__
(
'
%{type} License
'
);
export
const
licenseFileText
=
__
(
'
License file
'
);
export
const
cloudLicenseText
=
__
(
'
SuperSonics|Cloud license
'
);
export
const
usersInSubscriptionUnlimited
=
__
(
'
Unlimited
'
);
export
const
detailsLabels
=
{
address
:
__
(
'
Address
'
),
...
...
@@ -40,7 +41,7 @@ export const detailsLabels = {
export
const
removeLicense
=
__
(
'
Remove license
'
);
export
const
removeLicenseConfirm
=
__
(
'
Are you sure you want to remove the license?
'
);
export
const
uploadLicense
=
__
(
'
Upload license
'
);
export
const
uploadL
egacyLicense
=
s__
(
'
SuperSonics|Upload a legacy licens
e
'
);
export
const
uploadL
icenseFile
=
s__
(
'
SuperSonics|Upload a license fil
e
'
);
export
const
billableUsersTitle
=
s__
(
'
SuperSonics|Billable users
'
);
export
const
maximumUsersTitle
=
s__
(
'
SuperSonics|Maximum users
'
);
export
const
usersInSubscriptionTitle
=
s__
(
'
SuperSonics|Users in subscription
'
);
...
...
@@ -85,9 +86,9 @@ export const subscriptionSyncStatus = {
SYNC_FAILURE
:
'
SYNC_FAILURE
'
,
SYNC_SUCCESS
:
'
SYNC_SUCCESS
'
,
};
export
const
subscriptionType
=
{
export
const
subscriptionType
s
=
{
CLOUD
:
'
cloud
'
,
L
EGACY
:
'
legacy
'
,
L
ICENSE_FILE
:
'
legacy
'
,
};
export
const
subscriptionQueries
=
{
...
...
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
View file @
319af498
...
...
@@ -117,10 +117,10 @@ RSpec.describe 'Admin views Cloud License', :js do
end
end
context
'Upload
Legacy L
icense'
do
it
'shows a link to upload a l
egacy licens
e'
do
context
'Upload
a legacy l
icense'
do
it
'shows a link to upload a l
icense fil
e'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_link
(
'Upload a l
egacy licens
e'
,
href:
new_admin_license_path
)
expect
(
page
).
to
have_link
(
'Upload a l
icense fil
e'
,
href:
new_admin_license_path
)
end
end
end
...
...
ee/spec/frontend/admin/cloud_licenses/components/subscription_activation_card_spec.js
View file @
319af498
...
...
@@ -7,7 +7,7 @@ import SubscriptionActivationErrors from 'ee/pages/admin/cloud_licenses/componen
import
SubscriptionActivationForm
,
{
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT
,
}
from
'
ee/pages/admin/cloud_licenses/components/subscription_activation_form.vue
'
;
import
{
CONNECTIVITY_ERROR
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
import
{
CONNECTIVITY_ERROR
,
uploadLicenseFile
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
describe
(
'
CloudLicenseApp
'
,
()
=>
{
...
...
@@ -57,7 +57,7 @@ describe('CloudLicenseApp', () => {
});
it
(
'
shows a link when provided
'
,
()
=>
{
expect
(
findUploadLink
().
text
()).
toBe
(
'
Upload a legacy license
'
);
expect
(
findUploadLink
().
text
()).
toBe
(
uploadLicenseFile
);
});
it
(
'
shows an help link
'
,
()
=>
{
...
...
ee/spec/frontend/admin/cloud_licenses/components/subscription_breakdown_spec.js
View file @
319af498
...
...
@@ -18,7 +18,7 @@ import {
licensedToHeaderText
,
subscriptionSyncStatus
,
subscriptionDetailsHeaderText
,
subscriptionType
,
subscriptionType
s
,
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
...
@@ -30,7 +30,7 @@ describe('Subscription Breakdown', () => {
let
wrapper
;
let
glModalDirective
;
const
[,
l
egacyLicens
e
]
=
subscriptionHistory
;
const
[,
l
icenseFil
e
]
=
subscriptionHistory
;
const
connectivityHelpURL
=
'
connectivity/help/url
'
;
const
customersPortalUrl
=
'
customers.dot
'
;
const
licenseRemovePath
=
'
/license/remove/
'
;
...
...
@@ -154,12 +154,12 @@ describe('Subscription Breakdown', () => {
describe
(
'
footer buttons
'
,
()
=>
{
it
.
each
`
url | type | shouldShow
${
subscriptionSyncPath
}
|
${
subscriptionType
.
CLOUD
}
|
${
true
}
${
subscriptionSyncPath
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
subscriptionSyncPath
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
true
}
${
subscriptionSyncPath
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
`
(
'
with url is $url and type is $type the sync button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
...
...
@@ -180,12 +180,12 @@ describe('Subscription Breakdown', () => {
it
.
each
`
url | type | shouldShow
${
licenseUploadPath
}
|
${
subscriptionType
.
LEGACY
}
|
${
true
}
${
licenseUploadPath
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
licenseUploadPath
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
true
}
${
licenseUploadPath
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
`
(
'
with url is $url and type is $type the upload button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
...
...
@@ -225,12 +225,12 @@ describe('Subscription Breakdown', () => {
it
.
each
`
url | type | shouldShow
${
licenseRemovePath
}
|
${
subscriptionType
.
LEGACY
}
|
${
true
}
${
licenseRemovePath
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
''
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
LEGACY
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
.
CLOUD
}
|
${
false
}
${
licenseRemovePath
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
true
}
${
licenseRemovePath
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
''
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
LICENSE_FILE
}
|
${
false
}
${
undefined
}
|
${
subscriptionType
s
.
CLOUD
}
|
${
false
}
`
(
'
with url is $url and type is $type the remove button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
...
...
@@ -250,10 +250,10 @@ describe('Subscription Breakdown', () => {
);
});
describe
(
'
with a l
egacy licens
e
'
,
()
=>
{
describe
(
'
with a l
icense fil
e
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
props
:
{
subscription
:
l
egacyLicens
e
},
props
:
{
subscription
:
l
icenseFil
e
},
stubs
:
{
GlCard
,
SubscriptionDetailsCard
},
});
});
...
...
ee/spec/frontend/admin/cloud_licenses/components/subscription_details_history_spec.js
View file @
319af498
import
{
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
SubscriptionDetailsHistory
from
'
ee/pages/admin/cloud_licenses/components/subscription_details_history.vue
'
;
import
{
cloudLicenseText
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
license
,
subscriptionHistory
}
from
'
../mock_data
'
;
...
...
@@ -42,8 +43,8 @@ describe('Subscription Details History', () => {
});
it
(
'
has the correct license type
'
,
()
=>
{
expect
(
findCurrentRow
().
text
()).
toContain
(
'
Cloud License
'
);
expect
(
findTableRows
().
at
(
0
).
text
()).
toContain
(
'
L
egacy Licens
e
'
);
expect
(
findCurrentRow
().
text
()).
toContain
(
cloudLicenseText
);
expect
(
findTableRows
().
at
(
0
).
text
()).
toContain
(
'
L
icense fil
e
'
);
});
it
(
'
has a badge for the license type
'
,
()
=>
{
...
...
@@ -82,7 +83,7 @@ describe('Subscription Details History', () => {
it
(
'
displays the correct value for the type cell
'
,
()
=>
{
const
cellTestId
=
`subscription-cell-type`
;
expect
(
findCellByTestid
(
cellTestId
).
text
()).
toBe
(
'
Cloud License
'
);
expect
(
findCellByTestid
(
cellTestId
).
text
()).
toBe
(
cloudLicenseText
);
});
it
(
'
displays the correct value for the plan cell
'
,
()
=>
{
...
...
ee/spec/frontend/admin/cloud_licenses/mock_data.js
View file @
319af498
import
{
CONNECTIVITY_ERROR
,
subscriptionType
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
import
{
CONNECTIVITY_ERROR
,
subscriptionType
s
}
from
'
ee/pages/admin/cloud_licenses/constants
'
;
export
const
license
=
{
ULTIMATE
:
{
...
...
@@ -13,7 +13,7 @@ export const license = {
name
:
'
Jane Doe
'
,
plan
:
'
ultimate
'
,
startsAt
:
'
2021-03-11
'
,
type
:
subscriptionType
.
CLOUD
,
type
:
subscriptionType
s
.
CLOUD
,
usersInLicenseCount
:
'
10
'
,
usersOverLicenseCount
:
'
0
'
,
},
...
...
@@ -29,7 +29,7 @@ export const subscriptionHistory = [
name
:
'
Jane Doe
'
,
plan
:
'
ultimate
'
,
startsAt
:
'
2021-03-11
'
,
type
:
subscriptionType
.
CLOUD
,
type
:
subscriptionType
s
.
CLOUD
,
usersInLicenseCount
:
'
10
'
,
},
{
...
...
@@ -41,7 +41,7 @@ export const subscriptionHistory = [
name
:
'
Jane Doe
'
,
plan
:
'
premium
'
,
startsAt
:
'
2020-03-16
'
,
type
:
subscriptionType
.
LEGACY
,
type
:
subscriptionType
s
.
LICENSE_FILE
,
usersInLicenseCount
:
'
5
'
,
},
];
...
...
locale/gitlab.pot
View file @
319af498
...
...
@@ -960,9 +960,6 @@ msgstr ""
msgid "%{total} warnings found: showing first %{warningsDisplayed}"
msgstr ""
msgid "%{type} License"
msgstr ""
msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc."
msgstr ""
...
...
@@ -19599,6 +19596,9 @@ msgstr ""
msgid "License ID:"
msgstr ""
msgid "License file"
msgstr ""
msgid "License overview"
msgstr ""
...
...
@@ -31671,6 +31671,9 @@ msgstr ""
msgid "SuperSonics|Buy subscription"
msgstr ""
msgid "SuperSonics|Cloud license"
msgstr ""
msgid "SuperSonics|Enter activation code"
msgstr ""
...
...
@@ -31758,7 +31761,7 @@ msgstr ""
msgid "SuperSonics|Type"
msgstr ""
msgid "SuperSonics|Upload a l
egacy licens
e"
msgid "SuperSonics|Upload a l
icense fil
e"
msgstr ""
msgid "SuperSonics|Users in subscription"
...
...
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