From e691a90a8bfa5bba7cadffb8642a45a06a276874 Mon Sep 17 00:00:00 2001 From: Vigneshkumar Chinnachamy M Date: Sat, 21 Sep 2019 22:40:24 +0530 Subject: [PATCH] revert required fields in profile settins form --- .../profile/components/ProfileSettingsForm.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx b/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx index e4f69336e..f74631635 100644 --- a/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx +++ b/src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx @@ -127,11 +127,16 @@ class ProfileSettingsForm extends Component { } onSubmit(data) { + // hardcoding company size for now as it's required in the backend + const defaultValues = { + companySize: '16-50' + } // we have to use initial data as a base for updated data // as form could update not all fields, thus they won't be included in `data` // for example user avatar is not included in `data` thus will be removed if don't use // this.props.values.settings as a base const updatedData = { + ...defaultValues, ...this.props.values.settings, ...data, } @@ -176,12 +181,13 @@ class ProfileSettingsForm extends Component { uploadPhoto={this.props.uploadPhoto} /> - {this.getField('First Name', 'firstName', false)} - {this.getField('Last Name', 'lastName', false)} + {this.getField('First Name', 'firstName', true)} + {this.getField('Last Name', 'lastName', true)} {this.getField('Title', 'title', true)}
- Business Phone + Business Phone  + *
- {this.getField('Company name', 'companyName', false, (isCustomer || isCopilot) && !isManager)} + {this.getField('Company name', 'companyName', true, (isCustomer || isCopilot) && !isManager)}
Country