Commit 49912e1f authored by Mark Florian's avatar Mark Florian

Merge branch '337622-number-of-employees-placeholder' into 'master'

Placeholder for "Number of employees" in trial form

See merge request gitlab-org/gitlab!67688
parents 9a8c2097 162a68a1
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
module EE module EE
module TrialHelper module TrialHelper
def company_size_options_for_select(selected = 0) def company_size_options_for_select(selected = '')
options_for_select([ options_for_select([
[_('Please select'), 0], [_('Please select'), ''],
['1 - 99', '1-99'], ['1 - 99', '1-99'],
['100 - 499', '100-499'], ['100 - 499', '100-499'],
['500 - 1,999', '500-1,999'], ['500 - 1,999', '500-1,999'],
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
.row .row
.form-group.col-sm-12.gl-select2-html5-required-fix .form-group.col-sm-12.gl-select2-html5-required-fix
= label_tag :company_size, s_('Trial|Number of employees'), for: :company_size, class: 'col-form-label' = label_tag :company_size, s_('Trial|Number of employees'), for: :company_size, class: 'col-form-label'
= select_tag :company_size, company_size_options_for_select(params[:company_size]), include_blank: true, class: 'js-trial-field select2', required: true = select_tag :company_size, company_size_options_for_select(params[:company_size]), class: 'js-trial-field select2', required: true
.row .row
.form-group.col-sm-12 .form-group.col-sm-12
= label_tag :number_of_users, s_('Trial|How many employees will use Gitlab?'), for: :number_of_users, class: 'col-form-label' = label_tag :number_of_users, s_('Trial|How many employees will use Gitlab?'), for: :number_of_users, class: 'col-form-label'
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
= text_field_tag :company_name, params[:company_name] || current_user.organization, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'company_name' }, readonly: readonly = text_field_tag :company_name, params[:company_name] || current_user.organization, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'company_name' }, readonly: readonly
.form-group.gl-select2-html5-required-fix .form-group.gl-select2-html5-required-fix
= label_tag :company_size, _('Number of employees'), for: :company_size, class: 'col-form-label' = label_tag :company_size, _('Number of employees'), for: :company_size, class: 'col-form-label'
= select_tag :company_size, company_size_options_for_select(params[:company_size]), include_blank: true, class: 'select2', required: true, data: { qa_selector: 'number_of_employees' } = select_tag :company_size, company_size_options_for_select(params[:company_size]), class: 'select2', required: true, data: { qa_selector: 'number_of_employees' }
.form-group .form-group
= label_tag :phone_number, _('Telephone number'), for: :phone_number, class: 'col-form-label' = label_tag :phone_number, _('Telephone number'), for: :phone_number, class: 'col-form-label'
= telephone_field_tag :phone_number, params[:phone_number], pattern: '^(\+)*[0-9-\s]+$', class: 'form-control gl-form-input', required: true, data: { qa_selector: 'telephone_number' } = telephone_field_tag :phone_number, params[:phone_number], pattern: '^(\+)*[0-9-\s]+$', class: 'form-control gl-form-input', required: true, data: { qa_selector: 'telephone_number' }
......
...@@ -16,10 +16,12 @@ RSpec.describe 'trials/new.html.haml' do ...@@ -16,10 +16,12 @@ RSpec.describe 'trials/new.html.haml' do
subject { rendered } subject { rendered }
it 'has fields for first, last and company names', :aggregate_failures do it 'has fields for first, last company name and size', :aggregate_failures do
is_expected.to have_field('first_name') is_expected.to have_field('first_name')
is_expected.to have_field('last_name') is_expected.to have_field('last_name')
is_expected.to have_field('company_name') is_expected.to have_field('company_name')
sizes = ['Please select', '1 - 99', '100 - 499', '500 - 1,999', '2,000 - 9,999', '10,000 +']
is_expected.to have_select('company_size', options: sizes, selected: [])
end end
context 'remove_known_trial_form_fields noneditable experiment is enabled' do context 'remove_known_trial_form_fields noneditable experiment is enabled' do
......
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