Skip to content

Commit fc7f57f

Browse files
Merge branch 'develop' into stat_marathon_match_link
2 parents 1995583 + 6c42073 commit fc7f57f

File tree

13 files changed

+156
-65
lines changed

13 files changed

+156
-65
lines changed

.circleci/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,28 +343,27 @@ workflows:
343343
branches:
344344
only:
345345
- develop
346-
- fix/infected-submission
347346
# This is alternate dev env for parallel testing
348347
- "build-test":
349348
context : org-global
350349
filters:
351350
branches:
352351
only:
353-
- ca-profile-bug-bash
352+
- free
354353
# This is alternate dev env for parallel testing
355354
- "build-qa":
356355
context : org-global
357356
filters:
358357
branches:
359358
only:
360-
- thrive-rss
359+
- free
361360
# This is beta env for production soft releases
362361
- "build-prod-beta":
363362
context : org-global
364363
filters:
365364
branches:
366365
only:
367-
- new-tc-logo
366+
- free
368367
# This is stage env for production QA releases
369368
- "build-prod-staging":
370369
context : org-global

config/default.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ module.exports = {
116116
FORUMS_VANILLA: 'https://vanilla.topcoder-dev.com',
117117
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
118118
SUBMISSION_REVIEW: 'https://submission-review.topcoder-dev.com',
119+
SUBMISSION_REVIEW_API_URL: 'https://submission-review-api.topcoder-dev.com',
119120

120-
THRIVE: 'https://www.topcoder.com/thrive',
121+
THRIVE: 'https://community-app.topcoder-dev.com/thrive',
121122

122123
COMMUNITIES: {
123124
BLOCKCHAIN: 'https://blockchain.topcoder-dev.com',

config/production.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = {
3535
FORUMS_VANILLA: 'https://discussions.topcoder.com',
3636
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
3737
SUBMISSION_REVIEW: 'https://submission-review.topcoder.com',
38+
SUBMISSION_REVIEW_API_URL: 'https://submission-review-api.topcoder.com',
3839
MEMBER: 'https://member.topcoder.com',
3940
ONLINE_REVIEW: 'https://software.topcoder.com',
4041
PAYMENT_TOOL: 'https://payment.topcoder.com',
@@ -50,6 +51,8 @@ module.exports = {
5051

5152
COMMUNITY_API: 'http://localhost:8000',
5253

54+
THRIVE: 'https://www.topcoder.com/thrive',
55+
5356
COMMUNITIES: {
5457
BLOCKCHAIN: 'https://blockchain.topcoder.com',
5558
COGNITIVE: 'https://cognitive.topcoder.com',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"supertest": "^3.1.0",
154154
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
155155
"tc-ui": "^1.0.12",
156-
"topcoder-react-lib": "1.2.5",
156+
"topcoder-react-lib": "1.2.6",
157157
"topcoder-react-ui-kit": "2.0.1",
158158
"topcoder-react-utils": "0.7.8",
159159
"turndown": "^4.0.2",

src/server/index.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,86 @@ async function onExpressJsSetup(server) {
131131
return next();
132132
};
133133

134+
server.use((req, res, next) => {
135+
res.header('Referrer-Policy', 'strict-origin-when-cross-origin');
136+
res.header('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
137+
138+
if (req.url.startsWith('/__community__/veterans') || req.hostname === 'veterans.topcoder.com') {
139+
res.header(
140+
'Content-Security-Policy',
141+
"default-src 'self';"
142+
+ " script-src 'report-sample' 'self' 'unsafe-inline' 'unsafe-eval'"
143+
+ ` ${config.CDN.PUBLIC}`
144+
+ ' http://www.google-analytics.com'
145+
+ ' https://43d132d5dbff47c59d9d53ad448f93c2.js.ubembed.com'
146+
+ ' https://assets.ubembed.com'
147+
+ ' https://assets.zendesk.com'
148+
+ ' https://browser.sentry-cdn.com'
149+
+ ' https://cdn.heapanalytics.com'
150+
+ ' https://cdn.segment.com'
151+
+ ' https://connect.facebook.net'
152+
+ ' https://d1of0acg2orgco.cloudfront.net'
153+
+ ' https://d1mwkvp2xbqfs9.cloudfront.net'
154+
+ ' https://d24oibycet9bsb.cloudfront.net'
155+
+ ' https://fast.trychameleon.com'
156+
+ ' https://static.zdassets.com'
157+
+ ' https://www.googletagmanager.com;'
158+
+ " style-src 'report-sample' 'self' 'unsafe-inline'"
159+
+ ` ${config.CDN.PUBLIC}`
160+
+ ' https://d1of0acg2orgco.cloudfront.net'
161+
+ ' https://d1mwkvp2xbqfs9.cloudfront.net'
162+
+ ' https://d24oibycet9bsb.cloudfront.net'
163+
+ ' https://d2nl5eqipnb33q.cloudfront.net;'
164+
+ " object-src 'none';"
165+
+ " base-uri 'self';"
166+
+ " connect-src 'self'"
167+
+ ` ${config.API.V2}/`
168+
+ ` ${config.API.V3}/`
169+
+ ` ${config.API.V4}/`
170+
+ ` ${config.API.V5}/`
171+
+ ` ${config.CDN.PUBLIC}`
172+
+ ` ${config.URL.COMMUNITY_APP}`
173+
+ ' https://api.segment.io'
174+
+ ' https://cdn.segment.com'
175+
+ ' https://ekr.zdassets.com'
176+
+ ' https://fast.trychameleon.com'
177+
+ ' https://topcoder.zendesk.com'
178+
+ ' https://stats.g.doubleclick.net'
179+
+ ' https://www.google-analytics.com;'
180+
+ " font-src 'self'"
181+
+ ' data:'
182+
+ ` ${config.CDN.PUBLIC}`
183+
+ ' https://d1of0acg2orgco.cloudfront.net'
184+
+ ' https://d24oibycet9bsb.cloudfront.net'
185+
+ ' https://43d132d5dbff47c59d9d53ad448f93c2.js.ubembed.com;'
186+
+ " frame-src 'self'"
187+
+ ` ${config.URL.AUTH}`
188+
+ ' https://www.youtube.com;'
189+
+ " img-src 'self'"
190+
+ ` ${config.CDN.PUBLIC}`
191+
+ ' https://cdn.segment.com'
192+
+ ' https://d1of0acg2orgco.cloudfront.net'
193+
+ ' https://d24oibycet9bsb.cloudfront.net'
194+
+ ' https://d2nl5eqipnb33q.cloudfront.net'
195+
+ ' https://images.ctfassets.net'
196+
+ ' https://heapanalytics.com'
197+
+ ' https://q.quora.com'
198+
+ ' https://topcoder-prod-media.s3.amazonaws.com'
199+
+ ' https://www.facebook.com'
200+
+ ' https://www.google-analytics.com'
201+
+ ' https://www.google.com'
202+
+ ' https://www.googletagmanager.com'
203+
+ ' https://i.ytimg.com;'
204+
+ " manifest-src 'self';"
205+
+ " media-src 'self';"
206+
+ ' report-uri https://623d4c23f90d055298b24042.endpoint.csper.io/?v=0;'
207+
+ " worker-src 'self';",
208+
);
209+
}
210+
211+
next();
212+
});
213+
134214
/* Log Entries service proxy. */
135215
server.use('/community-app-assets/api/logger', checkAuthorizationHeader, (req, res) => {
136216
logger.log(`${req.clientIp} > `, ...req.body.data);

src/server/services/recruitCRM.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,16 @@ export default class RecruitCRMService {
209209
return res.send(error);
210210
}
211211
const data = await response.json();
212+
213+
// If job or form not open return just job status
214+
if ((data.job_status && data.job_status.id !== 1)
215+
|| data.enable_job_application_form !== 1) {
216+
return res.send({
217+
job_status: data.job_status,
218+
enable_job_application_form: data.enable_job_application_form,
219+
});
220+
}
221+
212222
return res.send(sanitizeJob(data));
213223
} catch (err) {
214224
return next(err);
@@ -261,10 +271,18 @@ export default class RecruitCRMService {
261271
const pageData = await pageDataRsp.json();
262272
data.data = _.flatten(data.data.concat(pageData.data));
263273
}
274+
275+
// Filter by Job Application active
276+
data.data = _.filter(data.data, job => job.enable_job_application_form === 1);
277+
264278
const toSend = _.map(data.data, j => sanitizeJob(j));
265279
return toSend;
266280
});
267281
}
282+
283+
// Filter by Job Application active
284+
data.data = _.filter(data.data, job => job.enable_job_application_form === 1);
285+
268286
const toSend = _.map(data.data, j => sanitizeJob(j));
269287
return toSend;
270288
} catch (err) {
@@ -322,6 +340,10 @@ export default class RecruitCRMService {
322340
const pageData = await pageDataRsp.json();
323341
data.data = _.flatten(data.data.concat(pageData.data));
324342
}
343+
344+
// Filter by Job Application active
345+
data.data = _.filter(data.data, job => job.enable_job_application_form === 1);
346+
325347
const toSend = _.map(data.data, j => sanitizeJob(j));
326348
gigsCache.set(CACHE_KEY, toSend);
327349
return res.send(toSend);
@@ -330,6 +352,10 @@ export default class RecruitCRMService {
330352
error: e,
331353
}));
332354
}
355+
356+
// Filter by Job Application active
357+
data.data = _.filter(data.data, job => job.enable_job_application_form === 1);
358+
333359
const toSend = _.map(data.data, j => sanitizeJob(j));
334360
gigsCache.set(CACHE_KEY, toSend);
335361
return res.send(toSend);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ export default class MyAccount extends ConsentComponent {
782782
<div styleName="field col-2">
783783
<div styleName="validation-bar" className="form-field">
784784
<div styleName={`password toggle-password ${focus['new-password-input'] ? 'focus' : ''}`}>
785-
<input id="new-password-input" styleName="password-input" ref={this.newPasswordRef} onChange={this.checkPassword} onFocus={this.onPasswordFocus} onBlur={this.onPasswordBlur} name="password" type={passwordInputType['new-password-input']} placeholder="RE-TYPE YOUR NEW PASSWORD" minLength="8" maxLength="64" required />
785+
<input id="new-password-input" styleName="password-input" ref={this.newPasswordRef} onChange={this.checkPassword} onFocus={this.onPasswordFocus} onBlur={this.onPasswordBlur} name="password" type={passwordInputType['new-password-input']} placeholder="TYPE YOUR NEW PASSWORD" minLength="8" maxLength="64" required />
786786
<label htmlFor="newPasswordCheckbox" styleName="passwordCheckbox">
787787
<input type="checkbox" id="newPasswordCheckbox" styleName="newPasswordCheckbox" onChange={() => this.toggleTypeAttribute('new-password-input')} />
788788
Show
@@ -818,7 +818,7 @@ export default class MyAccount extends ConsentComponent {
818818
<div styleName="field col-2">
819819
<div styleName="validation-bar" className="form-field">
820820
<div styleName={`password toggle-password ${focus['re-new-password-input'] ? 'focus' : ''}`}>
821-
<input id="re-new-password-input" styleName="password-input" ref={this.reNewPasswordRef} onChange={this.checkPassword} onFocus={this.onPasswordFocus} onBlur={this.onPasswordBlur} name="re-password" type={passwordInputType['re-new-password-input']} placeholder="TYPE YOUR NEW PASSWORD" minLength="8" maxLength="64" required />
821+
<input id="re-new-password-input" styleName="password-input" ref={this.reNewPasswordRef} onChange={this.checkPassword} onFocus={this.onPasswordFocus} onBlur={this.onPasswordBlur} name="re-password" type={passwordInputType['re-new-password-input']} placeholder="RE-TYPE YOUR NEW PASSWORD" minLength="8" maxLength="64" required />
822822
<label htmlFor="reNewPasswordCheckbox" styleName="passwordCheckbox">
823823
<input type="checkbox" id="reNewPasswordCheckbox" styleName="newPasswordCheckbox" onChange={() => this.toggleTypeAttribute('re-new-password-input')} />
824824
Show

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

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -363,53 +363,37 @@ export default function ChallengeDetailsView(props) {
363363
</div>
364364
)
365365
}
366-
<article>
367-
<h2>
368-
Payments
369-
</h2>
370-
{
371-
isWipro ? (
372-
<div>
373-
<p>
374-
For employees of Wipro Technologies, following are the
375-
payment terms. Winner/s would be awarded the prize money on
376-
successful completion and acceptance of the submission by
377-
the stakeholder. Accumulated prize money for the month will
378-
be paid through Wipro payroll as part of subsequent month’s
379-
salary (eg. Aug month challenge winners payment will be
380-
credited as part Sept month salary). For payment of prize
381-
money, respective country currency conversion shall be
382-
considered as per Wipro standard currency conversion
383-
guidelines. Please refer to policy document at
384-
&zwnj;
385-
<a
386-
href="https://wipro365.sharepoint.com/sites/wipro-people-policies/wipro%20policies/TopGear-RewardPoints-Policy.pdf"
387-
rel="noopener noreferrer"
388-
target="_blank"
389-
>
390-
https://wipro365.sharepoint.com/sites/wipro-people-policies/wipro%20policies/TopGear-RewardPoints-Policy.pdf
391-
</a>
392-
&zwnj;
393-
for details regarding the policy.
394-
</p>
395-
</div>
396-
) : (
366+
{isWipro && (
367+
<article>
368+
<h2>
369+
Payments
370+
</h2>
371+
<div>
397372
<p>
398-
Topcoder will compensate members in accordance with our standard payment policies, unless
399-
otherwise specified in this challenge. For information on payment policies, setting up your profile to
400-
receive payments, and general payment questions, please refer to
373+
For employees of Wipro Technologies, following are the
374+
payment terms. Winner/s would be awarded the prize money on
375+
successful completion and acceptance of the submission by
376+
the stakeholder. Accumulated prize money for the month will
377+
be paid through Wipro payroll as part of subsequent month’s
378+
salary (eg. Aug month challenge winners payment will be
379+
credited as part Sept month salary). For payment of prize
380+
money, respective country currency conversion shall be
381+
considered as per Wipro standard currency conversion
382+
guidelines. Please refer to policy document at
401383
&zwnj;
402384
<a
403-
href="https://www.topcoder.com/thrive/articles/Payment%20Policies%20and%20Instructions"
385+
href="https://wipro365.sharepoint.com/sites/wipro-people-policies/wipro%20policies/TopGear-RewardPoints-Policy.pdf"
404386
rel="noopener noreferrer"
405387
target="_blank"
406388
>
407-
Payment Policies and Instructions
408-
</a>.
389+
https://wipro365.sharepoint.com/sites/wipro-people-policies/wipro%20policies/TopGear-RewardPoints-Policy.pdf
390+
</a>
391+
&zwnj;
392+
for details regarding the policy.
409393
</p>
410-
)
411-
}
412-
</article>
394+
</div>
395+
</article>
396+
)}
413397
</div>
414398
</div>
415399
<SideBar

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ $tc-link-visited: #0c4e98;
421421
.challenge-specs-main {
422422
@include roboto-regular;
423423

424+
width: 100%;
424425
padding: 0 20px;
425426
max-width: 720px;
426427
align-self: center;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function ThriveArticles({ articles }) {
2020

2121
const getPageUrl = article => (article.externalArticle && article.contentUrl
2222
? article.contentUrl
23-
: `${config.TC_EDU_BASE_PATH}${config.TC_EDU_ARTICLES_PATH}/${article.slug || article.title}`);
23+
: `${config.URL.THRIVE}${config.TC_EDU_ARTICLES_PATH}/${article.slug || article.title}`);
2424

2525
const items = map(articles, (a, idx) => (
2626
<div styleName="article" key={idx}>

src/shared/containers/Profile.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ProfileContainer extends React.Component {
9696
handleParam,
9797
} = this.props;
9898

99-
if (loadingError) {
99+
if (loadingError || (info && info.status !== 'ACTIVE')) {
100100
return <Error404 />;
101101
}
102102

src/shared/containers/SubmissionManagement/index.jsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ import PT from 'prop-types';
1515
import { connect } from 'react-redux';
1616
import { Modal } from 'topcoder-react-ui-kit';
1717
import { config } from 'topcoder-react-utils';
18-
import { actions, services } from 'topcoder-react-lib';
18+
import { actions } from 'topcoder-react-lib';
1919

2020
import './styles.scss';
2121
import smpActions from '../../actions/page/submission_management';
2222

23-
const { getService } = services.submissions;
24-
2523
// The container component
2624
class SubmissionManagementPageContainer extends React.Component {
2725
componentDidMount() {
@@ -70,17 +68,16 @@ class SubmissionManagementPageContainer extends React.Component {
7068
onShowDetails,
7169
onDelete: onSubmissionDelete,
7270
onDownload: (challengeType, submissionId) => {
73-
const submissionsService = getService(authTokens.tokenV3);
74-
submissionsService.downloadSubmission(submissionId)
75-
.then((blob) => {
76-
const url = window.URL.createObjectURL(new Blob([blob]));
77-
const link = document.createElement('a');
78-
link.href = url;
79-
link.setAttribute('download', `submission-${challengeType}-${submissionId}.zip`);
80-
document.body.appendChild(link);
81-
link.click();
82-
link.parentNode.removeChild(link);
83-
});
71+
// download large file using stream method
72+
const downloadSubmissionURL = `${config.URL.SUBMISSION_REVIEW_API_URL}/challengeSubmissions/${submissionId}/download?token=${authTokens.tokenV3}`;
73+
74+
const link = document.createElement('a');
75+
link.href = downloadSubmissionURL;
76+
link.setAttribute('download', `submission-${challengeType}-${submissionId}.zip`);
77+
78+
document.body.appendChild(link);
79+
link.click();
80+
link.parentNode.removeChild(link);
8481
},
8582
onlineReviewUrl: `${config.URL.ONLINE_REVIEW}/review/actions/ViewProjectDetails?pid=${challengeId}`,
8683
challengeUrl: `${challengesUrl}/${challengeId}`,

src/shared/reducers/recruitCRM.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function onDone(state, { payload }) {
2626
return {
2727
...state,
2828
loading: false,
29-
jobs: _.filter(payload.data, job => job.enable_job_application_form === 1),
29+
jobs: payload.data,
3030
};
3131
}
3232

0 commit comments

Comments
 (0)