Skip to content

Commit fe1e493

Browse files
committed
hide upload section on init when is not mandatory and there a no file uploaded in the submission
1 parent b665456 commit fe1e493

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/core/submission/submission-response-parsing.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ export class SubmissionResponseParsingService extends BaseResponseParsingService
131131
// Iterate over all workspaceitem's sections
132132
Object.keys(item.sections)
133133
.forEach((sectionId) => {
134-
if (typeof item.sections[sectionId] === 'object' && isNotEmpty(item.sections[sectionId])) {
134+
if (typeof item.sections[sectionId] === 'object' && (isNotEmpty(item.sections[sectionId]) &&
135+
// When Upload section is disabled, add to submission only if there are files
136+
(!item.sections[sectionId].hasOwnProperty('files') || isNotEmpty((item.sections[sectionId] as any).files)))) {
137+
135138
const normalizedSectionData = Object.create({});
136139
// Iterate over all sections property
137140
Object.keys(item.sections[sectionId])

0 commit comments

Comments
 (0)