Unverified Commit 78231aab authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

Added org type field (#267)



* Added org type field

* Added org type field

* Updated the org type option values

* Added org type field

* Updated the org type option values

* Added org type to review page

* Removed for profit org option
Co-authored-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
parent ed0cab4a
......@@ -112,6 +112,22 @@ export const OPTIONS_FOR_EMPLOYEE_COUNT = [
{ label: '> 10,000', value: '> 10,000' },
];
export const OPTIONS_FOR_ORG_TYPE = [
{
label: 'Non-Profit Open Source Organization/User Group',
value: 'NON_PROFIT_OPEN_SOURCE',
},
{ label: 'Academic Organization', value: 'ACADEMIC' },
{ label: 'Standards Organization', value: 'STANDARDS' },
{
label: 'Government Organization, Government Agency, or NGO',
value: 'GOVERNMENT_ORGANIZATION_AGENCY_NGO',
},
{ label: 'Publishing/Media Organization', value: 'MEDIA_ORGANIZATION' },
{ label: 'Research Institute', value: 'RESEARCH' },
{ label: 'All others', value: 'OTHER' },
];
export const END_POINT = {
organizations: 'organizations',
contacts: 'contacts',
......@@ -166,7 +182,7 @@ export const FULL_WORKING_GROUP_LIST_FOR_REACT_ONLY = [
{ description: 'Participant Member', relation: 'WGAPS' },
{ description: 'Guest Member', relation: 'WGSAP' },
],
charter: 'https://www.eclipse.org/org/workinggroups/jakarta_ee_charter.php'
charter: 'https://www.eclipse.org/org/workinggroups/jakarta_ee_charter.php',
},
];
......
......@@ -2,6 +2,8 @@ export interface FormValue {
organization: {
id: string;
legalName: string;
type: string;
twitterHandle: string;
revenue: string;
employeeCount: string;
address: {
......@@ -13,7 +15,6 @@ export interface FormValue {
'country-label': string;
postalCode: string;
};
twitterHandle: string;
};
representative: {
member: {
......
......@@ -76,6 +76,7 @@ export function matchCompanyFields(existingOrganizationData) {
legalName: existingOrganizationData?.legal_name || '',
revenue: existingOrganizationData?.aggregate_revenue || '',
employeeCount: existingOrganizationData?.employee_count || '',
type: existingOrganizationData?.organization_type || '',
address: {
id: existingOrganizationData?.address?.id || '',
street: existingOrganizationData?.address?.street || '',
......@@ -232,6 +233,7 @@ export function matchCompanyFieldsToBackend(organizationData, formId) {
twitter: organizationData.twitterHandle || '',
aggregate_revenue: organizationData.revenue,
employee_count: organizationData.employeeCount,
organization_type: organizationData.type
};
if (organizationData.address.id) {
......
......@@ -3,7 +3,7 @@ import { formField } from '../../UIComponents/FormComponents/formFieldModel';
import Autocomplete from '@material-ui/lab/Autocomplete';
import { TextField } from '@material-ui/core';
import DropdownMenu from '../../UIComponents/Inputs/DropdownMenu';
import { OPTIONS_FOR_REVENUE, OPTIONS_FOR_EMPLOYEE_COUNT, HELPERTEXT_FOR_REVENUE } from '../../../Constants/Constants';
import { OPTIONS_FOR_ORG_TYPE, OPTIONS_FOR_REVENUE, OPTIONS_FOR_EMPLOYEE_COUNT, HELPERTEXT_FOR_REVENUE } from '../../../Constants/Constants';
/**
* Render Oraganization selector (used React-Select)
......@@ -16,7 +16,8 @@ import { OPTIONS_FOR_REVENUE, OPTIONS_FOR_EMPLOYEE_COUNT, HELPERTEXT_FOR_REVENUE
const CompanyInformationCompany = ({ formik, useStyles }) => {
const classes = useStyles();
const { organizationName, organizationTwitter, organizationAddress, organizationRevenue } = formField;
const { organizationName, organizationTwitter, organizationAddress, organizationRevenue, organizationType } =
formField;
// get country list library and map as option pass to the React-Select
const countryList = require('country-list')
......@@ -33,7 +34,7 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
Organization
</h2>
<div className="row">
<div className="col-md-16">
<div className="col-md-24">
<Input
name={organizationName.name}
labelName={organizationName.label}
......@@ -44,6 +45,17 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
onChange={formik.handleChange}
/>
</div>
</div>
<div className="row">
<div className="col-md-16">
<DropdownMenu
inputLabel={organizationType.label}
inputName={organizationType.name}
inputValue={formik.values.organization.type}
optionsArray={OPTIONS_FOR_ORG_TYPE}
handleChange={formik.handleChange}
/>
</div>
<div className="col-md-8">
<Input
name={organizationTwitter.name}
......
......@@ -38,9 +38,12 @@ const Review: React.FC<ReviewProps> = ({ values, submitForm, isTermChecked, setI
<div className="margin-top-30">
<h2 className="fw-600 h3">Company Information</h2>
<div className="row">
<div className="col-md-16">
<label>Organization Name</label>
<div className="preview-field">{values.organization.legalName}</div>
<div className="col-md-12">
<div className="margin-top-25 preview-field">{values.organization.legalName}</div>
</div>
<div className="col-md-6">
<label>Organization Type</label>
<div className="preview-field">{values.organization.type}</div>
</div>
<div className="col-md-8">
<label>Twitter</label>
......
......@@ -16,6 +16,7 @@ const vatNumber = 'VAT Number';
const countryOfRegistration = 'Country of Registration';
const REVENUE = 'Revenue';
const EMPLOYEE_COUNT = 'Employee Count';
const ORG_TYPE = 'Organization Type';
export const requiredErrorMsg = 'is required';
......@@ -28,6 +29,8 @@ export const initialValues = {
legalName: '',
revenue: '',
employeeCount: '',
type: '',
twitterHandle: '',
address: {
id: '',
street: '',
......@@ -37,7 +40,6 @@ export const initialValues = {
'country-label': '',
postalCode: '',
},
twitterHandle: '',
},
// Step1: Representatives
......@@ -144,6 +146,11 @@ export const formField = {
placeholder: EMPLOYEE_COUNT,
},
},
organizationType: {
name: 'organization.type',
label: ORG_TYPE,
placeholder: ORG_TYPE,
},
organizationAddress: {
address: {
name: 'organization.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