diff --git a/src/projects/detail/containers/ProjectInfoContainer.js b/src/projects/detail/containers/ProjectInfoContainer.js index 9b89647e3..e4a99db15 100644 --- a/src/projects/detail/containers/ProjectInfoContainer.js +++ b/src/projects/detail/containers/ProjectInfoContainer.js @@ -129,7 +129,7 @@ class ProjectInfoContainer extends React.Component { const { duration } = this.state const { project, currentMemberRole, isSuperUser, phases, feeds, hideInfo, hideLinks, hideMembers, onChannelClick, activeChannelId, productsTimelines, - isManageUser, phasesTopics, isProjectPlan, isProjectProcessing } = this.props + isManageUser, phasesTopics, isProjectPlan, isProjectProcessing, projectTemplates } = this.props let directLinks = null // check if direct links need to be added const isMemberOrCopilot = _.indexOf([PROJECT_ROLE_COPILOT, PROJECT_ROLE_MANAGER], currentMemberRole) > -1 @@ -206,6 +206,11 @@ 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') return (
@@ -236,7 +241,7 @@ class ProjectInfoContainer extends React.Component { ({ + projectTemplates : templates.projectTemplates, +}) const mapDispatchToProps = { updateProject, deleteProject, addProjectAttachment, loadDashboardFeeds, loadPhaseFeed } -export default connect(null, mapDispatchToProps)(ProjectInfoContainer) +export default connect(mapStateToProps, mapDispatchToProps)(ProjectInfoContainer)