mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(client): show demo on demand in labs (#55569)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7b05b89d03
commit
b9893bb4d6
@@ -1,9 +1,6 @@
|
||||
const path = require('path');
|
||||
const { sortChallengeFiles } = require('../sort-challengefiles');
|
||||
const {
|
||||
challengeTypes,
|
||||
viewTypes
|
||||
} = require('../../../shared/config/challenge-types');
|
||||
const { viewTypes } = require('../../../shared/config/challenge-types');
|
||||
|
||||
const backend = path.resolve(
|
||||
__dirname,
|
||||
@@ -150,8 +147,7 @@ exports.createChallengePages = function (createPage) {
|
||||
// it during the curriculum build process and attach it to the first challenge?
|
||||
// That would remove the need to analyse allChallengeEdges.
|
||||
function getProjectPreviewConfig(challenge, allChallengeEdges) {
|
||||
const { block, challengeOrder, challengeType, usesMultifileEditor } =
|
||||
challenge;
|
||||
const { block } = challenge;
|
||||
|
||||
const challengesInBlock = allChallengeEdges
|
||||
.filter(({ node: { challenge } }) => challenge.block === block)
|
||||
@@ -169,15 +165,6 @@ function getProjectPreviewConfig(challenge, allChallengeEdges) {
|
||||
}));
|
||||
|
||||
return {
|
||||
showProjectPreview:
|
||||
challengeOrder === 0 &&
|
||||
usesMultifileEditor &&
|
||||
// TODO: handle the special cases better. Create a meta property for
|
||||
// showProjectPreview, maybe? Then we can remove all the following cases
|
||||
challengeType !== challengeTypes.multifileCertProject &&
|
||||
challengeType !== challengeTypes.multifilePythonCertProject &&
|
||||
challengeType !== challengeTypes.python &&
|
||||
challengeType !== challengeTypes.js,
|
||||
challengeData: {
|
||||
challengeType: lastChallenge.challengeType,
|
||||
challengeFiles: projectPreviewChallengeFiles
|
||||
|
||||
Reference in New Issue
Block a user