Commit 5f0b3edf authored by minahilnichols's avatar minahilnichols

Add redirect logic and fix specs

parent 105d88f6
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
trial: { trial: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false, default: true,
}, },
}, },
data() { data() {
......
...@@ -36,7 +36,7 @@ class TrialsController < ApplicationController ...@@ -36,7 +36,7 @@ class TrialsController < ApplicationController
render(:new) && return unless @result[:success] render(:new) && return unless @result[:success]
if params[:onboarding] == 'true' if params[:onboarding] == 'true' || params[:trial] == 'true'
redirect_to(new_users_sign_up_groups_project_path(url_params.merge(trial_onboarding_flow: true))) redirect_to(new_users_sign_up_groups_project_path(url_params.merge(trial_onboarding_flow: true)))
elsif @namespace = helpers.only_trialable_group_namespace elsif @namespace = helpers.only_trialable_group_namespace
params[:namespace_id] = @namespace.id params[:namespace_id] = @namespace.id
...@@ -50,6 +50,7 @@ class TrialsController < ApplicationController ...@@ -50,6 +50,7 @@ class TrialsController < ApplicationController
result = GitlabSubscriptions::CreateHandRaiseLeadService.new.execute(hand_raise_lead_params) result = GitlabSubscriptions::CreateHandRaiseLeadService.new.execute(hand_raise_lead_params)
if result.success? if result.success?
redirect_to new_users_sign_up_groups_project_path(skip_trial: true) if params.has_key?(:trial)
head 200 head 200
else else
render_403 render_403
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%h2.gl-pb-5.gl-my-0 %h2.gl-pb-5.gl-my-0
= _("About your company") = _("About your company")
#js-company-registration-form{ data: { trial: params[:trial] == 'true', create_lead_path: create_lead_trials_path } } #js-company-registration-form{ data: create_company_form_data }
.col-md-4.gl-display-inline-flex.gl-vertical-align-middle .col-md-4.gl-display-inline-flex.gl-vertical-align-middle
= image_tag 'illustrations/saas-trial-illustration.svg', alt: '', class: 'gl-display-none d-md-inline gl-w-full' = image_tag 'illustrations/saas-trial-illustration.svg', alt: '', class: 'gl-display-none d-md-inline gl-w-full'
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