Skip to content
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

PROD - Fixes to use v5 for challenge results instead of v2 #6955

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"supertest": "^3.1.0",
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3.1",
"tc-ui": "^1.0.12",
"topcoder-react-lib": "1.2.13",
"topcoder-react-lib": "1.2.14",
"topcoder-react-ui-kit": "2.0.1",
"topcoder-react-utils": "0.7.8",
"turndown": "^4.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function passedCheckpoint(checkpoints, handle, results) {
}

function getPlace(results, handle, places) {
const found = _.find(results, w => _.toString(w.memberHandle) === _.toString(handle)
&& w.placement <= places && w.submissionStatus !== 'Failed Review');
const found = _.find(results, w => _.toString(w.handle) === _.toString(handle)
&& w.placement <= places);

if (found) {
return found.placement;
Expand Down
10 changes: 2 additions & 8 deletions src/shared/containers/challenge-detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ ChallengeDetailPageContainer.propTypes = {
fetchChallengeStatistics: PT.func.isRequired,
getAllCountries: PT.func.isRequired,
getReviewTypes: PT.func.isRequired,
// loadResults: PT.func.isRequired,
// loadingCheckpointResults: PT.bool,
// loadingResultsForChallengeId: PT.string.isRequired,
openTermsModal: PT.func.isRequired,
Expand Down Expand Up @@ -970,8 +969,8 @@ const mapDispatchToProps = (dispatch) => {
} else dispatch(a.dropCheckpoints());
} else dispatch(a.dropCheckpoints());
if (ch.status === CHALLENGE_STATUS.COMPLETED) {
dispatch(a.loadResultsInit(ch.legacyId));
dispatch(a.loadResultsDone(tokens, ch.legacyId, ch.track.toLowerCase()));
dispatch(a.loadResultsInit(ch.id));
dispatch(a.loadResultsDone(ch.id));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmgasper why are the other arguments loadResultsDone missing?
Is loadResultsDone moved to the react-lib and updated thus not to see it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tokens weren't used in the original call, and the track isn't necessary since we can now get that from the v5 challenge object response.

} else dispatch(a.dropResults());
return res;
});
Expand Down Expand Up @@ -1014,11 +1013,6 @@ const mapDispatchToProps = (dispatch) => {
dispatch(a.unregisterInit());
dispatch(a.unregisterDone(auth, challengeId));
},
loadResults: (auth, challengeId, type) => {
const a = actions.challenge;
dispatch(a.loadResultsInit(challengeId));
dispatch(a.loadResultsDone(auth, challengeId, type));
},
fetchCheckpoints: (tokens, challengeId) => {
const a = actions.challenge;
dispatch(a.fetchCheckpointsInit());
Expand Down
Loading