Commit 6c5aabd7 authored by Aishwarya Subramanian's avatar Aishwarya Subramanian Committed by Clement Ho

Handling abuse of repeat trial in self managed

Passes email ID of the current user as a query parameter.
parent fa60b009
......@@ -9,7 +9,9 @@
.bs-callout {
margin: $gl-padding 0;
padding: $gl-padding;
border-left: 3px solid $border-color;
border-color: $border-color;
border-style: solid;
border-width: 0 0 0 3px;
color: $text-color;
background: $gray-light;
......@@ -48,6 +50,10 @@
background-color: $blue-100;
border-color: $blue-200;
color: $blue-700;
h4 {
color: $blue-700;
}
}
.bs-callout-success {
......
......@@ -85,7 +85,7 @@ module LicenseHelper
return_to_url = CGI.escape(Gitlab.config.gitlab.url)
uri = URI.parse(::EE::SUBSCRIPTIONS_URL)
uri.path = '/trials/new'
uri.query = "return_to=#{return_to_url}"
uri.query = "return_to=#{return_to_url}&id=#{Base64.strict_encode64(current_user.email)}"
uri.to_s
end
......
#repeat-trial-info.bs-callout.bs-callout-info.alert.alert-dismissible.fade.in.show{ role: "alert" }
%button.close{ type: "button", 'data-dismiss': "alert", 'aria-label': "Close" }
%span
= sprite_icon('close', size: 16)
%h4
= _('Free Trial')
%p
= _('Thank you for signing up for your free trial! You will get additional instructions in your inbox shortly.')
......@@ -7,6 +7,8 @@
= render "upload_trial_license"
%hr
- if params.key?(:trial_key) && params[:trial_key].blank?
= render "repeat_trial_info"
.container.blank-state-container
.text-center
......
---
title: Handling use case for repeat trial
merge_request: 14714
author:
type: fixed
......@@ -28,6 +28,19 @@ describe "Admin uploads license" do
end
end
context "when license key is not provided in the query string, as it is a repeat trial" do
before do
License.destroy_all # rubocop: disable DestroyAll
visit(admin_license_path(trial_key: ""))
end
it "shows an info banner for repeat trial" do
expect(page).to have_selector('div#repeat-trial-info')
expect(page).to have_selector('div.bs-callout-info')
end
end
context "uploading license" do
before do
visit(new_admin_license_path)
......
......@@ -6466,6 +6466,9 @@ msgstr ""
msgid "Found errors in your .gitlab-ci.yml:"
msgstr ""
msgid "Free Trial"
msgstr ""
msgid "Free Trial of GitLab.com Gold"
msgstr ""
......@@ -14357,6 +14360,9 @@ msgstr ""
msgid "TestHooks|Ensure the wiki is enabled and has pages."
msgstr ""
msgid "Thank you for signing up for your free trial! You will get additional instructions in your inbox shortly."
msgstr ""
msgid "Thank you for your report. A GitLab administrator will look into it shortly."
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment