Skip to content
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c381f24
Enable Clear Date Input (#5809)
fikzzzy Nov 16, 2021
95e904b
Validate Non Valid Input Characters (#5810)
fikzzzy Nov 16, 2021
70dc4cf
ci:deploying
LieutenantRoger Nov 16, 2021
82552a8
fix: issue #5807 (#5811)
yoution Nov 17, 2021
665a385
fix: issue #5802 (#5812)
yoution Nov 17, 2021
b72fc3b
fix: issue #5796 (#5813)
yoution Nov 17, 2021
9f349ca
fix: #5798 (#5814)
shivam-51 Nov 18, 2021
2aa8c51
fix:5798-2
LieutenantRoger Nov 18, 2021
1d5a575
fix: test
LieutenantRoger Nov 18, 2021
d6c1225
fix: issue #5800 (#5816)
yoution Nov 18, 2021
8b4dc0b
fix: issue #5786 (#5815)
yoution Nov 18, 2021
aa9e173
fix: issue #5802 (#5823)
yoution Nov 19, 2021
55b5780
merge develop
LieutenantRoger Nov 19, 2021
33edc06
deploying ca-branch
LieutenantRoger Nov 19, 2021
a74ef92
revert ci
LieutenantRoger Nov 19, 2021
22885f3
revert device checking
LieutenantRoger Nov 22, 2021
7d1a129
merge develop
LieutenantRoger Nov 22, 2021
8f982db
patch: 5783
LieutenantRoger Nov 22, 2021
c4f60f4
Merge branch 'develop' into ca-profile-bug-bash
LieutenantRoger Nov 22, 2021
85d3cfd
Merge branch 'develop' into ca-profile-bug-bash
LieutenantRoger Nov 22, 2021
ceb5df6
fix: test
LieutenantRoger Nov 22, 2021
d51680d
fix: #5781 (#5824)
shivam-51 Nov 22, 2021
edba0cd
Merge branch 'develop' into ca-profile-bug-bash
LieutenantRoger Nov 23, 2021
529ade4
ci:deploying bug bash to test
LieutenantRoger Nov 23, 2021
3459429
fix: #5795 (#5837)
shivam-51 Nov 26, 2021
91da96b
refix
LieutenantRoger Nov 29, 2021
62c7f96
merge develop
LieutenantRoger Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/shared/components/Settings/Profile/BasicInfo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ export default class BasicInfo extends ConsentComponent {

const { userTraits } = props;
this.state = {
componentMounted: false,
inputChanged: false,
formInvalid: false,
basicInfoTrait: this.loadBasicInfoTraits(userTraits),
personalizationTrait: this.loadPersonalizationTrait(userTraits),
newBasicInfo: {
handle: '',
firstName: '',
lastName: '',
firstName: null,
lastName: null,
gender: '',
ethnicBackground: null,
shortBio: '',
Expand Down Expand Up @@ -82,9 +81,6 @@ export default class BasicInfo extends ConsentComponent {
const { basicInfoTrait } = this.state;
const basicInfo = basicInfoTrait.traits ? basicInfoTrait.traits.data[0] : {};
this.processBasicInfo(basicInfo);
this.setState({
componentMounted: true,
});
}

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -381,6 +377,8 @@ export default class BasicInfo extends ConsentComponent {
}
if (_.has(value, 'firstName')) {
newBasicInfo.firstName = value.firstName;
} else {
newBasicInfo.firstName = '';
}
if (_.has(value, 'gender')) {
newBasicInfo.gender = value.gender;
Expand All @@ -394,6 +392,8 @@ export default class BasicInfo extends ConsentComponent {
}
if (_.has(value, 'lastName')) {
newBasicInfo.lastName = value.lastName;
} else {
newBasicInfo.lastName = '';
}
if (_.has(value, 'primaryInterestInTopcoder')) {
newBasicInfo.primaryInterestInTopcoder = value.primaryInterestInTopcoder;
Expand Down Expand Up @@ -465,7 +465,6 @@ export default class BasicInfo extends ConsentComponent {
const {
newBasicInfo,
inputChanged,
componentMounted,
} = this.state;

const canModifyTrait = !this.props.traitRequestCount;
Expand Down Expand Up @@ -506,7 +505,7 @@ export default class BasicInfo extends ConsentComponent {
<div styleName="field col-2">
<span styleName="text-required">* Required</span>
<input disabled={!canModifyTrait} id="firstName" name="firstName" type="text" placeholder="First Name" onChange={this.onUpdateInput} value={newBasicInfo.firstName} maxLength="64" required />
<ErrorMessage invalid={_.isEmpty(newBasicInfo.firstName) && componentMounted} message="First Name cannot be empty" />
<ErrorMessage invalid={_.isEmpty(newBasicInfo.firstName) && !_.isNull(newBasicInfo.firstName) && inputChanged} message="First Name cannot be empty" />
</div>
</div>
<div styleName="row">
Expand All @@ -519,7 +518,7 @@ export default class BasicInfo extends ConsentComponent {
<div styleName="field col-2">
<span styleName="text-required">* Required</span>
<input disabled={!canModifyTrait} id="lastName" name="lastName" type="text" placeholder="Last Name" onChange={this.onUpdateInput} value={newBasicInfo.lastName} maxLength="64" required />
<ErrorMessage invalid={_.isEmpty(newBasicInfo.lastName) && componentMounted} message="Last Name cannot be empty" />
<ErrorMessage invalid={_.isEmpty(newBasicInfo.lastName) && !_.isNull(newBasicInfo.lastName) && inputChanged} message="Last Name cannot be empty" />
</div>
</div>
<div styleName="row">
Expand Down