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
7013161f
Commit
7013161f
authored
May 06, 2021
by
Angelo Gulina
Committed by
Kushal Pandya
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subscription Activation: Upload License Link
parent
5fdc6450
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
12 deletions
+76
-12
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_card.vue
...loud_licenses/components/subscription_activation_card.vue
+16
-5
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
...ssets/javascripts/pages/admin/cloud_licenses/constants.js
+1
-0
ee/app/assets/javascripts/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
...s/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
+9
-2
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+2
-1
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
...es/admin/cloud_licences/admin_views_cloud_license_spec.rb
+8
-0
ee/spec/frontend/admin/cloud_licenses/components/subscription_activation_card_spec.js
..._licenses/components/subscription_activation_card_spec.js
+33
-2
ee/spec/helpers/license_helper_spec.rb
ee/spec/helpers/license_helper_spec.rb
+4
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_activation_card.vue
View file @
7013161f
...
...
@@ -7,6 +7,7 @@ import {
connectivityErrorAlert
,
connectivityIssue
,
howToActivateSubscription
,
uploadLegacyLicense
,
}
from
'
../constants
'
;
import
SubscriptionActivationForm
from
'
./subscription_activation_form.vue
'
;
...
...
@@ -22,11 +23,7 @@ export default {
connectivityIssueSubtitle
:
connectivityErrorAlert
.
subtitle
,
connectivityIssueHelpText
:
connectivityErrorAlert
.
helpText
,
howToActivateSubscription
,
},
links
:
{
adminLicenseUrl
,
subscriptionActivationHelpLink
,
troubleshootingHelpLink
,
uploadLegacyLicense
,
},
components
:
{
GlAlert
,
...
...
@@ -35,6 +32,12 @@ export default {
GlSprintf
,
SubscriptionActivationForm
,
},
inject
:
[
'
licenseUploadPath
'
],
links
:
{
adminLicenseUrl
,
subscriptionActivationHelpLink
,
troubleshootingHelpLink
,
},
data
()
{
return
{
error
:
null
,
...
...
@@ -98,5 +101,13 @@ export default {
class=
"gl-p-5"
@
subscription-activation-failure=
"handleFormActivationFailure"
/>
<
template
#footer
>
<gl-link
v-if=
"licenseUploadPath"
data-testid=
"upload-license-link"
:href=
"licenseUploadPath"
>
{{
$options
.
i18n
.
uploadLegacyLicense
}}
</gl-link
>
</
template
>
</gl-card>
</template>
ee/app/assets/javascripts/pages/admin/cloud_licenses/constants.js
View file @
7013161f
...
...
@@ -37,6 +37,7 @@ export const detailsLabels = {
startsAt
:
s__
(
'
SuperSonics|Started
'
),
};
export
const
uploadLegacyLicense
=
s__
(
'
SuperSonics|Upload a legacy license
'
);
export
const
billableUsersTitle
=
s__
(
'
CloudLicense|Billable users
'
);
export
const
maximumUsersTitle
=
s__
(
'
CloudLicense|Maximum users
'
);
export
const
usersInSubscriptionTitle
=
s__
(
'
CloudLicense|Users in subscription
'
);
...
...
ee/app/assets/javascripts/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
View file @
7013161f
...
...
@@ -23,7 +23,13 @@ export default () => {
return
null
;
}
const
{
hasActiveLicense
,
freeTrialPath
,
buySubscriptionPath
,
subscriptionSyncPath
}
=
el
.
dataset
;
const
{
buySubscriptionPath
,
freeTrialPath
,
hasActiveLicense
,
licenseUploadPath
,
subscriptionSyncPath
,
}
=
el
.
dataset
;
const
connectivityHelpURL
=
helpPagePath
(
'
/user/admin_area/license.html
'
,
{
anchor
:
'
activate-gitlab-ee-with-a-license
'
,
});
...
...
@@ -32,9 +38,10 @@ export default () => {
el
,
apolloProvider
,
provide
:
{
freeTrialPath
,
buySubscriptionPath
,
connectivityHelpURL
,
freeTrialPath
,
licenseUploadPath
,
subscriptionSyncPath
,
},
render
:
(
h
)
=>
...
...
ee/app/helpers/license_helper.rb
View file @
7013161f
...
...
@@ -57,7 +57,8 @@ module LicenseHelper
has_active_license:
(
has_active_license?
?
'true'
:
'false'
),
free_trial_path:
new_trial_url
,
buy_subscription_path:
::
EE
::
SUBSCRIPTIONS_PLANS_URL
,
subscription_sync_path:
sync_seat_link_admin_license_path
subscription_sync_path:
sync_seat_link_admin_license_path
,
license_upload_path:
new_admin_license_path
}
end
...
...
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
View file @
7013161f
...
...
@@ -59,5 +59,13 @@ RSpec.describe 'Admin views Cloud License', :js do
expect
(
page
).
to
have_content
(
'You do not have an active subscription'
)
end
end
context
'Upload Legacy License'
do
it
'shows a link to upload a legacy license'
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_link
(
'Upload a legacy license'
,
href:
new_admin_license_path
)
end
end
end
end
end
ee/spec/frontend/admin/cloud_licenses/components/subscription_activation_card_spec.js
View file @
7013161f
import
{
GlAlert
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
Gl
Card
,
Gl
Link
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SubscriptionActivationCard
,
{
subscriptionActivationHelpLink
,
...
...
@@ -13,15 +13,21 @@ import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe
(
'
CloudLicenseApp
'
,
()
=>
{
let
wrapper
;
const
licenseUploadPath
=
'
license/upload
'
;
const
findConnectivityErrorAlert
=
()
=>
wrapper
.
findComponent
(
GlAlert
);
const
findSubscriptionActivationForm
=
()
=>
wrapper
.
findComponent
(
SubscriptionActivationForm
);
const
findUploadLink
=
()
=>
wrapper
.
findByTestId
(
'
upload-license-link
'
);
const
createComponent
=
({
props
=
{},
stubs
=
{}
}
=
{})
=>
{
const
createComponent
=
({
props
=
{},
stubs
=
{}
,
provide
=
{}
}
=
{})
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
SubscriptionActivationCard
,
{
propsData
:
{
...
props
,
},
provide
:
{
licenseUploadPath
,
...
provide
,
},
stubs
,
}),
);
...
...
@@ -43,6 +49,31 @@ describe('CloudLicenseApp', () => {
expect
(
findConnectivityErrorAlert
().
exists
()).
toBe
(
false
);
});
describe
(
'
with an upload legacy license link
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
stubs
:
{
GlCard
}
});
});
it
(
'
shows a link when provided
'
,
()
=>
{
expect
(
findUploadLink
().
text
()).
toBe
(
'
Upload a legacy license
'
);
});
it
(
'
provides the correct path
'
,
()
=>
{
expect
(
findUploadLink
().
attributes
(
'
href
'
)).
toBe
(
licenseUploadPath
);
});
});
it
(
'
does not show a link when legacy license link is not provided
'
,
()
=>
{
createComponent
({
stubs
:
{
GlCard
},
provide
:
{
licenseUploadPath
:
''
,
},
});
expect
(
findUploadLink
().
exists
()).
toBe
(
false
);
});
describe
(
'
when the forms emits a connectivity error
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
stubs
:
{
GlSprintf
}
});
...
...
ee/spec/helpers/license_helper_spec.rb
View file @
7013161f
...
...
@@ -95,7 +95,8 @@ RSpec.describe LicenseHelper do
expect
(
helper
.
cloud_license_view_data
).
to
eq
({
has_active_license:
'true'
,
free_trial_path:
'new_trial_url'
,
buy_subscription_path:
'subscriptions_plans_url'
,
subscription_sync_path:
sync_seat_link_admin_license_path
})
subscription_sync_path:
sync_seat_link_admin_license_path
,
license_upload_path:
new_admin_license_path
})
end
end
...
...
@@ -106,7 +107,8 @@ RSpec.describe LicenseHelper do
expect
(
helper
.
cloud_license_view_data
).
to
eq
({
has_active_license:
'false'
,
free_trial_path:
'new_trial_url'
,
buy_subscription_path:
'subscriptions_plans_url'
,
subscription_sync_path:
sync_seat_link_admin_license_path
})
subscription_sync_path:
sync_seat_link_admin_license_path
,
license_upload_path:
new_admin_license_path
})
end
end
end
...
...
locale/gitlab.pot
View file @
7013161f
...
...
@@ -31127,6 +31127,9 @@ msgstr ""
msgid "SuperSonics|Type"
msgstr ""
msgid "SuperSonics|Upload a legacy license"
msgstr ""
msgid "SuperSonics|Valid From"
msgstr ""
...
...
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