From b434ef6e432c1f2e5e09525b969bb0aea2f3e23f Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 23 Jun 2016 16:08:01 -0700 Subject: [PATCH] Feature(map): add super block message logic --- common/app/routes/challenges/components/map/Block.jsx | 5 ++--- .../routes/challenges/components/map/Super-Block.jsx | 10 ++++++---- .../coding-interview-training.json | 2 +- .../mock-interview-training.json | 2 +- server/services/map.js | 3 ++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/common/app/routes/challenges/components/map/Block.jsx b/common/app/routes/challenges/components/map/Block.jsx index e7a9d5053c..6d28040850 100644 --- a/common/app/routes/challenges/components/map/Block.jsx +++ b/common/app/routes/challenges/components/map/Block.jsx @@ -11,11 +11,10 @@ import { toggleThisPanel } from '../../redux/actions'; const dispatchActions = { toggleThisPanel }; const mapStateToProps = createSelector( (_, props) => props.dashedName, - state => state.entities.block, + (state, props) => state.entities.block[props.dashedName], state => state.entities.challenge, (state, props) => state.challengesApp.mapUi[props.dashedName], - (dashedName, blockMap, challengeMap, isOpen) => { - const block = blockMap[dashedName]; + (dashedName, block, challengeMap, isOpen) => { return { isOpen, dashedName, diff --git a/common/app/routes/challenges/components/map/Super-Block.jsx b/common/app/routes/challenges/components/map/Super-Block.jsx index b94706e8aa..220b7b26b5 100644 --- a/common/app/routes/challenges/components/map/Super-Block.jsx +++ b/common/app/routes/challenges/components/map/Super-Block.jsx @@ -11,12 +11,14 @@ import { toggleThisPanel } from '../../redux/actions'; const dispatchActions = { toggleThisPanel }; const mapStateToProps = createSelector( (_, props) => props.dashedName, - state => state.entities.superBlock, + (state, props) => state.entities.superBlock[props.dashedName], (state, props) => state.challengesApp.mapUi[props.dashedName], - (dashedName, superBlockMap, isOpen) => ({ + (dashedName, superBlock, isOpen) => ({ isOpen, - title: superBlockMap[dashedName].title, - blocks: superBlockMap[dashedName].blocks + dashedName, + title: superBlock.title, + blocks: superBlock.blocks, + message: superBlock.message }) ); export class SuperBlock extends PureComponent { diff --git a/seed/challenges/06-coding-interview-preperation/coding-interview-training.json b/seed/challenges/06-coding-interview-preperation/coding-interview-training.json index c38eb790e2..de05dbb3fa 100644 --- a/seed/challenges/06-coding-interview-preperation/coding-interview-training.json +++ b/seed/challenges/06-coding-interview-preperation/coding-interview-training.json @@ -3,7 +3,7 @@ "order": 23, "time": "70 Hours", "isLocked": true, - "message": "To qualify for these nonprofit projects, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End", + "message": "To qualify for the coding interview preparation, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End", "challenges": [ { "title": "Soft Skill Training" diff --git a/seed/challenges/06-coding-interview-preperation/mock-interview-training.json b/seed/challenges/06-coding-interview-preperation/mock-interview-training.json index 4e9d94d969..4ca6114c78 100644 --- a/seed/challenges/06-coding-interview-preperation/mock-interview-training.json +++ b/seed/challenges/06-coding-interview-preperation/mock-interview-training.json @@ -3,7 +3,7 @@ "order": 24, "time": "10 Hours", "isLocked": true, - "message": "To qualify for these nonprofit projects, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End", + "message": "To qualify for the coding interview preparation, you must first earn all three foundational certifications: Front End, Data Visualization, and Back End", "challenges": [ { "title": "Mock Interview #1" diff --git a/server/services/map.js b/server/services/map.js index e03302b5ec..70472a5fbb 100644 --- a/server/services/map.js +++ b/server/services/map.js @@ -59,7 +59,8 @@ function cachedMap(Block) { order: block.superOrder, name: nameify(_.startCase(block.superBlock)), dashedName: block.superBlock, - blocks: [block] + blocks: [block], + message: block.superBlockMessage }; } return map;