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
aaeecb01
Commit
aaeecb01
authored
May 10, 2021
by
Angelo Gulina
Committed by
Etienne Baqué
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose Customers Portal URL to Vue app
parent
994d1ad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+5
-4
ee/lib/ee.rb
ee/lib/ee.rb
+1
-0
ee/spec/helpers/license_helper_spec.rb
ee/spec/helpers/license_helper_spec.rb
+3
-0
No files found.
ee/app/helpers/license_helper.rb
View file @
aaeecb01
...
...
@@ -54,11 +54,12 @@ module LicenseHelper
def
cloud_license_view_data
{
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
,
license_upload_path:
new_admin_license_path
customers_portal_url:
::
EE
::
SUBSCRIPTIONS_MANAGE_URL
,
free_trial_path:
new_trial_url
,
has_active_license:
(
has_active_license?
?
'true'
:
'false'
),
license_upload_path:
new_admin_license_path
,
subscription_sync_path:
sync_seat_link_admin_license_path
}
end
...
...
ee/lib/ee.rb
View file @
aaeecb01
...
...
@@ -6,6 +6,7 @@ module EE
SUBSCRIPTIONS_GRAPHQL_URL
=
"
#{
SUBSCRIPTIONS_URL
}
/graphql"
SUBSCRIPTIONS_MORE_MINUTES_URL
=
"
#{
SUBSCRIPTIONS_URL
}
/buy_pipeline_minutes"
SUBSCRIPTIONS_MORE_STORAGE_URL
=
"
#{
SUBSCRIPTIONS_URL
}
/buy_storage"
SUBSCRIPTIONS_MANAGE_URL
=
"
#{
SUBSCRIPTIONS_URL
}
/subscriptions"
SUBSCRIPTIONS_PLANS_URL
=
"
#{
SUBSCRIPTIONS_URL
}
/plans"
SUBSCRIPTION_PORTAL_ADMIN_EMAIL
=
ENV
.
fetch
(
'SUBSCRIPTION_PORTAL_ADMIN_EMAIL'
,
'gl_com_api@gitlab.com'
)
SUBSCRIPTION_PORTAL_ADMIN_TOKEN
=
ENV
.
fetch
(
'SUBSCRIPTION_PORTAL_ADMIN_TOKEN'
,
'customer_admin_token'
)
...
...
ee/spec/helpers/license_helper_spec.rb
View file @
aaeecb01
...
...
@@ -81,6 +81,7 @@ RSpec.describe LicenseHelper do
describe
'#cloud_license_view_data'
do
before
do
stub_const
(
'::EE::SUBSCRIPTIONS_MANAGE_URL'
,
'subscriptions_manage_url'
)
stub_const
(
'::EE::SUBSCRIPTIONS_PLANS_URL'
,
'subscriptions_plans_url'
)
allow
(
helper
).
to
receive
(
:new_trial_url
).
and_return
(
'new_trial_url'
)
...
...
@@ -93,6 +94,7 @@ RSpec.describe LicenseHelper do
allow
(
License
).
to
receive
(
:current
).
and_return
(
license
)
expect
(
helper
.
cloud_license_view_data
).
to
eq
({
has_active_license:
'true'
,
customers_portal_url:
'subscriptions_manage_url'
,
free_trial_path:
'new_trial_url'
,
buy_subscription_path:
'subscriptions_plans_url'
,
subscription_sync_path:
sync_seat_link_admin_license_path
,
...
...
@@ -105,6 +107,7 @@ RSpec.describe LicenseHelper do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
expect
(
helper
.
cloud_license_view_data
).
to
eq
({
has_active_license:
'false'
,
customers_portal_url:
'subscriptions_manage_url'
,
free_trial_path:
'new_trial_url'
,
buy_subscription_path:
'subscriptions_plans_url'
,
subscription_sync_path:
sync_seat_link_admin_license_path
,
...
...
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