Skip to content

Commit 8d0b370

Browse files
authored
Merge pull request #4807 from topcoder-platform/develop
V5 Integration fixes
2 parents 53cb80e + 909d67d commit 8d0b370

File tree

15 files changed

+192
-58
lines changed

15 files changed

+192
-58
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ workflows:
237237
filters:
238238
branches:
239239
only:
240-
- integration-v5-challenge-api
240+
- hot-fix
241241
# This is alternate dev env for parallel testing
242242
- "build-qa":
243243
context : org-global
@@ -251,14 +251,14 @@ workflows:
251251
filters:
252252
branches:
253253
only:
254-
- develop
254+
- hot-fix
255255
# This is stage env for production QA releases
256256
- "build-prod-staging":
257257
context : org-global
258258
filters:
259259
branches:
260260
only:
261-
- hot-fix
261+
- develop
262262
# Production builds are exectuted
263263
# when PR is merged to the master
264264
# Don't change anything in this configuration

package-lock.json

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/tc-communities/zurich/metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"communityId": "zurich",
1313
"communityName": "Zurich Community",
1414
"groupIds": ["20000145"],
15-
"authorizedGroupIdsCatalog": ["20000160", "20000161"],
15+
"authorizedGroupIdsCatalog": ["c40767a9-e02e-4872-87eb-d50dcb946055", "a1bcb865-7235-481f-ae62-b82dd958fc4c"],
1616
"competitorsGroupIds": ["20000226"],
1717
"logos": [{
1818
"img": "/community-app-assets/themes/zurich/zurich.svg",

src/shared/components/challenge-detail/Specification/SideBar/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export default function SideBar({
3636
const scorecardURL = `${config.URL.ONLINE_REVIEW}/review/actions/ViewScorecard?scid=`;
3737
const faqURL = config.URL.INFO.DESIGN_CHALLENGE_SUBMISSION;
3838
let submissionLimitDisplay = 'Unlimited';
39-
const submissionLimit = _.find(metadata, { type: 'submissionLimit' });
39+
const submissionLimit = _.find(metadata, { name: 'submissionLimit' });
4040
const fileTypes = _.find(metadata, { name: 'fileTypes' });
4141

4242
if (submissionLimit) {
4343
if (submissionLimit.value === 1) {
4444
submissionLimitDisplay = '1 submission';
45-
} else if (submissionLimit > 1) {
45+
} else if (submissionLimit.value > 1) {
4646
submissionLimitDisplay = `${submissionLimit.value} submissions`;
4747
}
4848
}

src/shared/components/challenge-detail/Specification/index.jsx

+21-16
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ export default function ChallengeDetailsView(props) {
5959
forumId,
6060
} = legacy;
6161

62-
const allowStockArt = _.find(metadata, { type: 'allowStockArt' });
62+
let stockArtValue = '';
63+
const allowStockArt = _.find(metadata, { name: 'allowStockArt' });
64+
if (allowStockArt) {
65+
stockArtValue = allowStockArt.value;
66+
}
67+
6368
let environment = '';
6469
const environmentData = _.find(metadata, { name: 'environment' });
6570
if (environmentData) {
@@ -103,7 +108,7 @@ export default function ChallengeDetailsView(props) {
103108
const toolbarConnector = new ToolbarConnector();
104109
const isSaving = specsTabState === SPECS_TAB_STATES.SAVING;
105110

106-
const stockArtText = allowStockArt
111+
const stockArtText = stockArtValue
107112
? 'Stock photography is allowed in this challenge.'
108113
: 'Stock photography is not allowed in this challenge. All submitted elements must be designed solely by you.';
109114

@@ -170,7 +175,7 @@ export default function ChallengeDetailsView(props) {
170175
description
171176
&& (
172177
<article>
173-
<h2 styleName="h2">
178+
<h2>
174179
Challenge Overview
175180
</h2>
176181
{
@@ -195,7 +200,7 @@ export default function ChallengeDetailsView(props) {
195200
finalSubmissionGuidelines
196201
&& (
197202
<article>
198-
<h2 styleName="h2">
203+
<h2>
199204
Final Submission Guidelines
200205
</h2>
201206
{
@@ -228,7 +233,7 @@ export default function ChallengeDetailsView(props) {
228233
description
229234
&& (
230235
<article>
231-
<h2 styleName="h2">
236+
<h2>
232237
Challenge Summary
233238
</h2>
234239
{
@@ -246,8 +251,8 @@ export default function ChallengeDetailsView(props) {
246251
/>
247252
)
248253
}
249-
<p styleName="p" />
250-
<p styleName="p note">
254+
<p />
255+
<p styleName="note">
251256
Please read the challenge specification carefully and
252257
watch the forums for any questions or feedback
253258
concerning this challenge. It is important that you
@@ -259,10 +264,10 @@ export default function ChallengeDetailsView(props) {
259264
)
260265
}
261266
<article>
262-
<h2 styleName="h2">
267+
<h2>
263268
Stock Photography
264269
</h2>
265-
<p styleName="p">
270+
<p>
266271
{stockArtText}
267272
&nbsp;
268273
<a href={config.URL.INFO.STOCK_ART_POLICY}>
@@ -271,10 +276,10 @@ export default function ChallengeDetailsView(props) {
271276
</p>
272277
</article>
273278
<article>
274-
<h2 styleName="h2">
279+
<h2>
275280
How To Submit
276281
</h2>
277-
<ul styleName="ul">
282+
<ul>
278283
<li>
279284
New to Studio?
280285
&zwnj;
@@ -311,10 +316,10 @@ export default function ChallengeDetailsView(props) {
311316
</article>
312317

313318
<article>
314-
<h2 styleName="h2">
319+
<h2>
315320
Winner Selection
316321
</h2>
317-
<p styleName="p">
322+
<p>
318323
Submissions are viewable to the client as they are entered
319324
into the challenge. Winners are selected by the client and
320325
are chosen solely at the client&apos;s discretion.
@@ -324,13 +329,13 @@ export default function ChallengeDetailsView(props) {
324329
)
325330
}
326331
<article>
327-
<h2 styleName="h2">
332+
<h2>
328333
Payments
329334
</h2>
330335
{
331336
isWipro ? (
332337
<div>
333-
<p styleName="p">
338+
<p>
334339
For employees of Wipro Technologies, following are the
335340
payment terms. Winner/s would be awarded the prize money on
336341
successful completion and acceptance of the submission by
@@ -354,7 +359,7 @@ export default function ChallengeDetailsView(props) {
354359
</p>
355360
</div>
356361
) : (
357-
<p styleName="p">
362+
<p>
358363
Topcoder will compensate members in accordance with our standard payment policies, unless
359364
otherwise specified in this challenge. For information on payment policies, setting up your profile to
360365
receive payments, and general payment questions, please refer to

src/shared/components/challenge-detail/Specification/styles.scss

+16-4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ $tc-link-visited: #0c4e98;
7878
align-items: baseline;
7979
word-break: break-word;
8080

81+
@include linkStyle;
82+
8183
@include xs-to-sm {
8284
flex-direction: column;
8385
}
@@ -118,7 +120,7 @@ $tc-link-visited: #0c4e98;
118120
}
119121
}
120122

121-
.h2 {
123+
h2 {
122124
@include roboto-bold;
123125

124126
font-size: 20px;
@@ -127,7 +129,7 @@ $tc-link-visited: #0c4e98;
127129
margin: (6 * $base-unit) 0 (2 * $base-unit);
128130
}
129131

130-
.h3 {
132+
h3 {
131133
@include roboto-bold;
132134

133135
font-size: 15px;
@@ -137,7 +139,17 @@ $tc-link-visited: #0c4e98;
137139
text-transform: uppercase;
138140
}
139141

140-
.p {
142+
p,
143+
em,
144+
strong {
145+
@include roboto-regular;
146+
147+
font-size: 15px;
148+
color: $tc-gray-90;
149+
line-height: 25px;
150+
}
151+
152+
p {
141153
@include roboto-regular;
142154

143155
font-size: 15px;
@@ -149,7 +161,7 @@ $tc-link-visited: #0c4e98;
149161
margin: (2 * $base-unit) 0 (3 * $base-unit);
150162
}
151163

152-
.ul {
164+
ul {
153165
@include roboto-regular;
154166

155167
margin: 0 0 5px 20px;

src/shared/components/challenge-detail/Submissions/index.jsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ class SubmissionsComponent extends React.Component {
175175
valueA = `${a.member || ''}`.toLowerCase();
176176
valueB = `${b.member || ''}`.toLowerCase();
177177
} else {
178-
valueA = `${a.createdBy}`.toLowerCase();
179-
valueB = `${b.createdBy}`.toLowerCase();
178+
valueA = _.get(a.registrant, 'memberHandle', '');
179+
valueB = _.get(b.registrant, 'memberHandle', '');
180180
}
181181
valueIsString = true;
182182
break;
@@ -314,12 +314,12 @@ class SubmissionsComponent extends React.Component {
314314
{`#${s.id}`}
315315
</a>
316316
<a
317-
href={`${window.origin}/members/${s.createdBy}`}
317+
href={`${window.origin}/members/${_.get(s.registrant, 'memberHandle', '')}`}
318318
target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}
319319
rel="noopener noreferrer"
320320
styleName={`level-${getRatingLevel(_.get(s.registrant, 'rating', 0))}`}
321321
>
322-
{s.createdBy}
322+
{_.get(s.registrant, 'memberHandle', '')}
323323
</a>
324324
</div>
325325
<div>
@@ -705,7 +705,7 @@ class SubmissionsComponent extends React.Component {
705705
{
706706
!isMM && (
707707
sortedSubmissions.map(s => (
708-
<div key={s.createdBy + s.created} styleName="row">
708+
<div key={_.get(s.registrant, 'memberHandle', '') + s.created} styleName="row">
709709
{
710710
!isF2F && !isBugHunt && (
711711
<div styleName={`col-2 level-${getRatingLevel(_.get(s.registrant, 'rating', 0))}`}>
@@ -715,12 +715,12 @@ class SubmissionsComponent extends React.Component {
715715
}
716716
<div styleName="col-3">
717717
<a
718-
href={`${window.origin}/members/${s.createdBy}`}
718+
href={`${window.origin}/members/${_.get(s.registrant, 'memberHandle', '')}`}
719719
target={`${_.includes(window.origin, 'www') ? '_self' : '_blank'}`}
720720
rel="noopener noreferrer"
721721
styleName={`handle level-${getRatingLevel(_.get(s.registrant, 'rating', 0))}`}
722722
>
723-
{s.createdBy}
723+
{_.get(s.registrant, 'memberHandle', '')}
724724
</a>
725725
</div>
726726
<div styleName="col-4">

src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import LeaderboardAvatar from 'components/challenge-listing/LeaderboardAvatar';
66
import { config, Link } from 'topcoder-react-utils';
77
import { TABS as DETAIL_TABS } from 'actions/page/challenge-details';
88
import 'moment-duration-format';
9+
import { phaseEndDate } from 'utils/challenge-listing/helper';
910
import {
1011
getTimeLeft,
1112
} from 'utils/challenge-detail/helper';
@@ -271,7 +272,7 @@ export default function ChallengeStatus(props) {
271272
<ChallengeProgressBar
272273
color="green"
273274
value={getPhaseProgress(statusPhase)}
274-
isLate={moment().isAfter(statusPhase.scheduledEndDate)}
275+
isLate={moment().isAfter(phaseEndDate(statusPhase))}
275276
/>
276277
<div styleName="time-left">
277278
{getTimeLeft(statusPhase, 'to go').text}

src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import _ from 'lodash';
1717
import React from 'react';
1818
import PT from 'prop-types';
1919
import Tooltip from 'components/Tooltip';
20+
import { phaseStartDate, phaseEndDate } from 'utils/challenge-listing/helper';
2021
import LoaderIcon from '../../../Loader/Loader';
2122
import './style.scss';
2223

@@ -95,31 +96,32 @@ function Tip(props) {
9596
if (!c || _.isEmpty(c)) return <div />;
9697

9798
const allPhases = c.phases || [];
98-
const endPhaseDate = Math.max(...allPhases.map(d => new Date(d.scheduledEndDate)));
99+
const endPhaseDate = Math.max(...allPhases.map(d => phaseEndDate(d)));
99100
const registrationPhase = allPhases.find(phase => phase.name === 'Registration');
100101
const submissionPhase = allPhases.find(phase => phase.name === 'Submission');
102+
const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission');
101103

102104
if (registrationPhase) {
103105
steps.push({
104-
date: new Date(registrationPhase.scheduledStartDate),
106+
date: phaseStartDate(registrationPhase),
105107
name: 'Start',
106108
});
107109
}
108-
if (c.checkpointSubmissionEndDate) {
110+
if (checkpointPhase) {
109111
steps.push({
110-
date: new Date(c.checkpointSubmissionEndDate),
112+
date: phaseEndDate(checkpointPhase),
111113
name: 'Checkpoint',
112114
});
113115
}
114116
const iterativeReviewPhase = allPhases.find(phase => phase.isOpen && phase.name === 'Iterative Review');
115117
if (iterativeReviewPhase) {
116118
steps.push({
117-
date: new Date(iterativeReviewPhase.scheduledEndDate),
119+
date: phaseEndDate(iterativeReviewPhase),
118120
name: 'Iterative Review',
119121
});
120122
} else if (submissionPhase) {
121123
steps.push({
122-
date: new Date(submissionPhase.scheduledEndDate),
124+
date: phaseEndDate(submissionPhase),
123125
name: 'Submission',
124126
});
125127
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function Header(props) {
5555
const AUTH_URL = config.URL.AUTH;
5656
const normalizedProfile = profile && _.clone(profile);
5757
const isZurichCompetitor = (profile && profile.groups) ? _.intersection(
58-
_.map(profile.groups, 'id'),
58+
_.map(profile.groups, 'oldId'),
5959
meta.competitorsGroupIds,
6060
) : [];
6161

0 commit comments

Comments
 (0)