Skip to content

Commit 0e84539

Browse files
additional fix on 2020-09-12
1 parent 54ef309 commit 0e84539

File tree

13 files changed

+228
-229
lines changed

13 files changed

+228
-229
lines changed

__tests__/shared/components/challenge-listing/__snapshots__/index.jsx.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ exports[`Matches shallow shapshot 1 shapshot 1 1`] = `
3030
loadMoreMy={null}
3131
loadMoreOnGoing={null}
3232
loadMoreOpenForRegistration={null}
33-
loadMorePast={null}
3433
loadMoreReviewOpportunities={null}
35-
loadingPastChallenges={false}
3634
newChallengeDetails={false}
3735
openChallengesInNewTabs={false}
3836
preListingMsg={null}
@@ -95,9 +93,7 @@ exports[`Matches shallow shapshot 2 shapshot 2 1`] = `
9593
loadMoreMy={null}
9694
loadMoreOnGoing={null}
9795
loadMoreOpenForRegistration={null}
98-
loadMorePast={null}
9996
loadMoreReviewOpportunities={null}
100-
loadingPastChallenges={false}
10197
newChallengeDetails={false}
10298
openChallengesInNewTabs={false}
10399
preListingMsg={null}

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ function getTotalChallengesCountDone(uuid, tokenV3, frontFilter = {}) {
341341
* @param {Object} frontFilter
342342
* @return {Object}
343343
*/
344-
function getPastChallengesInit(uuid, page, frontFilter) {
345-
return { uuid, page, frontFilter };
346-
}
344+
// function getPastChallengesInit(uuid, page, frontFilter) {
345+
// return { uuid, page, frontFilter };
346+
// }
347347

348348
/**
349349
* Gets the specified page of past challenges (including MMs).
@@ -353,27 +353,27 @@ function getPastChallengesInit(uuid, page, frontFilter) {
353353
* @param {Object} frontFilter Optional. Original frontend filter.
354354
* @param {Object}
355355
*/
356-
function getPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
357-
const { sorts } = frontFilter;
358-
const filter = {
359-
backendFilter,
360-
frontFilter: {
361-
...frontFilter,
362-
status: 'Completed',
363-
perPage: PAGE_SIZE,
364-
page: page + 1,
365-
sortBy: sorts[BUCKETS.PAST],
366-
sortOrder: SORT[sorts[BUCKETS.PAST]].order,
367-
},
368-
};
369-
delete filter.frontFilter.sorts;
370-
const service = getService(tokenV3);
371-
return service.getChallenges(filter).then(({ challenges }) => ({
372-
uuid,
373-
pastChallenges: challenges,
374-
frontFilter,
375-
}));
376-
}
356+
// function getPastChallengesDone(uuid, page, backendFilter, tokenV3, frontFilter = {}) {
357+
// const { sorts } = frontFilter;
358+
// const filter = {
359+
// backendFilter,
360+
// frontFilter: {
361+
// ...frontFilter,
362+
// status: 'Completed',
363+
// perPage: PAGE_SIZE,
364+
// page: page + 1,
365+
// sortBy: sorts[BUCKETS.PAST],
366+
// sortOrder: SORT[sorts[BUCKETS.PAST]].order,
367+
// },
368+
// };
369+
// delete filter.frontFilter.sorts;
370+
// const service = getService(tokenV3);
371+
// return service.getChallenges(filter).then(({ challenges }) => ({
372+
// uuid,
373+
// pastChallenges: challenges,
374+
// frontFilter,
375+
// }));
376+
// }
377377

378378
/**
379379
* Action to get a list of currently open Review Opportunities using V3 API
@@ -494,8 +494,8 @@ export default createActions({
494494
GET_CHALLENGE_TAGS_INIT: _.noop,
495495
GET_CHALLENGE_TAGS_DONE: getChallengeTagsDone,
496496

497-
GET_PAST_CHALLENGES_INIT: getPastChallengesInit,
498-
GET_PAST_CHALLENGES_DONE: getPastChallengesDone,
497+
// GET_PAST_CHALLENGES_INIT: getPastChallengesInit,
498+
// GET_PAST_CHALLENGES_DONE: getPastChallengesDone,
499499

500500
GET_REVIEW_OPPORTUNITIES_INIT: (uuid, page) => ({ uuid, page }),
501501
GET_REVIEW_OPPORTUNITIES_DONE: getReviewOpportunitiesDone,

src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/* eslint-disable jsx-a11y/label-has-for */
2323

