Skip to content

Commit 802edf4

Browse files
committed
fix: issue #5582
1 parent 8f120b7 commit 802edf4

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ module.exports = {
116116
FORUMS_VANILLA: 'https://vanilla.topcoder-dev.com',
117117
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
118118
SUBMISSION_REVIEW: 'https://submission-review.topcoder-dev.com',
119+
SUBMISSION_REVIEW_API_URL: 'https://submission-review-api.topcoder-dev.com',
119120

120121
THRIVE: 'https://community-app.topcoder-dev.com/thrive',
121122

config/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = {
3535
FORUMS_VANILLA: 'https://discussions.topcoder.com',
3636
HELP: 'https://www.topcoder.com/thrive/tracks?track=Topcoder&tax=Help%20Articles',
3737
SUBMISSION_REVIEW: 'https://submission-review.topcoder.com',
38+
SUBMISSION_REVIEW_API_URL: 'https://submission-review-api.topcoder.com',
3839
MEMBER: 'https://member.topcoder.com',
3940
ONLINE_REVIEW: 'https://software.topcoder.com',
4041
PAYMENT_TOOL: 'https://payment.topcoder.com',

src/shared/containers/SubmissionManagement/index.jsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ class SubmissionManagementPageContainer extends React.Component {
7070
onShowDetails,
7171
onDelete: onSubmissionDelete,
7272
onDownload: (challengeType, submissionId) => {
73-
const submissionsService = getService(authTokens.tokenV3);
74-
submissionsService.downloadSubmission(submissionId)
75-
.then((blob) => {
76-
const url = window.URL.createObjectURL(new Blob([blob]));
77-
const link = document.createElement('a');
78-
link.href = url;
79-
link.setAttribute('download', `submission-${challengeType}-${submissionId}.zip`);
80-
document.body.appendChild(link);
81-
link.click();
82-
link.parentNode.removeChild(link);
83-
});
73+
// download large file using stream method
74+
const downloadSubmissionURL = `${config.URL.SUBMISSION_REVIEW_API_URL}/challengeSubmissions/${submissionId}/download?token=${authTokens.tokenV3}`;
75+
76+
const link = document.createElement('a');
77+
link.href = downloadSubmissionURL;
78+
link.setAttribute('download', `submission-${challengeType}-${submissionId}.zip`);
79+
80+
document.body.appendChild(link);
81+
link.click();
82+
link.parentNode.removeChild(link);
8483
},
8584
onlineReviewUrl: `${config.URL.ONLINE_REVIEW}/review/actions/ViewProjectDetails?pid=${challengeId}`,
8685
challengeUrl: `${challengesUrl}/${challengeId}`,

0 commit comments

Comments
 (0)