Commit 162a68a1 authored by Alper Akgun's avatar Alper Akgun

Placeholder for "Number of employees" in trial

Changelog: changed
EE: true
parent 8a6f6da1
......@@ -2,9 +2,9 @@
module EE
module TrialHelper
def company_size_options_for_select(selected = 0)
def company_size_options_for_select(selected = '')
options_for_select([
[_('Please select'), 0],
[_('Please select'), ''],
['1 - 99', '1-99'],
['100 - 499', '100-499'],
['500 - 1,999', '500-1,999'],
......
......@@ -15,7 +15,7 @@
.row
.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'
= 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
.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'
......
......@@ -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
.form-group.gl-select2-html5-required-fix
= 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
= 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' }
......
......@@ -16,10 +16,12 @@ RSpec.describe 'trials/new.html.haml' do
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('last_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
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