From c381f24f90ce3cfd549f440658d2ec70758c34d4 Mon Sep 17 00:00:00 2001
From: M Fikri A <81801960+fikzzzy@users.noreply.github.com>
Date: Tue, 16 Nov 2021 22:22:43 +0700
Subject: [PATCH 01/54] Enable Clear Date Input (#5809)
---
.../Settings/Profile/Education/index.jsx | 13 +++++++------
.../Settings/Profile/Education/styles.scss | 14 ++++++++++++++
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/shared/components/Settings/Profile/Education/index.jsx b/src/shared/components/Settings/Profile/Education/index.jsx
index ffc9d7cecb..7df00f3408 100644
--- a/src/shared/components/Settings/Profile/Education/index.jsx
+++ b/src/shared/components/Settings/Profile/Education/index.jsx
@@ -181,12 +181,10 @@ export default class Education extends ConsentComponent {
}
onUpdateDate(date, timePeriod) {
- if (date) {
- const { newEducation: oldEducation } = this.state;
- const newEducation = { ...oldEducation };
- newEducation[timePeriod] = date;
- this.setState({ newEducation, isSubmit: false });
- }
+ const { newEducation: oldEducation } = this.state;
+ const newEducation = { ...oldEducation };
+ newEducation[timePeriod] = date || '';
+ this.setState({ newEducation, isSubmit: false });
}
/**
@@ -530,6 +528,7 @@ export default class Education extends ConsentComponent {
Date: Mon, 29 Nov 2021 20:56:48 +0800
Subject: [PATCH 21/54] refix
---
.../Settings/Profile/BasicInfo/index.jsx | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/shared/components/Settings/Profile/BasicInfo/index.jsx b/src/shared/components/Settings/Profile/BasicInfo/index.jsx
index 71fc42e99e..1818e9d80a 100644
--- a/src/shared/components/Settings/Profile/BasicInfo/index.jsx
+++ b/src/shared/components/Settings/Profile/BasicInfo/index.jsx
@@ -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: '',
@@ -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) {
@@ -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;
@@ -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;
@@ -465,7 +465,6 @@ export default class BasicInfo extends ConsentComponent {
const {
newBasicInfo,
inputChanged,
- componentMounted,
} = this.state;
const canModifyTrait = !this.props.traitRequestCount;
@@ -506,7 +505,7 @@ export default class BasicInfo extends ConsentComponent {
* Required
-
+
From 7c72a2bce89fb22ba061aea38d034b4437366df6 Mon Sep 17 00:00:00 2001
From: C Dharmateja
Date: Wed, 1 Dec 2021 19:52:26 +0530
Subject: [PATCH 22/54] fix: safely parse input value for regex
---
src/shared/components/InputSelect/index.jsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/components/InputSelect/index.jsx b/src/shared/components/InputSelect/index.jsx
index a91c088093..98e8b5355d 100644
--- a/src/shared/components/InputSelect/index.jsx
+++ b/src/shared/components/InputSelect/index.jsx
@@ -139,9 +139,10 @@ export default class InputSelect extends Component {
filterVal,
} = this.state;
+ const escapeRegExp = stringToGoIntoTheRegex => stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
let fiterList = options;
if (filterVal) {
- const REG = new RegExp(filterVal, 'i');
+ const REG = new RegExp(escapeRegExp(filterVal), 'i');
fiterList = filter(options, o => REG.test(o[labelKey]));
}
const list = map(fiterList, o => (
From 044b68adeeaa33c4f66c1d3e3a21e879da18e2d4 Mon Sep 17 00:00:00 2001
From: gets0ul
Date: Wed, 1 Dec 2021 21:43:09 +0700
Subject: [PATCH 23/54] fix: issue #5885 (#5894)
---
.../Settings/Tools/Subscriptions/index.jsx | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/shared/components/Settings/Tools/Subscriptions/index.jsx b/src/shared/components/Settings/Tools/Subscriptions/index.jsx
index b4691b4cd9..1f18fde6bd 100644
--- a/src/shared/components/Settings/Tools/Subscriptions/index.jsx
+++ b/src/shared/components/Settings/Tools/Subscriptions/index.jsx
@@ -328,7 +328,18 @@ export default class Subscription extends ConsentComponent {
* Required
-
+ e.key === 'Enter' && e.preventDefault()}
+ required
+ />
{
isSubmit && (
@@ -380,7 +391,18 @@ export default class Subscription extends ConsentComponent {
* Required
-
+ e.key === 'Enter' && e.preventDefault()}
+ required
+ />
{
isSubmit && (
From 52fd7a6b24d00a2239b1b08077059ff4103f48be Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Wed, 1 Dec 2021 23:03:41 +0800
Subject: [PATCH 24/54] update lint
---
src/shared/components/InputSelect/index.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/components/InputSelect/index.jsx b/src/shared/components/InputSelect/index.jsx
index 98e8b5355d..40a2d2a1e6 100644
--- a/src/shared/components/InputSelect/index.jsx
+++ b/src/shared/components/InputSelect/index.jsx
@@ -139,7 +139,7 @@ export default class InputSelect extends Component {
filterVal,
} = this.state;
- const escapeRegExp = stringToGoIntoTheRegex => stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ const escapeRegExp = stringToGoIntoTheRegex => stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); /* eslint-disable-line no-useless-escape */
let fiterList = options;
if (filterVal) {
const REG = new RegExp(escapeRegExp(filterVal), 'i');
From 5346e4db5b950bdb0e4f5becdb3f7cd498ec12cf Mon Sep 17 00:00:00 2001
From: C DHARMATEJA
Date: Wed, 1 Dec 2021 20:42:00 +0530
Subject: [PATCH 25/54] fix: click on input down arrow (#5895)
---
src/shared/components/InputSelect/index.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/components/InputSelect/index.jsx b/src/shared/components/InputSelect/index.jsx
index 40a2d2a1e6..de895d4482 100644
--- a/src/shared/components/InputSelect/index.jsx
+++ b/src/shared/components/InputSelect/index.jsx
@@ -111,7 +111,7 @@ export default class InputSelect extends Component {
let i = 0;
let node = e.target;
const REG = new RegExp(_id);
- while (node && i < 5) {
+ while (node && i < 20) {
if (REG.test(node.className)) {
return true;
}
From 9624b4624a980cfb3691a8b0ee604e2cf38a1d99 Mon Sep 17 00:00:00 2001
From: gets0ul
Date: Wed, 1 Dec 2021 22:23:01 +0700
Subject: [PATCH 26/54] fix: issue #5874 - keep the order of existing languages
after done editing (#5896)
---
src/shared/components/Settings/Profile/Language/index.jsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/shared/components/Settings/Profile/Language/index.jsx b/src/shared/components/Settings/Profile/Language/index.jsx
index 57ba250dc9..cb1539f5e8 100644
--- a/src/shared/components/Settings/Profile/Language/index.jsx
+++ b/src/shared/components/Settings/Profile/Language/index.jsx
@@ -244,11 +244,11 @@ export default class Language extends ConsentComponent {
const newLanguageTrait = _.cloneDeep(languageTrait);
if (isEdit) {
- newLanguageTrait.traits.data.splice(indexNo, 1);
+ newLanguageTrait.traits.data.splice(indexNo, 1, language);
+ } else {
+ newLanguageTrait.traits.data.push(language);
}
- newLanguageTrait.traits.data.push(language);
-
updateUserTrait(handle, 'languages', newLanguageTrait.traits.data, tokenV3);
} else {
const newLanguages = [];
From 5aaf3696f80ad98cf82a534a79a1e6cbc9d6c4d8 Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Thu, 2 Dec 2021 01:04:15 +0800
Subject: [PATCH 27/54] update: 5877
---
src/shared/components/Settings/Tools/ServiceProviders/index.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/components/Settings/Tools/ServiceProviders/index.jsx b/src/shared/components/Settings/Tools/ServiceProviders/index.jsx
index ced86d9d34..84352a6129 100644
--- a/src/shared/components/Settings/Tools/ServiceProviders/index.jsx
+++ b/src/shared/components/Settings/Tools/ServiceProviders/index.jsx
@@ -161,6 +161,7 @@ export default class ServiceProviders extends ConsentComponent {
}
this.setState({
showConfirmation: false,
+ isEdit: false,
indexNo: null,
formInvalid: false,
isSubmit: false,
From f4fca8c4b3ff97869c83722f40782f1f913eb3e8 Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Thu, 2 Dec 2021 01:10:48 +0800
Subject: [PATCH 28/54] update: 5875
---
src/shared/components/Settings/Profile/Work/index.jsx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/shared/components/Settings/Profile/Work/index.jsx b/src/shared/components/Settings/Profile/Work/index.jsx
index bbff9e769d..b72cbef88e 100644
--- a/src/shared/components/Settings/Profile/Work/index.jsx
+++ b/src/shared/components/Settings/Profile/Work/index.jsx
@@ -174,6 +174,16 @@ export default class Work extends ConsentComponent {
this.setState({
showConfirmation: false,
+ newWork: {
+ company: '',
+ position: '',
+ cityTown: '',
+ timePeriodFrom: '',
+ timePeriodTo: '',
+ industry: '',
+ working: false,
+ },
+ isEdit: false,
indexNo: null,
isSubmit: false,
formInvalid: false,
From 978245ea0e5f5c483236af62a9e9a49d3100de92 Mon Sep 17 00:00:00 2001
From: gets0ul
Date: Thu, 2 Dec 2021 00:15:22 +0700
Subject: [PATCH 29/54] Issue #5878 (#5893)
* fix: issue #5878
* fix: lint tab error
---
src/shared/components/Settings/Tools/Software/index.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/components/Settings/Tools/Software/index.jsx b/src/shared/components/Settings/Tools/Software/index.jsx
index a1bc02e312..5e74d4c44b 100644
--- a/src/shared/components/Settings/Tools/Software/index.jsx
+++ b/src/shared/components/Settings/Tools/Software/index.jsx
@@ -147,6 +147,7 @@ export default class Software extends ConsentComponent {
showConfirmation: false,
indexNo: null,
isSubmit: false,
+ isEdit: false,
formInvalid: false,
});
}
From 36d36a7e3f32b1ca8a4459b4b10a2109646e84d6 Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Thu, 2 Dec 2021 01:24:09 +0800
Subject: [PATCH 30/54] update: 5899
---
src/shared/components/Settings/Tools/Subscriptions/index.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/shared/components/Settings/Tools/Subscriptions/index.jsx b/src/shared/components/Settings/Tools/Subscriptions/index.jsx
index 1f18fde6bd..8cdd86eaad 100644
--- a/src/shared/components/Settings/Tools/Subscriptions/index.jsx
+++ b/src/shared/components/Settings/Tools/Subscriptions/index.jsx
@@ -153,6 +153,7 @@ export default class Subscription extends ConsentComponent {
showConfirmation: false,
indexNo: null,
formInvalid: false,
+ isEdit: false,
isSubmit: false,
});
}
From 4ee7fb5264f1de3556dfad62acc45abd88a6910b Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Thu, 2 Dec 2021 01:36:13 +0800
Subject: [PATCH 31/54] update: 5868
---
src/shared/components/Settings/Account/MyAccount/index.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/components/Settings/Account/MyAccount/index.jsx b/src/shared/components/Settings/Account/MyAccount/index.jsx
index b7e688ba22..21f0adeecb 100644
--- a/src/shared/components/Settings/Account/MyAccount/index.jsx
+++ b/src/shared/components/Settings/Account/MyAccount/index.jsx
@@ -585,7 +585,7 @@ export default class MyAccount extends ConsentComponent {
{
- get(profileState, 'credential.hasPassword', false) === false && (
+ get(profileState, 'credential.hasPassword') === false && (
Since you joined Topcoder using your <SSO Service> account,
any email updates will need to be handled by logging in to
From a054043da1b3b8839c89523511e99e3659ca78d6 Mon Sep 17 00:00:00 2001
From: LieutenantRoger
Date: Thu, 2 Dec 2021 01:48:03 +0800
Subject: [PATCH 32/54] update: 5867
---
src/shared/components/InputSelect/index.jsx | 5 ++++-
src/shared/components/Settings/Tools/Devices/index.jsx | 8 ++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/shared/components/InputSelect/index.jsx b/src/shared/components/InputSelect/index.jsx
index de895d4482..bd43cbbdcc 100644
--- a/src/shared/components/InputSelect/index.jsx
+++ b/src/shared/components/InputSelect/index.jsx
@@ -131,6 +131,7 @@ export default class InputSelect extends Component {
placeholder,
labelKey,
options,
+ onKeyPress,
} = this.props;
const {
@@ -172,7 +173,7 @@ export default class InputSelect extends Component {
-
+
{list}
@@ -196,6 +197,7 @@ InputSelect.defaultProps = {
isLoading: false,
onChange: () => {},
onLoadMore: () => {},
+ onKeyPress: () => {},
};
InputSelect.propTypes = {
@@ -206,6 +208,7 @@ InputSelect.propTypes = {
placeholder: PT.string,
onChange: PT.func,
onLoadMore: PT.func,
+ onKeyPress: PT.func,
hasMore: PT.bool,
isLoading: PT.bool,
disabled: PT.bool,
diff --git a/src/shared/components/Settings/Tools/Devices/index.jsx b/src/shared/components/Settings/Tools/Devices/index.jsx
index ff3ab7da46..d941f5bbb4 100644
--- a/src/shared/components/Settings/Tools/Devices/index.jsx
+++ b/src/shared/components/Settings/Tools/Devices/index.jsx
@@ -516,6 +516,7 @@ export default class Devices extends ConsentComponent {
valueKey="name"
labelKey="name"
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
{
isSubmit && (
@@ -541,6 +542,7 @@ export default class Devices extends ConsentComponent {
valueKey="name"
labelKey="name"
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
@@ -564,6 +566,7 @@ export default class Devices extends ConsentComponent {
isLoading={isModelsLoading}
hasMore={hasMoreModels}
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
@@ -587,6 +590,7 @@ export default class Devices extends ConsentComponent {
isLoading={isOsesLoading}
onLoadMore={this.onLoadMoreOses}
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
@@ -651,6 +655,7 @@ export default class Devices extends ConsentComponent {
valueKey="name"
labelKey="name"
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
{
isSubmit && (
@@ -672,6 +677,7 @@ export default class Devices extends ConsentComponent {
valueKey="name"
labelKey="name"
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
@@ -693,6 +699,7 @@ export default class Devices extends ConsentComponent {
isLoading={isModelsLoading}
hasMore={hasMoreModels}
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
@@ -712,6 +719,7 @@ export default class Devices extends ConsentComponent {
isLoading={isOsesLoading}
onLoadMore={this.onLoadMoreOses}
disabled={!canModifyTrait}
+ onKeyPress={e => e.key === 'Enter' && e.preventDefault()}
/>
From 9f6dbda32e54b6f22c59de9bf5004d446fd61920 Mon Sep 17 00:00:00 2001
From: C DHARMATEJA
Date: Wed, 1 Dec 2021 23:24:54 +0530
Subject: [PATCH 33/54] fix: make select clearable for spoken and written
languages (#5898)
---
.../Settings/Profile/Language/index.jsx | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/shared/components/Settings/Profile/Language/index.jsx b/src/shared/components/Settings/Profile/Language/index.jsx
index cb1539f5e8..c61fa0b13a 100644
--- a/src/shared/components/Settings/Profile/Language/index.jsx
+++ b/src/shared/components/Settings/Profile/Language/index.jsx
@@ -441,7 +441,13 @@ export default class Language extends ConsentComponent {