Skip to content

Commit 031e03f

Browse files
committed
fix: issue #39
2 parents ed7c67c + fdd8213 commit 031e03f

File tree

9 files changed

+140
-81
lines changed

9 files changed

+140
-81
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ workflows:
7777
branches:
7878
only:
7979
- dev
80-
- challenge-details-page
8180
- submission-page
8281

8382
# Production builds are exectuted only on tagged commits to the

config/dev.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ module.exports = {
1414
*/
1515
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",
1616

17-
AV_SCAN_SCORER_REVIEW_TYPE_ID: "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
18-
1917
SERVER_API_KEY: "79b2d5eb-c1fd-42c4-9391-6b2c9780d591",
2018
URL: {
2119
/* Connector URL of the TC accounts App. */
@@ -122,9 +120,8 @@ module.exports = {
122120
V2: "https://api.topcoder-dev.com/v2",
123121
},
124122
MOCK_TERMS_SERVICE: false,
125-
AV_SCAN_SCORER_REVIEW_TYPE_ID: "68c5a381-c8ab-48af-92a7-7a869a4ee6c3",
126-
PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID:
127-
"52c91e85-745f-4e62-b592-9879a2dfe9fd",
123+
AV_SCAN_SCORER_REVIEW_TYPE_ID: "55bbb17d-aac2-45a6-89c3-a8d102863d05",
124+
PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID: "df51ca7d-fb0a-4147-9569-992fcf5aae48",
128125
PAGE_SIZE: 50,
129126
REVIEW_OPPORTUNITY_PAGE_SIZE: 1000,
130127
CONTENTFUL: {

config/prod.js

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module.exports = {
1515
SERVER_API_KEY: "aa9ccf36-3936-450c-9983-097ddba51bef",
1616
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",
1717

18-
AV_SCAN_SCORER_REVIEW_TYPE_ID: "55bbb17d-aac2-45a6-89c3-a8d102863d05",
1918
URL: {
2019
ARENA: "https://arena.topcoder.com",
2120
APP: "https://community-app.topcoder.com",
@@ -27,12 +26,18 @@ module.exports = {
2726
AUTH: "https://accounts-auth0.topcoder.com",
2827
BASE: "https://www.topcoder.com",
2928
HOME: "/my-dashboard",
29+
BLOG: "https://www.topcoder.com/blog",
30+
BLOG_FEED: "https://www.topcoder.com/blog/feed/",
31+
3032
COMMUNITY: "https://community.topcoder.com",
3133
FORUMS: "https://apps.topcoder.com/forums",
3234
FORUMS_VANILLA: "https://discussions.topcoder.com",
3335
HELP:
3436
"https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles",
3537
SUBMISSION_REVIEW: "https://submission-review.topcoder.com",
38+
39+
THRIVE: "https://www.topcoder.com/thrive",
40+
3641
MEMBER: "https://member.topcoder.com",
3742
ONLINE_REVIEW: "https://software.topcoder.com",
3843
PAYMENT_TOOL: "https://payment.topcoder.com",
@@ -41,24 +46,62 @@ module.exports = {
4146

4247
/* Connector URL of the TC accounts App. */
4348
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder.com/",
49+
50+
TCO: "https://www.topcoder.com/tco",
4451
TCO17: "https://tco17.topcoder.com/",
4552
TCO19: "https://tco19.topcoder.com/",
53+
WIPRO: "https://wipro.topcoder.com",
4654

4755
TOPGEAR: "https://topgear-app.wipro.com",
4856

4957
COMMUNITY_API: "http://localhost:8000",
50-
58+
COMMUNITY_APP_GITHUB_ISSUES:
59+
"https://github.com/topcoder-platform/community-app/issues",
5160
COMMUNITIES: {
5261
BLOCKCHAIN: "https://blockchain.topcoder.com",
5362
COGNITIVE: "https://cognitive.topcoder.com",
5463
ZURICH: "https://zurich.topcoder.com",
5564
COMCAST: "https://comcast.topcoder.com",
5665
CS: "https://cs.topcoder.com",
5766
},
67+
68+
INFO: {
69+
DESIGN_CHALLENGES:
70+
"http://help.topcoder.com/hc/en-us/categories/202610437-DESIGN",
71+
DESIGN_CHALLENGE_CHECKPOINTS:
72+
"https://help.topcoder.com/hc/en-us/articles/219240807-Multi-Round-Checkpoint-Design-Challenges",
73+
DESIGN_CHALLENGE_SUBMISSION:
74+
"http://help.topcoder.com/hc/en-us/articles/219122667-Formatting-Your-Submission-for-Design-Challenges",
75+
DESIGN_CHALLENGE_TYPES:
76+
"http://help.topcoder.com/hc/en-us/articles/217481388-Choosing-a-Design-Challenge",
77+
RELIABILITY_RATINGS_AND_BONUSES:
78+
"https://www.topcoder.com/thrive/articles/Development%20Reliability%20Ratings%20and%20Bonuses",
79+
STOCK_ART_POLICY:
80+
"http://help.topcoder.com/hc/en-us/articles/217481408-Policy-for-Stock-Artwork-in-Design-Submissions",
81+
STUDIO_FONTS_POLICY:
82+
"http://help.topcoder.com/hc/en-us/articles/217959447-Font-Policy-for-Design-Challenges",
83+
TOPCODER_TERMS: "https://www.topcoder.com/community/how-it-works/terms/",
84+
HOWTOCOMPETEINMARATHON:
85+
"https://www.topcoder.com/thrive/articles/How%20To%20Compete%20in%20a%20Marathon%20Match",
86+
USABLECODEDEV:
87+
"https://www.topcoder.com/thrive/articles/Usable%20Code%20in%20Dev%20Challenges",
88+
EXTENSIONVSCODE:
89+
"https://marketplace.visualstudio.com/items?itemName=Topcoder.topcoder-workflow&ssr=false#overview",
90+
TEMPLATES_REPO: "https://github.com/topcoder-platform-templates",
91+
},
92+
93+
USER_SETTINGS: "https://lc1-user-settings-service.herokuapp.com",
5894
EMAIL_VERIFY_URL: "http://www.topcoder.com/settings/account/changeEmail",
59-
CAL_MODE: false,
60-
DEFAULT_SPACE_NAME: "default",
61-
DEFAULT_ENVIRONMENT: "master",
95+
ABANDONMENT_EMBED:
96+
"https://43d132d5dbff47c59d9d53ad448f93c2.js.ubembed.com",
97+
SUBDOMAIN_PROFILE_CONFIG: [
98+
{
99+
groupId: "20000000",
100+
communityId: "wipro",
101+
communityName: "topgear",
102+
userProfile: "https://topgear-app.wipro.com/user-details",
103+
},
104+
],
62105
},
63106

64107
// Config for TC EDU - THRIVE
@@ -75,9 +118,7 @@ module.exports = {
75118

76119
MOCK_TERMS_SERVICE: false,
77120
AV_SCAN_SCORER_REVIEW_TYPE_ID: "55bbb17d-aac2-45a6-89c3-a8d102863d05",
78-
PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID:
79-
"df51ca7d-fb0a-4147-9569-992fcf5aae48",
80-
121+
PROVISIONAL_SCORING_COMPLETED_REVIEW_TYPE_ID: "df51ca7d-fb0a-4147-9569-992fcf5aae48",
81122
PAGE_SIZE: 50,
82123
REVIEW_OPPORTUNITY_PAGE_SIZE: 1000,
83124
CONTENTFUL: {

src/actions/challenges.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,7 @@ async function getChallenges(filter, signal) {
8686
}
8787

8888
export default createActions({
89+
GET_CHALLENGES_INIT: _.noop(),
90+
GET_CHALLENGES_DONE: getChallenges,
8991
GET_CHALLENGES_FAILURE: _.noop,
9092
});

src/components/challenge-detail/Header/index.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default function ChallengeHeader(props) {
4242
checkpoints,
4343
hasRegistered,
4444
numWinners,
45+
isLoadingChallenge,
4546
onSelectorClicked,
4647
onToggleDeadlines,
4748
registering,
@@ -390,7 +391,12 @@ export default function ChallengeHeader(props) {
390391
</DangerButton>
391392
) : (
392393
<PrimaryButton
393-
disabled={registering || registrationEnded || isLegacyMM}
394+
disabled={
395+
isLoadingChallenge ||
396+
registering ||
397+
registrationEnded ||
398+
isLegacyMM
399+
}
394400
forceA
395401
onClick={registerForChallenge}
396402
theme={{ button: style.challengeAction }}
@@ -406,7 +412,7 @@ export default function ChallengeHeader(props) {
406412
isLegacyMM
407413
}
408414
theme={{ button: style.challengeAction }}
409-
to={`/earn/find/challenges/${challengeId}/submit`}
415+
to={`${config.URL.BASE}/challenges/${challengeId}/submit`}
410416
>
411417
Submit
412418
</PrimaryButton>
@@ -416,7 +422,7 @@ export default function ChallengeHeader(props) {
416422
hasSubmissions && (
417423
<PrimaryButton
418424
theme={{ button: style.challengeAction }}
419-
to={`/earn/find/challenges/${challengeId}/my-submissions`}
425+
to={`${config.URL.BASE}/challenges/${challengeId}/my-submissions`}
420426
>
421427
View Submissions
422428
</PrimaryButton>
@@ -531,6 +537,7 @@ ChallengeHeader.propTypes = {
531537
unregistering: PT.bool.isRequired,
532538
challengeTypesMap: PT.shape().isRequired,
533539
hasFirstPlacement: PT.bool.isRequired,
540+
isLoadingChallenge: PT.bool.isRequired,
534541
isMenuOpened: PT.bool,
535542
mySubmissions: PT.arrayOf(PT.shape()).isRequired,
536543
openForRegistrationChallenges: PT.shape().isRequired,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ class SubmissionsComponent extends React.Component {
734734
!hasRegistered || unregistering || submissionEnded || isLegacyMM
735735
}
736736
theme={{ button: style.challengeAction }}
737-
to={`${challengesUrl}/${challengeId}/submit`}
737+
to={`${config.URL.BASE}/${challengeId}/submit`}
738738
>
739739
Add Submission
740740
</PrimaryButton>

src/containers/challenge-detail/index.jsx

Lines changed: 73 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ class ChallengeDetailPageContainer extends React.Component {
476476
unregisterFromChallenge(auth, challengeId)
477477
}
478478
unregistering={unregistering}
479+
isLoadingChallenge={isLoadingFullChallenge}
479480
checkpoints={checkpoints}
480481
hasRegistered={challenge.isRegistered}
481482
hasFirstPlacement={hasFirstPlacement}
@@ -501,63 +502,73 @@ class ChallengeDetailPageContainer extends React.Component {
501502
updateChallenge={(x) => updateChallenge(x, auth.tokenV3)}
502503
/>
503504
)}
504-
{!isEmpty && selectedTab === DETAIL_TABS.REGISTRANTS && isLoadingFullChallenge && (
505-
<LoadingIndicator/>
506-
)}
507-
{!isEmpty && selectedTab === DETAIL_TABS.REGISTRANTS && !isLoadingFullChallenge && (
508-
<Registrants
509-
challenge={challenge}
510-
registrants={challenge.registrants}
511-
checkpointResults={_.merge(
512-
checkpointResults,
513-
checkpointResultsUi
514-
)}
515-
results={results2}
516-
registrantsSort={registrantsSort}
517-
notFoundCountryFlagUrl={notFoundCountryFlagUrl}
518-
onGetFlagImageFail={(countryInfo) => {
519-
notFoundCountryFlagUrl[countryInfo.countryCode] = true;
520-
this.setState({ notFoundCountryFlagUrl });
521-
}}
522-
onSortChange={(sort) => this.setState({ registrantsSort: sort })}
523-
/>
524-
)}
505+
{!isEmpty &&
506+
selectedTab === DETAIL_TABS.REGISTRANTS &&
507+
isLoadingFullChallenge && <LoadingIndicator />}
508+
{!isEmpty &&
509+
selectedTab === DETAIL_TABS.REGISTRANTS &&
510+
!isLoadingFullChallenge && (
511+
<Registrants
512+
challenge={challenge}
513+
registrants={challenge.registrants}
514+
checkpointResults={_.merge(
515+
checkpointResults,
516+
checkpointResultsUi
517+
)}
518+
results={results2}
519+
registrantsSort={registrantsSort}
520+
notFoundCountryFlagUrl={notFoundCountryFlagUrl}
521+
onGetFlagImageFail={(countryInfo) => {
522+
notFoundCountryFlagUrl[countryInfo.countryCode] = true;
523+
this.setState({ notFoundCountryFlagUrl });
524+
}}
525+
onSortChange={(sort) =>
526+
this.setState({ registrantsSort: sort })
527+
}
528+
/>
529+
)}
525530
{!isEmpty && selectedTab === DETAIL_TABS.CHECKPOINTS && (
526531
<ChallengeCheckpoints
527532
checkpoints={checkpoints}
528533
toggleCheckpointFeedback={toggleCheckpointFeedback}
529534
/>
530535
)}
531-
{!isEmpty && isLoggedIn && selectedTab === DETAIL_TABS.SUBMISSIONS && isLoadingFullChallenge && (
532-
<LoadingIndicator/>
533-
)}
534-
{!isEmpty && isLoggedIn && selectedTab === DETAIL_TABS.SUBMISSIONS && !isLoadingFullChallenge && (
535-
<Submissions
536-
challenge={challenge}
537-
submissions={challenge.submissions}
538-
loadingMMSubmissionsForChallengeId={
539-
loadingMMSubmissionsForChallengeId
540-
}
541-
mmSubmissions={mmSubmissions}
542-
loadMMSubmissions={loadMMSubmissions}
543-
auth={auth}
544-
isLoadingSubmissionInformation={isLoadingSubmissionInformation}
545-
submssionInformation={submissionInformation}
546-
loadSubmissionInformation={loadSubmissionInformation}
547-
submissionsSort={submissionsSort}
548-
notFoundCountryFlagUrl={notFoundCountryFlagUrl}
549-
onGetFlagImageFail={(countryInfo) => {
550-
notFoundCountryFlagUrl[countryInfo.countryCode] = true;
551-
this.setState({ notFoundCountryFlagUrl });
552-
}}
553-
onSortChange={(sort) => this.setState({ submissionsSort: sort })}
554-
hasRegistered={challenge.isRegistered}
555-
unregistering={unregistering}
556-
isLegacyMM={isLegacyMM}
557-
submissionEnded={submissionEnded}
558-
challengesUrl={challengesUrl}
559-
/>
560-
)}
536+
{!isEmpty &&
537+
isLoggedIn &&
538+
selectedTab === DETAIL_TABS.SUBMISSIONS &&
539+
isLoadingFullChallenge && <LoadingIndicator />}
540+
{!isEmpty &&
541+
isLoggedIn &&
542+
selectedTab === DETAIL_TABS.SUBMISSIONS &&
543+
!isLoadingFullChallenge && (
544+
<Submissions
545+
challenge={challenge}
546+
submissions={challenge.submissions}
547+
loadingMMSubmissionsForChallengeId={
548+
loadingMMSubmissionsForChallengeId
549+
}
550+
mmSubmissions={mmSubmissions}
551+
loadMMSubmissions={loadMMSubmissions}
552+
auth={auth}
553+
isLoadingSubmissionInformation={isLoadingSubmissionInformation}
554+
submssionInformation={submissionInformation}
555+
loadSubmissionInformation={loadSubmissionInformation}
556+
submissionsSort={submissionsSort}
557+
notFoundCountryFlagUrl={notFoundCountryFlagUrl}
558+
onGetFlagImageFail={(countryInfo) => {
559+
notFoundCountryFlagUrl[countryInfo.countryCode] = true;
560+
this.setState({ notFoundCountryFlagUrl });
561+
}}
562+
onSortChange={(sort) =>
563+
this.setState({ submissionsSort: sort })
564+
}
565+
hasRegistered={challenge.isRegistered}
566+
unregistering={unregistering}
567+
isLegacyMM={isLegacyMM}
568+
submissionEnded={submissionEnded}
569+
challengesUrl={challengesUrl}
570+
/>
571+
)}
561572
{isMM && !isEmpty && selectedTab === DETAIL_TABS.MY_SUBMISSIONS && (
562573
<MySubmissions
563574
challengesUrl={challengesUrl}
@@ -827,7 +838,9 @@ function mapStateToProps(state, props) {
827838
communitiesList: state.tcCommunities.list,
828839
domain: state.domain,
829840
isLoadingChallenge: Boolean(state.challenge.loadingDetailsForChallengeId),
830-
isLoadingFullChallenge: Boolean(state.challenge.loadingFullDetailsForChallengeId),
841+
isLoadingFullChallenge: Boolean(
842+
state.challenge.loadingFullDetailsForChallengeId
843+
),
831844
isLoadingTerms: _.isEqual(state.terms.loadingTermsForEntity, {
832845
type: "challenge",
833846
id: props.match.params.challengeId,
@@ -905,15 +918,15 @@ const mapDispatchToProps = (dispatch) => {
905918
});
906919
},
907920
loadFullChallengeDetails: (tokens, challengeId) => {
908-
const a = actions.challenge;
921+
const a = actions.challenge;
909922

910-
dispatch(a.getFullDetailsInit(challengeId));
911-
dispatch(
912-
a.getFullDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2)
913-
).then((res) => {
914-
return res;
915-
});
916-
},
923+
dispatch(a.getFullDetailsInit(challengeId));
924+
dispatch(
925+
a.getFullDetailsDone(challengeId, tokens.tokenV3, tokens.tokenV2)
926+
).then((res) => {
927+
return res;
928+
});
929+
},
917930
registerForChallenge: (auth, challengeId) => {
918931
const a = actions.challenge;
919932
dispatch(a.registerInit());

src/reducers/challenge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function onRegisterDone(state, action) {
306306
/* As a part of registration flow we silently update challenge details,
307307
* reusing for this purpose the corresponding action handler. Thus, we
308308
* should also reuse corresponding reducer to generate proper state. */
309-
return onGetDetailsDone(
309+
return onGetBasicDetailsDone(
310310
{
311311
...state,
312312
registering: false,
@@ -331,7 +331,7 @@ function onUnregisterDone(state, action) {
331331
/* As a part of unregistration flow we silently update challenge details,
332332
* reusing for this purpose the corresponding action handler. Thus, we
333333
* should also reuse corresponding reducer to generate proper state. */
334-
return onGetDetailsDone(
334+
return onGetBasicDetailsDone(
335335
{
336336
...state,
337337
unregistering: false,

src/routers/challenge-detail/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import AuthComponent from "containers/auth-component";
77
import ErrorMessage from "containers/ErrorMessage";
88
import "utils/loading-indicator-animation";
99

10-
if (process.env.APPENV === "production") {
10+
if (process.env.APPMODE === "production") {
1111
require("topcoder-react-ui-kit/dist/prod/style.css");
1212
} else {
1313
require("topcoder-react-ui-kit/dist/dev/style.css");

0 commit comments

Comments
 (0)