2424
import _ from 'lodash';
25-
// import { challenge as challengeUtils } from 'topcoder-react-lib';
25+
import { challenge as challengeUtils } from 'topcoder-react-lib';
2626
import React from 'react';
2727
import PT from 'prop-types';
2828
import Select from 'components/Select';
@@ -31,13 +31,13 @@ import { Button } from 'topcoder-react-ui-kit';
3131
import Tooltip from 'components/Tooltip';
3232
import { config, Link } from 'topcoder-react-utils';
3333
import { COMPOSE, PRIORITY } from 'react-css-super-themr';
34-
// import { REVIEW_OPPORTUNITY_TYPES } from 'utils/tc';
34+
import { REVIEW_OPPORTUNITY_TYPES } from 'utils/tc';
3535
import CheckmarkIcon from './CheckmarkIcon';
3636
import DateRangePicker from '../DateRangePicker';
3737
import style from './style.scss';
3838
import UiSimpleRemove from '../../Icons/ui-simple-remove.svg';
3939

40-
// const Filter = challengeUtils.filter;
40+
const Filter = challengeUtils.filter;
4141

4242
export default function FiltersPanel({
4343
communityFilters,
@@ -273,7 +273,7 @@ export default function FiltersPanel({
273273
/>
274274
</div>
275275
{/* Only shown when the Review Opportunity bucket is selected */}
276-
{/* { isReviewOpportunitiesBucket
276+
{ isReviewOpportunitiesBucket
277277
? (
278278
<div styleName="filter review-type">
279279
<label htmlFor="review-type-select">
@@ -297,7 +297,7 @@ export default function FiltersPanel({
297297
/>
298298
</div>
299299
) : null
300-
} */}
300+
}
301301
<div styleName="filter dates hidetwomonthdatepicker">
302302
<label htmlFor="date-range-picker-one-month">
303303
Date range

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default function ReviewOpportunityBucket({
4040

4141
const sortedOpportunities = _.clone(opportunities);
4242
sortedOpportunities.sort(Sort[activeSort].func);
43-
console.log(challengeTypes);
4443

4544
/* Filtering for Review Opportunities will be done entirely in the front-end
4645
* which means it can be done at render, rather than in the reducer,

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ function Listing({
2323
challenges,
2424
openForRegistrationChallenges,
2525
myChallenges,
26-
pastChallenges,
26+
// pastChallenges,
2727
challengeTypes,
2828
// userChallenges,
2929
challengesUrl,
3030
communityName,
3131
// extraBucket,
3232
filterState,
3333
keepPastPlaceholders,
34-
loadingPastChallenges,
34+
// loadingPastChallenges,
3535
loadingReviewOpportunities,
3636
loadingMyChallenges,
3737
loadMoreMy,
3838
loadingOpenForRegistrationChallenges,
3939
loadMoreOpenForRegistration,
4040
loadingOnGoingChallenges,
4141
loadMoreOnGoing,
42-
loadMorePast,
42+
// loadMorePast,
4343
loadMoreReviewOpportunities,
4444
newChallengeDetails,
4545
openChallengesInNewTabs,
@@ -70,19 +70,19 @@ function Listing({
7070
// return filteredChallenges.length > 0;
7171
// };
7272
const getBucket = (bucket, expanded = false) => {
73-
let keepPlaceholders = false;
73+
// const keepPlaceholders = false;
7474
let loading;
7575
let loadMore;
7676
// let searchTimestamp;
7777
let bucketChallenges = [];
7878
switch (bucket) {
79-
case BUCKETS.PAST:
80-
keepPlaceholders = keepPastPlaceholders;
81-
bucketChallenges = [].concat(pastChallenges);
82-
loading = loadingPastChallenges;
83-
loadMore = loadMorePast;
84-
// searchTimestamp = pastSearchTimestamp;
85-
break;
79+
// case BUCKETS.PAST:
80+
// keepPlaceholders = keepPastPlaceholders;
81+
// bucketChallenges = [].concat(pastChallenges);
82+
// loading = loadingPastChallenges;
83+
// loadMore = loadMorePast;
84+
// // searchTimestamp = pastSearchTimestamp;
85+
// break;
8686
case BUCKETS.MY:
8787
bucketChallenges = [].concat(myChallenges);
8888
loading = loadingMyChallenges;
@@ -113,7 +113,7 @@ function Listing({
113113
expandedTags={expandedTags}
114114
expandTag={expandTag}
115115
filterState={filterState}
116-
keepPlaceholders={keepPlaceholders}
116+
keepPlaceholders={keepPastPlaceholders}
117117
loading={loadingReviewOpportunities}
118118
loadMore={loadMoreReviewOpportunities}
119119
opportunities={reviewOpportunities}
@@ -187,7 +187,7 @@ function Listing({
187187
{auth.user ? getBucket(BUCKETS.MY) : null}
188188
{/* {extraBucket ? getBucket(extraBucket) : null} */}
189189
{getBucket(BUCKETS.OPEN_FOR_REGISTRATION)}
190-
{getBucket(BUCKETS.ONGOING)}
190+
{/* {getBucket(BUCKETS.ONGOING)} */}
191191
</div>
192192
);
193193
}
@@ -196,15 +196,15 @@ Listing.defaultProps = {
196196
challenges: [],
197197
openForRegistrationChallenges: [],
198198
myChallenges: [],
199-
pastChallenges: [],
199+
// pastChallenges: [],
200200
challengeTypes: [],
201201
communityName: null,
202202
// currentFilterName: '',
203203
// expanded: false,
204204
expandedTags: [],
205205
expandTag: null,
206206
// extraBucket: null,
207-
loadMorePast: null,
207+
// loadMorePast: null,
208208
loadMoreReviewOpportunities: null,
209209
loadMoreMy: null,
210210
loadMoreOpenForRegistration: null,
@@ -229,7 +229,7 @@ Listing.propTypes = {
229229
challenges: PT.arrayOf(PT.shape()),
230230
openForRegistrationChallenges: PT.arrayOf(PT.shape()),
231231
myChallenges: PT.arrayOf(PT.shape()),
232-
pastChallenges: PT.arrayOf(PT.shape()),
232+
// pastChallenges: PT.arrayOf(PT.shape()),
233233
challengeTypes: PT.arrayOf(PT.shape()),
234234
challengesUrl: PT.string.isRequired,
235235
communityName: PT.string,
@@ -238,15 +238,15 @@ Listing.propTypes = {
238238
// extraBucket: PT.string,
239239
filterState: PT.shape().isRequired,
240240
keepPastPlaceholders: PT.bool.isRequired,
241-
loadingPastChallenges: PT.bool.isRequired,
241+
// loadingPastChallenges: PT.bool.isRequired,
242242
loadingMyChallenges: PT.bool.isRequired,
243243
loadingOpenForRegistrationChallenges: PT.bool.isRequired,
244244
loadingOnGoingChallenges: PT.bool.isRequired,
245245
loadingReviewOpportunities: PT.bool.isRequired,
246246
loadMoreMy: PT.func,
247247
loadMoreOnGoing: PT.func,
248248
loadMoreOpenForRegistration: PT.func,
249-
loadMorePast: PT.func,
249+
// loadMorePast: PT.func,
250250
loadMoreReviewOpportunities: PT.func,
251251
newChallengeDetails: PT.bool.isRequired,
252252
openChallengesInNewTabs: PT.bool,

src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function BucketSelector({
8181
{getBucket(BUCKETS.ONGOING)}
8282
<hr />
8383
{getBucket(BUCKETS.REVIEW_OPPORTUNITIES)}
84-
{getBucket(BUCKETS.PAST)}
84+
{/* {getBucket(BUCKETS.PAST)} */}
8585
{/* NOTE: We do not show upcoming challenges for now, for various reasons,
8686
* more political than technical ;)
8787
getBucket(BUCKETS.UPCOMING) */

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function ChallengeListing(props) {
3131
challenges,
3232
openForRegistrationChallenges,
3333
myChallenges,
34-
pastChallenges,
34+
// pastChallenges,
3535
// communityFilter,
3636
communityName,
3737
defaultCommunityId,
@@ -98,23 +98,23 @@ export default function ChallengeListing(props) {
9898
challenges={challenges}
9999
openForRegistrationChallenges={openForRegistrationChallenges}
100100
myChallenges={myChallenges}
101-
pastChallenges={pastChallenges}
101+
// pastChallenges={pastChallenges}
102102
challengesUrl={props.challengesUrl}
103103
communityName={props.communityName}
104104
expandedTags={props.expandedTags}
105105
expandTag={props.expandTag}
106106
// extraBucket={extraBucket}
107107
filterState={props.filterState}
108108
keepPastPlaceholders={keepPastPlaceholders}
109-
loadingPastChallenges={props.loadingPastChallenges}
109+
// loadingPastChallenges={props.loadingPastChallenges}
110110
loadingMyChallenges={props.loadingMyChallenges}
111111
loadingOpenForRegistrationChallenges={props.loadingOpenForRegistrationChallenges}
112112
loadingOnGoingChallenges={props.loadingOnGoingChallenges}
113113
loadingReviewOpportunities={props.loadingReviewOpportunities}
114114
loadMoreMy={props.loadMoreMy}
115115
loadMoreOpenForRegistration={props.loadMoreOpenForRegistration}
116116
loadMoreOnGoing={props.loadMoreOnGoing}
117-
loadMorePast={props.loadMorePast}
117+
// loadMorePast={props.loadMorePast}
118118
loadMoreReviewOpportunities={props.loadMoreReviewOpportunities}
119119
newChallengeDetails={props.newChallengeDetails}
120120
openChallengesInNewTabs={props.openChallengesInNewTabs}
@@ -177,7 +177,7 @@ ChallengeListing.defaultProps = {
177177
loadMoreMy: null,
178178
loadMoreOpenForRegistration: null,
179179
loadMoreOnGoing: null,
180-
loadMorePast: null,
180+
// loadMorePast: null,
181181
loadMoreReviewOpportunities: null,
182182
newChallengeDetails: false,
183183
openChallengesInNewTabs: false,
@@ -196,7 +196,7 @@ ChallengeListing.propTypes = {
196196
challenges: PT.arrayOf(PT.shape()).isRequired,
197197
openForRegistrationChallenges: PT.arrayOf(PT.shape()).isRequired,
198198
myChallenges: PT.arrayOf(PT.arrayOf()).isRequired,
199-
pastChallenges: PT.arrayOf(PT.arrayOf()).isRequired,
199+
// pastChallenges: PT.arrayOf(PT.arrayOf()).isRequired,
200200
challengesUrl: PT.string.isRequired,
201201
// communityFilter: PT.shape(),
202202
communityName: PT.string,
@@ -213,12 +213,12 @@ ChallengeListing.propTypes = {
213213
loadingMyChallenges: PT.bool.isRequired,
214214
loadingOpenForRegistrationChallenges: PT.bool.isRequired,
215215
loadingOnGoingChallenges: PT.bool.isRequired,
216-
loadingPastChallenges: PT.bool.isRequired,
216+
// loadingPastChallenges: PT.bool.isRequired,
217217
loadingReviewOpportunities: PT.bool.isRequired,
218218
loadMoreMy: PT.func,
219219
loadMoreOpenForRegistration: PT.func,
220220
loadMoreOnGoing: PT.func,
221-
loadMorePast: PT.func,
221+
// loadMorePast: PT.func,
222222
loadMoreReviewOpportunities: PT.func,
223223
newChallengeDetails: PT.bool,
224224
openChallengesInNewTabs: PT.bool,

src/shared/containers/challenge-listing/FilterPanel.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import React from 'react';
1313
// import localStorage from 'localStorage';
1414
// import sidebarActions from 'actions/challenge-listing/sidebar';
1515
// import { BUCKETS, isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets';
16+
import { isReviewOpportunitiesBucket } from 'utils/challenge-listing/buckets';
1617
import { bindActionCreators } from 'redux';
1718
import { connect } from 'react-redux';
1819
// import qs from 'qs';
@@ -75,7 +76,7 @@ export class Container extends React.Component {
7576

7677
render() {
7778
const {
78-
// activeBucket,
79+
activeBucket,
7980
communityFilters,
8081
// filterState,
8182
// isSavingFilter,
@@ -95,7 +96,7 @@ export class Container extends React.Component {
9596
...communityFilters,
9697
];
9798

98-
// const isForReviewOpportunities = isReviewOpportunitiesBucket(activeBucket);
99+
const isForReviewOpportunities = isReviewOpportunitiesBucket(activeBucket);
99100

100101
return (
101102
<FilterPanel
@@ -121,7 +122,7 @@ export class Container extends React.Component {
121122
// }
122123
}}
123124
// isSavingFilter={isSavingFilter}
124-
// isReviewOpportunitiesBucket={isForReviewOpportunities}
125+
isReviewOpportunitiesBucket={isForReviewOpportunities}
125126
/>
126127
);
127128
}

0 commit comments

Comments
 (0)