Skip to content

Commit 7e6cf67

Browse files
Merge pull request #5391 from topcoder-platform/add-sort-options
Challenge listing sort - Hide TimeToRegister and TimeToSubmit
2 parents 108a7ac + 86a5935 commit 7e6cf67

File tree

3 files changed

+19
-26
lines changed

3 files changed

+19
-26
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ workflows:
304304
branches:
305305
only:
306306
- develop
307-
- nav-vanilla-forum
308307
- "approve-smoke-test-on-staging":
309308
type: approval
310309
requires:

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const BUCKET_DATA = {
4545
// SORTS.TIME_TO_SUBMIT,
4646
// SORTS.NUM_REGISTRANTS,
4747
// SORTS.NUM_SUBMISSIONS,
48-
// SORTS.PRIZE_HIGH_TO_LOW,
48+
SORTS.PRIZE_HIGH_TO_LOW,
4949
SORTS.TITLE_A_TO_Z,
5050
],
5151
},
@@ -63,7 +63,7 @@ export const BUCKET_DATA = {
6363
// SORTS.TIME_TO_SUBMIT,
6464
// SORTS.NUM_REGISTRANTS,
6565
// SORTS.NUM_SUBMISSIONS,
66-
// SORTS.PRIZE_HIGH_TO_LOW,
66+
SORTS.PRIZE_HIGH_TO_LOW,
6767
SORTS.TITLE_A_TO_Z,
6868
],
6969
},
@@ -78,9 +78,9 @@ export const BUCKET_DATA = {
7878
name: 'Ongoing challenges',
7979
sorts: [
8080
SORTS.MOST_RECENT_START_DATE,
81-
// SORTS.CURRENT_PHASE,
81+
SORTS.CURRENT_PHASE,
8282
SORTS.TITLE_A_TO_Z,
83-
// SORTS.PRIZE_HIGH_TO_LOW,
83+
SORTS.PRIZE_HIGH_TO_LOW,
8484
],
8585
},
8686
[BUCKETS.UPCOMING]: {

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

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,38 @@ import { sumBy } from 'lodash';
77
// import { phaseStartDate, phaseEndDate } from './helper';
88

99
export const SORTS = {
10-
// CURRENT_PHASE: 'current-phase',
10+
CURRENT_PHASE: 'current-phase',
1111
MOST_RECENT: 'updated',
1212
MOST_RECENT_START_DATE: 'startDate',
1313
// NUM_REGISTRANTS: 'num-registrants',
1414
// NUM_SUBMISSIONS: 'num-submissions',
15-
// PRIZE_HIGH_TO_LOW: 'prize-high-to-low',
16-
// TIME_TO_REGISTER: 'time-to-register',
17-
// TIME_TO_SUBMIT: 'time-to-submit',
15+
PRIZE_HIGH_TO_LOW: 'overview.totalPrizes',
16+
// TIME_TO_REGISTER: 'registrationEndDate',
17+
// TIME_TO_SUBMIT: 'submissionEndDate',
1818
TITLE_A_TO_Z: 'name',
1919
REVIEW_OPPORTUNITIES_TITLE_A_TO_Z: 'review-opportunities-title-a-to-z',
2020
REVIEW_OPPORTUNITIES_PAYMENT: 'review-opportunities-payment',
2121
REVIEW_OPPORTUNITIES_START_DATE: 'review-opportunities-start-date',
2222
};
2323

2424
export default {
25-
// [SORTS.CURRENT_PHASE]: {
26-
// func: (a, b) => a.status.localeCompare(b.status),
27-
// name: 'Current phase',
28-
// },
25+
[SORTS.CURRENT_PHASE]: {
26+
func: (a, b) => a.status.localeCompare(b.status),
27+
name: 'Current phase',
28+
},
2929
[SORTS.MOST_RECENT]: {
30-
// func: (a, b) => moment(b.registrationStartDate).diff(a.registrationStartDate),
3130
name: 'Most recent',
3231
order: 'desc',
3332
},
3433
[SORTS.MOST_RECENT_START_DATE]: {
3534
name: 'Most recent',
3635
order: 'desc',
3736
},
38-
// [SORTS.NUM_REGISTRANTS]: {
39-
// func: (a, b) => b.numOfRegistrants - a.numOfRegistrants,
40-
// name: '# of registrants',
41-
// },
42-
// [SORTS.NUM_SUBMISSIONS]: {
43-
// func: (a, b) => b.numOfSubmissions - a.numOfSubmissions,
44-
// name: '# of submissions',
45-
// },
46-
// [SORTS.PRIZE_HIGH_TO_LOW]: {
47-
// func: (a, b) => b.totalPrize - a.totalPrize,
48-
// name: 'Prize high to low',
49-
// },
37+
[SORTS.PRIZE_HIGH_TO_LOW]: {
38+
func: (a, b) => b.totalPrize - a.totalPrize,
39+
name: 'Prize high to low',
40+
order: 'desc',
41+
},
5042
// [SORTS.TIME_TO_REGISTER]: {
5143
// func: (a, b) => {
5244
// const aDate = moment(a.registrationEndDate || a.submissionEndTimestamp);
@@ -59,6 +51,7 @@ export default {
5951
// return aDate.diff(bDate);
6052
// },
6153
// name: 'Time to register',
54+
// order: 'desc',
6255
// },
6356
// [SORTS.TIME_TO_SUBMIT]: {
6457
// func: (a, b) => {
@@ -79,6 +72,7 @@ export default {
7972
// return aDate.diff(bDate);
8073
// },
8174
// name: 'Time to submit',
75+
// order: 'desc',
8276
// },
8377
[SORTS.TITLE_A_TO_Z]: {
8478
// func: (a, b) => a.name.localeCompare(b.name),

0 commit comments

Comments
 (0)