Commit 191da6c3 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch...

Merge branch '33742-last-name-validation-error-for-existing-users-with-single-word-full-name' into 'master'

Add First & last name on the trial form

See merge request gitlab-org/gitlab!21822
parents 8162cff2 73c1ab01
......@@ -46,12 +46,12 @@ class TrialsController < ApplicationController
end
def company_params
params.permit(:company_name, :company_size, :phone_number, :number_of_users, :country)
params.permit(:company_name, :company_size, :first_name, :last_name, :phone_number, :number_of_users, :country)
.merge(extra_params)
end
def extra_params
attrs = current_user.slice(:first_name, :last_name)
attrs = {}
attrs[:work_email] = current_user.email
attrs[:uid] = current_user.id
attrs[:skip_email_confirmation] = true
......
......@@ -9,6 +9,12 @@
= render 'errors'
= form_tag create_lead_trials_path, method: :post do |f|
.form-group
= label_tag :first_name, _('First name'), for: :first_name, class: 'col-form-label'
= text_field_tag :first_name, params[:first_name] || current_user.first_name, class: 'form-control', required: true
.form-group
= label_tag :last_name, _('Last name'), for: :last_name, class: 'col-form-label'
= text_field_tag :last_name, params[:last_name] || current_user.last_name, class: 'form-control', required: true
.form-group
= label_tag :company_name, _('Company name'), for: :company_name, class: 'col-form-label'
= text_field_tag :company_name, params[:company_name], class: 'form-control', required: true
......
---
title: Add First & last name on the trial form
merge_request: 33742
author:
type: changed
......@@ -73,13 +73,13 @@ describe TrialsController do
params = {
company_name: 'Gitlab',
company_size: '1-99',
first_name: user.first_name,
last_name: user.last_name,
phone_number: '1111111111',
number_of_users: "20",
country: 'IN'
}
extra_params = {
first_name: user.first_name,
last_name: user.last_name,
work_email: user.email,
uid: user.id,
skip_email_confirmation: true,
......
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