Commit Graph

80 Commits (1083f1d5c5a58a4b399f1af4842abd96443aff0b)

Author SHA1 Message Date
Naomi Carrigan fe71a9cf25
feat: new js cert (#45873)
* 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
2022-05-16 11:53:45 +02:00
Naomi Carrigan 0d749d7ff0
feat: enable RWD on i18n (#45587) 2022-04-25 19:00:27 +01:00
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
Sem Bauke 567e99231f
feat: add block description to mobile curriculum (#45370)
* feat: add block description to mobile curriculum

* feat: add superblock names
2022-03-22 19:11:44 +00:00
Oliver Eyton-Williams 8ee9b5761a
fix: use keys in curriculum.json (#45407)
* feat: add function to map from path to superblock

* fix: use superblocks as keys in curriculum.json

* fix: handle new superblock names

* fix: keep deleting relational-database
2022-03-10 20:41:33 +00:00
Oliver Eyton-Williams cacc4eacd7
fix: handle the sorting of transformed files (#44724)
* 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
2022-01-24 10:42:27 -08:00
Oliver Eyton-Williams 60258d40c9
fix: order import (again) (#44670)
* refactor: reenable import ordering

* refactor: require alphabetic ordered imports
2022-01-05 16:05:50 -06:00
Oliver Eyton-Williams ff566d441a
fix: rename superblock to use /2022/ (#44535)
* chore: update superblock properties

* refactor: remove isAudited from certs

It was always defaulting to English, anyway.

* refactor: get superblock from metas, not dirs

* fix: rename responsive-web-design-22

This converts the slugs to /2022/responsive-web-design

* refactor: remove unused export

* test: update test with new curriculum config

* refactor: use key not [key]

* refactor: remove directory reference from test
2021-12-21 12:35:51 -06: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
Oliver Eyton-Williams 1642c631de
refactor: drop superorder from metas (#44422)
* 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>
2021-12-14 08:16:23 -08:00
Oliver Eyton-Williams 9ad29e03d5
refactor: handle certs separately (#44434)
* refactor: split createChallenge into two functions

* refactor: remove certification metas

* fix: remove the metas I missed
2021-12-09 11:53:12 -08: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
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
Oliver Eyton-Williams e118dda13a
fix: order imports and remove circular dependencies (#41824)
* 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
2021-08-02 08:39:40 -05:00
Mrugesh Mohapatra a378bc6dd4
chore: rework the language audits for build (#42510)
This also reverts commit cd5c28b332.
2021-06-15 23:07:52 +05:30
Nicholas Carrigan (he/him) cd5c28b332
revert: disable portuguese (#42508)
* 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.
2021-06-15 21:32:29 +05:30
Oliver Eyton-Williams c6aa6ddbcd
fix: get showUpcomingChange from env.json (#42440) 2021-06-11 16:40:37 +02:00
renovate[bot] 21dd80c47a
chore(deps): update dependency prettier to v2.3.0 (#42074)
* chore(deps): update dependency prettier to v2.3.0

* chore: apply formating per prettier

* fix: correctly disable import/no-unresolved

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Mrugesh Mohapatra <hi@mrugesh.dev>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-05-10 08:48:49 -07:00
Oliver Eyton-Williams cbdf317aae
fix: suppress warning for seedless challenges (#41507)
Both challengeType 11 and challengeType 3 have no seeds, so there's no
need to warn about a lack of seed.

The warning has been updated to better reflect the problem (lack of
seed, not lack of comments)
2021-03-16 09:22:39 -06:00
Mrugesh Mohapatra b5f4754e2a
fix: re-revert the API decoupling (#41263)
* fix(api): decouple api from curriculum

This reverts commit 8f0e441644 and
introduces the implementations from #40703.

* fix(gitpod): add curriculum build to GitPod

This reverts commit 706d70f58d and
introduces implementations from #41234.

* docs: update DevOps manual for api change (#41259)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-02-25 12:02:35 -08:00
Mrugesh Mohapatra 8f0e441644 revert(api): decouple api from curriculum
This reverts commit c077ffe4b9
via PR #40703
2021-02-25 03:40:09 +05:30
Oliver Eyton-Williams f8699a8d55
refactor: simplify challenge.block usage (#41185) 2021-02-23 09:52:48 +05:30
Oliver Eyton-Williams c077ffe4b9
feat(api): decouple api from curriculum (#40703) 2021-02-22 12:23:59 +05:30
Oliver Eyton-Williams 97fcaa693f
refactor: only use dasherized superBlock (#41067) 2021-02-13 10:36:04 +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 73c06a5d71 refactor: tidy up translation-parser 2021-02-03 22:26:36 +05:30
Oliver Eyton-Williams 7640147a07
feat: curriculum dictionaries to objects (#40878)
* test: update to catch missing comments

* feat: convert dictionaries to JSON objects

* chore: update dictionaries

* fix: update tests for new dictionary objects

* fix: convert fixture to json

* fix: updated the incomplete dicts to new format
2021-02-02 12:14:29 -07:00
Oliver Eyton-Williams a3a678b7af chore: remove old parser 2021-02-02 09:51:02 +05:30
Oliver Eyton-Williams e3511f2930 chore: rename challenge-md-parser 2021-02-02 09:51:02 +05:30
Oliver Eyton-Williams 6abfcd8608 fix(curriculum): use js-yaml to parse certs 2021-02-02 09:51:02 +05:30
Randell Dawson 00a876d9b2
fix(learn): use json files for comments (#40844) 2021-01-31 21:36:57 +05:30
Oliver Eyton-Williams ac6fc605ad refactor: clean up supportLangs refs 2021-01-31 12:15:34 +05:30
Oliver Eyton-Williams 24d9c94fe5 refactor: remove confusing abstraction 2021-01-31 12:15:34 +05:30
Oliver Eyton-Williams 7c4e0ec41e refactor: abstract out walk in getChallenges 2021-01-31 12:15:33 +05:30
Tom 3978c6be28 feat: i18n user interface (#40306)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-01-31 12:15: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 1f65b3b7eb
fix: require project completion to claim certs (#40399)
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>

Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
2020-12-08 07:53:02 -08: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 92a60f8bce fix(tools): update translation parser
Since we're adding more validation we can simplify the parser and
make sure it does catch all the comments.  Rather than worry about a
load of edge cases that do not appear in our challenges.
2020-10-22 03:18:16 +05:30
Oliver Eyton-Williams 793fa8fb52 test: check replaced iff translatable comment
All translatable comments should be replaced, but nothing else.
2020-10-22 03:18:13 +05:30
Oliver Eyton-Williams d2ecd03013 fix: recreate comment map 2020-10-22 02:51:46 +05:30
Randell Dawson 2cae697f65 fix: change variables to match exported names 2020-10-22 02:51:45 +05:30
Randell Dawson 5eb33e36e1 fix(learn): add a comments dictionary 2020-10-22 02:51:45 +05:30
Oliver Eyton-Williams 1b895e7809 fix: translate title and dashName correctly 2020-10-06 23:10:08 +05:30
Oliver Eyton-Williams df532099bc
test: stop relying on curriculum dir structure
Also refactors path resolution a little
2020-09-29 22:09:02 +02:00
Oliver Eyton-Williams 9089ddca5c
fix: use location for language, not extension
Rather than relying on .lang.md this expects to find the English source
challenge in /curriculum/challenges/english/<translationPath>
2020-09-29 22:09:01 +02:00
Oliver Eyton-Williams 34f2c4ae32
refactor: acceptedLanguage -> supported 2020-09-29 22:08:59 +02:00