diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4a915b1b3..8f3a7f408 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -4196,6 +4196,16 @@ "requires": { "legacy-swc-helpers": "npm:@swc/helpers@=0.4.14", "tslib": "^2.4.0" + }, + "dependencies": { + "legacy-swc-helpers": { + "version": "npm:@swc/helpers@0.4.14", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", + "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", + "requires": { + "tslib": "^2.4.0" + } + } } }, "@types/babel__core": { @@ -11950,14 +11960,6 @@ "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" }, - "legacy-swc-helpers": { - "version": "npm:@swc/helpers@0.4.14", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz", - "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==", - "requires": { - "tslib": "^2.4.0" - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", diff --git a/frontend/src/components/projects/ProjectDetail/index.js b/frontend/src/components/projects/ProjectDetail/index.js index fd1a4e25b..8d63c6143 100644 --- a/frontend/src/components/projects/ProjectDetail/index.js +++ b/frontend/src/components/projects/ProjectDetail/index.js @@ -143,7 +143,9 @@ const ProjectDetail = ({ const value = find(event.tracks, t => t.slug === project.track) if (!value) { - return No track + return ( + No track selected + ) } return {value.name} } @@ -155,7 +157,11 @@ const ProjectDetail = ({ ) if (values.length === 0) { - return No challenges + return ( + + No challenges selected + + ) } return values.map(challenge => ( @@ -341,16 +347,18 @@ const ProjectDetail = ({ {project.punchline} -
- -
+ {project.description && ( +
+ +
+ )} {submissionFormAnswersArray?.length > 0 && submissionFormAnswersArray.map( (section, index) => { if (section.answers?.length > 0) { return (
0 && section.answers.map( - (answer, index) => ( -
- - { - answer.question + (answer, index) => { + return ( +
- {answer.fieldType === - 'attachment' ? ( -
- -
- ) : ( - + className="tw-flex tw-flex-col tw-gap-2" + > + { - answer.value + answer.question } - )} -
- ), + + {answer.fieldType === + 'boolean' + ? answer.value + ? 'Yes' + : 'No' + : answer.value} + +
+ ) + }, )}
) @@ -423,7 +418,7 @@ const ProjectDetail = ({ )} - {project.video ? ( + {event?.submissionFormDefaultFields?.video && (
video - - {project.video} - -
- - console.log('onReady') - } - onStart={() => - console.log('onStart') - } - onBuffer={() => - console.log('onBuffer') - } - onSeek={e => - console.log('onSeek', e) - } - onError={e => - console.log('onError', e) - } - /> -
-
- ) : ( -
- - video - - - No video available - + {project.video ? ( + <> + + {project.video} + +
+ + console.log('onReady') + } + onStart={() => + console.log('onStart') + } + onBuffer={() => + console.log('onBuffer') + } + onSeek={e => + console.log('onSeek', e) + } + onError={e => + console.log( + 'onError', + e, + ) + } + /> +
+ + ) : ( + + Not available + + )}
)} - - {project.demo ? ( + {event?.submissionFormDefaultFields?.demo && (
Demo - - {project.demo} - -
- ) : ( -
- - Demo - - - No demo available - + {project.demo ? ( + + {project.demo} + + ) : ( + + Not available + + )}
)} - {!project.sourcePublic ? ( -
- - Source code - - - Source code not public - -
- ) : ( + {event?.submissionFormDefaultFields?.source && (
Source code - - {project.source} - + {project.sourcePublic ? ( + + {project.source + ? project.source + : 'Not available'} + + ) : ( + + Not public + + )}
)} - {event && project.track && ( + {event.tracksEnabled && project.track && (
)} - {event && project.challenges.length > 0 && ( -
- - Challenges - - {renderChallenges()} -
- )} + {event.challengesEnabled && + project.challenges.length > 0 && ( +
+ + Challenges + + {renderChallenges()} +
+ )}
val === i)) continue - if (typeof ob[i] === 'object' && ob[i] !== null) { + if (i === 'firstName' || i === 'lastName') { + toReturn[i] = ob[i].replace(/"/g, '""') + continue + } else if (typeof ob[i] === 'object' && ob[i] !== null) { if (i === 'CustomAnswers') { for (let j in ob[i]) { if (!ob[i].hasOwnProperty(j)) continue const customAnswerLabel = ob[i][j].label const customAnswerValue = ob[i][j].value - toReturn[customAnswerLabel] = customAnswerValue + toReturn[customAnswerLabel] = customAnswerValue.replace( + /"/g, + '""', + ) } } else { let flatObject = flattenObject(ob[i]) diff --git a/frontend/src/components/tables/ProjectsTable/index.js b/frontend/src/components/tables/ProjectsTable/index.js index 18b8dc12a..37ef19a6b 100644 --- a/frontend/src/components/tables/ProjectsTable/index.js +++ b/frontend/src/components/tables/ProjectsTable/index.js @@ -20,14 +20,14 @@ const ProjectsTable = ({ projects }) => { if (!ob.hasOwnProperty(i) || skipArray.some(val => val === i)) continue - if (i === 'description' || i === 'punchline') { + if (i === 'description' || i === 'name' || i === 'punchline') { toReturn[i] = ob[i].replace(/"/g, '""') continue } else if (typeof ob[i] === 'object' && ob[i] !== null) { let flatObject = flattenObject(ob[i]) for (let x in flatObject) { if (!flatObject.hasOwnProperty(x)) continue - toReturn[i + '.' + x] = flatObject[x] + toReturn[i + '.' + x] = flatObject[x].replace(/"/g, '""') } } else { toReturn[i] = ob[i]