@@ -15,13 +15,11 @@ import PT from 'prop-types';
15
15
import { connect } from 'react-redux' ;
16
16
import { Modal } from 'topcoder-react-ui-kit' ;
17
17
import { config } from 'topcoder-react-utils' ;
18
- import { actions , services } from 'topcoder-react-lib' ;
18
+ import { actions } from 'topcoder-react-lib' ;
19
19
20
20
import './styles.scss' ;
21
21
import smpActions from '../../actions/page/submission_management' ;
22
22
23
- const { getService } = services . submissions ;
24
-
25
23
// The container component
26
24
class SubmissionManagementPageContainer extends React . Component {
27
25
componentDidMount ( ) {
@@ -70,17 +68,16 @@ class SubmissionManagementPageContainer extends React.Component {
70
68
onShowDetails,
71
69
onDelete : onSubmissionDelete ,
72
70
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
- } ) ;
71
+ // download large file using stream method
72
+ const downloadSubmissionURL = `${ config . URL . SUBMISSION_REVIEW_API_URL } /challengeSubmissions/${ submissionId } /download?token=${ authTokens . tokenV3 } ` ;
73
+
74
+ const link = document . createElement ( 'a' ) ;
75
+ link . href = downloadSubmissionURL ;
76
+ link . setAttribute ( 'download' , `submission-${ challengeType } -${ submissionId } .zip` ) ;
77
+
78
+ document . body . appendChild ( link ) ;
79
+ link . click ( ) ;
80
+ link . parentNode . removeChild ( link ) ;
84
81
} ,
85
82
onlineReviewUrl : `${ config . URL . ONLINE_REVIEW } /review/actions/ViewProjectDetails?pid=${ challengeId } ` ,
86
83
challengeUrl : `${ challengesUrl } /${ challengeId } ` ,
0 commit comments