Skip to content

Commit 8db9beb

Browse files
Merge branch 'ca-profile-bug-bash' into review_5864
2 parents bfba9d7 + 9f6dbda commit 8db9beb

File tree

28 files changed

+251
-98
lines changed

28 files changed

+251
-98
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ workflows:
349349
filters:
350350
branches:
351351
only:
352-
- free
352+
- ca-profile-bug-bash
353353
# This is alternate dev env for parallel testing
354354
- "build-qa":
355355
context : org-global
@@ -363,7 +363,7 @@ workflows:
363363
filters:
364364
branches:
365365
only:
366-
- thrive-spooky1-p0-2
366+
- free
367367
# This is stage env for production QA releases
368368
- "build-prod-staging":
369369
context : org-global

__tests__/shared/components/Settings/Account/__snapshots__/index.jsx.snap

-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ exports[`renders account setting page correctly 1`] = `
1010
<SideBar
1111
icons={
1212
Object {
13-
"linked accounts": <LinkedAccountIcon
14-
height="30"
15-
viewBox="0 0 30 30"
16-
width="30"
17-
xmlns="http://www.w3.org/2000/svg"
18-
/>,
1913
"my account": <MyAccountIcon
2014
height="30"
2115
viewBox="0 0 30 30"
@@ -27,7 +21,6 @@ exports[`renders account setting page correctly 1`] = `
2721
names={
2822
Array [
2923
"my account",
30-
"linked account",
3124
]
3225
}
3326
/>

__tests__/shared/components/Settings/Account/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const settingsUI = {
1212
TABS: {
1313
ACCOUNT: {
1414
MYACCOUNT: 'my account',
15-
LINKEDACCOUNT: 'linked account',
15+
// LINKEDACCOUNT: 'linked account',
1616
},
1717
},
1818
};

src/server/services/recruitCRM.js

