Commit 26304dca authored by Zhou Fang's avatar Zhou Fang Committed by Martin Lowe
Browse files

Added employee count

parent 5ae9742d
......@@ -220,14 +220,16 @@ export function matchCompanyFieldsToBackend(organizationData, formId) {
address: {
city: organizationData.address.city,
country: organizationData.address.country,
postal_code: organizationData.address.postalCode,
province_state: organizationData.address.provinceOrState,
postal_code: organizationData.address.postalCode || '',
province_state: organizationData.address.provinceOrState || '',
street: organizationData.address.street,
},
form_id: formId,
id: organizationData.id,
legal_name: organizationData.legalName,
twitter: organizationData.twitterHandle || '',
aggregate_revenue: `${organizationData.revenue} ${organizationData.currency}`,
employee_count: organizationData.employeeCount,
};
if (organizationData.address.id) {
......
......@@ -23,13 +23,10 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
.getNames()
.map((item) => ({ label: item, value: item }));
const handleRevenueChange = (value) => {
formik.setFieldValue('organization.revenue', value);
const handleFieldChange = (value, fieldName) => {
formik.setFieldValue(fieldName, value);
};
const handleCurrencyChange = (value) => {
formik.setFieldValue('organization.currency', value);
};
return (
<>
<h2 className="fw-600 h4" id={organizationName.name}>
......@@ -61,9 +58,9 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
/>
</div>
</div>
<p>Let us know your corporate revenue from all the Affiliates.</p>
<p>Let us know your corporate revenue from all the affiliates.</p>
<div className="row">
<div className="col-md-8">
<div className="col-md-10">
<Input
name={organizationRevenue.revenue.name}
labelName={organizationRevenue.revenue.label}
......@@ -71,17 +68,29 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
requiredMark={true}
type={'number'}
value={formik.values.organization.revenue}
onChange={(ev) => handleRevenueChange(ev.target.value)}
onChange={(ev) => handleFieldChange(ev.target.value, 'organization.revenue')}
ariaLabel={`${organizationRevenue.revenue.name}`}
/>
</div>
<div className="col-md-4">
<div className="col-md-6">
<DropdownMenu
inputLabel={organizationRevenue.currency.label}
inputName={organizationRevenue.currency.name}
inputValue={formik.values.organization.currency}
optionsArray={OPTIONS_FOR_REVENUE_CURRENCY}
handleChange={(ev) => handleCurrencyChange(ev.target.value)}
handleChange={(ev) => handleFieldChange(ev.target.value, 'organization.currency')}
/>
</div>
<div className="col-md-8">
<Input
name={organizationRevenue.employeeCount.name}
labelName={organizationRevenue.employeeCount.label}
placeholder={organizationRevenue.employeeCount.placeholder}
requiredMark={true}
type={'number'}
value={formik.values.organization.employeeCount}
onChange={(ev) => handleFieldChange(ev.target.value, 'organization.employeeCount')}
ariaLabel={`${organizationRevenue.employeeCount.name}`}
/>
</div>
</div>
......
......@@ -16,6 +16,7 @@ const vatNumber = 'VAT Number';
const countryOfRegistration = 'Country of Registration';
const REVENUE = 'Revenue';
const CURRENCY = 'Currency';
const EMPLOYEE_COUNT = 'Employee Count';
export const requiredErrorMsg = 'is required';
......@@ -28,6 +29,7 @@ export const initialValues = {
legalName: '',
revenue: '',
currency: '',
employeeCount: '',
address: {
id: '',
street: '',
......@@ -143,6 +145,11 @@ export const formField = {
label: CURRENCY,
placeholder: CURRENCY,
},
employeeCount: {
name: 'employeeCount',
label: EMPLOYEE_COUNT,
placeholder: EMPLOYEE_COUNT,
},
},
organizationAddress: {
address: {
......
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