From f61b22766595a3030bf758bf9de0d181f16b37e1 Mon Sep 17 00:00:00 2001 From: Ilenia Date: Mon, 11 Jul 2022 14:28:29 +0200 Subject: [PATCH] chore: rename project type from bonfire to jsProject (#46823) * change bonfire in index.js * change bonfire in build.js * change bonfire in challenge-types.js * change bonfire in test-challenges.js * add jsProject to constants.js --- client/src/templates/Challenges/redux/index.js | 2 +- client/src/templates/Challenges/utils/build.js | 4 ++-- client/utils/challenge-types.js | 10 +++++----- config/constants.js | 2 ++ curriculum/test/test-challenges.js | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/src/templates/Challenges/redux/index.js b/client/src/templates/Challenges/redux/index.js index 76bc059588c..7180f9b94d2 100644 --- a/client/src/templates/Challenges/redux/index.js +++ b/client/src/templates/Challenges/redux/index.js @@ -160,7 +160,7 @@ export const challengeDataSelector = state => { let challengeData = { challengeType }; if ( challengeType === challengeTypes.js || - challengeType === challengeTypes.bonfire + challengeType === challengeTypes.jsProject ) { challengeData = { ...challengeData, diff --git a/client/src/templates/Challenges/utils/build.js b/client/src/templates/Challenges/utils/build.js index 23a596fbf21..d9105cb1508 100644 --- a/client/src/templates/Challenges/utils/build.js +++ b/client/src/templates/Challenges/utils/build.js @@ -66,7 +66,7 @@ function checkFilesErrors(challengeFiles) { const buildFunctions = { [challengeTypes.js]: buildJSChallenge, - [challengeTypes.bonfire]: buildJSChallenge, + [challengeTypes.jsProject]: buildJSChallenge, [challengeTypes.html]: buildDOMChallenge, [challengeTypes.modern]: buildDOMChallenge, [challengeTypes.backend]: buildBackendChallenge, @@ -237,7 +237,7 @@ export function challengeHasPreview({ challengeType }) { export function isJavaScriptChallenge({ challengeType }) { return ( challengeType === challengeTypes.js || - challengeType === challengeTypes.bonfire + challengeType === challengeTypes.jsProject ); } diff --git a/client/utils/challenge-types.js b/client/utils/challenge-types.js index 2ad68fcddcb..1a3b2f51227 100644 --- a/client/utils/challenge-types.js +++ b/client/utils/challenge-types.js @@ -4,7 +4,7 @@ const backend = 2; const zipline = 3; const frontEndProject = 3; const backEndProject = 4; -const bonfire = 5; +const jsProject = 5; const modern = 6; const step = 7; const quiz = 8; @@ -30,7 +30,7 @@ exports.challengeTypes = { frontEndProject, backEndProject, pythonProject, - bonfire, + jsProject, modern, step, quiz, @@ -57,13 +57,13 @@ exports.isProject = challengeType => { exports.pathsMap = { [html]: 'html', [js]: 'js', - [bonfire]: 'js' + [jsProject]: 'js' }; // determine the component to view for each challenge exports.viewTypes = { [html]: 'classic', [js]: 'classic', - [bonfire]: 'classic', + [jsProject]: 'classic', [frontEndProject]: 'frontend', [backEndProject]: 'backend', [pythonProject]: 'frontend', @@ -81,7 +81,7 @@ exports.viewTypes = { exports.submitTypes = { [html]: 'tests', [js]: 'tests', - [bonfire]: 'tests', + [jsProject]: 'tests', // requires just a single url // like codepen.com/my-project [frontEndProject]: 'project.frontEnd', diff --git a/config/constants.js b/config/constants.js index 6c5a8206db0..0be3bf20b3f 100644 --- a/config/constants.js +++ b/config/constants.js @@ -60,6 +60,7 @@ let blocklist = [ 'completed-bonfire', 'completed-challenge', 'completed-field-guide', + 'completed-jsProject', 'completed-zipline-or-basejump', 'copyright-policy', 'copyright', @@ -79,6 +80,7 @@ let blocklist = [ 'internal', 'jobs-form', 'jobs', + 'jsProject', 'learn-to-code', 'learn', 'login', diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js index ecb2da4bf9c..50a5e578fdb 100644 --- a/curriculum/test/test-challenges.js +++ b/curriculum/test/test-challenges.js @@ -435,7 +435,7 @@ ${inspect(commentMap)} if ( challengeType !== challengeTypes.html && challengeType !== challengeTypes.js && - challengeType !== challengeTypes.bonfire && + challengeType !== challengeTypes.jsProject && challengeType !== challengeTypes.modern && challengeType !== challengeTypes.backend ) { @@ -464,7 +464,7 @@ ${inspect(commentMap)} const buildChallenge = challengeType === challengeTypes.js || - challengeType === challengeTypes.bonfire + challengeType === challengeTypes.jsProject ? buildJSChallenge : buildDOMChallenge;