-4
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,6 @@ export default class RecruitCRMService {
373373
let isReferred = false;
374374
let referralCookie = req.cookies[config.GROWSURF_COOKIE];
375375
if (referralCookie) referralCookie = JSON.parse(referralCookie);
376-
if (referralCookie) {
377-
logger.info(`The referralCookie is: ${referralCookie}`);
378-
logger.info(`The referralId is: ${referralCookie.referralId}`);
379-
}
380376
const tcHandle = _.findIndex(form.custom_fields, { field_id: 2 });
381377
let growRes;
382378
try {

src/shared/components/Contentful/ArticleCard/themes/article_small.scss

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
border-radius: 10px;
77
overflow: hidden;
88
position: relative;
9+
cursor: pointer;
910

1011
@include xs-to-sm {
1112
background: #f4f4f4;

src/shared/components/Contentful/Tabs/Tabs.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export default class TabsItemsLoader extends Component {
8787
theme,
8888
tabId,
8989
themeName,
90+
forceRenderTabPanel,
9091
} = this.props;
9192
const { tabIndex, mobileTabsShow } = this.state;
9293

@@ -102,7 +103,7 @@ export default class TabsItemsLoader extends Component {
102103
selectedIndex={tabIndex}
103104
selectedTabClassName={theme.selected}
104105
onSelect={tIndx => this.setState({ tabIndex: tIndx, mobileTabsShow: false })}
105-
forceRenderTabPanel
106+
forceRenderTabPanel={forceRenderTabPanel}
106107
>
107108
<div className={theme.tabListWrap}>
108109
{
@@ -230,6 +231,7 @@ TabsItemsLoader.defaultProps = {
230231
selected: 0,
231232
spaceName: null,
232233
environment: null,
234+
forceRenderTabPanel: true,
233235
};
234236

235237
TabsItemsLoader.propTypes = {
@@ -241,4 +243,5 @@ TabsItemsLoader.propTypes = {
241243
theme: PT.shape().isRequired,
242244
tabId: PT.string.isRequired,
243245
themeName: PT.string.isRequired,
246+
forceRenderTabPanel: PT.bool,
244247
};

src/shared/components/Contentful/Tabs/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function ContentfulTabs(props) {
3636
theme={TAB_THEMES[fields.theme || 'Default']}
3737
tabId={fields.urlQueryName || id}
3838
themeName={fields.theme}
39+
forceRenderTabPanel={fields.forceRenderTabPanel}
3940
/>
4041
);
4142
}}

src/shared/components/Contentful/Tabs/themes/pills.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ $text-color-black: #262628;
2222
border-bottom: none;
2323

2424
@include xs-to-sm {
25-
-webkit-flex-direction: column; /* Safari */
26-
flex-direction: column;
25+
overflow: auto;
2726
align-items: center;
27+
justify-content: flex-start;
2828
}
2929
}
3030

@@ -38,9 +38,11 @@ $text-color-black: #262628;
3838
cursor: pointer;
3939
border-radius: 15px;
4040
padding: 0 15px;
41+
white-space: nowrap;
4142

4243
@include xs-to-sm {
4344
margin: 2px;
45+
padding: 0 25px;
4446
}
4547

4648
&:hover {

src/shared/components/Contentful/Tabs/themes/vertical.scss

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* stylelint-disable no-descending-specificity */
12
@import '~styles/mixins';
23

34
$text-color-black: #262628;
@@ -11,6 +12,10 @@ $gray-border-color: #e9e9e9;
1112
display: flex;
1213
max-width: $screen-lg;
1314
margin: auto;
15+
16+
@media (max-width: 768px) {
17+
flex-direction: column;
18+
}
1419
}
1520

1621
.tablist {
@@ -24,9 +29,18 @@ $gray-border-color: #e9e9e9;
2429
border-right: 5px solid $gray-border-color;
2530
margin-right: 58px;
2631
padding: 7px 0;
32+
33+
@media (max-width: 768px) {
34+
flex-direction: row;
35+
border-right: none;
36+
margin-right: 0;
37+
margin-bottom: 15px;
38+
overflow: auto;
39+
padding: 0;
40+
}
2741
}
2842

29-
.tab {
43+
li.tab {
3044
text-align: left;
3145
color: $text-color-black;
3246
font-size: 16px;
@@ -35,6 +49,16 @@ $gray-border-color: #e9e9e9;
3549
cursor: pointer;
3650
padding-right: 30px;
3751

52+
@media (max-width: 768px) {
53+
padding-right: 20px;
54+
border-bottom: 5px solid $gray-border-color;
55+
min-width: auto !important;
56+
57+
&:first-child {
58+
padding-left: 7px;
59+
}
60+
}
61+
3862
&:hover,
3963
&.selected {
4064
font-weight: 700;
@@ -52,6 +76,29 @@ $gray-border-color: #e9e9e9;
5276
border-radius: 5px;
5377
border-top: 1px solid white;
5478
border-bottom: 1px solid white;
79+
80+
@media (max-width: 768px) {
81+
display: none;
82+
}
83+
}
84+
85+
p {
86+
position: relative;
87+
display: inline-block;
88+
89+
&::after {
90+
@media (max-width: 768px) {
91+
content: '';
92+
background: $selected-color;
93+
height: 5px;
94+
width: 100%;
95+
display: flex;
96+
position: absolute;
97+
border-radius: 15%;
98+
border-left: 2px solid white;
99+
border-right: 2px solid white;
100+
}
101+
}
55102
}
56103
}
57104

src/shared/components/InputSelect/index.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default class InputSelect extends Component {
111111
let i = 0;
112112
let node = e.target;
113113
const REG = new RegExp(_id);
114-
while (node && i < 5) {
114+
while (node && i < 20) {
115115
if (REG.test(node.className)) {
116116
return true;
117117
}
@@ -131,6 +131,7 @@ export default class InputSelect extends Component {
131131
placeholder,
132132
labelKey,
133133
options,
134+
onKeyPress,
134135
} = this.props;
135136

136137
const {
@@ -139,9 +140,10 @@ export default class InputSelect extends Component {
139140
filterVal,
140141
} = this.state;
141142

143+
const escapeRegExp = stringToGoIntoTheRegex => stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); /* eslint-disable-line no-useless-escape */
142144
let fiterList = options;
143145
if (filterVal) {
144-
const REG = new RegExp(filterVal, 'i');
146+
const REG = new RegExp(escapeRegExp(filterVal), 'i');
145147
fiterList = filter(options, o => REG.test(o[labelKey]));
146148
}
147149
const list = map(fiterList, o => (
@@ -171,7 +173,7 @@ export default class InputSelect extends Component {
171173
<div styleName="modal">
172174
<div styleName="modal-input-container">
173175

174-
<input type="text" onChange={this.onFilterChange} placeholder="Search" />
176+
<input type="text" onChange={this.onFilterChange} placeholder="Search" onKeyPress={onKeyPress} />
175177
</div>
176178
<div styleName="modal-list-container" onScroll={this.onLoadMore}>
177179
{list}
@@ -195,6 +197,7 @@ InputSelect.defaultProps = {
195197
isLoading: false,
196198
onChange: () => {},
197199
onLoadMore: () => {},
200+
onKeyPress: () => {},
198201
};
199202

200203
InputSelect.propTypes = {
@@ -205,6 +208,7 @@ InputSelect.propTypes = {
205208
placeholder: PT.string,
206209
onChange: PT.func,
207210
onLoadMore: PT.func,
211+
onKeyPress: PT.func,
208212
hasMore: PT.bool,
209213
isLoading: PT.bool,
210214
disabled: PT.bool,

src/shared/components/Settings/Account/LinkedAccount/AddWebLink.jsx

+21-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default class AddWebLink extends React.Component {
1313
super(props);
1414
this.state = {
1515
webLink: '',
16+
webLinkEmpty: false,
1617
};
1718

1819
this.onUpdateWebLink = this.onUpdateWebLink.bind(this);
@@ -32,6 +33,11 @@ export default class AddWebLink extends React.Component {
3233
// Set web link
3334
onUpdateWebLink(e) {
3435
e.preventDefault();
36+
if (e.target.value) {
37+
this.setState({
38+
webLinkEmpty: false,
39+
});
40+
}
3541
this.setState({ webLink: e.target.value });
3642
}
3743

@@ -62,6 +68,11 @@ export default class AddWebLink extends React.Component {
6268
tokenV3,
6369
} = this.props;
6470
const { webLink } = this.state;
71+
if (!webLink) {
72+
this.setState({
73+
webLinkEmpty: true,
74+
});
75+
}
6576
if (webLink && this.isWebLinkValid() && !this.webLinkExist()) {
6677
addWebLink(handle, tokenV3, webLink);
6778
}
@@ -82,7 +93,7 @@ export default class AddWebLink extends React.Component {
8293
}
8394

8495
render() {
85-
const { webLink } = this.state;
96+
const { webLink, webLinkEmpty } = this.state;
8697

8798
const webLinkValid = this.isWebLinkValid();
8899
const webLinkExist = this.webLinkExist();
@@ -172,6 +183,15 @@ export default class AddWebLink extends React.Component {
172183
onKeyDown={this.onAddWebLink}
173184
required
174185
/>
186+
{
187+
webLinkEmpty && (
188+
<div styleName="form-input-error">
189+
<p>
190+
Please Enter External Link
191+
</p>
192+
</div>
193+
)
194+
}
175195
{
176196
!webLinkValid && !webLinkExist
177197
&& (

src/shared/components/Settings/Account/LinkedAccount/index.jsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ export default class LinkedAccount extends React.Component {
105105
if (!linkedAccounts.length) {
106106
const providers = _.omit(externalAccountsData, ['userId', 'updatedAt', 'createdAt', 'createdBy', 'updatedBy']);
107107

108-
_.forEach(_.keys(providers), (p) => {
109-
if (providers[p]) {
110-
linkedAccounts.push({ providerType: p });
111-
}
112-
});
108+
if (_.keys(_.omitBy(providers, _.isNil)).length > 1) {
109+
_.forEach(_.keys(providers), (p) => {
110+
if (providers[p]) {
111+
linkedAccounts.push({ providerType: p });
112+
}
113+
});
114+
}
113115
}
114116
_.forEach(linkedAccounts, (linkedAccount) => {
115117
const providerType = linkedAccount.providerType || linkedAccount.provider;

src/shared/components/Settings/Account/MyAccount/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ export default class MyAccount extends ConsentComponent {
585585
</div>
586586
</div>
587587
{
588-
get(profileState, 'credential.hasPassword', false) === false && (
588+
get(profileState, 'credential.hasPassword') === false && (
589589
<div styleName="error-message">
590590
Since you joined Topcoder using your &lt;SSO Service&gt; account,
591591
any email updates will need to be handled by logging in to

src/shared/components/Settings/Account/index.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import _ from 'lodash';
88

99
import Accordion from 'components/Settings/Accordion';
1010
import MyAccountIcon from 'assets/images/account/sideicons/myaccount.svg';
11-
import LinkedAccountIcon from 'assets/images/account/sideicons/linkedaccount.svg';
11+
// import LinkedAccountIcon from 'assets/images/account/sideicons/linkedaccount.svg';
1212
import ErrorWrapper from 'components/Settings/ErrorWrapper';
1313
import SideBar from '../SideBar';
1414
import ComingSoon from '../ComingSoon';
1515
import MyAccount from './MyAccount';
16-
import LinkedAccount from './LinkedAccount';
16+
// import LinkedAccount from './LinkedAccount';
1717
import { SCREEN_SIZE } from '../constants';
1818
import './styles.scss';
1919

@@ -74,14 +74,14 @@ export default class Account extends React.Component {
7474
const currentTab = this.tablink || settingsUI.currentAccountTab;
7575
const icons = {
7676
'my account': <MyAccountIcon />,
77-
'linked accounts': <LinkedAccountIcon />,
77+
// 'linked accounts': <LinkedAccountIcon />,
7878
};
7979
const renderTabContent = (tab) => {
8080
switch (tab) {
8181
case 'my account':
8282
return <MyAccount {...this.props} />;
83-
case 'linked accounts':
84-
return <LinkedAccount {...this.props} />;
83+
// case 'linked accounts':
84+
// return <LinkedAccount {...this.props} />;
8585
default:
8686
return <ComingSoon />;
8787
}

0 commit comments

Comments
 (0)