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/17] 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: Tue, 16 Nov 2021 23:20:08 +0700 Subject: [PATCH 02/17] Validate Non Valid Input Characters (#5810) --- src/shared/components/Settings/Profile/BasicInfo/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/components/Settings/Profile/BasicInfo/index.jsx b/src/shared/components/Settings/Profile/BasicInfo/index.jsx index aa7e8c9711..9e96db632c 100644 --- a/src/shared/components/Settings/Profile/BasicInfo/index.jsx +++ b/src/shared/components/Settings/Profile/BasicInfo/index.jsx @@ -255,6 +255,10 @@ export default class BasicInfo extends ConsentComponent { case 'streetAddr2': newBasicInfo.addresses[0][e.target.name] = e.target.value; break; + case 'firstName': + case 'lastName': + newBasicInfo[e.target.name] = e.target.value.replace(/[^a-zA-Z0-9,.]/g, ''); + break; default: newBasicInfo[e.target.name] = e.target.value; } From 70dc4cfb5c91e552fbdb608868f77b3c65b42b3a Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Wed, 17 Nov 2021 00:23:02 +0800 Subject: [PATCH 03/17] ci:deploying --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88aca8cf49..f887d76e39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -343,6 +343,7 @@ workflows: branches: only: - develop + - ca-profile-bug-bash # This is alternate dev env for parallel testing - "build-test": context : org-global From 82552a8d3076206ba4203084de065eaef1954ea9 Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 17 Nov 2021 21:18:11 +0800 Subject: [PATCH 04/17] fix: issue #5807 (#5811) --- .../Settings/Account/LinkedAccount/index.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shared/components/Settings/Account/LinkedAccount/index.jsx b/src/shared/components/Settings/Account/LinkedAccount/index.jsx index 216fd9f908..4c7008cd88 100644 --- a/src/shared/components/Settings/Account/LinkedAccount/index.jsx +++ b/src/shared/components/Settings/Account/LinkedAccount/index.jsx @@ -105,11 +105,13 @@ export default class LinkedAccount extends React.Component { if (!linkedAccounts.length) { const providers = _.omit(externalAccountsData, ['userId', 'updatedAt', 'createdAt', 'createdBy', 'updatedBy']); - _.forEach(_.keys(providers), (p) => { - if (providers[p]) { - linkedAccounts.push({ providerType: p }); - } - }); + if (_.keys(_.omitBy(providers, _.isNil)).length > 1) { + _.forEach(_.keys(providers), (p) => { + if (providers[p]) { + linkedAccounts.push({ providerType: p }); + } + }); + } } _.forEach(linkedAccounts, (linkedAccount) => { const providerType = linkedAccount.providerType || linkedAccount.provider; From 665a38513ea0d14943b9d0e70ffcce370eb82040 Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 17 Nov 2021 21:24:43 +0800 Subject: [PATCH 05/17] fix: issue #5802 (#5812) --- .../Settings/Tools/Devices/index.jsx | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/shared/components/Settings/Tools/Devices/index.jsx b/src/shared/components/Settings/Tools/Devices/index.jsx index 4e86b1302b..ff3ab7da46 100644 --- a/src/shared/components/Settings/Tools/Devices/index.jsx +++ b/src/shared/components/Settings/Tools/Devices/index.jsx @@ -84,46 +84,44 @@ export default class Devices extends ConsentComponent { */ onHandleAddDevice(e) { e.preventDefault(); - const { newDevice, deviceTrait, isEdit } = this.state; + const { newDevice, deviceTrait } = this.state; const { clearDeviceState } = this.props; this.setState({ isSubmit: true }); if (this.onCheckFormValue(newDevice)) { return; } - if (!isEdit) { - const deviceItems = deviceTrait.traits - ? deviceTrait.traits.data.slice() : []; - let exist = false; - // eslint-disable-next-line no-restricted-syntax - for (const item of deviceItems) { - if (item.deviceType === newDevice.deviceType - && item.manufacturer === newDevice.manufacturer - && item.model === newDevice.model - && item.operatingSystem === newDevice.operatingSystem) { - exist = true; - break; - } - } - if (exist === true) { - const empty = { - deviceType: '', - manufacturer: '', - model: '', - operatingSystem: '', - }; - this.setState({ - newDevice: empty, - isEdit: false, - indexNo: null, - isSubmit: false, - }); - clearDeviceState(); - setImmediate(() => { - toastr.error('Looks like you\'ve already entered this device.'); - }); - return; + const deviceItems = deviceTrait.traits + ? deviceTrait.traits.data.slice() : []; + let exist = false; + // eslint-disable-next-line no-restricted-syntax + for (const item of deviceItems) { + if (item.deviceType === newDevice.deviceType + && item.manufacturer === newDevice.manufacturer + && item.model === newDevice.model + && item.operatingSystem === newDevice.operatingSystem) { + exist = true; + break; } } + if (exist === true) { + const empty = { + deviceType: '', + manufacturer: '', + model: '', + operatingSystem: '', + }; + this.setState({ + newDevice: empty, + isEdit: false, + indexNo: null, + isSubmit: false, + }); + clearDeviceState(); + setImmediate(() => { + toastr.error('Looks like you\'ve already entered this device.'); + }); + return; + } this.showConsent(this.onAddDevice.bind(this)); } From b72fc3be422ab926beaa988b37dec7137e2386ae Mon Sep 17 00:00:00 2001 From: yoution Date: Wed, 17 Nov 2021 21:29:41 +0800 Subject: [PATCH 06/17] fix: issue #5796 (#5813) --- src/shared/components/Settings/Profile/Work/index.jsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/shared/components/Settings/Profile/Work/index.jsx b/src/shared/components/Settings/Profile/Work/index.jsx index 0bbfa631bf..bbff9e769d 100644 --- a/src/shared/components/Settings/Profile/Work/index.jsx +++ b/src/shared/components/Settings/Profile/Work/index.jsx @@ -81,15 +81,6 @@ export default class Work extends ConsentComponent { endDateInvalid: false, endDateDisabled: false, endDateInvalidMsg: '', - newWork: { - company: '', - position: '', - cityTown: '', - timePeriodFrom: '', - timePeriodTo: '', - industry: '', - working: false, - }, }); } From 9f349ca916e42249e10883709ebf02ce667eb242 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Singh Date: Thu, 18 Nov 2021 17:25:38 +0530 Subject: [PATCH 07/17] fix: #5798 (#5814) --- .../Settings/Account/__snapshots__/index.jsx.snap | 7 ------- __tests__/shared/components/Settings/Account/index.jsx | 2 +- src/shared/components/Settings/Account/index.jsx | 4 ++-- src/shared/reducers/page/ui/settings.js | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/__tests__/shared/components/Settings/Account/__snapshots__/index.jsx.snap b/__tests__/shared/components/Settings/Account/__snapshots__/index.jsx.snap index a893682b08..706a373936 100644 --- a/__tests__/shared/components/Settings/Account/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/Settings/Account/__snapshots__/index.jsx.snap @@ -10,12 +10,6 @@ exports[`renders account setting page correctly 1`] = ` , "my account": diff --git a/__tests__/shared/components/Settings/Account/index.jsx b/__tests__/shared/components/Settings/Account/index.jsx index ab7a1d2bc0..0bd72d407d 100644 --- a/__tests__/shared/components/Settings/Account/index.jsx +++ b/__tests__/shared/components/Settings/Account/index.jsx @@ -12,7 +12,7 @@ const settingsUI = { TABS: { ACCOUNT: { MYACCOUNT: 'my account', - LINKEDACCOUNT: 'linked account', + // LINKEDACCOUNT: 'linked account', }, }, }; diff --git a/src/shared/components/Settings/Account/index.jsx b/src/shared/components/Settings/Account/index.jsx index 123dd15e55..e738b8ee3b 100644 --- a/src/shared/components/Settings/Account/index.jsx +++ b/src/shared/components/Settings/Account/index.jsx @@ -8,7 +8,7 @@ import _ from 'lodash'; import Accordion from 'components/Settings/Accordion'; import MyAccountIcon from 'assets/images/account/sideicons/myaccount.svg'; -import LinkedAccountIcon from 'assets/images/account/sideicons/linkedaccount.svg'; +// import LinkedAccountIcon from 'assets/images/account/sideicons/linkedaccount.svg'; import ErrorWrapper from 'components/Settings/ErrorWrapper'; import SideBar from '../SideBar'; import ComingSoon from '../ComingSoon'; @@ -74,7 +74,7 @@ export default class Account extends React.Component { const currentTab = this.tablink || settingsUI.currentAccountTab; const icons = { 'my account': , - 'linked accounts': , + // 'linked accounts': , }; const renderTabContent = (tab) => { switch (tab) { diff --git a/src/shared/reducers/page/ui/settings.js b/src/shared/reducers/page/ui/settings.js index 16d69c61f0..b0440eaed7 100644 --- a/src/shared/reducers/page/ui/settings.js +++ b/src/shared/reducers/page/ui/settings.js @@ -25,7 +25,7 @@ const TABS = { }, ACCOUNT: { MYACCOUNT: 'my account', - LINKEDACCOUNT: 'linked accounts', + // LINKEDACCOUNT: 'linked accounts', }, }; From 2aa8c517b1eb3ba66e2d300b2d891a9dd3a36a1a Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 18 Nov 2021 19:58:02 +0800 Subject: [PATCH 08/17] fix:5798-2 --- src/shared/components/Settings/Account/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/Settings/Account/index.jsx b/src/shared/components/Settings/Account/index.jsx index e738b8ee3b..b8a94d7489 100644 --- a/src/shared/components/Settings/Account/index.jsx +++ b/src/shared/components/Settings/Account/index.jsx @@ -80,8 +80,8 @@ export default class Account extends React.Component { switch (tab) { case 'my account': return ; - case 'linked accounts': - return ; + // case 'linked accounts': + // return ; default: return ; } From 1d5a5759fa0f40339541b6a9ebfe1268576929f0 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 18 Nov 2021 20:07:29 +0800 Subject: [PATCH 09/17] fix: test --- src/shared/components/Settings/Account/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/Settings/Account/index.jsx b/src/shared/components/Settings/Account/index.jsx index b8a94d7489..003f736c75 100644 --- a/src/shared/components/Settings/Account/index.jsx +++ b/src/shared/components/Settings/Account/index.jsx @@ -13,7 +13,7 @@ import ErrorWrapper from 'components/Settings/ErrorWrapper'; import SideBar from '../SideBar'; import ComingSoon from '../ComingSoon'; import MyAccount from './MyAccount'; -import LinkedAccount from './LinkedAccount'; +// import LinkedAccount from './LinkedAccount'; import { SCREEN_SIZE } from '../constants'; import './styles.scss'; From d6c1225b5cd8c038842a16a9dae8befaa2f4596c Mon Sep 17 00:00:00 2001 From: yoution Date: Thu, 18 Nov 2021 20:17:13 +0800 Subject: [PATCH 10/17] fix: issue #5800 (#5816) --- .../Account/LinkedAccount/AddWebLink.jsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/shared/components/Settings/Account/LinkedAccount/AddWebLink.jsx b/src/shared/components/Settings/Account/LinkedAccount/AddWebLink.jsx index 168581561d..d807114ece 100644 --- a/src/shared/components/Settings/Account/LinkedAccount/AddWebLink.jsx +++ b/src/shared/components/Settings/Account/LinkedAccount/AddWebLink.jsx @@ -13,6 +13,7 @@ export default class AddWebLink extends React.Component { super(props); this.state = { webLink: '', + webLinkEmpty: false, }; this.onUpdateWebLink = this.onUpdateWebLink.bind(this); @@ -32,6 +33,11 @@ export default class AddWebLink extends React.Component { // Set web link onUpdateWebLink(e) { e.preventDefault(); + if (e.target.value) { + this.setState({ + webLinkEmpty: false, + }); + } this.setState({ webLink: e.target.value }); } @@ -62,6 +68,11 @@ export default class AddWebLink extends React.Component { tokenV3, } = this.props; const { webLink } = this.state; + if (!webLink) { + this.setState({ + webLinkEmpty: true, + }); + } if (webLink && this.isWebLinkValid() && !this.webLinkExist()) { addWebLink(handle, tokenV3, webLink); } @@ -82,7 +93,7 @@ export default class AddWebLink extends React.Component { } render() { - const { webLink } = this.state; + const { webLink, webLinkEmpty } = this.state; const webLinkValid = this.isWebLinkValid(); const webLinkExist = this.webLinkExist(); @@ -172,6 +183,15 @@ export default class AddWebLink extends React.Component { onKeyDown={this.onAddWebLink} required /> + { + webLinkEmpty && ( +
+

+ Please Enter External Link +

+
+ ) + } { !webLinkValid && !webLinkExist && ( From 8b4dc0baba3f7a22b47bda2c0ac9aabf993472a2 Mon Sep 17 00:00:00 2001 From: yoution Date: Thu, 18 Nov 2021 20:22:19 +0800 Subject: [PATCH 11/17] fix: issue #5786 (#5815) --- src/shared/components/Settings/Profile/Hobby/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/components/Settings/Profile/Hobby/index.jsx b/src/shared/components/Settings/Profile/Hobby/index.jsx index a8f700fa30..a3b8ccd2f0 100644 --- a/src/shared/components/Settings/Profile/Hobby/index.jsx +++ b/src/shared/components/Settings/Profile/Hobby/index.jsx @@ -137,6 +137,7 @@ export default class Hobby extends ConsentComponent { } this.setState({ showConfirmation: false, + isEdit: false, indexNo: null, isSubmit: false, }); From aa9e173b767f43e9e9ba9744c29454856d2508d8 Mon Sep 17 00:00:00 2001 From: yoution Date: Sat, 20 Nov 2021 00:00:48 +0800 Subject: [PATCH 12/17] fix: issue #5802 (#5823) --- src/shared/components/Settings/Tools/Devices/index.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/components/Settings/Tools/Devices/index.jsx b/src/shared/components/Settings/Tools/Devices/index.jsx index ff3ab7da46..2f2721ba8b 100644 --- a/src/shared/components/Settings/Tools/Devices/index.jsx +++ b/src/shared/components/Settings/Tools/Devices/index.jsx @@ -97,8 +97,7 @@ export default class Devices extends ConsentComponent { for (const item of deviceItems) { if (item.deviceType === newDevice.deviceType && item.manufacturer === newDevice.manufacturer - && item.model === newDevice.model - && item.operatingSystem === newDevice.operatingSystem) { + && item.model === newDevice.model) { exist = true; break; } From 33edc06ccaa1477058358d6451e5458fafa14728 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Sat, 20 Nov 2021 00:31:56 +0800 Subject: [PATCH 13/17] deploying ca-branch --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 349c4c5d3c..41c8261eab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -343,6 +343,7 @@ workflows: branches: only: - develop + - ca-profile-bug-bash # This is alternate dev env for parallel testing - "build-test": context : org-global From a74ef9290edd11212847af76e4ce5b8b5906e033 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Sat, 20 Nov 2021 00:33:12 +0800 Subject: [PATCH 14/17] revert ci --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41c8261eab..349c4c5d3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -343,7 +343,6 @@ workflows: branches: only: - develop - - ca-profile-bug-bash # This is alternate dev env for parallel testing - "build-test": context : org-global From 22885f3106fa204af84865fe1aafaa7fb8abac0d Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 22 Nov 2021 13:34:59 +0800 Subject: [PATCH 15/17] revert device checking --- src/shared/components/Settings/Tools/Devices/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/components/Settings/Tools/Devices/index.jsx b/src/shared/components/Settings/Tools/Devices/index.jsx index 2f2721ba8b..ff3ab7da46 100644 --- a/src/shared/components/Settings/Tools/Devices/index.jsx +++ b/src/shared/components/Settings/Tools/Devices/index.jsx @@ -97,7 +97,8 @@ export default class Devices extends ConsentComponent { for (const item of deviceItems) { if (item.deviceType === newDevice.deviceType && item.manufacturer === newDevice.manufacturer - && item.model === newDevice.model) { + && item.model === newDevice.model + && item.operatingSystem === newDevice.operatingSystem) { exist = true; break; } From 8f982db953bd24af58e5174fe2a55efb42b0f603 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 22 Nov 2021 20:46:05 +0800 Subject: [PATCH 16/17] patch: 5783 --- src/shared/components/Settings/Profile/BasicInfo/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/Settings/Profile/BasicInfo/index.jsx b/src/shared/components/Settings/Profile/BasicInfo/index.jsx index 9e96db632c..7ba68ea5d0 100644 --- a/src/shared/components/Settings/Profile/BasicInfo/index.jsx +++ b/src/shared/components/Settings/Profile/BasicInfo/index.jsx @@ -257,7 +257,7 @@ export default class BasicInfo extends ConsentComponent { break; case 'firstName': case 'lastName': - newBasicInfo[e.target.name] = e.target.value.replace(/[^a-zA-Z0-9,.]/g, ''); + newBasicInfo[e.target.name] = e.target.value.replace(/[^a-zA-Z0-9,.\-\ ]/g, ''); break; default: newBasicInfo[e.target.name] = e.target.value; From ceb5df6e1681e45454ec57448f28dffdcf230cc7 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 22 Nov 2021 21:09:43 +0800 Subject: [PATCH 17/17] fix: test --- src/shared/components/Settings/Profile/BasicInfo/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/Settings/Profile/BasicInfo/index.jsx b/src/shared/components/Settings/Profile/BasicInfo/index.jsx index 7ba68ea5d0..1240cc2184 100644 --- a/src/shared/components/Settings/Profile/BasicInfo/index.jsx +++ b/src/shared/components/Settings/Profile/BasicInfo/index.jsx @@ -257,7 +257,7 @@ export default class BasicInfo extends ConsentComponent { break; case 'firstName': case 'lastName': - newBasicInfo[e.target.name] = e.target.value.replace(/[^a-zA-Z0-9,.\-\ ]/g, ''); + newBasicInfo[e.target.name] = e.target.value.replace(/[^a-zA-Z0-9,. -]/g, ''); break; default: newBasicInfo[e.target.name] = e.target.value;