@@ -164,7 +164,7 @@ function filterByTrack(challenge, state) {
164
164
}
165
165
166
166
function filterByTypes ( challenge , state ) {
167
- if ( ! state . types ) return true ;
167
+ if ( state . types . length === 0 ) return true ;
168
168
return state . types . includes ( challenge . typeId ) ;
169
169
}
170
170
@@ -173,10 +173,10 @@ function filterByUpcoming(challenge, state) {
173
173
return moment ( ) . isBefore ( challenge . registrationStartDate ) ;
174
174
}
175
175
176
- function filterByUsers ( challenge , state ) {
177
- if ( ! state . userChallenges ) return true ;
178
- return state . userChallenges . find ( ch => challenge . id === ch ) ;
179
- }
176
+ // function filterByUsers(challenge, state) {
177
+ // if (!state.userChallenges) return true;
178
+ // return state.userChallenges.find(ch => challenge.id === ch);
179
+ // }
180
180
181
181
/**
182
182
* Returns clone of the state with the specified competition track added.
@@ -216,7 +216,7 @@ export function getFilterFunction(state) {
216
216
&& filterByText ( challenge , state )
217
217
&& filterByTags ( challenge , state )
218
218
&& filterByTypes ( challenge , state )
219
- && filterByUsers ( challenge , state )
219
+ // && filterByUsers(challenge, state)
220
220
&& filterByEndDate ( challenge , state )
221
221
&& filterByStartDate ( challenge , state )
222
222
&& filterByStarted ( challenge , state )
@@ -238,7 +238,7 @@ export function getFilterFunction(state) {
238
238
* @param {Object } state
239
239
* @return {Function }
240
240
*/
241
- export function getReviewOpportunitiesFilterFunction ( state ) {
241
+ export function getReviewOpportunitiesFilterFunction ( state , validTypes ) {
242
242
return ( opp ) => {
243
243
const trackAbbr = {
244
244
DATA_SCIENCE : 'DS' ,
@@ -247,6 +247,7 @@ export function getReviewOpportunitiesFilterFunction(state) {
247
247
QA : 'QA' ,
248
248
} ;
249
249
// const newType = _.find(validTypes, { name: opp.challenge.type }) || {};
250
+ const newType = _ . find ( validTypes , { name : opp . challenge . subTrack === 'FIRST_2_FINISH' ? 'First2Finish' : 'Challenge' } ) || { } ;
250
251
251
252
// Review Opportunity objects have a challenge field which
252
253
// is largely compatible with many of the existing filter functions
@@ -261,7 +262,7 @@ export function getReviewOpportunitiesFilterFunction(state) {
261
262
// opp.challenge.track === 'QA' ? 'Dev' : trackAbbr[opp.challenge.track],
262
263
// ]),
263
264
track : trackAbbr [ opp . challenge . track ] ,
264
- // typeId: newType.id ,
265
+ typeId : newType . abbreviation ,
265
266
tags : opp . challenge . technologies || [ ] ,
266
267
platforms : opp . challenge . platforms || [ ] ,
267
268
} ;
0 commit comments