Skip to content

Topgear submission fix and other small fixes #1947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
2 changes: 1 addition & 1 deletion src/shared/actions/challenge-listing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const PAGE_SIZE = 50;
/**
* The maximum number of review opportunities to fetch in a single API call.
*/
const REVIEW_OPPORTUNITY_PAGE_SIZE = 10;
const REVIEW_OPPORTUNITY_PAGE_SIZE = 1000;

/**
* Private. Loads from the backend all challenges matching some conditions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
.titleListItem {
color: #a3a3ae;
cursor: pointer;
font-size: 36px;
line-height: 45px;
font-size: 20px;
line-height: 30px;
padding: 15px 0;
position: relative;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function ReviewOpportunityBucket({
));

const placeholders = [];
if (loading || keepPlaceholders) {
if ((loading || keepPlaceholders) && cards.length === 0) {
for (let i = 0; i < 8; i += 1) {
placeholders.push(<CardPlaceholder id={i} key={i} />);
}
Expand Down
12 changes: 1 addition & 11 deletions src/shared/containers/SubmissionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Connects the Redux store to the Challenge Submissions display components.
* Passes the relevent state and setters as properties to the UI components.
*/
import _ from 'lodash';
import actions from 'actions/page/submission';
import communityActions from 'actions/tc-communities';
import shortId from 'shortid';
Expand All @@ -15,7 +14,6 @@ import PT from 'prop-types';
import { connect } from 'react-redux';
import SubmissionsPage from 'components/SubmissionPage';
import AccessDenied, { CAUSE as ACCESS_DENIED_REASON } from 'components/tc-communities/AccessDenied';
import { USER_GROUP_MAXAGE } from 'config';

/**
* SubmissionsPage Container
Expand All @@ -29,18 +27,10 @@ class SubmissionsPageContainer extends React.Component {
componentDidMount() {
const {
auth,
groups,
communitiesList,
getCommunitiesList,
} = this.props;

// check if challenge belongs to any groups
// and the communitiesList is not up-to-date
// then will load the communitiesList
if (!_.isEmpty(groups) && !communitiesList.loadingUuid
&& (Date.now() - communitiesList.timestamp > USER_GROUP_MAXAGE)) {
getCommunitiesList(auth);
}
getCommunitiesList(auth);
}

/* A child component has called their submitForm() prop, prepare the passed
Expand Down
7 changes: 1 addition & 6 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { BUCKETS } from 'utils/challenge-listing/buckets';
import { CHALLENGE_PHASE_TYPES, COMPETITION_TRACKS_V3, SUBTRACKS } from 'utils/tc';
import { config, MetaTags } from 'topcoder-react-utils';
import { actions } from 'topcoder-react-lib';
import { USER_GROUP_MAXAGE } from 'config';

import ogWireframe from
'../../../assets/images/open-graph/challenges/01-wireframe.jpg';
Expand Down Expand Up @@ -127,7 +126,6 @@ class ChallengeDetailPageContainer extends React.Component {
const {
auth,
challenge,
communitiesList,
getCommunitiesList,
loadChallengeDetails,
challengeId,
Expand Down Expand Up @@ -161,10 +159,7 @@ class ChallengeDetailPageContainer extends React.Component {
loadChallengeDetails(auth, challengeId);
}

if (!communitiesList.loadingUuid
&& (Date.now() - communitiesList.timestamp > USER_GROUP_MAXAGE)) {
getCommunitiesList(auth);
}
getCommunitiesList(auth);

if (_.isEmpty(challengeSubtracksMap)) {
getSubtracks();
Expand Down