Skip to content

Commit ab34e60

Browse files
authored
Merge pull request #2356 from topcoder-platform/develop
develop
2 parents 7bddee4 + 18252eb commit ab34e60

File tree

18 files changed

+87
-43
lines changed

18 files changed

+87
-43
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ workflows:
181181
filters:
182182
branches:
183183
only:
184-
- legacy-tco
184+
- hot-fixes
185+
- legacy-tco
185186
# This is beta env for production soft releases
186187
- "build-prod-beta":
187188
context : org-global

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"slick-carousel": "^1.8.1",
108108
"supertest": "^3.1.0",
109109
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
110-
"topcoder-react-lib": "^0.7.11",
110+
"topcoder-react-lib": "^0.7.14",
111111
"topcoder-react-ui-kit": "^0.5.10",
112112
"topcoder-react-utils": "0.7.8",
113113
"turndown": "^4.0.2",

src/shared/components/Contentful/Banner/themes/tco19.scss

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,23 @@ $contentWrapperPadding: 0;
7777
}
7878

7979
p {
80-
font-size: 20px;
80+
font-size: 15px;
8181
margin-bottom: 1em;
8282
line-height: 25px;
83+
84+
strong {
85+
font-weight: bold;
86+
}
87+
88+
em {
89+
font-style: italic;
90+
}
8391
}
8492

8593
ul {
8694
list-style: disc;
8795
margin-bottom: 1em;
8896
margin-left: 20px;
89-
90-
li {
91-
p {
92-
font-size: 16px;
93-
line-height: 27px;
94-
}
95-
}
9697
}
9798

