feat: add framework for rwd cert projects (#44505)

* feat: add rwd cert projects

feat: save projects with flag

revert: not needed things

revert: empty line

revert: empty line

fix: it

fix: remove log

* fix: snapshot tests

* fix: show bread crumbs by default

* revert: snapshot fix

* Update curriculum/challenges/_meta/responsive-web-design-projects/meta.json

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* fix: manuallyApproved -> isManuallyApproved

* fix: add review suggestions

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Tom
2022-01-06 07:26:54 -06:00
committed by GitHub
parent ff09b2ee43
commit b061a760c1
12 changed files with 96 additions and 33 deletions

View File

@@ -72,7 +72,8 @@ const buildFunctions = {
[challengeTypes.modern]: buildDOMChallenge,
[challengeTypes.backend]: buildBackendChallenge,
[challengeTypes.backEndProject]: buildBackendChallenge,
[challengeTypes.pythonProject]: buildBackendChallenge
[challengeTypes.pythonProject]: buildBackendChallenge,
[challengeTypes.multiFileCertProject]: buildDOMChallenge
};
export function canBuildChallenge(challengeData) {
@@ -93,7 +94,8 @@ const testRunners = {
[challengeTypes.js]: getJSTestRunner,
[challengeTypes.html]: getDOMTestRunner,
[challengeTypes.backend]: getDOMTestRunner,
[challengeTypes.pythonProject]: getDOMTestRunner
[challengeTypes.pythonProject]: getDOMTestRunner,
[challengeTypes.multiFileCertProject]: getDOMTestRunner
};
export function getTestRunner(buildData, runnerConfig, document) {
const { challengeType } = buildData;
@@ -146,7 +148,11 @@ export function buildDOMChallenge({
.then(checkFilesErrors)
.then(challengeFiles => ({
challengeType: challengeTypes.html,
build: concatHtml({ required: finalRequires, template, challengeFiles }),
build: concatHtml({
required: finalRequires,
template,
challengeFiles
}),
sources: buildSourceMap(challengeFiles),
loadEnzyme
}));
@@ -184,7 +190,10 @@ export function buildBackendChallenge({ url }) {
}
export function updatePreview(buildData, document, proxyLogger) {
if (buildData.challengeType === challengeTypes.html) {
if (
buildData.challengeType === challengeTypes.html ||
buildData.challengeType === challengeTypes.multiFileCertProject
) {
createMainPreviewFramer(document, proxyLogger)(buildData);
} else {
throw new Error(
@@ -194,7 +203,10 @@ export function updatePreview(buildData, document, proxyLogger) {
}
export function updateProjectPreview(buildData, document) {
if (buildData.challengeType === challengeTypes.html) {
if (
buildData.challengeType === challengeTypes.html ||
buildData.challengeType === challengeTypes.multiFileCertProject
) {
createProjectPreviewFramer(document)(buildData);
} else {
throw new Error(
@@ -206,7 +218,8 @@ export function updateProjectPreview(buildData, document) {
export function challengeHasPreview({ challengeType }) {
return (
challengeType === challengeTypes.html ||
challengeType === challengeTypes.modern
challengeType === challengeTypes.modern ||
challengeType === challengeTypes.multiFileCertProject
);
}