Skip to content

Commit 692b747

Browse files
Merge pull request #4991 from gets0ul/issue-4973
Fix for Issue #4973
2 parents 57918b7 + 64a6ef5 commit 692b747

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/shared/components/challenge-listing/Listing/Bucket/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function Bucket({
5858
refs.current.push(el);
5959
}
6060
};
61-
const activeSort = sort || 'updated';
61+
const activeSort = sort || 'startDate';
6262

6363
const sortedChallenges = activeBucket === 'all' ? _.clone(challenges.slice(0, 10)) : _.clone(challenges);
6464
// sortedChallenges.sort(Sort[activeSort].func);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,9 @@ function create(initialState) {
817817
selectedCommunityId: 'All',
818818

819819
sorts: {
820-
ongoing: 'updated',
821-
openForRegistration: 'updated',
822-
my: 'updated',
820+
ongoing: 'startDate',
821+
openForRegistration: 'startDate',
822+
my: 'startDate',
823823
// past: 'updated',
824824
reviewOpportunities: 'review-opportunities-start-date',
825825
},

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

Lines changed: 3 additions & 3 deletions
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,
@@ -52,7 +52,7 @@ export const BUCKET_DATA = {
5252
// hideCount: false,
5353
name: 'Open for registration',
5454
sorts: [
55-
SORTS.MOST_RECENT,
55+
SORTS.MOST_RECENT_START_DATE,
5656
// SORTS.TIME_TO_REGISTER,
5757
// SORTS.TIME_TO_SUBMIT,
5858
// SORTS.NUM_REGISTRANTS,
@@ -71,7 +71,7 @@ export const BUCKET_DATA = {
7171
// hideCount: false,
7272
name: 'Ongoing challenges',
7373
sorts: [
74-
SORTS.MOST_RECENT,
74+
SORTS.MOST_RECENT_START_DATE,
7575
// SORTS.CURRENT_PHASE,
7676
SORTS.TITLE_A_TO_Z,
7777
// SORTS.PRIZE_HIGH_TO_LOW,

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

Lines changed: 5 additions & 0 deletions
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',

0 commit comments

Comments
 (0)