Skip to content

Commit 835c7dc

Browse files
Merge branch 'develop' into seo-fix
2 parents 9278750 + 4f52467 commit 835c7dc

File tree

24 files changed

+296
-62
lines changed

24 files changed

+296
-62
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ workflows:
244244
filters:
245245
branches:
246246
only:
247-
- issue-5041
247+
- free
248248
# This is beta env for production soft releases
249249
- "build-prod-beta":
250250
context : org-global
@@ -260,7 +260,6 @@ workflows:
260260
branches:
261261
only:
262262
- develop
263-
- seo-fix
264263
# Production builds are exectuted
265264
# when PR is merged to the master
266265
# Don't change anything in this configuration

__tests__/shared/components/GUIKit/TextInput/__snapshots__/index.jsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`Default render 1`] = `
99
defaultValue=""
1010
onBlur={[Function]}
1111
onChange={[Function]}
12+
onKeyPress={[Function]}
1213
placeholder=""
1314
type="text"
1415
/>

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ module.exports = {
112112
COMMUNITY: 'https://community.topcoder-dev.com',
113113
FORUMS: 'https://apps.topcoder-dev.com/forums',
114114
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
115+
SUBMISSION_REVIEW: 'https://submission-review.topcoder-dev.com',
115116

116117
THRIVE: 'https://www.topcoder.com/thrive',
117118

config/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = {
3232
COMMUNITY: 'https://community.topcoder.com',
3333
FORUMS: 'https://apps.topcoder.com/forums',
3434
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
35+
SUBMISSION_REVIEW: 'https://submission-review.topcoder.com',
3536
MEMBER: 'https://member.topcoder.com',
3637
ONLINE_REVIEW: 'https://software.topcoder.com',
3738
PAYMENT_TOOL: 'https://payment.topcoder.com',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"supertest": "^3.1.0",
141141
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
142142
"tc-ui": "^1.0.12",
143-
"topcoder-react-lib": "1.1.1",
143+
"topcoder-react-lib": "1000.25.10",
144144
"topcoder-react-ui-kit": "2.0.1",
145145
"topcoder-react-utils": "0.7.8",
146146
"turndown": "^4.0.2",

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export default class PasswordScreen extends React.Component {
2121

2222
onSubmit() {
2323
const { password } = this.props;
24-
const { inputVal } = this.state;
25-
this.setState({
26-
authorized: password === inputVal,
27-
errorMsg: password === inputVal ? '' : 'Password incorrect',
24+
this.setState((state) => {
25+
const { inputVal } = state;
26+
return {
27+
authorized: password === inputVal,
28+
errorMsg: password === inputVal ? '' : 'Password incorrect',
29+
};
2830
});
2931
}
3032

@@ -41,7 +43,7 @@ export default class PasswordScreen extends React.Component {
4143
authorized, errorMsg, inputVal,
4244
} = this.state;
4345
const {
44-
viewPortId, preview, spaceName, environment, baseUrl, title,
46+
viewPortId, preview, spaceName, environment, baseUrl, title, btnText, content,
4547
} = this.props;
4648
return authorized ? (
4749
<Viewport
@@ -62,11 +64,24 @@ export default class PasswordScreen extends React.Component {
6264
onChange={val => this.onPasswordInput(val)}
6365
errorMsg={errorMsg}
6466
required
67+
type="password"
68+
onEnterKey={this.onSubmit}
6569
/>
6670
<div styleName="cta">
67-
<button type="button" styleName="submit" onClick={this.onSubmit} disabled={!inputVal}>SUBMIT</button>
71+
<button type="button" styleName="submit" onClick={this.onSubmit} disabled={!inputVal}>{btnText}</button>
6872
</div>
6973
</div>
74+
{
75+
content ? (
76+
<Viewport
77+
id={content.sys.id}
78+
preview={preview}
79+
spaceName={spaceName}
80+
environment={environment}
81+
baseUrl={baseUrl}
82+
/>
83+
) : null
84+
}
7085
</div>
7186
);
7287
}
@@ -78,6 +93,8 @@ PasswordScreen.defaultProps = {
7893
environment: null,
7994
baseUrl: '',
8095
title: 'GET ACCESS WITH PASSWORD',
96+
btnText: 'SUBMIT',
97+
content: null,
8198
};
8299

83100
PasswordScreen.propTypes = {
@@ -88,4 +105,6 @@ PasswordScreen.propTypes = {
88105
environment: PT.string,
89106
baseUrl: PT.string,
90107
title: PT.string,
108+
btnText: PT.string,
109+
content: PT.shape(),
91110
};

src/shared/components/Contentful/Route.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ function ChildRoutesLoader(props) {
7171
environment={environment}
7272
baseUrl={url}
7373
title={fields.passwordScreenTitle}
74+
btnText={fields.passwordScreenButtonText}
75+
content={fields.passwordScreenContent}
7476
/>
7577
)
7678
) : <Error404 />

src/shared/components/GUIKit/TextInput/index.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ function TextInput({
1717
onChange,
1818
required,
1919
size,
20+
type,
21+
onEnterKey,
2022
}) {
2123
const [val, setVal] = useState(value);
2224
const delayedOnChange = useRef(
@@ -28,7 +30,7 @@ function TextInput({
2830
<div className="textInputContainer" styleName={`container ${sizeStyle}`}>
2931
<input
3032
defaultValue={value}
31-
type="text"
33+
type={type}
3234
placeholder={`${placeholder}${placeholder && required ? ' *' : ''}`}
3335
styleName={`${value || val ? 'haveValue' : ''} ${errorMsg ? 'haveError' : ''}`}
3436
onChange={(e) => {
@@ -39,6 +41,11 @@ function TextInput({
3941
delayedOnChange(e.target.value, onChange);
4042
setVal(e.target.value);
4143
}}
44+
onKeyPress={(e) => {
45+
if (e.key === 'Enter') {
46+
onEnterKey();
47+
}
48+
}}
4249
/>
4350
{label ? (
4451
<label htmlFor="textBoxInput">
@@ -58,6 +65,8 @@ TextInput.defaultProps = {
5865
onChange: () => {},
5966
required: false,
6067
size: 'lg',
68+
type: 'text',
69+
onEnterKey: () => {},
6170
};
6271

6372
TextInput.propTypes = {
@@ -68,6 +77,8 @@ TextInput.propTypes = {
6877
onChange: PT.func,
6978
required: PT.bool,
7079
size: PT.oneOf(['xs', 'lg']),
80+
type: PT.string,
81+
onEnterKey: PT.func,
7182
};
7283

7384
export default TextInput;

src/shared/components/Leaderboard/ChallengeHistoryModal/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ChallengeHistoryModal extends Component {
116116
challengesOrdered.map(challenge => (
117117
<tr styleName="row" key={`${challenge['tco_leaderboard.challenge_id'] || challenge.challenge_id}`}>
118118
<td styleName="name">
119-
<a href={`${config.URL.BASE}/challenges/${challenge['tco_leaderboard.challenge_id'] || challenge.challenge_id}/`} styleName="link" target="_blank" rel="noopener noreferrer">
119+
<a href={`${config.URL.BASE}/challenges/${challenge['tco_leaderboard.challenge_id'] || challenge['challenge.challenge_id'] || challenge.challenge_id}/`} styleName="link" target="_blank" rel="noopener noreferrer">
120120
{challenge.challenge_name || challenge['challenge.challenge_name'] || challenge['tco_leaderboard.challenge_id'] || challenge.challenge_id}
121121
</a>
122122
</td>

src/shared/components/Leaderboard/LeaderboardTable/index.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ export default function LeaderboardTable(props) {
6565
photoUrl = `${config.CDN.PUBLIC}/avatar/${
6666
encodeURIComponent(photoUrl)}?size=40`;
6767
}
68+
const fulfillment = competitor['tco_leaderboard.fulfillment']
69+
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
70+
: competitor.fulfillment;
6871
return (
6972
<tr key={competitor.rank}>
7073
<td styleName={`${stylesName}.col-rank`}>{competitor.rank}</td>
@@ -105,7 +108,7 @@ export default function LeaderboardTable(props) {
105108
</td>
106109
{
107110
isCopilot ? (
108-
<td styleName={`${stylesName}.col-fulfillment`}>{competitor.fulfillment}</td>
111+
<td styleName={`${stylesName}.col-fulfillment`}>{fulfillment}</td>
109112
) : null
110113
}
111114
<td styleName={`${stylesName}.col-challenges`}>{competitor['tco_leaderboard.challenge_count'] || competitor.challengecount}</td>
@@ -122,7 +125,7 @@ export default function LeaderboardTable(props) {
122125
}
123126
{
124127
isAlgo ? (
125-
<td styleName={`${stylesName}.col-points`}>{competitor['srm_tco19.score']}</td>
128+
<td styleName={`${stylesName}.col-points`}>{competitor['tco_leaderboard.total_score'] || competitor['srm_tco19.score']}</td>
126129
) : null
127130
}
128131
</tr>
@@ -141,7 +144,13 @@ export default function LeaderboardTable(props) {
141144
<th styleName={`${stylesName}.col-fulfillment`}>Fulfillment</th>
142145
) : null
143146
}
144-
<th styleName={`${stylesName}.col-challenges`}># of Challenges</th>
147+
{
148+
isAlgo ? (
149+
<th styleName={`${stylesName}.col-challenges`}># of Matches</th>
150+
) : (
151+
<th styleName={`${stylesName}.col-challenges`}># of Challenges</th>
152+
)
153+
}
145154
<th styleName={`${stylesName}.col-points`}>Points</th>
146155
{
147156
isTopGear ? (

src/shared/components/Leaderboard/PodiumSpot/index.jsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ export default function PodiumSpot(props) {
107107
}
108108
let rootStyle = `${stylesName}.PodiumSpot`;
109109
if (PODIUM_ITEM_MODIFIER[competitor.rank]) rootStyle += ` ${stylesName}.PodiumSpot--${PODIUM_ITEM_MODIFIER[competitor.rank]}`;
110+
const fulfillment = competitor['tco_leaderboard.fulfillment']
111+
? (parseFloat(competitor['tco_leaderboard.fulfillment']) * 100).toFixed(2).replace(/[.,]00$/, '')
112+
: competitor.fulfillment;
110113

111114
return (
112115
<div styleName={rootStyle}>
@@ -175,14 +178,20 @@ export default function PodiumSpot(props) {
175178
{
176179
isCopilot ? (
177180
<div styleName={`${stylesName}.stats`}>
178-
<span styleName={`${stylesName}.value`}>{competitor.fulfillment}</span>
181+
<span styleName={`${stylesName}.value`}>{fulfillment}</span>
179182
<span styleName={`${stylesName}.value-title`}>fulfillment</span>
180183
</div>
181184
) : null
182185
}
183186
<div styleName={`${stylesName}.stats`}>
184187
<span styleName={`${stylesName}.value`}>{competitor['tco_leaderboard.challenge_count'] || competitor.challengecount}</span>
185-
<span styleName={`${stylesName}.value-title`}>challenges</span>
188+
{
189+
isAlgo ? (
190+
<span styleName={`${stylesName}.value-title`}># of matches</span>
191+
) : (
192+
<span styleName={`${stylesName}.value-title`}>challenges</span>
193+
)
194+
}
186195
</div>
187196
<div styleName={`${stylesName}.stats`}>
188197
<span styleName={`${stylesName}.value`}>{formatPoints(competitor['tco_leaderboard.tco_points'] || competitor.points)}</span>
@@ -207,7 +216,7 @@ export default function PodiumSpot(props) {
207216
{
208217
isAlgo ? (
209218
<div styleName={`${stylesName}.stats`}>
210-
<span styleName={`${stylesName}.value`}>{competitor['srm_tco19.score']}</span>
219+
<span styleName={`${stylesName}.value`}>{competitor['tco_leaderboard.total_score'] || competitor['srm_tco19.score']}</span>
211220
<span styleName={`${stylesName}.value-title`}>total score</span>
212221
</div>
213222
) : null

src/shared/components/MMatchLeaderboard/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export default class MMLeaderboard extends Component {
7070
// Use Lodash to sort array
7171
data = _.orderBy(
7272
data,
73-
[d => String(d[sortParam.field]).toLowerCase()], [sortParam.order],
73+
[d => Number(d[sortParam.field]) || String(d[sortParam.field]).toLowerCase()],
74+
[sortParam.order],
7475
);
7576
}
7677

src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import shortId from 'shortid';
1313
import ChallengeTile from 'components/ChallengeTile';
1414
import SRMTile from 'components/SRMTile';
1515
import { actions } from 'topcoder-react-lib';
16+
import { OLD_COMPETITION_TRACKS, COMPETITION_TRACKS } from 'utils/tc';
1617
import LoadingIndicator from 'components/LoadingIndicator';
1718
import GalleryModal from './GalleryModal';
1819
import './style.scss';
@@ -104,6 +105,27 @@ const processPastChallenge = (challenge) => {
104105
} else {
105106
cloned.numImages = 0;
106107
}
108+
109+
if (!cloned.type) {
110+
cloned.type = cloned.subTrack;
111+
}
112+
113+
switch (cloned.track) {
114+
case OLD_COMPETITION_TRACKS.DATA_SCIENCE:
115+
cloned.track = COMPETITION_TRACKS.DS;
116+
break;
117+
case OLD_COMPETITION_TRACKS.DESIGN:
118+
cloned.track = COMPETITION_TRACKS.DES;
119+
break;
120+
case OLD_COMPETITION_TRACKS.DEVELOP:
121+
cloned.track = COMPETITION_TRACKS.DEV;
122+
break;
123+
case OLD_COMPETITION_TRACKS.QA:
124+
cloned.track = COMPETITION_TRACKS.QA;
125+
break;
126+
default:
127+
break;
128+
}
107129
}
108130
return cloned;
109131
};
@@ -421,7 +443,6 @@ function mapDispatchToProps(dispatch) {
421443
pageNum,
422444
pageSize,
423445
refresh,
424-
userId,
425446
) => {
426447
const uuid = shortId();
427448
dispatch(action.getSubtrackChallengesInit(handle, uuid));
@@ -434,7 +455,6 @@ function mapDispatchToProps(dispatch) {
434455
pageNum,
435456
pageSize,
436457
refresh,
437-
userId,
438458
));
439459
},
440460
loadSRM: (handle, tokenV3, pageNum, pageSize, refresh) => {

0 commit comments

Comments
 (0)