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
d6b25e28
Commit
d6b25e28
authored
Mar 26, 2021
by
Angelo Gulina
Committed by
Phil Hughes
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display correct plan name on Subscription Activation Form
Update title with plan name Update translations
parent
55959477
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
9 deletions
+77
-9
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/app.vue
...javascripts/pages/admin/cloud_licenses/components/app.vue
+13
-3
ee/app/assets/javascripts/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
...s/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
+9
-0
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+1
-1
ee/app/views/admin/cloud_licenses/show.html.haml
ee/app/views/admin/cloud_licenses/show.html.haml
+1
-1
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
...es/admin/cloud_licences/admin_views_cloud_license_spec.rb
+42
-0
ee/spec/frontend/admin/cloud_licenses/components/app_spec.js
ee/spec/frontend/admin/cloud_licenses/components/app_spec.js
+7
-0
ee/spec/helpers/license_helper_spec.rb
ee/spec/helpers/license_helper_spec.rb
+2
-2
ee/spec/requests/admin/cloud_licenses_controller_spec.rb
ee/spec/requests/admin/cloud_licenses_controller_spec.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+1
-1
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/app.vue
View file @
d6b25e28
<
script
>
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
CloudLicenseSubscriptionActivationForm
from
'
./subscription_activation_form.vue
'
;
export
default
{
...
...
@@ -6,6 +7,10 @@ export default {
components
:
{
CloudLicenseSubscriptionActivationForm
,
},
i18n
:
{
mainTitle
:
s__
(
`CloudLicense|This instance is currently using the %{planName} plan.`
),
},
inject
:
[
'
planName
'
],
props
:
{
subscription
:
{
required
:
false
,
...
...
@@ -18,14 +23,19 @@ export default {
subscriptionData
:
this
.
subscription
,
};
},
computed
:
{
mainTitle
()
{
return
sprintf
(
this
.
$options
.
i18n
.
mainTitle
,
{
planName
:
this
.
planName
,
});
},
},
};
</
script
>
<
template
>
<div
class=
"gl-display-flex gl-justify-content-center gl-flex-direction-column"
>
<h3
class=
"gl-mb-7 gl-mt-6 gl-text-center"
>
{{
s__
(
'
CloudLicense|This instance is currently using the Core plan.
'
)
}}
</h3>
<h3
class=
"gl-mb-7 gl-mt-6 gl-text-center"
>
{{
mainTitle
}}
</h3>
<cloud-license-subscription-activation-form
v-if=
"!subscriptionData"
/>
</div>
</
template
>
ee/app/assets/javascripts/pages/admin/cloud_licenses/show/mount_cloud_licenses.js
View file @
d6b25e28
...
...
@@ -12,9 +12,18 @@ const apolloProvider = new VueApollo({
export
default
()
=>
{
const
el
=
document
.
getElementById
(
'
js-show-cloud-license-page
'
);
if
(
!
el
)
{
return
null
;
}
const
{
planName
}
=
el
.
dataset
;
return
new
Vue
({
el
,
apolloProvider
,
provide
:
{
planName
,
},
render
:
(
h
)
=>
h
(
CloudLicenseShowApp
),
});
};
ee/app/helpers/license_helper.rb
View file @
d6b25e28
...
...
@@ -50,7 +50,7 @@ module LicenseHelper
def
cloud_license_view_data
{
current_plan_titl
e:
current_license_title
plan_nam
e:
current_license_title
}
end
...
...
ee/app/views/admin/cloud_licenses/show.html.haml
View file @
d6b25e28
-
page_title
_
(
'Cloud License'
)
#js-show-cloud-license-page
#js-show-cloud-license-page
{
data:
cloud_license_view_data
}
ee/spec/features/admin/cloud_licences/admin_views_cloud_license_spec.rb
0 → 100644
View file @
d6b25e28
# frozen_string_literal: true
require
"spec_helper"
RSpec
.
describe
"Admin views Cloud License"
,
:js
do
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
gitlab_enable_admin_mode_sign_in
(
admin
)
stub_application_setting
(
cloud_license_enabled:
true
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
end
License
::
EE_ALL_PLANS
.
each
do
|
plan
|
context
"
#{
plan
}
license"
do
let_it_be
(
:license
)
{
build
(
:license
,
plan:
plan
)
}
it
'displays the correct license name'
do
visit
(
admin_cloud_license_path
)
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
"This instance is currently using the
#{
plan
.
titleize
}
plan."
)
end
end
end
end
context
"when there is no license"
do
let_it_be
(
:license
)
{
nil
}
before
do
visit
(
admin_cloud_license_path
)
end
it
"displays the fallback license name"
do
page
.
within
(
find
(
'#content-body'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
"This instance is currently using the Core plan."
)
end
end
end
end
ee/spec/frontend/admin/cloud_licenses/components/app_spec.js
View file @
d6b25e28
...
...
@@ -15,6 +15,9 @@ describe('CloudLicenseApp', () => {
propsData
:
{
...
props
,
},
provide
:
{
planName
:
'
Core
'
,
},
}),
);
};
...
...
@@ -29,5 +32,9 @@ describe('CloudLicenseApp', () => {
it
(
'
presents a form
'
,
()
=>
{
expect
(
findActivateSubscriptionForm
().
exists
()).
toBe
(
true
);
});
it
(
'
presents a main title with the plan name
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
'
Core plan
'
);
});
});
});
ee/spec/helpers/license_helper_spec.rb
View file @
d6b25e28
...
...
@@ -86,7 +86,7 @@ RSpec.describe LicenseHelper do
license
=
double
(
'License'
,
plan:
custom_plan
)
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
expect
(
cloud_license_view_data
).
to
eq
({
current_plan_titl
e:
'Custom Plan'
})
expect
(
cloud_license_view_data
).
to
eq
({
plan_nam
e:
'Custom Plan'
})
end
end
...
...
@@ -94,7 +94,7 @@ RSpec.describe LicenseHelper do
it
'returns the data for the view'
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
expect
(
cloud_license_view_data
).
to
eq
({
current_plan_titl
e:
'Core'
})
expect
(
cloud_license_view_data
).
to
eq
({
plan_nam
e:
'Core'
})
end
end
end
...
...
ee/spec/requests/admin/cloud_licenses_controller_spec.rb
View file @
d6b25e28
...
...
@@ -47,7 +47,7 @@ RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
send_request
expect
(
response
).
to
render_template
(
:show
)
expect
(
response
.
body
).
to
include
(
'js-show-cloud-license-pag'
)
expect
(
response
.
body
).
to
include
(
'js-show-cloud-license-pag
e
'
)
end
end
end
...
...
locale/gitlab.pot
View file @
d6b25e28
...
...
@@ -6440,7 +6440,7 @@ msgstr ""
msgid "CloudLicense|Paste your activation code below"
msgstr ""
msgid "CloudLicense|This instance is currently using the
Core
plan."
msgid "CloudLicense|This instance is currently using the
%{planName}
plan."
msgstr ""
msgid "Cluster"
...
...
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