Skip to content

Commit 77a7fc7

Browse files
author
Huan Li
committed
Fix Server-side filtering on challenge listings
1 parent 187ff2c commit 77a7fc7

21 files changed

+2625
-7
lines changed

__tests__/__snapshots__/index.js.snap

+225
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ Object {
2929
"updateChallengeDone": [Function],
3030
"updateChallengeInit": [Function],
3131
},
32+
"challengeListing": Object {
33+
"dropChallenges": [Function],
34+
"expandTag": [Function],
35+
"getActiveChallengesDone": [Function],
36+
"getActiveChallengesInit": [Function],
37+
"getAllActiveChallengesDone": [Function],
38+
"getAllActiveChallengesInit": [Function],
39+
"getChallengeSubtracksDone": [Function],
40+
"getChallengeSubtracksInit": [Function],
41+
"getChallengeTagsDone": [Function],
42+
"getChallengeTagsInit": [Function],
43+
"getMoreChallenges": [Function],
44+
"getPastChallengesDone": [Function],
45+
"getPastChallengesInit": [Function],
46+
"getRestActiveChallengesDone": [Function],
47+
"getRestActiveChallengesInit": [Function],
48+
"getReviewOpportunitiesDone": [Function],
49+
"getReviewOpportunitiesInit": [Function],
50+
"getSrmsDone": [Function],
51+
"getSrmsInit": [Function],
52+
"selectCommunity": [Function],
53+
"setDatepickerStatus": [Function],
54+
"setFilter": [Function],
55+
"setSort": [Function],
56+
},
3257
"direct": Object {
3358
"dropAll": [Function],
3459
"getProjectDetailsDone": [Function],
@@ -173,13 +198,145 @@ Object {
173198
},
174199
},
175200
"challenge": Object {
201+
"buckets": Object {
202+
"BUCKETS": Object {
203+
"ALL": "all",
204+
"MY": "my",
205+
"ONGOING": "ongoing",
206+
"OPEN_FOR_REGISTRATION": "openForRegistration",
207+
"PAST": "past",
208+
"REVIEW_OPPORTUNITIES": "reviewOpportunities",
209+
"SAVED_FILTER": "saved-filter",
210+
"SAVED_REVIEW_OPPORTUNITIES_FILTER": "savedReviewOpportunitiesFilter",
211+
"UPCOMING": "upcoming",
212+
},
213+
"BUCKET_DATA": Object {
214+
"all": Object {
215+
"filter": Object {
216+
"started": true,
217+
"status": Array [
218+
"ACTIVE",
219+
],
220+
},
221+
"hideCount": false,
222+
"name": "All Challenges",
223+
"sorts": Array [],
224+
},
225+
"my": Object {
226+
"filter": Object {
227+
"started": true,
228+
"status": Array [
229+
"ACTIVE",
230+
],
231+
},
232+
"hideCount": false,
233+
"name": "My Challenges",
234+
"sorts": Array [
235+
"most-recent",
236+
"time-to-submit",
237+
"num-registrants",
238+
"num-submissions",
239+
"prize-high-to-low",
240+
"title-a-to-z",
241+
],
242+
},
243+
"ongoing": Object {
244+
"filter": Object {
245+
"registrationOpen": false,
246+
"started": true,
247+
"status": Array [
248+
"ACTIVE",
249+
],
250+
},
251+
"hideCount": false,
252+
"name": "Ongoing challenges",
253+
"sorts": Array [
254+
"most-recent",
255+
"current-phase",
256+
"title-a-to-z",
257+
"prize-high-to-low",
258+
],
259+
},
260+
"openForRegistration": Object {
261+
"filter": Object {
262+
"registrationOpen": true,
263+
"started": true,
264+
"status": Array [
265+
"ACTIVE",
266+
],
267+
},
268+
"hideCount": false,
269+
"name": "Open for registration",
270+
"sorts": Array [
271+
"most-recent",
272+
"time-to-register",
273+
"time-to-submit",
274+
"num-registrants",
275+
"num-submissions",
276+
"prize-high-to-low",
277+
"title-a-to-z",
278+
],
279+
},
280+
"past": Object {
281+
"filter": Object {
282+
"status": Array [
283+
"COMPLETED",
284+
"PAST",
285+
],
286+
},
287+
"hideCount": true,
288+
"name": "Past challenges",
289+
"sorts": Array [
290+
"most-recent",
291+
"prize-high-to-low",
292+
"title-a-to-z",
293+
],
294+
},
295+
"reviewOpportunities": Object {
296+
"filter": Object {},
297+
"hideCount": true,
298+
"name": "Open for review",
299+
"sorts": Array [
300+
"review-opportunities-start-date",
301+
"review-opportunities-payment",
302+
"review-opportunities-title-a-to-z",
303+
],
304+
},
305+
"savedReviewOpportunitiesFilter": Object {
306+
"filter": Object {},
307+
"sorts": Array [
308+
"review-opportunities-start-date",
309+
"review-opportunities-payment",
310+
"review-opportunities-title-a-to-z",
311+
],
312+
},
313+
"upcoming": Object {
314+
"filter": Object {
315+
"upcoming": true,
316+
},
317+
"hideCount": true,
318+
"name": "Upcoming challenges",
319+
"sorts": Array [
320+
"most-recent",
321+
"prize-high-to-low",
322+
"title-a-to-z",
323+
],
324+
},
325+
},
326+
"default": undefined,
327+
"getBuckets": [Function],
328+
"isReviewOpportunitiesBucket": [Function],
329+
"registerBucket": [Function],
330+
},
176331
"filter": Object {
177332
"addTrack": [Function],
178333
"combine": [Function],
179334
"default": undefined,
335+
"filterByDate": [Function],
180336
"getFilterFunction": [Function],
181337
"getReviewOpportunitiesFilterFunction": [Function],
182338
"mapToBackend": [Function],
339+
"newMeta": [Function],
183340
"removeTrack": [Function],
184341
"setEndDate": [Function],
185342
"setReviewOpportunityType": [Function],
@@ -188,6 +345,67 @@ Object {
188345
"setTags": [Function],
189346
"setText": [Function],
190347
},
348+
"sort": Object {
349+
"SORTS": Object {
350+
"CURRENT_PHASE": "current-phase",
351+
"MOST_RECENT": "most-recent",
352+
"NUM_REGISTRANTS": "num-registrants",
353+
"NUM_SUBMISSIONS": "num-submissions",
354+
"PRIZE_HIGH_TO_LOW": "prize-high-to-low",
355+
"REVIEW_OPPORTUNITIES_PAYMENT": "review-opportunities-payment",
356+
"REVIEW_OPPORTUNITIES_START_DATE": "review-opportunities-start-date",
357+
"REVIEW_OPPORTUNITIES_TITLE_A_TO_Z": "review-opportunities-title-a-to-z",
358+
"TIME_TO_REGISTER": "time-to-register",
359+
"TIME_TO_SUBMIT": "time-to-submit",
360+
"TITLE_A_TO_Z": "title-a-to-z",
361+
},
362+
"SORTS_DATA": Object {
363+
"current-phase": Object {
364+
"func": [Function],
365+
"name": "Current phase",
366+
},
367+
"most-recent": Object {
368+
"func": [Function],
369+
"name": "Most recent",
370+
},
371+
"num-registrants": Object {
372+
"func": [Function],
373+
"name": "# of registrants",
374+
},
375+
"num-submissions": Object {
376+
"func": [Function],
377+
"name": "# of submissions",
378+
},
379+
"prize-high-to-low": Object {
380+
"func": [Function],
381+
"name": "Prize high to low",
382+
},
383+
"review-opportunities-payment": Object {
384+
"func": [Function],
385+
"name": "Payment",
386+
},
387+
"review-opportunities-start-date": Object {
388+
"func": [Function],
389+
"name": "Review start date",
390+
},
391+
"review-opportunities-title-a-to-z": Object {
392+
"func": [Function],
393+
"name": "Title A-Z",
394+
},
395+
"time-to-register": Object {
396+
"func": [Function],
397+
"name": "Time to register",
398+
},
399+
"time-to-submit": Object {
400+
"func": [Function],
401+
"name": "Time to submit",
402+
},
403+
"title-a-to-z": Object {
404+
"func": [Function],
405+
"name": "Title A-Z",
406+
},
407+
},
408+
},
191409
},
192410
"errors": Object {
193411
"ERROR_ICON_TYPES": Object {
@@ -227,6 +445,7 @@ Object {
227445
"reducers": Object {
228446
"auth": [Function],
229447
"challenge": [Function],
448+
"challengeListing": [Function],
230449
"direct": [Function],
231450
"errors": [Function],
232451
"groups": [Function],
@@ -321,11 +540,17 @@ Object {
321540
},
322541
"getApiResponsePayload": [Function],
323542
"getLookerApiResponsePayload": [Function],
543+
"processSRM": [Function],
324544
},
325545
"time": Object {
326546
"default": undefined,
327547
"delay": [Function],
328548
"formatDuration": [Function],
329549
},
550+
"url": Object {
551+
"default": undefined,
552+
"removeTrailingSlash": [Function],
553+
"updateQuery": [Function],
554+
},
330555
}
331556
`;

0 commit comments

Comments
 (0)