mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(client-plugins): default description, instructions, and seed to empty string (#56679)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
+1
@@ -4,6 +4,7 @@ title: Task 1
|
||||
challengeType: 19
|
||||
dashedName: task-1
|
||||
---
|
||||
|
||||
<!-- (Audio) Bob: Hey Lisa, do you have a minute? -->
|
||||
|
||||
# --instructions--
|
||||
|
||||
@@ -290,6 +290,10 @@ function generateChallengeCreator(lang, englishPath, i18nPath) {
|
||||
challenge.blockLayout = meta.blockLayout;
|
||||
challenge.hasEditableBoundaries = !!meta.hasEditableBoundaries;
|
||||
challenge.order = meta.order;
|
||||
|
||||
if (!challenge.description) challenge.description = '';
|
||||
if (!challenge.instructions) challenge.instructions = '';
|
||||
|
||||
// const superOrder = getSuperOrder(meta.superBlock);
|
||||
// NOTE: Use this version when a super block is in beta.
|
||||
const superOrder = getSuperOrder(meta.superBlock, {
|
||||
|
||||
@@ -7,27 +7,6 @@ function createChallengeNode(
|
||||
reporter,
|
||||
{ isReloading } = { isReloading: false }
|
||||
) {
|
||||
// challengeType 11 is for video challenges (they only have instructions)
|
||||
// challengeType 7 is for certificates (they only have tests)
|
||||
// challengeType 12 is for CodeAlly/CodeRoad challenge
|
||||
|
||||
// TODO: either handle empty descriptions inside Gatsby OR ensure that
|
||||
// description defaults to '' when creating challenges.
|
||||
// ditto for seeds and instructions.
|
||||
// create-md should, then, not create empty seed, description or instruction
|
||||
// sections.
|
||||
if (
|
||||
typeof challenge.description !== 'string' &&
|
||||
challenge.challengeType !== 11 &&
|
||||
challenge.challengeType !== 7 &&
|
||||
challenge.challengeType !== 12
|
||||
) {
|
||||
reporter.warn(`
|
||||
|
||||
${challenge.title} has a description that will break things!
|
||||
|
||||
`);
|
||||
}
|
||||
const contentDigest = crypto
|
||||
.createHash('md5')
|
||||
.update(JSON.stringify(challenge))
|
||||
|
||||
Reference in New Issue
Block a user