* 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
* chore: move files
* wip: i have no idea what i am doing
* feat: finish up the logic
* chore: use order from randy sheet
* chore: standardise titles
* feat: fix layout for new js projects
* fix: utils test
* fix: challenge tests
* fix: ignore show new curriculum on non-english tests
* chore: help category????
* fix: if these tests would fail locally that'd be great
* chore: duplicate ids
* fix: fallback to english challenges
All challenges will use the english version if a translated file is not
available. SHOW_NEW_CURRICULUM still gates what's shown in the client.
* refactor: use closures to simplify createChallenge
* refactor: remove messy destructure
* refactor: add meta via helper
* fix: fallback to [] for meta.required
* fix: repair challenge.block
* refactor: use CONST_CASE for meta + challenge dirs
* fix: catch empty superblocks immediately
* fix: clean up path.resolves
* fix: invalid syntax in JS project steps
* fix: default to english comments and relax tests
Instead of always throwing errors when a comment is not translated, the
tests now warn while SHOW_UPCOMING_CHANGES is true, so that tests will
pass while we're developing and allow translators time to work.
They still throw when SHOW_UPCOMING_CHANGES is false to catch issues
in production
* test: update createCommentMap test
* refactor: delete stale comment
* refactor: clarify validate with explanatory consts
* feat: throw if audited cert falls back to english
* fix: stop testing upcoming localized curriculum
* feat: make all sources available in tests
The original contents of all files (index.html, script.js etc.) will be
accessible in tests. For example __sources['index.html'] gets the
original html file and nothing else.
* feat: use __file to get user code
* fix: handle the sorting of transformed files
We can't use the ext property, since that is transformed, but the
history is maintained.
* test: make solutions polyVinyls for sorting
* refactor: inline prepareChallenge
* refactor: make solutions polys in getChallenges
* fix: convert each solution to a poly
* fix: skip empty solutions
* fix: get challenge file history in client
* refactor: stop calling isPoly from the client
* fix: remove debug console.log
* refactor: remove unnecessary sorting step
* fix: use an iframe to preserve head and body
* fix: remove unnecessary parsing of html
The contents gets inserted into the DOM during transformHtml, which
is always part of the build pipeline
* fix: pipe contents through iframe
* refactor: use the same code for both transforms
* fix: try to handle test errors better
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
* fix: ensures jquery exists for those challenges
For tests frame-runner.js imports jquery, but jquery challenges always
need it
* Revert "Revert "fix: only include frame-runner when running tests (#44337)" (#44419)"
This reverts commit c19bf504b8.
* fix: handle missing solutions correctly
Rather than creating an [[]] the parser now creates [] which isEmpty().
This makes the test suite check the next challenge for a solution.
In addition, the logic for testing solutions was fixed.
* chore: update snapshots
* test: build new superblock in node.js-tests CI
* test: allow forward slash in superblock slug
* fix: borked tests oops
* test: ignore duplicated projects
* fix: i did not break these shaun did :)
* fix: idIndex is index of id not id
Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
* refactor: use enum
* feat: create links between legacy and new
* refactor: pull out legacy-links component
* fix: import order
* fix: provide icon for new superblock
* feat: only show the copy on the new superblock
* fix: use the proper i18n keys correctly
* feat: put the new superblock at the end of the map
* feat: update the new superblock title
* test: update for soft launch order
* fix: show original project links on /settings
Soft launch only.
* test: use SHOW_NEW_CURRICULUM in tests
* fix: rename the remaining rwd-22s
* feat: make the messge prettier
* fix: message copy
* refactor: make comment make sense
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
* refactor: create superOrder from superblock
* chore: drop superOrders from meta
* fix: return null for 'certifications'
* fix: only set superOrder if it is needed
* fix(tests): remove filter from order tests
* test: use getSuperOrder, since superOrder has gone
* test: ignore certificates
* fix: getSuperOrder throw for 'certifications'
* test: remove certificate special case
It wasn't necessary, anyway (it had never been working because I put
certificate not certification)
Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
* chore(tools): test curriculum order
* chore: update orders
* fix(tests): temporarily ignore cert super
The Relational Databases cert being 'upcomingChanges' is breaking
the tests.
* fix: graphql query here
* fix: use only one meta
* chore: remove unnecessary superOrders
* chore: zero-based indexing
* fix: update mock
* refactor: remove unused fixture
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix: replace index with script/styles as needed
* fix: remove redundant fileKey
It's overwritten by createPoly, so the parser does not need to create it
* fix: curriculum test suite
* Update client/src/templates/Challenges/classic/MultifileEditor.js
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* feat: dispatch resetChallenge action
* fix: copy challengeFiles instead of in-place sort
* fix: handle null updateFile payloads in redux
* refactor: reorganise region initialization
* refactor: pull code into editorDidMount
Then we can rely on the presence of the editor and monaco and don't have
litter the code with null checks.
* refactor: use better name for editable region init
* refactor: remove unused decoration
* refactor: rename forbidden region init functions
* fix: keep all challengeFiles when resetting
* refactor: remove unused decoration class
* fix: reinitialize editor on reset
* fix: stop adding multiple scroll listeners
Since the challengeFile update on each keystroke extra (unnecessary)
adding of listeners slowed the editor to a crawl.
* fix: only scroll to editor on mount
Rather than on any edit.
* refactor: remove logs and comments
* fix: rename toSortedArray and fix broken test
* fix: check for null not falsy in updateFile
* fix: only update project features when project
* fix: only reset if editor contents have changed
* feat: focus on editor after reset
* fix(client): fix client
* fix propType and add comment
* revert user.json prettification
* slight type refactor and payload correction
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* update ChallengeFile type imports
* add cypress test for code-storage
* update test and storage epic
* fix Shaun's tired brain's logic
* refactor with suggestions
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* update codeReset
* increate cypress timeout because firefox is slow
* remove unused import to make linter happy
* use focus on editor
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* use more specific seletor for cypress editor test
* account for silly null challengeFiles
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix: remove circular dependency
redux depended on templates/Challenges/redux and vice versa. This
meant that import order mattered and confusing bugs could arise.
(cherry picked from commit 7d67a4e70922bbb3051f2f9982dcc69e240d43dc)
* feat: require imports to be in alphabetical order
Import order generally does not matter, but there are edge cases
(circular imports and css imports, for example) where changing order
changes behaviour
(cherry picked from commit b8d1393a91ec6e068caf8e8498a5c95df68c2b2c)
* chore: order imports
* fix: lift up challenge description + title comps
This brings the classic Show closer to the others as they
now all create the description and title components
* fix: remove donation-saga/index circular import
(cherry picked from commit 51a44ca668a700786d2744feffeae4fdba5fd207)
* refactor: extract action-types from settings
(cherry picked from commit 25e26124d691c84a0d0827d41dafb761c686fadd)
* fix: lint errors
* feat: prevent useless renames
* revert: disable portuguese
First certification is not 100% yet. Shipped too soon. :(
* feat: enable portuguese curriculum
Curriculum can build in portuguese, leaving client disabled to
prevent language from appearing in nav bar.
* feat: move audited cert list
Moves the audited cert list to the config, instead of the utils.
* fix: restrict removeJSComments to test-evaluator
To prevent @babel from being included everywhere, this only calls
removeJSComments inside the test-evaluator
* test: add removeJSComments test
* Removes comments in js challanges by default
* fix local-scope-and-functions test regex
* fix all languages
* revert language changes
* removed unnecessary removeJSComments from challenges
* fix challanges in other languages
* removed removeJSComments from all challanges
* feat: get helpCategory from frontmatter
* DEBUG: sets all the projects to JavaScript
This is just so the tests pass, it'll need to go.
* fix: updated helpCategoryMap categories
* fix: added Python to helpCategory frontmatter key
Co-authored-by: Randell Dawson <rdawson@onepathtech.com>
* feat: __testEditable allows editable region tests
It's not entirely isolated, but it makes it possible to select only the
element with id 'editable-only' which is built solely from code inside
the editable region.
* fix(client): missing editableContents -> ''
Previously it was added as the string 'undefined'
* fix: more informative error messages
* fix: DRY, correct and test getLines