Skip to content

Commit a93bff2

Browse files
authored
Merge pull request #3326 from vigneshTheDev/revert-profile-settings-required-fields
revert required fields in profile settings form
2 parents dd14de4 + e691a90 commit a93bff2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,16 @@ class ProfileSettingsForm extends Component {
127127
}
128128

129129
onSubmit(data) {
130+
// hardcoding company size for now as it's required in the backend
131+
const defaultValues = {
132+
companySize: '16-50'
133+
}
130134
// we have to use initial data as a base for updated data
131135
// as form could update not all fields, thus they won't be included in `data`
132136
// for example user avatar is not included in `data` thus will be removed if don't use
133137
// this.props.values.settings as a base
134138
const updatedData = {
139+
...defaultValues,
135140
...this.props.values.settings,
136141
...data,
137142
}
@@ -176,12 +181,13 @@ class ProfileSettingsForm extends Component {
176181
uploadPhoto={this.props.uploadPhoto}
177182
/>
178183
</div>
179-
{this.getField('First Name', 'firstName', false)}
180-
{this.getField('Last Name', 'lastName', false)}
184+
{this.getField('First Name', 'firstName', true)}
185+
{this.getField('Last Name', 'lastName', true)}
181186
{this.getField('Title', 'title', true)}
182187
<div className="field">
183188
<div className="label">
184-
<span styleName="fieldLabelText">Business Phone</span>
189+
<span styleName="fieldLabelText">Business Phone</span>&nbsp;
190+
<sup styleName="requiredMarker">*</sup>
185191
</div>
186192
<div className="input-field">
187193
<PhoneInput
@@ -194,6 +200,7 @@ class ProfileSettingsForm extends Component {
194200
type="phone"
195201
validationError="Invalid business phone"
196202
showCheckMark
203+
required
197204
listCountry={ISOCountries}
198205
forceCountry={this.state.countrySelected}
199206
value={this.props.values.settings.businessPhone}
@@ -207,7 +214,7 @@ class ProfileSettingsForm extends Component {
207214
}
208215
</div>
209216
</div>
210-
{this.getField('Company name', 'companyName', false, (isCustomer || isCopilot) && !isManager)}
217+
{this.getField('Company name', 'companyName', true, (isCustomer || isCopilot) && !isManager)}
211218
<div className="field">
212219
<div className="label">
213220
<span styleName="fieldLabelText">Country</span>

0 commit comments

Comments
 (0)