-
Eclipse Foundation AISBL Membership Application date submitted: {now}
+
Eclipse Foundation AISBL Membership Application
+
Date submitted: {time:format(now,'d MMM uuuu, HH:mm')}
{#if includePreamble}
Dear {name},
-
Thank you for submitting the member enrollment form on behalf of your organization. Our team will review your application and follow up within 2 business days.
+
Thank you for submitting the Membership Application Form on behalf of your organization. Our team will review your application and follow up within 2 business days.
Meanwhile, if you have any questions, please reach out to us at membership.coordination@eclipse-foundation.org.
Best regards,
Eclipse Foundation Membership Coordination
{/if}
-
New form submission by: {name} ({data.form.userID})
+
Form submission by: {name} ({data.form.userID})
Organization
-
Name: {data.org.legalName}
-
Aggregate Revenue: {data.org.aggregateRevenue}
-
Employee count: {data.org.employeeCount}
+
Name: {data.org.legalName}
+
Aggregate Revenue: {data.org.aggregateRevenue}
+
Employee Count: {data.org.employeeCount}
Organization Type: {data.org.organizationType}
-
Twitter: {data.org.twitterHandle}
-
Requires purchase order: {data.form.purchaseOrderRequired}
-
VAT number: {data.form.vatNumber}
-
VAT Registration country: {data.form.registrationCountry}
+
Twitter: {data.org.twitterHandle}
+
Requires Purchase Order: {data.form.purchaseOrderRequired}
+
VAT Number: {data.form.vatNumber}
+
VAT Registration Country: {data.form.registrationCountry}
+
Membership Level: {data.form.membershipLevel}
Address
@@ -70,7 +72,18 @@
{/for}
-
+ {#if isPDF}
+
As a new Member:
+
+ - You agree to publicly support the Eclipse Foundation and its Purpose.
+ - You acknowledge your commitment in principle to comply with the Bylaws, the Internal Rules, the Eclipse Foundation Antitrust Policy, IP Policy, and any and all additional policies, procedures and other governing rules of the Eclipse Foundation.
+ - You agree to provide Eclipse Foundation with your logo (or instructions to obtain your logo) in accordance with Section 2.3 of the Eclipse Foundation Membership Agreement. When providing your logo, be sure to include a reference or link to any logo and trademark usage guidelines you have.
+ Our Membership Coordination team will work with you to complete this after your Membership Application is processed.
+
+
Thank you for completing the Membership Application Process. This PDF captures the information you have provided to us. Please review this information as it becomes a part of your formal application to the Eclipse Foundation.
+
Should you wish to update any of the information, please reach out to our Membership team at membership.coordination@eclipse-foundation.org
+ {/if}
+
This is an automatic message from https://membership.eclipse.org
Twitter: @EclipseFdn
diff --git a/src/main/www/src/App.css b/src/main/www/src/App.css
index ab73c8ba86071ead8adfe79cbe7679eb1bce329f..0b0ac52483423e5c11ef3227ebc92cf55d62f0c7 100644
--- a/src/main/www/src/App.css
+++ b/src/main/www/src/App.css
@@ -41,6 +41,8 @@ html {
display: flex;
align-items: center;
justify-content: center;
+}
+.eclipsefdn-membership-webform .loadingIcon {
margin-top: 5rem;
margin-bottom: 3rem;
}
@@ -56,7 +58,7 @@ html {
border-color: #ff0000;
}
.eclipsefdn-membership-webform .btn {
- margin: 0 10px;
+ margin: 10px;
border-radius: 5px;
}
.eclipsefdn-membership-webform .button-container {
@@ -116,6 +118,7 @@ html {
justify-content: center;
position: relative;
padding-top: 30px;
+ cursor: pointer;
}
.eclipsefdn-membership-webform .step a {
text-decoration: none;
diff --git a/src/main/www/src/Constants/Constants.js b/src/main/www/src/Constants/Constants.js
index 532315930afd5053b91d20919c790f35510818cf..205cafd8d4bc5e3817654dc3cf57397bd9c9075d 100644
--- a/src/main/www/src/Constants/Constants.js
+++ b/src/main/www/src/Constants/Constants.js
@@ -31,6 +31,7 @@ export const REVIEW = 'Review';
export const HAS_TOKEN_EXPIRED = 'HAS_TOKEN_EXPIRED';
export const LOGIN_EXPIRED_MSG = 'Your session has expired, please sign in again.';
+export const MAX_LENGTH_HELPER_TEXT = 'The value exceeds max length 255 characters'
export const PATH_NAME_ARRAY = [
'/company-info',
@@ -57,18 +58,18 @@ export const FETCH_HEADER = {
export const MEMBERSHIP_LEVELS = [
{ label: 'Strategic Member', value: 'Strategic Member' },
{
- label: 'Contributing Member (formerly referred to as Solutions Members)',
+ label: 'Contributing Member',
value: 'Contributing Member',
},
{ label: 'Associate Member', value: 'Associate Member' },
];
export const PAGE_STEP = [
- { props: { label: COMPANY_INFORMATION, pathName: '/company-info' } },
- { props: { label: MEMBERSHIP_LEVEL, pathName: '/membership-level' } },
- { props: { label: WORKING_GROUPS, pathName: '/working-groups' } },
- { props: { label: SIGNING_AUTHORITY, pathName: '/signing-authority' } },
- { props: { label: REVIEW, pathName: '/review' } },
+ { label: COMPANY_INFORMATION, pathName: '/company-info' },
+ { label: MEMBERSHIP_LEVEL, pathName: '/membership-level' },
+ { label: WORKING_GROUPS, pathName: '/working-groups' },
+ { label: SIGNING_AUTHORITY, pathName: '/signing-authority' },
+ { label: REVIEW, pathName: '/review' },
];
export const CONTACT_TYPE = {
diff --git a/src/main/www/src/Utils/formFunctionHelpers.js b/src/main/www/src/Utils/formFunctionHelpers.js
index 86d78e288464e752ac0764da56d10fd31808af6d..50d201897aa601f1e6792d8c531bd8a07086c386 100644
--- a/src/main/www/src/Utils/formFunctionHelpers.js
+++ b/src/main/www/src/Utils/formFunctionHelpers.js
@@ -7,7 +7,6 @@ import {
getCurrentMode,
MODE_REACT_ONLY,
MODE_REACT_API,
- PATH_NAME_ARRAY,
HAS_TOKEN_EXPIRED,
} from '../Constants/Constants';
@@ -179,7 +178,8 @@ export function matchContactFields(existingContactData) {
*/
export function matchWorkingGroupFields(
existingworkingGroupData,
- workingGroupsOptions
+ workingGroupsOptions,
+ existingCompanyContact,
) {
var res = [];
// Array
@@ -187,6 +187,12 @@ export function matchWorkingGroupFields(
let wg = workingGroupsOptions?.find(
(el) => el.label === item?.working_group_id
);
+ const basicRepInfo = {
+ firstName: item?.contact?.first_name || '',
+ lastName: item?.contact?.last_name || '',
+ jobtitle: item?.contact?.job_title || '',
+ email: item?.contact?.email || '',
+ };
res.push({
id: item?.id || '',
workingGroup:
@@ -198,11 +204,12 @@ export function matchWorkingGroupFields(
participationLevel: item?.participation_level || '',
effectiveDate: item?.effective_date?.substring(0, 10) || '',
workingGroupRepresentative: {
- firstName: item?.contact?.first_name || '',
- lastName: item?.contact?.last_name || '',
- jobtitle: item?.contact?.job_title || '',
- email: item?.contact?.email || '',
+ ...basicRepInfo,
id: item?.contact?.id || '',
+ sameAsCompany: checkSameContact(
+ existingCompanyContact,
+ basicRepInfo
+ ),
},
});
});
@@ -306,9 +313,7 @@ export function matchWGFieldsToBackend(eachWorkingGroupData, formId) {
formId
);
- const theDate = eachWorkingGroupData?.effectiveDate
- ? new Date(eachWorkingGroupData?.effectiveDate)
- : new Date();
+ const theDate = new Date();
return {
id: eachWorkingGroupData?.id,
@@ -329,27 +334,14 @@ export function matchWGFieldsToBackend(eachWorkingGroupData, formId) {
* @param formId - Form Id fetched from the server, sotored in membership context, used for calling APIs
* @param userId - User Id fetched from the server when sign in, sotored in membership context, used for calling APIs
*/
-export async function executeSendDataByStep(
- step,
- formData,
- formId,
- userId,
- goToNextStep,
- setFieldValueObj
-) {
- const goToNextStepObj = {
- method: goToNextStep,
- stepNum: step,
- pathName: PATH_NAME_ARRAY[step],
- };
+export async function executeSendDataByStep(step, formData, formId, userId, setFieldValueObj) {
switch (step) {
case 1:
- // only need 1 goToNextStepObj in "case 1", or it would execute it 5 times.
callSendData(
formId,
END_POINT.organizations,
matchCompanyFieldsToBackend(formData.organization, formId),
- goToNextStepObj,
+ step,
{
fieldName: setFieldValueObj.fieldName.organization,
method: setFieldValueObj.method,
@@ -358,12 +350,8 @@ export async function executeSendDataByStep(
callSendData(
formId,
END_POINT.contacts,
- matchContactFieldsToBackend(
- formData.representative.member,
- CONTACT_TYPE.COMPANY,
- formId
- ),
- '',
+ matchContactFieldsToBackend(formData.representative.member, CONTACT_TYPE.COMPANY, formId),
+ step,
{
fieldName: setFieldValueObj.fieldName.member,
method: setFieldValueObj.method,
@@ -372,12 +360,8 @@ export async function executeSendDataByStep(
callSendData(
formId,
END_POINT.contacts,
- matchContactFieldsToBackend(
- formData.representative.marketing,
- CONTACT_TYPE.MARKETING,
- formId
- ),
- '',
+ matchContactFieldsToBackend(formData.representative.marketing, CONTACT_TYPE.MARKETING, formId),
+ step,
{
fieldName: setFieldValueObj.fieldName.marketing,
method: setFieldValueObj.method,
@@ -386,12 +370,8 @@ export async function executeSendDataByStep(
callSendData(
formId,
END_POINT.contacts,
- matchContactFieldsToBackend(
- formData.representative.accounting,
- CONTACT_TYPE.ACCOUNTING,
- formId
- ),
- '',
+ matchContactFieldsToBackend(formData.representative.accounting, CONTACT_TYPE.ACCOUNTING, formId),
+ step,
{
fieldName: setFieldValueObj.fieldName.accounting,
method: setFieldValueObj.method,
@@ -403,15 +383,27 @@ export async function executeSendDataByStep(
matchMembershipLevelFieldsToBackend(formData, formId, userId),
''
);
+ let isWGRepSameAsCompany = false;
+ formData.workingGroups.map(
+ (wg) => (isWGRepSameAsCompany = wg.workingGroupRepresentative?.sameAsCompany || isWGRepSameAsCompany)
+ );
+ // only do this API call when there is at least 1 WG rep is same as company rep
+ if (isWGRepSameAsCompany) {
+ formData.workingGroups.forEach((item, index) => {
+ callSendData(
+ formId,
+ END_POINT.working_groups,
+ matchWGFieldsToBackend(item, formId),
+ '',
+ setFieldValueObj,
+ index
+ );
+ });
+ }
break;
case 2:
- callSendData(
- formId,
- '',
- matchMembershipLevelFieldsToBackend(formData, formId, userId),
- goToNextStepObj
- );
+ callSendData(formId, '', matchMembershipLevelFieldsToBackend(formData, formId, userId), step);
break;
case 3:
@@ -420,7 +412,7 @@ export async function executeSendDataByStep(
formId,
END_POINT.working_groups,
matchWGFieldsToBackend(item, formId),
- goToNextStepObj,
+ step,
setFieldValueObj,
index
);
@@ -431,24 +423,14 @@ export async function executeSendDataByStep(
callSendData(
formId,
END_POINT.contacts,
- matchContactFieldsToBackend(
- formData.signingAuthorityRepresentative,
- CONTACT_TYPE.SIGNING,
- formId
- ),
- goToNextStepObj,
+ matchContactFieldsToBackend(formData.signingAuthorityRepresentative, CONTACT_TYPE.SIGNING, formId),
+ step,
setFieldValueObj
);
break;
case 5:
- callSendData(
- formId,
- END_POINT.complete,
- false,
- goToNextStepObj,
- setFieldValueObj
- );
+ callSendData(formId, END_POINT.complete, false, step, setFieldValueObj);
break;
default:
@@ -468,7 +450,7 @@ function callSendData(
formId,
endpoint = '',
dataBody,
- goToNextStepObj,
+ stepNum,
setFieldValueObj,
index
) {
@@ -490,9 +472,6 @@ function callSendData(
if (getCurrentMode() === MODE_REACT_ONLY) {
console.log(`You called ${url} with Method ${method} and data body is:`);
console.log(JSON.stringify(dataBody));
- if (goToNextStepObj) {
- goToNextStepObj.method(goToNextStepObj.stepNum, goToNextStepObj.pathName);
- }
}
if (getCurrentMode() === MODE_REACT_API) {
@@ -502,7 +481,7 @@ function callSendData(
body: JSON.stringify(dataBody),
})
.then((res) => {
- if (goToNextStepObj.stepNum === 5) {
+ if (stepNum === 5) {
if (res.ok) return res;
} else {
if (res.ok) return res.json();
@@ -573,13 +552,6 @@ function callSendData(
break;
}
}
-
- if (goToNextStepObj) {
- goToNextStepObj.method(
- goToNextStepObj.stepNum,
- goToNextStepObj.pathName
- );
- }
})
.catch((err) => {
console.log(err);
diff --git a/src/main/www/src/components/Application/Application.js b/src/main/www/src/components/Application/Application.js
index d2bf601e8a7a9d1cf1f9274fed1b4f1abb4ada50..ac0f1270299048b62ed2dcf325ac67c7ad90306e 100644
--- a/src/main/www/src/components/Application/Application.js
+++ b/src/main/www/src/components/Application/Application.js
@@ -25,6 +25,8 @@ export default function Application() {
const [isStartNewForm, setIsStartNewForm] = useState(true);
const [isLoginExpired, setIsLoginExpired] = useState(false);
const [isTermChecked, setIsTermChecked] = useState(false);
+ const [fullWorkingGroupList, setFullWorkingGroupList] = useState([]);
+ const [workingGroupsUserJoined, setWorkingGroupsUserJoined] = useState([]);
const goToNextStep = (pageIndex, nextPage) => {
if (furthestPage.index <= pageIndex)
@@ -56,175 +58,160 @@ export default function Application() {
'',
currentFormId,
currentUser.name,
- goToNextStep,
''
);
+ goToNextStep(5, '/submitted');
};
+ const submitCompanyInfo = (isUsingStepper) => {
+ const values = formikCompanyInfo.values;
+ // update the organization values
+ const organization = values.organization;
+ const representative = values.representative;
+ const purchasingAndVAT = values.purchasingAndVAT;
+ const membershipLevel = values.membershipLevel;
+ const membershipLevelLabel = values['membershipLevel-label'];
+ const signingAuthorityRepresentative = values.signingAuthorityRepresentative;
+
+ const theNewValue = {
+ ...updatedFormValues,
+ organization,
+ representative,
+ purchasingAndVAT,
+ membershipLevel,
+ 'membershipLevel-label': membershipLevelLabel,
+ workingGroups: formikWorkingGroups.values.workingGroups,
+ signingAuthorityRepresentative: signingAuthorityRepresentative,
+ };
+ setUpdatedFormValues(theNewValue);
+ console.log('updated company info: ', values);
+
+ const valueForMembershipLevelFormik = [
+ { field: 'purchasingAndVAT', value: purchasingAndVAT },
+ { field: 'membershipLevel', value: membershipLevel },
+ {
+ field: 'membershipLevel-label',
+ value: membershipLevelLabel?.label ? membershipLevelLabel : null,
+ },
+ ];
+ // set valueToUpdateFormik to membershipLevel formik to make sure the value is up to date
+ updateMembershipLevelForm(valueForMembershipLevelFormik);
+
+ const valueForSigningAuthorityFormik = [
+ {
+ field: 'signingAuthorityRepresentative',
+ value: signingAuthorityRepresentative,
+ },
+ ];
+ updateSigningAuthorityForm(valueForSigningAuthorityFormik);
+
+ const setFieldValueObj = {
+ fieldName: {
+ organization: 'organization',
+ member: 'representative.member',
+ accounting: 'representative.accounting',
+ marketing: 'representative.marketing',
+ },
+ method: formikCompanyInfo.setFieldValue,
+ };
+
+ executeSendDataByStep(1, theNewValue, currentFormId, currentUser.name, setFieldValueObj);
+ // Only need to call goToNextStep when is not using stepper
+ !isUsingStepper && goToNextStep(1, '/membership-level');
+ };
const formikCompanyInfo = useFormik({
initialValues: initialValues,
validationSchema: validationSchema[0],
- onSubmit: (values) => {
- // update the organization values
- const organization = values.organization;
- const representative = values.representative;
- const purchasingAndVAT = values.purchasingAndVAT;
- const membershipLevel = values.membershipLevel;
- const membershipLevelLabel = values['membershipLevel-label'];
- const signingAuthorityRepresentative =
- values.signingAuthorityRepresentative;
-
- const theNewValue = {
- ...updatedFormValues,
- organization,
- representative,
- purchasingAndVAT,
- membershipLevel,
- 'membershipLevel-label': membershipLevelLabel,
- signingAuthorityRepresentative: signingAuthorityRepresentative,
- };
- setUpdatedFormValues(theNewValue);
- console.log('updated company info: ', values);
-
- const valueForMembershipLevelFormik = [
- { field: 'purchasingAndVAT', value: purchasingAndVAT },
- { field: 'membershipLevel', value: membershipLevel },
- {
- field: 'membershipLevel-label',
- value: membershipLevelLabel?.label ? membershipLevelLabel : null,
- },
- ];
- // set valueToUpdateFormik to membershipLevel formik to make sure the value is up to date
- updateMembershipLevelForm(valueForMembershipLevelFormik);
-
- const valueForSigningAuthorityFormik = [
- {
- field: 'signingAuthorityRepresentative',
- value: signingAuthorityRepresentative,
- },
- ];
- updateSigningAuthorityForm(valueForSigningAuthorityFormik);
-
- const setFieldValueObj = {
- fieldName: {
- organization: 'organization',
- member: 'representative.member',
- accounting: 'representative.accounting',
- marketing: 'representative.marketing',
- },
- method: formikCompanyInfo.setFieldValue,
- };
- executeSendDataByStep(
- 1,
- theNewValue,
- currentFormId,
- currentUser.name,
- goToNextStep,
- setFieldValueObj
- );
- },
+ onSubmit: () => submitCompanyInfo(),
});
+ const submitMembershipLevel = (isUsingStepper) => {
+ const values = formikMembershipLevel.values;
+ // update the membershipLevel values
+ const membershipLevel = values.membershipLevel;
+ const membershipLevelLabel = values['membershipLevel-label'];
+ setUpdatedFormValues({
+ ...updatedFormValues,
+ membershipLevel,
+ 'membershipLevel-label': membershipLevelLabel,
+ });
+ console.log('updated membership level: ', values);
+
+ const valueToUpdateFormik = [
+ { field: 'membershipLevel', value: membershipLevel },
+ { field: 'membershipLevel-label', value: membershipLevelLabel },
+ ];
+ // set valueToUpdateFormik to CompanyInfo formik to make sure the value is up to date
+ updateCompanyInfoForm(valueToUpdateFormik);
+
+ executeSendDataByStep(2, values, currentFormId, currentUser.name);
+ !isUsingStepper && goToNextStep(2, '/working-groups');
+ };
const formikMembershipLevel = useFormik({
initialValues: initialValues,
validationSchema: validationSchema[1],
- onSubmit: (values) => {
- // update the membershipLevel values
- const membershipLevel = values.membershipLevel;
- const membershipLevelLabel = values['membershipLevel-label'];
- setUpdatedFormValues({
- ...updatedFormValues,
- membershipLevel,
- 'membershipLevel-label': membershipLevelLabel,
- });
- console.log('updated membership level: ', values);
-
- const valueToUpdateFormik = [
- { field: 'membershipLevel', value: membershipLevel },
- { field: 'membershipLevel-label', value: membershipLevelLabel },
- ];
- // set valueToUpdateFormik to CompanyInfo formik to make sure the value is up to date
- updateCompanyInfoForm(valueToUpdateFormik);
-
- executeSendDataByStep(
- 2,
- values,
- currentFormId,
- currentUser.name,
- goToNextStep
- );
- },
+ onSubmit: () => submitMembershipLevel(),
});
+ const submitWorkingGroups = (isUsingStepper) => {
+ const values = formikWorkingGroups.values;
+ // update the workingGroups values
+ const workingGroups = values.workingGroups;
+ setUpdatedFormValues({ ...updatedFormValues, workingGroups });
+ console.log('updated working groups: ', values);
+
+ if (!values.skipJoiningWG) {
+ // If the user is joining at least 1 wg, then make related API call
+ const setFieldValueObj = {
+ fieldName: 'workingGroups',
+ method: formikWorkingGroups.setFieldValue,
+ };
+
+ executeSendDataByStep(3, values, currentFormId, currentUser.name, setFieldValueObj);
+ !isUsingStepper && goToNextStep(3, '/signing-authority');
+ } else if (!isUsingStepper) {
+ // If the user is NOT using stepper and NOT joining any wg, then go to next page directly
+ goToNextStep(3, '/signing-authority');
+ }
+ };
const formikWorkingGroups = useFormik({
initialValues: initialValues,
validationSchema: validationSchema[2],
- onSubmit: (values) => {
- // update the workingGroups values
- const workingGroups = values.workingGroups;
- setUpdatedFormValues({ ...updatedFormValues, workingGroups });
- console.log('updated working groups: ', values);
-
- if (values.isJoiningWG){
- // If the user is joining at least 1 wg, then make related API call
- const setFieldValueObj = {
- fieldName: 'workingGroups',
- method: formikWorkingGroups.setFieldValue,
- };
-
- executeSendDataByStep(
- 3,
- values,
- currentFormId,
- currentUser.name,
- goToNextStep,
- setFieldValueObj
- );
- } else {
- // If the user is NOT joining any wg, then go to next page directly
- goToNextStep(3, '/signing-authority')
- }
-
- },
+ onSubmit: () => submitWorkingGroups(),
});
+ const submitSigningAuthority = (isUsingStepper) => {
+ const values = formikSigningAuthority.values;
+ // update the signingAuthorityRepresentative values
+ const signingAuthorityRepresentative = values.signingAuthorityRepresentative;
+ setUpdatedFormValues({
+ ...updatedFormValues,
+ signingAuthorityRepresentative,
+ });
+ console.log('updated SigningAuthority: ', values);
+
+ const valueToUpdateFormik = [
+ {
+ field: 'signingAuthorityRepresentative',
+ value: signingAuthorityRepresentative,
+ },
+ ];
+ // set valueToUpdateFormik to CompanyInfo formik to make sure the value is up to date
+ updateCompanyInfoForm(valueToUpdateFormik);
+ const setFieldValueObj = {
+ fieldName: 'signingAuthorityRepresentative',
+ method: {
+ signingAuthority: formikSigningAuthority.setFieldValue,
+ companyInfo: formikCompanyInfo.setFieldValue,
+ },
+ };
+ executeSendDataByStep(4, values, currentFormId, currentUser.name, setFieldValueObj);
+ !isUsingStepper && goToNextStep(4, '/review');
+ };
const formikSigningAuthority = useFormik({
initialValues: initialValues,
validationSchema: validationSchema[3],
- onSubmit: (values) => {
- // update the signingAuthorityRepresentative values
- const signingAuthorityRepresentative =
- values.signingAuthorityRepresentative;
- setUpdatedFormValues({
- ...updatedFormValues,
- signingAuthorityRepresentative,
- });
- console.log('updated SigningAuthority: ', values);
-
- const valueToUpdateFormik = [
- {
- field: 'signingAuthorityRepresentative',
- value: signingAuthorityRepresentative,
- },
- ];
- // set valueToUpdateFormik to CompanyInfo formik to make sure the value is up to date
- updateCompanyInfoForm(valueToUpdateFormik);
- const setFieldValueObj = {
- fieldName: 'signingAuthorityRepresentative',
- method: {
- signingAuthority: formikSigningAuthority.setFieldValue,
- companyInfo: formikCompanyInfo.setFieldValue,
- },
- };
- executeSendDataByStep(
- 4,
- values,
- currentFormId,
- currentUser.name,
- goToNextStep,
- setFieldValueObj
- );
- },
+ onSubmit: () => submitSigningAuthority(),
});
const handleLoginExpired = useCallback(() => {
@@ -248,16 +235,19 @@ export default function Application() {
// generate the step options above the form
const renderStepper = () => (
-
+
{PAGE_STEP.map((pageStep, index) => {
return (
);
})}
@@ -293,6 +283,10 @@ export default function Application() {
) : (
// if uses are not allowed to visit this page,
@@ -316,7 +310,10 @@ export default function Application() {
{furthestPage.index >= 3 ? (
) : (
diff --git a/src/main/www/src/components/Application/CompanyInformation/CompanyInformation.js b/src/main/www/src/components/Application/CompanyInformation/CompanyInformation.js
index 4f5691a15e2ac58c645f1eb46f56eb570740acb5..938cbece6e96758e10059c52516f60de1e6952c3 100644
--- a/src/main/www/src/components/Application/CompanyInformation/CompanyInformation.js
+++ b/src/main/www/src/components/Application/CompanyInformation/CompanyInformation.js
@@ -21,6 +21,10 @@ import {
import CustomStepButton from '../../UIComponents/Button/CustomStepButton';
import CompanyInformationVAT from './CompanyInformationVAT';
import { makeStyles } from '@material-ui/core';
+import {
+ fetchAvailableFullWorkingGroupList,
+ fetchWorkingGroupsUserJoined,
+} from '../WorkingGroups/WorkingGroupsWrapper';
/**
* Wrapper for Contacts and Company components
@@ -35,6 +39,8 @@ import { makeStyles } from '@material-ui/core';
* - formField: the form field in formModels/formFieldModel.js
*/
+let hasWGData = false;
+
const useStyles = makeStyles(() => ({
textField: {
marginBottom: 14,
@@ -48,10 +54,19 @@ const useStyles = makeStyles(() => ({
let hasOrgData = false;
let hasMembershipLevelData = false;
-const CompanyInformation = ({ formik, isStartNewForm }) => {
+const CompanyInformation = ({
+ formik,
+ isStartNewForm,
+ formikWG,
+ fullWorkingGroupList,
+ setFullWorkingGroupList,
+ setWorkingGroupsUserJoined,
+}) => {
const { currentFormId } = useContext(MembershipContext); // current chosen form id
const [loading, setLoading] = useState(true);
const { setFieldValue } = formik;
+ const setWGFieldValue = formikWG.setFieldValue;
+ const companyRep = formik.values.representative.member;
useEffect(() => {
scrollToTop();
@@ -84,24 +99,12 @@ const CompanyInformation = ({ formik, isStartNewForm }) => {
// Using promise pool, because in first step,
// need to get company data, and contacts data
let pool = [
- fetch(
- url_prefix_local +
- `/${currentFormId}/` +
- END_POINT.organizations +
- url_suffix_local,
- {
- headers: FETCH_HEADER,
- }
- ),
- fetch(
- url_prefix_local +
- `/${currentFormId}/` +
- END_POINT.contacts +
- url_suffix_local,
- {
- headers: FETCH_HEADER,
- }
- ),
+ fetch(url_prefix_local + `/${currentFormId}/` + END_POINT.organizations + url_suffix_local, {
+ headers: FETCH_HEADER,
+ }),
+ fetch(url_prefix_local + `/${currentFormId}/` + END_POINT.contacts + url_suffix_local, {
+ headers: FETCH_HEADER,
+ }),
];
Promise.all(pool)
.then((res) =>
@@ -140,10 +143,7 @@ const CompanyInformation = ({ formik, isStartNewForm }) => {
// if nested, it will automatically map the properties and values
setFieldValue('representative', tempContacts.organizationContacts);
- setFieldValue(
- 'signingAuthorityRepresentative',
- tempContacts.signingAuthorityRepresentative
- );
+ setFieldValue('signingAuthorityRepresentative', tempContacts.signingAuthorityRepresentative);
hasOrgData = true;
}
setLoading(false);
@@ -202,6 +202,35 @@ const CompanyInformation = ({ formik, isStartNewForm }) => {
}
}, [isStartNewForm, setFieldValue, currentFormId]);
+ useEffect(() => {
+ fetchAvailableFullWorkingGroupList(setFullWorkingGroupList);
+ }, [setFullWorkingGroupList]);
+
+ useEffect(() => {
+ if (!isStartNewForm && !hasWGData && fullWorkingGroupList.length > 0 && companyRep.firstName) {
+ // continue with an existing one and there is no working group data
+ fetchWorkingGroupsUserJoined(
+ currentFormId,
+ fullWorkingGroupList,
+ setWorkingGroupsUserJoined,
+ setWGFieldValue,
+ companyRep,
+ setLoading
+ );
+ hasWGData = true;
+ } else {
+ setLoading(false);
+ }
+ }, [
+ isStartNewForm,
+ currentFormId,
+ fullWorkingGroupList,
+ setFieldValue,
+ companyRep,
+ setWGFieldValue,
+ setWorkingGroupsUserJoined,
+ ]);
+
// If it is in loading status or hasn't gotten the form id,
// only return a loading spinning
if (loading || !currentFormId) {
@@ -213,19 +242,23 @@ const CompanyInformation = ({ formik, isStartNewForm }) => {
Company Information
- Please complete your company information below. This should be the
- legal name and address of your organization.
+ Please complete your company information below. This should be the legal name and address of your
+ organization.
+
+
+ **** NOTE: Committers wishing to complete the Eclipse Foundation membership process should not use this form,
+ but instead should visit{' '}
+
+ here
+
+ .
-
+
-
+
);
};
diff --git a/src/main/www/src/components/Application/CompanyInformation/CompanyInformationCompany.js b/src/main/www/src/components/Application/CompanyInformation/CompanyInformationCompany.js
index 1d30502887d087193ccd18e0d7e99f7aba67f215..8c4dc2ea638aa18386d9c460a591cce21f2fb54e 100644
--- a/src/main/www/src/components/Application/CompanyInformation/CompanyInformationCompany.js
+++ b/src/main/www/src/components/Application/CompanyInformation/CompanyInformationCompany.js
@@ -3,7 +3,12 @@ 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_ORG_TYPE, 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)
@@ -43,6 +48,8 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
requiredMark={true}
value={formik.values.organization.legalName}
onChange={formik.handleChange}
+ error={formik.touched.organization?.legalName && Boolean(formik.errors.organization?.legalName)}
+ helperText={formik.errors.organization?.legalName}
/>
@@ -54,6 +61,8 @@ const CompanyInformationCompany = ({ formik, useStyles }) => {
inputValue={formik.values.organization.type}
optionsArray={OPTIONS_FOR_ORG_TYPE}
handleChange={formik.handleChange}
+ error={formik.touched.organization?.type && Boolean(formik.errors.organization?.type)}
+ helperText={formik.errors.organization?.type}
/>