@@ -15,7 +15,8 @@ import {
1515 getRatingLevel ,
1616 sortList ,
1717 getProvisionalScore ,
18- getFinalScore
18+ getFinalScore ,
19+ checkManageRoles
1920} from '../../../util/tc'
2021import {
2122 getTopcoderReactLib
@@ -207,12 +208,12 @@ class SubmissionsComponent extends React.Component {
207208 render ( ) {
208209 const { challenge, token } = this . props
209210 const { checkpoints, track, type, tags } = challenge
211+ const haveManagePermission = checkManageRoles ( token )
210212
211213 const { field, sort } = this . getSubmissionsSortParam ( )
212214 const revertSort = sort === 'desc' ? 'asc' : 'desc'
213215
214216 const { sortedSubmissions, downloadingAll } = this . state
215- console . log ( 'totest sortedSubmissions' , sortedSubmissions )
216217
217218 const renderSubmission = s => (
218219 < div className = { styles . submission } key = { s . id } >
@@ -308,7 +309,7 @@ class SubmissionsComponent extends React.Component {
308309
309310 return (
310311 < div className = { cn ( styles . container , styles . dev , styles [ 'non-mm' ] ) } >
311- < div className = { styles [ 'empty-left' ] } />
312+ { haveManagePermission ? ( < div className = { styles [ 'empty-left' ] } /> ) : null }
312313 < div className = { styles . submissionsContainer } >
313314 < div className = { styles . head } >
314315 { ! isF2F && ! isBugHunt && (
@@ -405,11 +406,11 @@ class SubmissionsComponent extends React.Component {
405406 >
406407 < span > Legacy submission ID</ span >
407408 </ div >
408- < div
409+ { haveManagePermission ? ( < div
409410 className = { cn ( styles [ 'col-8' ] ) }
410411 >
411412 < span > Actions</ span >
412- </ div >
413+ </ div > ) : null }
413414 </ div >
414415 { sortedSubmissions . map ( s => (
415416 < div
@@ -464,11 +465,10 @@ class SubmissionsComponent extends React.Component {
464465 < div className = { styles [ 'col-7' ] } >
465466 { s . legacySubmissionId }
466467 </ div >
467- < div className = { styles [ 'col-8' ] } >
468+ { haveManagePermission ? ( < div className = { styles [ 'col-8' ] } >
468469 < button
469470 onClick = { ( ) => {
470471 // download submission
471- console . log ( 'totest download submission' )
472472 const reactLib = getTopcoderReactLib ( )
473473 const { getService } = reactLib . services . submissions
474474 const submissionsService = getService ( token )
@@ -487,12 +487,12 @@ class SubmissionsComponent extends React.Component {
487487 >
488488 < ReactSVG path = { assets ( `${ Download } ` ) } />
489489 </ button >
490- </ div >
490+ </ div > ) : null }
491491 </ div >
492492 ) ) }
493493 </ div >
494494
495- < div className = { styles [ 'top-title' ] } >
495+ { haveManagePermission ? ( < div className = { styles [ 'top-title' ] } >
496496 < div className = { styles . btnManageSubmissions } >
497497 < PrimaryButton
498498 text = 'Download All'
@@ -540,7 +540,7 @@ class SubmissionsComponent extends React.Component {
540540 } }
541541 />
542542 </ div >
543- </ div >
543+ </ div > ) : null }
544544 </ div >
545545 )
546546 }
0 commit comments