Skip to content

Commit d025513

Browse files
committed
Fix sorted of by 'Most recent' of My Challenges bucket and sorted by 'Review start date' of Open for Review bucket
to be based of challenge start date in descending order.
1 parent e1d09bd commit d025513

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/shared/reducers/challenge-listing/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ function create(initialState) {
812812
sorts: {
813813
ongoing: 'updated',
814814
openForRegistration: 'updated',
815-
my: 'updated',
815+
my: 'startDate',
816816
// past: 'updated',
817817
reviewOpportunities: 'review-opportunities-start-date',
818818
},

src/shared/utils/challenge-listing/buckets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const BUCKET_DATA = {
3535
// hideCount: false,
3636
name: 'My Challenges',
3737
sorts: [
38-
SORTS.MOST_RECENT,
38+
SORTS.MOST_RECENT_START_DATE,
3939
// SORTS.TIME_TO_SUBMIT,
4040
// SORTS.NUM_REGISTRANTS,
4141
// SORTS.NUM_SUBMISSIONS,

src/shared/utils/challenge-listing/sort.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { sumBy } from 'lodash';
88
export const SORTS = {
99
// CURRENT_PHASE: 'current-phase',
1010
MOST_RECENT: 'updated',
11+
MOST_RECENT_START_DATE: 'startDate',
1112
// NUM_REGISTRANTS: 'num-registrants',
1213
// NUM_SUBMISSIONS: 'num-submissions',
1314
// PRIZE_HIGH_TO_LOW: 'prize-high-to-low',
@@ -29,6 +30,10 @@ export default {
2930
name: 'Most recent',
3031
order: 'desc',
3132
},
33+
[SORTS.MOST_RECENT_START_DATE]: {
34+
name: 'Most recent',
35+
order: 'desc',
36+
},
3237
// [SORTS.NUM_REGISTRANTS]: {
3338
// func: (a, b) => b.numOfRegistrants - a.numOfRegistrants,
3439
// name: '# of registrants',
@@ -89,7 +94,7 @@ export default {
8994
},
9095
[SORTS.REVIEW_OPPORTUNITIES_START_DATE]: {
9196
// This will implicitly use moment#valueOf
92-
func: (a, b) => moment(a.startDate) - moment(b.startDate),
97+
func: (a, b) => moment(b.startDate) - moment(a.startDate), // descending
9398
name: 'Review start date',
9499
},
95100
};

0 commit comments

Comments
 (0)