Commit Graph

46 Commits (c356ecfa29728686b6e959780461e73dd2a64148)

Author SHA1 Message Date
Oliver Eyton-Williams 4cc20172c5
fix: fallback to english challenges (#45635)
* 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
2022-04-15 09:17:49 -05:00
Oliver Eyton-Williams b223cdd255
refactor: display solutions (#45139)
* refactor: re-organise show-project-links

* refactor: update ChallengeFile's declared shape

* fix: handle missing challenge solution

* refactor: use display function for Certification

* refactor: use display function for TimeLine

* refactor: use common component for timeline + cert

* fix: handle legacy solutions

* refactor: use widget for certifications

* refactor: reorganise ShowDisplayWidget

* refactor: remove unused ids

* test: pass dataCy, not projectTitle, to widget

* chore: kebabify

* revert: add id back for dropdown

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* revert: add the ids back

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2022-02-16 13:48:22 -08:00
Tom 57cf47dad4
feat: split rdbms into individual blocks and two challengeTypes (#44978)
* feat: split english rdbms into individual blocks

fix: stuff

fix: remove from partiallyComplete array on submit

fix: add suggestion

Update client/i18n/locales/english/translations.json

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

Update client/i18n/locales/english/intro.json

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

Update client/i18n/locales/english/intro.json

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

Update client/i18n/locales/english/intro.json

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

Update client/src/templates/Challenges/codeally/show.tsx

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

* fix: prettier

* fix: style suggestion

* Apply suggestions from code review

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

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-02-11 15:39:27 +00:00
Tom b061a760c1
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>
2022-01-06 13:26:54 +00:00
Oliver Eyton-Williams 36363f277d
test: enable tests for steps (#44550)
* 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>
2021-12-22 12:18:06 -08:00
Nicholas Carrigan (he/him) 8614db7a32
feat: enable new curriculum (#44183)
* feat: use legacy flag

chore: reorder challenges

fix: linter

revert: server change

feat: unblock new editor

fix: proper order

fix: 0-based order

fix: broke the order

feat: move tribute certification to its own block

feat: split the old projects block into 4

fix: put all blocks in order

chore: add intro text

refactor: use block, not blockName in query

fix: project progress indicator

* fix: reorder new challenges/certs

* fix: reorder legacy challenges

* fix: reintroduce legacy certs

* feat: add showNewCurriculum flag to env

* chore: forgot sample.env

* feat: use feature flag for display

* fix: rename meta + dirs to match new blocks

* fix: add new blocks to help-category-map

* fix: update completion-modal for new GQL schema

* test: duplicate title/id errors ->  warnings

* fix: update completion-modal to new GQL schema Mk2

* chore: re-order metas (again)

* fix: revert super-block-intro changes

The intro needs to show both legacy and new content.  We need to decide
which pages are created, rather than than what a page shows when
rendered.

* feat: move upcoming curriculum into own superblock

* fix: handle one certification with two superBlocks

* fix: remove duplicated intros

* fix: remove duplicate projects from /settings

* fix: drop 'two' from Responsive Web Design Two

* chore: rename slug suffix from two to v2

* feat: control display of new curriculum

* feat: control project paths shown on /settings

* fix: use new project order for /settings

This does mean that /settings will change before the release, but I
don't think it's serious.  All the projects are there, just not in the
legacy order.

* fix: claim/show cert button

* chore: remove isLegacy

Since we have legacy superblocks, we don't currently need individual
blocks to be legacy

* test: fix utils.test

* fix: verifyCanClaim needs certification

If Shaun removes the cert claim cards, maybe we can remove this entirely

* fix: add hasEditableBoundaries flags where needed

* chore: remove isUpcomingChange

* chore: v2 -> 22

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-12-20 12:36:31 -06:00
Tom 580a51f7a7
fix: simplify mobile layout tabs (#44431)
* fix: simplify mobile layout tabs

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


Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-12-15 13:52:44 +00:00
Tom 1c5d136add
feat(client): add notes tab to project based curriculum (#44247)
* feat: add notes tab to project based curriculum

* feat: add console key to i18n

* feat: add reset to i18n

* fix: use translations in action-row

* fix: use hasEditableBoundaries as check for when to display instructions/editor-tabs

* fix: clean up notes components and use prism formatting

* feat: add notes to docs/how-to-work-on-challenges

* revert: unused code

* fix: lint errors?

* fix: lint errors

* fix: add notes to graphql schema

* fix: add notes to challenge schema

* fix: only display notes on project based

* fix: add env data back to mobile layout

* fix: prettify

* revert: notes

* fix: hide notes on mobile for non project based

* rename: switchDisplayTab -> togglePane

* revert: hasEditableBoundaries check back to projectBasedChallenge check
2021-12-09 18:42:03 +00:00
Oliver Eyton-Williams 22afdd1aad
fix: stop modal appearing in steps (#43728)
* fix: stop showing completion modal on steps

* feat: submit steps with ctrl+enter

* fix: handle ctrl+enter when not focussing editor

* fix: reset tests when user types

* refactor: pass showCompletionModal as an option

Otherwise we have to write executeChallenge(true) which does not mean
what you might reasonably expect.

* fix: always executeChallenge when not on step

* fix: update frontend project show

* fix: handle missing payload

* refactor: isProjectStep -> hasEditableRegion

* refactor: more renaming

* fix: make meta.json control multifile editor use

* fix: update the challengeSchema correctly

* Update client/src/templates/Challenges/classic/editor.tsx

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* fix: remove logging

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-10-13 14:47:59 +03:00
Oliver Eyton-Williams 2b6bef08ae
feat: localize videos (#42869)
* refactor: separate out VideoPlayer component

* feat: support bilibili videos

* feat(client): allow localized videos to be shown

* fix: remove add subtitles CTA

* feat: add locale ids for Why Program?
2021-09-27 12:26:38 +03:00
Shaun Hamilton 59f17f237b
refactor: files{} -> challengeFiles[], and key -> fileKey (#43023)
* 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>
2021-08-12 20:48:28 +02:00
awu43 dd5d2919be
feat(client): ts-migrate client/utils/** (#42823)
* rename js files

* update imports and references

* migrate build-challenges

* migrate challenge-types

* migrate utils/index

* migrate state-management

* install @types/psl for tags

* migrate tags

* migrate tags.test

* migrate challenge-page-creator

* migrate utils/gatsby/index

* migrate layout-selector

* migrate layout-selector.test

* revert challenge-types

Curriculum can't handle TS or modules

* convert arrow functions

* revert build-challenges

* revert utils/gatsby/index

* revert challenge-page-creator

* revert challenge-types reference

* Delete state-management

Deleted in #42960

* Disable render-result-naming-convention (for now)

* update layout-selector.test comment

* reorder imports in build-challenges

* change ts-ignore to ts-expect-error
2021-08-09 10:30:31 +02:00
Tom 067761f2f6
feat(curriculum): add relational databases cert as upcoming change (#41658) 2021-06-15 16:37:13 +01:00
Oliver Eyton-Williams 1fde5897fc
fix(curriculum): remove helpRoom and fileName (#42268)
* fix(curriculum): remove helpRoom and fileName

Neither are used any more.

* fix: remove fileName form cert meta.jsons
2021-06-04 00:15:01 +05:30
Oliver Eyton-Williams be19823422 chore(deps): update joi and joi-objectid 2021-05-05 18:12:50 +05:30
Evgeny Klimenchenko db369fbed1
fix(client): remove JS comments from user code for tests (#41873)
* 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
2021-04-28 10:18:54 -05:00
Oliver Eyton-Williams 6b63da3996
fix(client): get translationPending in video chals (#41567) 2021-03-25 11:24:17 +05:30
Oliver Eyton-Williams 0d3158d4f4
fix(tests): add validation of comment translations (#41537) 2021-03-20 11:59:13 +05:30
Mrugesh Mohapatra 6c91f81b0e chore(deps): upgrade eslint, prettier & related packages 2021-03-11 12:19:42 +05:30
Oliver Eyton-Williams f8699a8d55
refactor: simplify challenge.block usage (#41185) 2021-02-23 09:52:48 +05:30
Oliver Eyton-Williams 6c1f6bebed
feat: label un-audited challenges (#41002)
Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Mrugesh Mohapatra <me@raisedadead.com>
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2021-02-11 18:10:32 +05:30
Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00
Oliver Eyton-Williams 0bd52f8bd1
Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
2020-11-27 10:02:05 -08:00
Oliver Eyton-Williams e4a9b2988c
feat: update Ask for help (#40114)
* 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>
2020-10-30 14:10:34 -05:00
Oliver Eyton-Williams 1b895e7809 fix: translate title and dashName correctly 2020-10-06 23:10:08 +05:30
Sky020 a86b220eb7 chore: remove isRequired from curriculum files 2020-09-21 20:51:46 +05:30
Oliver Eyton-Williams 0f3f27287d fix: unify single and multifile testing 2020-09-16 11:54:08 +05:30
Oliver Eyton-Williams 301212e194 feat: handle multi-file solutions 2020-09-16 11:54:06 +05:30
Oliver Eyton-Williams 3783ef118e fix(multi): validate challenges correctly 2020-09-16 11:54:05 +05:30
Oliver Eyton-Williams f77005cc43 fix: accept numbers for boundaries (#39181) 2020-09-16 11:54:02 +05:30
Randell Dawson 8478e021bf feat (learn): Remove editable regions from seed code before displaying user's code (#39153)
* feat: pull editable region from markdown

* test: update seed tests to reflect new schema

* feat(curriculum): validate multi-file solutions

* test: add editableRegionBoundaries to schema

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2020-09-16 11:54:02 +05:30
Oliver Eyton-Williams bd68b70f3d
Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00
Oliver Eyton-Williams 2a82c068d3 fix: relax schema while auditing translations
Without this change we would have to put in dummy localeTitle values.
This defeats the point of making it required.
2020-08-16 04:45:19 +05:30
moT01 ad8daeb851 fix: add video ids and better test for video id 2020-05-27 13:19:11 +05:30
Tom 379f6f89ca fix(learn): tests for python video lessons (#38600)
* fix: improve tests for video challenges

* fix: remove unused challenges + get rid of no description warning

* fix: remove non-existent challenges from meta
2020-05-27 13:19:11 +05:30
Tom 63fe67e53f feat: add video lessons to db on submit + update UI (#38591)
* feat: add video lessons to db on submit + update UI

* feat: delete CompletionVideoModal

* feat: clean up component + add comments

* feat: remove comment

* feat: remove log

* feat: remove log

* fix: update buttons + fix some testing

* fix: remove unused selector
2020-05-27 13:19:10 +05:30
Beau Carnes e776529ed0 feat(learn): add python video challenges (#38424) 2020-05-27 13:19:09 +05:30
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30
Oliver Eyton-Williams 68aef571ee feat: hide isHidden challenges 2020-05-25 16:25:19 +05:30
Mrugesh Mohapatra 31f337f2bd fix(tools): update challege formatting check 2019-08-05 22:14:37 +05:30
Valeriy S 6d5e3865e7 fix(client): return an empty string for empty sections 2019-03-04 08:56:11 +00:00
Valeriy 81f9dce834 test(curriculum): challenge schema validator for lang 2019-01-10 12:54:59 +00:00
Valeriy 36fa426149 fix: test curriculum 2018-11-28 15:19:38 +00:00
Valeriy 65094d13e4 test(curriculum): add localeTitle to the challenge schema (#31598) 2018-10-30 21:18:54 +05:30
Valeriy e099d6486d fix: test curriculum challenges (#24180) 2018-10-23 18:51:53 +05:30
Mrugesh Mohapatra 67929d80ff chore: preparing for the move 2018-09-27 12:36:41 +05:30