diff --git a/common/app/entities/index.js b/common/app/entities/index.js index 90e2b3aa68..5d95742299 100644 --- a/common/app/entities/index.js +++ b/common/app/entities/index.js @@ -119,6 +119,14 @@ export function projectsSelector(state) { ]), [] ); + + blocks['full-stack-projects'] = { + dashedName: 'full-stack', + title: 'Full Stack Certification', + time: '1800 hours', + challenges: [], + superBlock: 'full-stack' + }; return Object.keys(blocks) .filter(key => key.includes('projects') && !( diff --git a/common/app/routes/Settings/components/Cert-Settings.jsx b/common/app/routes/Settings/components/Cert-Settings.jsx index 2b56e23e94..3abd8347f1 100644 --- a/common/app/routes/Settings/components/Cert-Settings.jsx +++ b/common/app/routes/Settings/components/Cert-Settings.jsx @@ -37,34 +37,41 @@ const mapStateToProps = createSelector( isFrontEndCert, isBackEndCert, isDataVisCert, + isFullStackCert, username }, projects - ) => ({ - allProjects: projects, - legacyProjects: projects.filter(p => p.superBlock.includes('legacy')), - modernProjects: projects.filter(p => !p.superBlock.includes('legacy')), - userProjects: projects - .map(block => buildUserProjectsMap(block, completedChallenges)) - .reduce((projects, current) => ({ - ...projects, - ...current - }), {}), - blockNameIsCertMap: { - 'Responsive Web Design Projects': isRespWebDesignCert, - /* eslint-disable max-len */ - 'JavaScript Algorithms and Data Structures Projects': isJsAlgoDataStructCert, - /* eslint-enable max-len */ - 'Front End Libraries Projects': isFrontEndLibsCert, - 'Data Visualization Projects': is2018DataVisCert, - 'APIs and Microservices Projects': isApisMicroservicesCert, - 'Information Security and Quality Assurance Projects': isInfosecQaCert, - 'Legacy Front End Projects': isFrontEndCert, - 'Legacy Back End Projects': isBackEndCert, - 'Legacy Data Visualization Projects': isDataVisCert - }, - username - }) + ) => { + let modernProjects = projects.filter(p => !p.superBlock.includes('legacy')); + modernProjects.push(modernProjects.shift()); + + return { + allProjects: projects, + legacyProjects: projects.filter(p => p.superBlock.includes('legacy')), + modernProjects: modernProjects, + userProjects: projects + .map(block => buildUserProjectsMap(block, completedChallenges)) + .reduce((projects, current) => ({ + ...projects, + ...current + }), {}), + blockNameIsCertMap: { + 'Responsive Web Design Projects': isRespWebDesignCert, + /* eslint-disable max-len */ + 'JavaScript Algorithms and Data Structures Projects': isJsAlgoDataStructCert, + /* eslint-enable max-len */ + 'Front End Libraries Projects': isFrontEndLibsCert, + 'Data Visualization Projects': is2018DataVisCert, + 'APIs and Microservices Projects': isApisMicroservicesCert, + 'Information Security and Quality Assurance Projects': isInfosecQaCert, + 'Full Stack Certification': isFullStackCert, + 'Legacy Front End Projects': isFrontEndCert, + 'Legacy Back End Projects': isBackEndCert, + 'Legacy Data Visualization Projects': isDataVisCert + }, + username + }; + } ); function mapDispatchToProps(dispatch) { @@ -178,12 +185,40 @@ class CertificationSettings extends PureComponent { .length - 1; const fullForm = completedProjects === challengeTitles.length; + + let isFullStack = superBlock === 'full-stack'; + let isFullStackClaimable = false; + let description = ''; + if (isFullStack) { + isFullStackClaimable = Object.keys(blockNameIsCertMap).every(function(e) { + if (e.indexOf('Full Stack') !== -1 || e.indexOf('Legacy') !== -1) { + return true; + } + return blockNameIsCertMap[e]; + }); + + description = (