File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
components/SubmissionManagement/Submission Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ workflows:
343343 branches :
344344 only :
345345 - develop
346- - fix/regsource
346+ - fix/infected-submission
347347 # This is alternate dev env for parallel testing
348348 - " build-test " :
349349 context : org-global
Original file line number Diff line number Diff line change 232232 "webpack-pwa-manifest" : " ^3.7.1" ,
233233 "webpack-stats-plugin" : " ^0.2.1" ,
234234 "workbox-webpack-plugin" : " ^3.6.2"
235+ },
236+ "volta" : {
237+ "node" : " 8.11.2"
235238 }
236239}
Original file line number Diff line number Diff line change 1414import _ from 'lodash' ;
1515import moment from 'moment' ;
1616import React from 'react' ;
17- import { COMPETITION_TRACKS , CHALLENGE_STATUS } from 'utils/tc' ;
17+ import { COMPETITION_TRACKS , CHALLENGE_STATUS , safeForDownload } from 'utils/tc' ;
1818
1919import PT from 'prop-types' ;
2020
@@ -54,7 +54,7 @@ export default function Submission(props) {
5454 {
5555 track === COMPETITION_TRACKS . DES && (
5656 < td styleName = "status-col" >
57- { submissionObject . screening
57+ { ! safeForDownload ( submissionObject . url ) ? 'Malware found in submission' : submissionObject . screening
5858 && (
5959 < ScreeningStatus
6060 screeningObject = { submissionObject . screening }
@@ -71,7 +71,7 @@ export default function Submission(props) {
7171 onClick = { ( ) => onDownloadSubmission ( submissionObject . id ) }
7272 type = "button"
7373 >
74- < DownloadIcon />
74+ { safeForDownload ( submissionObject . url ) && < DownloadIcon /> }
7575 </ button >
7676 { /*
7777 TODO: At the moment we just fetch downloads from the legacy
@@ -127,6 +127,7 @@ Submission.propTypes = {
127127 type : PT . string ,
128128 created : PT . any ,
129129 download : PT . any ,
130+ url : PT . string ,
130131 } ) ,
131132 showScreeningDetails : PT . bool ,
132133 track : PT . string . isRequired ,
Original file line number Diff line number Diff line change @@ -305,4 +305,13 @@ export function isValidEmail(email) {
305305 return pattern . test ( email ) ;
306306}
307307
308+ /**
309+ * Test if the file is safe for download. This patch currently checks the location of the submission
310+ * to determine if the file is infected or not. This is an immedaite patch, and should be updated to
311+ * check the review scan score for review type virus scan.
312+ */
313+ export function safeForDownload ( url ) {
314+ return url != null && url . indexOf ( 'submissions-quarantine/' ) === - 1 ;
315+ }
316+
308317export default undefined ;
You can’t perform that action at this time.
0 commit comments