Feature/Block names added to challenge and document titles#11251
Feature/Block names added to challenge and document titles#11251BerkeleyTrue merged 1 commit intofreeCodeCamp:stagingfrom Bouncey:Feature/BlockNamesAddedToTitles
Conversation
BerkeleyTrue
left a comment
There was a problem hiding this comment.
Use the property block already on the challenge object instead of creating a new property.
common/app/redux/reducer.js
Outdated
| { | ||
| [types.updateTitle]: (state, { payload = 'Learn To Code' }) => ({ | ||
| [types.updateTitle]: | ||
| (state, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/app/redux/reducer.js
Outdated
| title: payload + ' | Free Code Camp' | ||
| }), | ||
|
|
||
| title: `${updatedTitle} | Free Code Camp` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| state => state.challengesApp.challenge, | ||
| state => state.challengesApp.superBlocks, | ||
| ({ challenge: { title } = {}, viewType }, challenge, superBlocks = []) => ({ | ||
| ({ challenge: { title = 'Learn to Code', blockType } = {}, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| state => state.challengesApp.isCodeLocked, | ||
| ( | ||
| { challenge: { title, description, hints = [] } = {} }, | ||
| { challenge: { title, description, hints = [], blockType } = {} }, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| style.height = height + 'px'; | ||
| } | ||
|
|
||
| let titleString = () => { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| render() { | ||
| const { title, description, isCompleted } = this.props; | ||
| const { title, description, isCompleted, blockType } = this.props; | ||
| let titleString = () => { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| const { updateTitle } = this.props; | ||
| updateTitle(this.props.title); | ||
| const { updateTitle, title, blockType } = this.props; | ||
| updateTitle({blockType, title}); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
|
I couldn't find |
|
It's |
|
I want to use Looking at { id: 'bd7123c8c441eddfaeb5bdef',
name: 'Say Hello to HTML Elements',
title: 'Say Hello to HTML Elements',
type: 'waypoint',
order: 2,
suborder: 1,
checksum: 3097141541,
isBeta: false,
isComingSoon: false,
dashedName: 'say-hello-to-html-elements',
superBlock: 'Front End Development Certification',
superOrder: 1,
hint: [],
block: 'html5-and-css',
difficulty: undefined,
description:
[ 'Welcome to Free Code Camp\'s first coding challenge.',
'You can edit <code>code</code> in your <code>text editor</code>, which we\'ve embedded into this web page.',
'Do you see the code in your text editor that says <code><h1>Hello</h1></code>? That\'s an HTML <code>element</code>.',
'Most HTML elements have an <code>opening tag</code> and a <code>closing tag</code>.',
'Opening tags look like this:',
'<code><h1></code>',
'Closing tags look like this:',
'<code></h1></code>',
'Note that the only difference between opening tags and closing tags is that closing tags have a slash after their opening angle bracket.',
'Each challenge has tests that you can run at any time by clicking the "Run tests" button. Once you get all tests passing, you can advance to the next challenge.',
'To pass the test on this challenge, change your <code>h1</code> element\'s text to say "Hello World" instead of "Hello". Then click the "Run tests" button.' ],
tests:
[ { text: 'Your <code>h1</code> element should have the text "Hello World".',
testString: 'assert.isTrue((/hello(\\s)+world/gi).test($(\'h1\').text()), \'Your <code>h1</code> element should have the text "Hello World".\');' } ],
head: [],
tail: [],
helpRoom: 'Help',
fileName: '01-front-end-development-certification/html5-and-css.json',
challengeSeed: [ '<h1>Hello</h1>' ],
challengeType: 0,
MDNlinks: undefined,
solutions: [],
releasedOn: undefined,
required: [],
blockId: 5807cf87d8438f138bf14304,
isLocked: false,
time: '5 hours' }@BerkeleyTrue, if you can shed some light on how I've followed it back as far as |
|
think of entities as a database of documents
{
"say-hello-to-css": { ... }
....
}Same with block {
"html-css": { ... },
...
}challenge.block is the dashedName of the block that challenge belongs to. to get the title of the block you need access to the block itself. To get the title of the block const block = entites.block[challenge.block]
const blockTitle = block.title; |
|
@Bouncey updated the pull request. |
|
The nice title like I am using |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/app/utils/challengeTitle.js
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
1 similar comment
|
@Bouncey updated the pull request. |
seed/index.js
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
seed/index.js
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
1 similar comment
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
1 similar comment
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
1 similar comment
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
2 similar comments
|
@Bouncey updated the pull request. |
|
@Bouncey updated the pull request. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
server/utils/blockNameify.js
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@Bouncey updated the pull request. |
|
I have refactored the I had to move PR has been rebased to clear merge conflicts |
|
@Bouncey updated the pull request. |
Pre-Submission Checklist
stagingbranch of FreeCodeCamp.fix/,feature/, ortranslate/(e.g.fix/signin-issue)npm run test-challenges. Usegit commit --amendto amend any fixes.Type of Change
Checklist:
Description
Re-opend under new branch name
Credit for the original idea goes to @andmckvr13