Skip to content

Commit cc24e4d

Browse files
authored
Merge pull request #80 from topcoder-platform/TCA-43_replace-repplit
TCA-43 Fix the preprod issues
2 parents 6468939 + 3593b78 commit cc24e4d

File tree

5 files changed

+1235
-16
lines changed

5 files changed

+1235
-16
lines changed

client/src/templates/Challenges/rechallenge/transformers.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,24 @@ export const embedFilesInHtml = async function (challengeFiles) {
211211
const style = contentDocument.createElement('style');
212212
style.classList.add('fcc-injected-styles');
213213
style.innerHTML = stylesCss?.contents;
214-
215-
link.parentNode.appendChild(style);
216-
217-
link.removeAttribute('href');
218-
link.dataset.href = 'styles.css';
214+
link.parentNode.replaceChild(style, link);
215+
} else if (stylesCss?.contents) {
216+
// automatic linking of style contents to html
217+
const style = contentDocument.createElement('style');
218+
style.classList.add('fcc-injected-styles');
219+
style.innerHTML = stylesCss?.contents;
220+
contentDocument.head.appendChild(style);
219221
}
220222
if (script) {
221-
script.innerHTML = scriptJs?.contents;
222-
script.removeAttribute('src');
223-
script.setAttribute('data-src', 'script.js');
223+
const newScript = contentDocument.createElement('script');
224+
newScript.innerHTML = scriptJs?.contents;
225+
script.parentNode.replaceChild(newScript, script);
226+
}
227+
if (indexJsx?.contents) {
228+
// automatic linking of jsx to html
229+
const newScript = contentDocument.createElement('script');
230+
newScript.innerHTML = indexJsx?.contents;
231+
contentDocument.head.appendChild(newScript);
224232
}
225233
return {
226234
contents: documentElement.innerHTML

client/src/templates/Challenges/redux/execute-challenge-saga.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function* buildChallengeData(challengeData, options) {
176176
}
177177
}
178178

179-
function* executeTests(testRunner, tests, testTimeout = 5000) {
179+
function* executeTests(testRunner, tests, testTimeout = 150000) {
180180
const testResults = [];
181181
for (let i = 0; i < tests.length; i++) {
182182
const { text, testString } = tests[i];

client/src/templates/Challenges/utils/worker-executor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class WorkerExecutor {
5757
}
5858
}
5959

60-
execute(data, timeout = 1000) {
60+
execute(data, timeout = 150000) {
6161
const task = eventify({});
6262
task._execute = function (getWorker) {
6363
getWorker().then(

curriculum/challenges/_meta/front-end-development-libraries-projects/meta.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@
44
"dashedName": "front-end-development-libraries-projects",
55
"order": 6,
66
"time": "150 hours",
7-
"template": "",
8-
"required": [],
7+
"template": "<body><div id='root'></div>${ source || '' }</body>",
8+
"required": [
9+
{
10+
"link": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css"
11+
},
12+
{
13+
"src": "https://code.jquery.com/jquery-3.6.0.min.js"
14+
},
15+
{
16+
"src": "https://unpkg.com/react@16.4.0/umd/react.production.min.js"
17+
},
18+
{
19+
"src": "https://unpkg.com/react-dom@16.4.0/umd/react-dom.production.min.js"
20+
},
21+
{
22+
"src": "https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.min.js"
23+
},
24+
{
25+
"src": "https://cdnjs.cloudflare.com/ajax/libs/react-redux/5.0.7/react-redux.min.js"
26+
}
27+
],
928
"superBlock": "front-end-development-libraries",
1029
"challengeOrder": [
1130
[

0 commit comments

Comments
 (0)