diff --git a/src/projects/detail/containers/ProjectInfoContainer.js b/src/projects/detail/containers/ProjectInfoContainer.js index e4a99db15..715c3a8bd 100644 --- a/src/projects/detail/containers/ProjectInfoContainer.js +++ b/src/projects/detail/containers/ProjectInfoContainer.js @@ -206,11 +206,14 @@ class ProjectInfoContainer extends React.Component { })) const attachmentsStorePath = `${PROJECT_ATTACHMENTS_FOLDER}/${project.id}/` - const templateId = _.get(project, 'templateId') - const projectTemplate = _.find(projectTemplates, pt => pt.id === templateId) - const subSectionsTemplate = projectTemplate.scope.sections[0].subSections - //Allowing upload of files only if files subSection is present in template - const shouldUploadFiles = _.some(subSectionsTemplate, st => st.id === 'files') + let enableFileUpload = true + if(project.version !== 'v2') { + const templateId = _.get(project, 'templateId') + const projectTemplate = _.find(projectTemplates, template => template.id === templateId) + enableFileUpload = _.some(projectTemplate.scope.sections, section => { + return _.some(section.subSections, subSection => subSection.id === 'files') + }) + } return (
@@ -241,7 +244,7 @@ class ProjectInfoContainer extends React.Component { ({ projectTemplates : templates.projectTemplates, })