9899
input {

src/shared/components/Contentful/ContentBlock/themes/TCO19.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,22 @@
110110
td {
111111
@include roboto-regular;
112112

113-
font-size: 20px;
114-
line-height: 70px;
113+
font-size: 15px;
114+
line-height: 25px;
115115
text-align: left;
116116
color: $tc-gray-80;
117117
border-top: 1px solid #ededf2;
118118
border-bottom: 1px solid #ededf2;
119-
padding: 0 10px;
119+
padding: 10px 0;
120+
min-height: 51px;
121+
122+
&:first-child {
123+
padding-left: 10px;
124+
}
125+
126+
&:last-child {
127+
padding-right: 10px;
128+
}
120129
}
121130

122131
ul,

src/shared/components/Looker/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export default function Looker(props) {
7171
cols.map((c) => {
7272
const name = c.headerName;
7373
const { styles } = c;
74-
return (
74+
return name ? (
7575
<th key={name} style={styles}>{ name }</th>
76-
);
76+
) : null;
7777
})
7878

7979
}
@@ -82,7 +82,7 @@ export default function Looker(props) {
8282

8383
const bodyRow = (record, cols, i) => (
8484
<tr key={Object.values(record)}>
85-
{ (countRows && (limit <= 0 || i < limit)) ? <td> {i + 1}. </td> : ' ' }
85+
{ (countRows && (limit <= 0 || i < limit)) ? <td style={{ borderTop: '1px solid #D5D5D5' }}> {i + 1}. </td> : ' ' }
8686
{
8787
cols.map((c) => {
8888
const prop = c.property;
@@ -96,11 +96,11 @@ export default function Looker(props) {
9696
value = record[prop].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
9797
}
9898
}
99-
return (
99+
return value ? (
100100
<td key={record[prop]} style={styles} title={value}>
101101
{value}
102102
</td>
103-
);
103+
) : null;
104104
})
105105
}
106106
</tr>

src/shared/components/ProfilePage/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class ProfilePage extends React.Component {
133133
? _.get(info, 'competitionCountryCode') : _.get(info, 'homeCountryCode');
134134

135135
const result = _.find(lookupData.countries,
136-
c => c.countryCode === countryCode.toUpperCase());
136+
c => countryCode && c.countryCode === countryCode.toUpperCase());
137137
country = _.isEmpty(result) ? '' : result.country;
138138
}
139139

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/* eslint-disable no-undef */
88
import React from 'react';
99
import PT from 'prop-types';
10-
import { omit } from 'lodash';
10+
import { omit, get } from 'lodash';
1111
import ConsentComponent from 'components/Settings/ConsentComponent';
1212
import { Modal, PrimaryButton } from 'topcoder-react-ui-kit';
1313
import Personalization from 'components/Settings/Preferences/Personalization';
@@ -57,7 +57,6 @@ export default class MyAccount extends ConsentComponent {
5757
reNewPassword: '',
5858
isMobileView: false,
5959
screenSM: 767,
60-
ssoUser: false,
6160
isSent: false,
6261
isOpen: false,
6362
};
@@ -175,12 +174,8 @@ export default class MyAccount extends ConsentComponent {
175174
}
176175

177176
onChangeEmail() {
178-
const { profile } = this.props;
179-
if (profile.withSSO !== null && profile.withSSO !== undefined && profile.withSSO) {
180-
this.setState({
181-
ssoUser: true,
182-
});
183-
} else {
177+
const { profileState } = this.props;
178+
if (get(profileState, 'credential.hasPassword')) {
184179
const newState = { ...this.state };
185180
newState.btnChangeEmailVisible = false;
186181
newState.btnVerifiEmailVisible = true;
@@ -383,7 +378,6 @@ export default class MyAccount extends ConsentComponent {
383378
showRePasswordTips,
384379
rePasswordValid,
385380
isValidEmail,
386-
ssoUser,
387381
isOpen,
388382
} = this.state;
389383

@@ -479,7 +473,7 @@ export default class MyAccount extends ConsentComponent {
479473
</div>
480474
</div>
481475
{
482-
ssoUser && (
476+
get(profileState, 'credential.hasPassword', false) === false && (
483477
<div styleName="error-message">
484478
Since you joined Topcoder using your &lt;SSO Service&gt; account,
485479
any email updates will need to be handled by logging in to
@@ -573,7 +567,7 @@ export default class MyAccount extends ConsentComponent {
573567
</div>
574568
</div>
575569
{
576-
ssoUser && (
570+
get(profileState, 'credential.hasPassword', false) === false && (
577571
<div styleName="error-message">
578572
Since you joined Topcoder using your &lt;SSO Service&gt; account,
579573
any email updates will need to be handled by logging in to

src/shared/components/Settings/Preferences/Email/index.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ const newsletters = [
1717
// desc: 'News summary from all tracks and programs',
1818
// },
1919
{
20-
id: 'TOPCODER_NL_DESIGN',
20+
id: 'Design Newsletter',
2121
name: 'Design Newsletter',
2222
desc: 'Website, mobile and product design; UI and UX',
2323
},
2424
{
25-
id: 'TOPCODER_NL_DEV',
25+
id: 'Dev Newsletter',
2626
name: 'Development Newsletter',
2727
desc: 'Software architecture, component assembly, application development, and bug hunting',
2828
},
2929
{
30-
id: 'TOPCODER_NL_DATA',
30+
id: 'Data Science Newsletter',
3131
name: 'Data Science Newsletter',
3232
desc: 'Algorithm and data structures, statistical analysis',
3333
},
@@ -107,8 +107,11 @@ export default class EmailPreferences extends ConsentComponent {
107107

108108
onChange(id, checked) {
109109
document.querySelectorAll(`#pre-onoffswitch-${id}`).forEach((el) => { el.checked = checked; }); // eslint-disable-line no-param-reassign
110-
const { emailPreferences } = this.state;
111-
emailPreferences[id] = checked;
110+
let { emailPreferences } = this.state;
111+
emailPreferences = {
112+
...emailPreferences,
113+
[id]: checked,
114+
};
112115
this.setState({
113116
emailPreferences,
114117
}, () => this.saveEmailPreferences());

src/shared/components/Settings/Profile/BasicInfo/index.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ export default class BasicInfo extends ConsentComponent {
100100
let invalid = false;
101101
let errorMessage = '';
102102
let dateError = '';
103+
let zipError = '';
103104
let birthDateInvalid = false;
105+
let zipInvalid = false;
104106
const invalidFields = [];
105107

106108
if (!_.trim(newBasicInfo.firstName).length) {
@@ -123,6 +125,13 @@ export default class BasicInfo extends ConsentComponent {
123125
errorMessage += ' cannot be empty';
124126
}
125127

128+
_.forEach(newBasicInfo.addresses, (address) => {
129+
if (!(/^[0-9-]*$/.test(address.zip))) {
130+
zipError = 'You must enter a valid zip code';
131+
zipInvalid = true;
132+
}
133+
});
134+
126135
if (_.trim(newBasicInfo.birthDate).length > 0) {
127136
if (!moment().isAfter(newBasicInfo.birthDate)) {
128137
dateError = 'You must enter a valid date for Birth Date';
@@ -137,6 +146,13 @@ export default class BasicInfo extends ConsentComponent {
137146
invalid = birthDateInvalid;
138147
}
139148

149+
if (errorMessage.length > 0) {
150+
errorMessage = `${errorMessage}. ${zipError}`;
151+
} else if (zipError.length > 0) {
152+
errorMessage = zipError;
153+
invalid = zipInvalid;
154+
}
155+
140156
this.setState({ errorMessage, formInvalid: invalid });
141157
return invalid;
142158
}

src/shared/components/Settings/Profile/Hobby/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ export default class Hobby extends ConsentComponent {
341341
<div styleName="field row-1">
342342
<label htmlFor="hobby">
343343
Hobby
344+
<span styleName="text-required">* Required</span>
344345
<input type="hidden" />
345346
</label>
346347
<input disabled={!canModifyTrait} id="hobby" name="hobby" type="text" placeholder="Hobby" onChange={this.onUpdateInput} value={newHobby.hobby} maxLength="128" required />
@@ -351,6 +352,7 @@ export default class Hobby extends ConsentComponent {
351352
<label styleName="description-label" htmlFor="description">
352353
<span>
353354
Description
355+
<span styleName="text-required">* Required</span>
354356
</span>
355357
{' '}
356358
<span styleName="description-counts">

src/shared/components/Settings/Profile/Hobby/styles.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ textarea {
180180
line-height: 15px;
181181
font-weight: 500;
182182
color: $tc-gray-80;
183+
184+
.text-required {
185+
font-size: 10px;
186+
color: $tc-red-110;
187+
margin-left: 5px;
188+
}
183189
}
184190

185191
&.col-1 {

src/shared/components/Settings/Profile/Skills/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ export default class Skills extends ConsentComponent {
590590
<div styleName="field">
591591
<label htmlFor="skills">
592592
Skill
593+
<span styleName="text-required">* Required</span>
593594
<input type="hidden" />
594595
</label>
595596
<Select

src/shared/components/Settings/Profile/Skills/styles.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@
165165
line-height: 15px;
166166
color: $tc-gray-80;
167167
margin-bottom: 6px;
168+
169+
.text-required {
170+
font-size: 10px;
171+
color: $tc-red-110;
172+
margin-left: 5px;
173+
}
168174
}
169175

170176
.col-1,

src/shared/components/tc-communities/Header/index.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ Toggle navigation
252252
<div className={isMobileOpen ? theme.menuWrapOpen : theme.menuWrap}>
253253
{
254254
menuItems[0] && menuItems[0].navigationMenu ? (
255-
<Menu id={menuItems[0].navigationMenu} baseUrl={baseUrl} />
255+
<Menu
256+
id={menuItems[0].navigationMenu}
257+
baseUrl={baseUrl}
258+
spaceName={menuItems[0].spaceName}
259+
environment={menuItems[0].environment}
260+
/>
256261
) : (
257262
<ul className={theme.menu}>
258263
{_.map(menuItems, menuIterator)}

src/shared/routes/Communities/TCO03/Routes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function TCO03({ base }) {
2525
<ContentfulRoute
2626
baseUrl={base}
2727
error404={<Error404 />}
28-
id="4mKZxfgAi6Us6dRS4Hy2Ab"
28+
id="2MKnrhssyBHnKH2wuV9Ate"
2929
/>
3030
<Route
3131
component={Error404}

src/shared/routes/Communities/TCO07/Routes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function TCO07({ base }) {
2525
<ContentfulRoute
2626
baseUrl={base}
2727
error404={<Error404 />}
28-
id="2XWcxVALvInOlAOfROErKS"
28+
id="52NfYmZnxLnJXKpIQXwnzC"
2929
/>
3030
<Route
3131
component={Error404}

src/shared/routes/Topcoder/Routes.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function Topcoder() {
7171
<Route
7272
component={Profile}
7373
exact
74-
path="/members/:handle([\w\-\[\].{}]{2,15})"
74+
path="/members/:handle([\w\-\[\].{} ]{2,15})"
7575
/>
7676
<Route
7777
component={() => <Settings base="/settings" />}
@@ -80,7 +80,7 @@ export default function Topcoder() {
8080
<Route
8181
component={ProfileStats}
8282
exact
83-
path="/members/:handle([\w\-\[\].{}]{2,15})/details"
83+
path="/members/:handle([\w\-\[\].{} ]{2,15})/details"
8484
/>
8585
<Error404 />
8686
</Switch>

0 commit comments

Comments
 (0)