@@ -21,7 +21,8 @@ import MySubmissions from 'components/challenge-detail/MySubmissions';
21
21
import Winners from 'components/challenge-detail/Winners' ;
22
22
import ChallengeDetailsView from 'components/challenge-detail/Specification' ;
23
23
import RecommendedThriveArticles from 'components/challenge-detail/ThriveArticles' ;
24
- import RecommendedActiveChallenges from 'components/challenge-detail/RecommendedActiveChallenges' ;
24
+ // eslint-disable-next-line max-len
25
+ // import RecommendedActiveChallenges from 'components/challenge-detail/RecommendedActiveChallenges';
25
26
import Terms from 'containers/Terms' ;
26
27
import termsActions from 'actions/terms' ;
27
28
import ChallengeCheckpoints from 'components/challenge-detail/Checkpoints' ;
@@ -36,10 +37,10 @@ import { CHALLENGE_PHASE_TYPES, COMPETITION_TRACKS_V3, SUBTRACKS } from 'utils/t
36
37
import { config , MetaTags } from 'topcoder-react-utils' ;
37
38
import { actions } from 'topcoder-react-lib' ;
38
39
import { getService } from 'services/contentful' ;
39
- import {
40
- getDisplayRecommendedChallenges ,
41
- getRecommendedTags ,
42
- } from 'utils/challenge-detail/helper' ;
40
+ // import {
41
+ // getDisplayRecommendedChallenges,
42
+ // getRecommendedTags,
43
+ // } from 'utils/challenge-detail/helper';
43
44
44
45
import ogWireframe from
45
46
'../../../assets/images/open-graph/challenges/01-wireframe.jpg' ;
@@ -200,11 +201,11 @@ class ChallengeDetailPageContainer extends React.Component {
200
201
const {
201
202
challengeId,
202
203
reloadChallengeDetails,
203
- getAllRecommendedChallenges,
204
- recommendedChallenges,
205
- auth,
204
+ // getAllRecommendedChallenges,
205
+ // recommendedChallenges,
206
+ // auth,
206
207
challenge,
207
- loadingRecommendedChallengesUUID,
208
+ // loadingRecommendedChallengesUUID,
208
209
history,
209
210
} = this . props ;
210
211
@@ -213,21 +214,21 @@ class ChallengeDetailPageContainer extends React.Component {
213
214
history . push ( history . location . pathname , history . state ) ;
214
215
}
215
216
216
- const recommendedTechnology = getRecommendedTags ( challenge ) ;
217
- if (
218
- challenge
219
- && challenge . id === challengeId
220
- && ! loadingRecommendedChallengesUUID
221
- && (
222
- ! recommendedChallenges [ recommendedTechnology ]
223
- || (
224
- Date . now ( ) - recommendedChallenges [ recommendedTechnology ] . lastUpdateOfActiveChallenges
225
- > 10 * MIN
226
- )
227
- )
228
- ) {
229
- getAllRecommendedChallenges ( auth . tokenV3 , recommendedTechnology ) ;
230
- }
217
+ // const recommendedTechnology = getRecommendedTags(challenge);
218
+ // if (
219
+ // challenge
220
+ // && challenge.id === challengeId
221
+ // && !loadingRecommendedChallengesUUID
222
+ // && (
223
+ // !recommendedChallenges[recommendedTechnology]
224
+ // || (
225
+ // Date.now() - recommendedChallenges[recommendedTechnology].lastUpdateOfActiveChallenges
226
+ // > 10 * MIN
227
+ // )
228
+ // )
229
+ // ) {
230
+ // getAllRecommendedChallenges(auth.tokenV3, recommendedTechnology);
231
+ // }
231
232
232
233
const { thriveArticles } = this . state ;
233
234
const userId = _ . get ( this , 'props.auth.user.userId' ) ;
@@ -251,9 +252,9 @@ class ChallengeDetailPageContainer extends React.Component {
251
252
} ) . then ( ( content ) => {
252
253
// format image file data
253
254
_ . forEach ( content . Article . items , ( item ) => {
254
- const asset = _ . find ( content . Article . includes . Asset ,
255
- a => a . sys . id === item . fields . featuredImage . sys . id ) ;
256
- _ . assign ( item . fields . featuredImage , { file : asset . fields . file } ) ;
255
+ // eslint-disable-next-line max-len
256
+ const asset = _ . find ( content . Article . includes . Asset , a => item . fields . featuredImage !== null && a . sys . id === item . fields . featuredImage . sys . id ) ;
257
+ if ( asset ) _ . assign ( item . fields . featuredImage , { file : asset . fields . file } ) ;
257
258
} ) ;
258
259
this . setState ( {
259
260
thriveArticles : content . Article . items ,
@@ -326,20 +327,20 @@ class ChallengeDetailPageContainer extends React.Component {
326
327
isLoadingSubmissionInformation,
327
328
submissionInformation,
328
329
loadSubmissionInformation,
329
- selectChallengeDetailsTab,
330
- prizeMode,
331
- recommendedChallenges,
332
- expandedTags,
333
- expandTag,
330
+ // selectChallengeDetailsTab,
331
+ // prizeMode,
332
+ // recommendedChallenges,
333
+ // expandedTags,
334
+ // expandTag,
334
335
mySubmissions,
335
336
reviewTypes,
336
337
} = this . props ;
337
338
338
- const displayRecommendedChallenges = getDisplayRecommendedChallenges (
339
- challenge ,
340
- recommendedChallenges ,
341
- auth ,
342
- ) ;
339
+ // const displayRecommendedChallenges = getDisplayRecommendedChallenges(
340
+ // challenge,
341
+ // recommendedChallenges,
342
+ // auth,
343
+ // );
343
344
344
345
const {
345
346
thriveArticles,
@@ -451,7 +452,7 @@ class ChallengeDetailPageContainer extends React.Component {
451
452
registerForChallenge = { this . registerForChallenge }
452
453
registering = { registering }
453
454
selectedView = { selectedTab }
454
- hasRecommendedChallenges = { displayRecommendedChallenges . length > 0 }
455
+ // hasRecommendedChallenges={displayRecommendedChallenges.length > 0}
455
456
hasThriveArticles = { thriveArticles . length > 0 }
456
457
setChallengeListingFilter = { setChallengeListingFilter }
457
458
unregisterFromChallenge = { ( ) => unregisterFromChallenge ( auth , challengeId )
@@ -590,7 +591,7 @@ class ChallengeDetailPageContainer extends React.Component {
590
591
} }
591
592
/>
592
593
) }
593
- {
594
+ { /* {
594
595
!isEmpty && displayRecommendedChallenges.length ? (
595
596
<RecommendedActiveChallenges
596
597
challenges={displayRecommendedChallenges}
@@ -604,7 +605,7 @@ class ChallengeDetailPageContainer extends React.Component {
604
605
isLoggedIn={isLoggedIn}
605
606
/>
606
607
) : null
607
- }
608
+ } */ }
608
609
{
609
610
! isEmpty && thriveArticles . length ? (
610
611
< RecommendedThriveArticles articles = { thriveArticles } />
@@ -635,7 +636,7 @@ ChallengeDetailPageContainer.defaultProps = {
635
636
mySubmissions : [ ] ,
636
637
isLoadingSubmissionInformation : false ,
637
638
submissionInformation : null ,
638
- prizeMode : 'money-usd' ,
639
+ // prizeMode: 'money-usd',
639
640
} ;
640
641
641
642
ChallengeDetailPageContainer . propTypes = {
@@ -648,7 +649,7 @@ ChallengeDetailPageContainer.propTypes = {
648
649
checkpointResults : PT . arrayOf ( PT . shape ( ) ) ,
649
650
checkpointResultsUi : PT . shape ( ) . isRequired ,
650
651
checkpoints : PT . shape ( ) ,
651
- recommendedChallenges : PT . shape ( ) . isRequired ,
652
+ // recommendedChallenges: PT.shape().isRequired,
652
653
communityId : PT . string ,
653
654
communitiesList : PT . shape ( {
654
655
data : PT . arrayOf ( PT . object ) . isRequired ,
@@ -692,12 +693,12 @@ ChallengeDetailPageContainer.propTypes = {
692
693
isLoadingSubmissionInformation : PT . bool ,
693
694
submissionInformation : PT . shape ( ) ,
694
695
loadSubmissionInformation : PT . func . isRequired ,
695
- selectChallengeDetailsTab : PT . func . isRequired ,
696
- getAllRecommendedChallenges : PT . func . isRequired ,
697
- prizeMode : PT . string ,
698
- expandedTags : PT . arrayOf ( PT . number ) . isRequired ,
699
- expandTag : PT . func . isRequired ,
700
- loadingRecommendedChallengesUUID : PT . string . isRequired ,
696
+ // selectChallengeDetailsTab: PT.func.isRequired,
697
+ // getAllRecommendedChallenges: PT.func.isRequired,
698
+ // prizeMode: PT.string,
699
+ // expandedTags: PT.arrayOf(PT.number).isRequired,
700
+ // expandTag: PT.func.isRequired,
701
+ // loadingRecommendedChallengesUUID: PT.string.isRequired,
701
702
history : PT . shape ( ) . isRequired ,
702
703
} ;
703
704
@@ -765,8 +766,8 @@ function mapStateToProps(state, props) {
765
766
auth : state . auth ,
766
767
challenge,
767
768
challengeTypes : cl . challengeTypes ,
768
- recommendedChallenges : cl . recommendedChallenges ,
769
- loadingRecommendedChallengesUUID : cl . loadingRecommendedChallengesUUID ,
769
+ // recommendedChallenges: cl.recommendedChallenges,
770
+ // loadingRecommendedChallengesUUID: cl.loadingRecommendedChallengesUUID,
770
771
expandedTags : cl . expandedTags ,
771
772
challengeId : String ( props . match . params . challengeId ) ,
772
773
challengesUrl : props . challengesUrl ,
@@ -811,16 +812,16 @@ const mapDispatchToProps = (dispatch) => {
811
812
const ca = communityActions . tcCommunity ;
812
813
const lookupActions = actions . lookup ;
813
814
return {
814
- getAllRecommendedChallenges : ( tokenV3 , recommendedTechnology ) => {
815
- const uuid = shortId ( ) ;
816
- const cl = challengeListingActions . challengeListing ;
817
- dispatch ( cl . getAllRecommendedChallengesInit ( uuid ) ) ;
818
- dispatch (
819
- cl . getAllRecommendedChallengesDone (
820
- uuid , tokenV3 , recommendedTechnology ,
821
- ) ,
822
- ) ;
823
- } ,
815
+ // getAllRecommendedChallenges: (tokenV3, recommendedTechnology) => {
816
+ // const uuid = shortId();
817
+ // const cl = challengeListingActions.challengeListing;
818
+ // dispatch(cl.getAllRecommendedChallengesInit(uuid));
819
+ // dispatch(
820
+ // cl.getAllRecommendedChallengesDone(
821
+ // uuid, tokenV3, recommendedTechnology,
822
+ // ),
823
+ // );
824
+ // },
824
825
getCommunitiesList : ( auth ) => {
825
826
const uuid = shortId ( ) ;
826
827
dispatch ( ca . getListInit ( uuid ) ) ;
0 commit comments