100 Commits
Author SHA1 Message Date
Oliver Eyton-WilliamsandGitHub 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-WilliamsandGitHub 1d87c3c4f2 fix: handle missing sound saga payloads (#45645) 2022-04-08 18:57:57 +01:00
Oliver Eyton-WilliamsandGitHub 07cfc8b83b fix: only test mobile curriculum on english (#45558) 2022-03-28 12:55:15 -07:00
Oliver Eyton-WilliamsandGitHub 47f0914de4 fix: lint sequentially to catch errors (#45441) 2022-03-16 13:52:12 +01:00
Oliver Eyton-WilliamsandGitHub 1e63f38c53 refactor: clean up tags tests (#45411)
I also added a note about why it's flaky, since I haven't been able to
fix the flakiness
2022-03-11 20:54:47 +05:30
Oliver Eyton-WilliamsandGitHub 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-WilliamsandGitHub f485bc1c16 chore: update CI tests (#45401)
* chore: echo npm version in CI (as debugging info)

* chore: remove redundant alterations to .env

sample.env already has SHOW_NEW_CURRICULUM=true
2022-03-10 10:09:06 -08:00
Oliver Eyton-WilliamsandGitHub 108d2460e7 fix(tools): use correct superblock paths (#45285)
* fix: use array of choices

* fix: capture traces from fs promise errors

* fix: use helper to get superblock subpath
2022-03-07 10:51:33 +05:30
c11bd163b2 feat: display multifile projects (#45220)
* refactor: DRY up certification and ProjectModal

* fix: use sensible keys for SolutionViewer

* refactor: handle legacy solutions like new ones

* refactor: correct CompletedChallenge type

* fix: store challengeType for multifile projects

* fix: use challengeType to set display type

* feat: use dropdown to display project + code

* refactor: isOpen -> showCode to avoid a clash

We need to be able both show the code and show the completed project

* refactor: remove redundant parts of projectPreview

* refactor: fix project preview types

* feat: wip, using existing modal to show project

* feat: show projects on timeline

* feat: display projects on time-line

* chore: use consistent case for GitHub

* fix(a11y): translate show solution/view

* refactor: rename showFilesSolution

* refactor: use self-closing tag

* fix: remove hardcoding (certification + timeline)

* fix: remove hardcoding (settings)

* test: supply store and mock ga

* fix: include challengeType for projects

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* refactor: remove space

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* fix: key -> filekey on challenge submission

* fix: handle submissions without files

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2022-03-02 19:49:54 -06:00
Oliver Eyton-WilliamsandGitHub 339c6713d2 feat: update challenge helpers to handle id filenames (#44769)
* refactor: light tweaks for readability

* refactor: simplify metadata functions

* fix: most tests

* test: fix utils tests

* test: simplify mocks

* WIP: update get-last-step-file-content

* feat: finish create-next-step

* fix: type error

* test: provide mock meta.json for test

* refactor: get meta path from project path

* refactor: get project name from path

* refactor: simplify getProjectMetaPath further

Also removes some excessive mocking

* refactor: remove more mocks, always clear .env

* feat: update create-next-step

* feat: update create-empty steps

Also refactors slightly, so it's easier to insert steps into the meta

* docs: update challenge-helper-script docs

* feat: create-step-between

* refactor: allow metadata parse errors to propagate

* fix: convert reorderSteps to renameSteps

* refactor: create-step-between -> insert-step

* feat: update delete-step

* refactor: consolidate commands into commands.ts

* refactor: clean up and consolidation

* refactor: more cleanup

* fix: make cli args consistent

Everything accepts a single integer and nothing else

* refactor: renameSteps -> updateStepTitles

* docs: update with the names and args

* feat: add step validating meta + files are synced
2022-03-02 07:12:20 -08:00
Oliver Eyton-WilliamsandGitHub c2105c17f3 fix(docker): save image size by dropping root deps (#45253) 2022-02-25 09:30:35 -08:00
Oliver Eyton-WilliamsandGitHub ce23dcb32c fix: return 410 for api/github (#45250) 2022-02-25 10:38:29 +01:00
Oliver Eyton-WilliamsandGitHub d501817207 chore(api): remove d3 (#45248) 2022-02-25 10:36:36 +01:00
Oliver Eyton-WilliamsandGitHub bc7cdf6c33 chore: remove unused api endpoints (#45085)
* chore: remove /refetch-user-completed-challenges

* chore: remove /update-my-theme

Theme changes are handled by /update-user-flag

I left 'update-my-theme' in the blocklist to allow for future use.

* chore: remove /certificate/verify-can-claim-cert

The client has not been using this for several weeks

* feat: return 410 for redundant endpoints

* chore: order endpoints
2022-02-24 21:11:24 -06:00
Oliver Eyton-WilliamsandGitHub 87f3d320ce refactor(client): explain transform's signature (#45166)
It's important to not pass frame to transform when using
transformWithFrame. Instead we need to pass either frame.contentDocument
or frame.contentDocument.documentElement
2022-02-18 23:02:40 +00:00
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
Oliver Eyton-WilliamsandGitHub cde1407f58 feat(client): make all sources available in tests (#44725)
* 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
2022-02-15 23:29:31 +05:30
Oliver Eyton-WilliamsandGitHub 604e29c4bc chore: remove broken endpoints (#45086)
These still exist, technically, but there's no render engine so they all
generate errors instead of pages
2022-02-11 12:44:07 -08:00
Oliver Eyton-WilliamsandGitHub 7fe4695794 refactor: ignore eslint less (#45082)
* refactor: remove and fix some eslint disables

* refactor: drop max-line disables
2022-02-11 10:28:13 -08:00
Oliver Eyton-WilliamsandGitHub 5f06b7805c test: titles in project previews (#45051)
* fix: trim titles before injecting into iframes

Surrounding whitespace isn't useful

* test: check preview iframe has correct title
2022-02-11 00:57:50 +07:00
Oliver Eyton-WilliamsandGitHub 44e2bce920 refactor: clean up ref types (#45070)
The react-hotkeys innerRef type is incorrect (it accepts both callback
and object refs), but the lib is unmaintained at this point.
2022-02-10 11:31:55 -06:00
Oliver Eyton-WilliamsandGitHub c541baf179 fix(client): update invalid stored code (#44437)
* fix: repair invalid stored code
2022-02-01 10:09:08 -06:00
Oliver Eyton-WilliamsandGitHub fff1d833b9 fix: prevent scroll jumping on /settings (#44937) 2022-01-28 09:02:07 +01:00
Oliver Eyton-WilliamsandGitHub f63a650c01 fix: show-cert... Cypress tests (#44911)
* fix: scroll to certification section

* test: refactor and update show-cert

Pulls out the flaky code from the before hook (where a single failure
kills the suite) into the test.  Also, the visit to settings to view the
certification only needed to happen once.
2022-01-25 14:23:01 -06:00
Oliver Eyton-WilliamsandGitHub 7216ca55cc refactor: organise TypeScript config and migrate helpers (#44747)
* feat: allow more 1000 steps to be created at once

* refactor: start migrating to typescript

* refactor: delete-step to ts

* refactor: migrated some helpers

* refactor: migrate create-empty-steps

* refactor: migrate create-step-between

* refactor: finish migrating to TS

* refactor: migrate tests

* fix: ensure mock.restore is done after each test

* fix: prevent double-tscing

* fix: repair the tests

* chore: use ts-node for scripts

We don't need the performance boost of incremental compilation and
ts-node is easier to work with

* refactor: consolidate tsconfigs

* refactor: replace gulp

* fix: use ts-node for build-curriculum

* fix: allow ts compilation of config

* feat: create and use create:config script

* fix: add /config to eslint projects

* fix: remove gulp script
2022-01-25 11:34:16 +01:00
Oliver Eyton-WilliamsandGitHub 7f027958af chore: migrate to nanoid 3 (#44893) 2022-01-25 11:09:41 +05:30
Oliver Eyton-WilliamsandGitHub 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
b1fb6adc39 fix: insert user html more consistently (#42195)
* 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>
2022-01-24 18:02:25 +00:00
Oliver Eyton-WilliamsandGitHub 128effe7c0 chore: install tailwindcss in workspace (#44847) 2022-01-20 08:25:24 -08:00
Oliver Eyton-WilliamsandGitHub f88473f994 fix(client): handle missing document in preview frame (#44833) 2022-01-20 13:22:25 +00:00
Oliver Eyton-WilliamsandGitHub d091bd3b8f fix: make sure a11y help widget is not obscured (#44822) 2022-01-20 10:06:22 +05:30
Oliver Eyton-WilliamsandGitHub a00788417a fix(client): stop injecting extra comments into preview (#44723) 2022-01-13 13:25:55 -08:00
2952f9399d fix(client): keep challengeFile order on update (#44722)
* fix: keep challengeFile order on update

* refactor: name variable challengeFile, not file

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

* fix: prettify

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2022-01-10 14:02:30 -08:00
Oliver Eyton-WilliamsandGitHub 01a03f2961 fix: prevent timeout errors (#44714) 2022-01-08 11:42:16 +05:30
Oliver Eyton-WilliamsandGitHub 87f5cff3cd fix(client): get jquery from cdn (#44421)
* 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.
2022-01-07 10:42:27 +00:00
Oliver Eyton-WilliamsandGitHub 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-WilliamsandGitHub e5e7f89f4b refactor(client): remove redundant code (#44669) 2022-01-04 20:38:52 +05:30
Oliver Eyton-WilliamsandGitHub e837e8a11e fix: clean tsconfig.buildinfo quietly (#44665) 2022-01-04 12:48:19 +00:00
Oliver Eyton-WilliamsandGitHub a726dd381f fix(client): prevent data url render (#44658)
* fix: only render profile urls

* feat: warn user when submitting data url

* fix: prevent dataurls being saved to db

* fix: tests and imports

Not sure why jest didn't like the es imports, but they aren't necessary
so I dropped them.

* fix: check for url protocol
2022-01-04 11:05:40 +05:30
Oliver Eyton-WilliamsandGitHub 795316b1d4 fix(client): always render bottom jaw in correct position (#44657) 2022-01-03 17:27:58 +05:30
Oliver Eyton-WilliamsandGitHub 05089c535a fix(client): enlarges console pane for project steps (#44567) 2021-12-23 17:39:06 +03:00
Oliver Eyton-WilliamsandGitHub 85b9daedb8 fix(client): handle challenge resets with hidden preview (#44570) 2021-12-23 17:34:26 +03:00
Oliver Eyton-WilliamsandGitHub 54ff692a10 fix: slight change to 'go back to learn' message (#44566) 2021-12-23 16:37:11 +05:30
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
fd63bb6f85 feat: mvp features for soft launch (#44539)
* 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>
2021-12-22 16:53:40 +00:00
Oliver Eyton-WilliamsandGitHub 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
Oliver Eyton-WilliamsandGitHub b57cf4ffa7 fix: store completed js projects in redux (#44496)
* fix: store completed js projects in redux

These were missed when we migrated from files to challengeFiles

* test: put the data-cy on the correct button

Rather than the fallback. The tests were only passing because the
fallback was kicking in and, since that was fixed, the tests started to
fail!
2021-12-14 17:59:53 -06:00
Oliver Eyton-WilliamsandGitHub 3b560deab6 refactor: stop spreading challenge over the node (#44499)
* refactor: stop spreading challenge over the node

Instead of creating a Gatsby node with id of challenge.id, we create a
single node field that has all the challenge data.

While this makes the GraphQL queries more verbose, it means we're free
to create multiple nodes with the same challenge.id.

* test: update time-line test for new GQL schema

* test: update mocks with new GQL schema
2021-12-14 12:11:20 -06:00
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-WilliamsandGitHub 48f88428e8 test: login more directly (#44467)
* test: login more directly

* test: separate login from other visits

In a single test, Cypress can only visit within a single domain, hence
the separation.

* chore: fail slowly for all strategies

* test: user certified user for showing cert

* test: fix and cleanup certifications
2021-12-11 14:34:16 +05:30
Oliver Eyton-WilliamsandGitHub 6ce8738fc0 refactor: remove useless warning (#44465) 2021-12-10 14:35:46 -08:00
Oliver Eyton-WilliamsandGitHub 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-WilliamsandGitHub fca626fc5e fix(client): prevent load from local storage (#44440) 2021-12-09 15:08:03 +00:00
Oliver Eyton-WilliamsandGitHub 2a286d3fc6 chore(docs): add contributor tools update instructions (#44393) 2021-12-07 21:46:38 +05:30
Oliver Eyton-WilliamsandGitHub a23a47750b fix: only include frame-runner when running tests (#44337)
* fix: only include frame-runner when running tests

* fix: handle missing options

* test: use test runner for curriculum tests
2021-12-06 13:02:49 -06:00
f613a1e5fd fix: index.css/js to styles/script (#44356)
* 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>
2021-12-03 12:32:29 -08:00
Oliver Eyton-WilliamsandGitHub 0cbb499e9c chore: remove contributor tools (#44368)
They're being stored in freeCodeCamp/tools now
2021-12-03 20:40:03 +05:30
Oliver Eyton-WilliamsandGitHub 9c078ab5d2 fix: update npm calls to handle workspaces (#44370)
* fix: use workspaces for crowdin npm ci

* fix: update server.Dockerfile to use workspaces

* fix: update client.Dockerfile to use workspaces
2021-12-03 20:06:08 +05:30
Oliver Eyton-WilliamsandGitHub 6af8ee6528 fix: hide file tabs on legacy challenges (#44291)
* fix: hide tabs for legacy challenges (desktop)

* fix: hide tabs for legacy challenges (mobile)

* fix: remove editor tabs (desktop)

* refactor: update comment

* fix: add missing usesMultifileEditor flags
2021-12-02 12:05:54 -08:00
Oliver Eyton-WilliamsandMrugesh Mohapatra 78757f20b5 fix: ignore unsafe argument 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 95e3de6b2a chore: regenerate package-lock 2021-12-02 19:57:47 +05:30
37932c48a7 refactor: drop redundant eslint-enables
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra f34bb986ed fix: remove unused arg from mapStateToProps 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra a79fa9aa6b chore: remove last vestiges of lerna 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 46b5f02e80 fix: storybook workspace issues 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 9a8959de26 fix: increase memory for gatsby processes 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra bb0e7317c8 fix: only use parts of gfm parser 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 01b354f0d1 refactor: mollify TypeScript 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 7d0760c98f chore: remove unused @types from ui-components 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 6e4dddd9ee chore: update ui-components to use root types 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 98195a7823 chore: stop building contributor tools
They should really be in a separate repo, but for now I'm preventing
them from being built.
2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 03309bea9e chore: remove old package-locks 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 264f5091ab chore: install core-js@2 (required by babel) 2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra a3e05ab45e chore: use workspaces, fix deps
react-monaco-editor needed rolling back due to an incompatibility with
react 16
monaco-editor then needed rolling back and the editor config, too.

Some @types needed to be added, some lint deps needed updating.
2021-12-02 19:57:47 +05:30
Oliver Eyton-WilliamsandGitHub efba2e777d chore: simplify eslint configuration (#44347)
* chore: extend import/recommended

* chore: use recommended lint rules

* refactor: apply lint rules

* chore: drop used config
2021-12-02 00:01:12 +00:00
Oliver Eyton-WilliamsandGitHub 1b006820bd fix(tests): wait longer for login to complete (#44349)
Hopefully this is long enough. If it isn't, we'll need to find out why
login takes so long.
2021-12-01 11:12:09 -08:00
Oliver Eyton-WilliamsandGitHub b89c31c0d1 fix: use the previewMounted connected to redux (#44336) 2021-12-01 13:01:12 -06:00
bb7893db8e feat: show project preview (#43967)
* feat: add data for preview to challengeMeta

* feat: allow creation of project preview frames

* feat: make project preview data available for frame

* refactor: simplify reducer

* feat: show project preview for first challenge

* feat: show project preview on MultiFile challenges

* test: check for presence/absence of preview modal

* fix: simplify previewProject saga

* test: uncomment project preview test

* fix: increase modal size + change modal title

* modal-footer

* feat: adjust preview size

* fix: remove margin, padding, and line-height for preview of finished projects

* Revert "fix: remove margin, padding, and line-height for preview of finished projects"

This reverts commit 0db11a0819.

* fix: remove margin on all previews

* refactor: use closeModal('projectPreview') for clarity

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

* fix: get started -> start coding!

* fix: update closeModal type

Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-11-29 18:30:28 +00:00
Oliver Eyton-WilliamsandGitHub 0418c59445 docs: explain dynamic hints in more depth (#44290) 2021-11-26 14:06:22 +00:00
Oliver Eyton-WilliamsandGitHub 260f945de8 feat: allow for dynamic hints (#44279) 2021-11-25 15:10:01 +00:00
Oliver Eyton-WilliamsandGitHub d489aa307e chore: import node types (#44172)
* chore: add @types/node to client

* fix: update declaration with node 16 changes
2021-11-12 20:38:39 +05:30
89c94e54e7 chore(client): add and apply naming convention (#44110)
* refactor: remove unused types

* chore: add naming-convention lint rule

* refactor: rename redux proptypes

* chore: remove Type suffix from prop-types

* chore: apply conventions to ajax

* chore: apply convention to create-types

* chore: apply convention to show-project-links

* chore: search-bar

* chore: Hotkeys

* chore: privacy

* chore: portfolio

* chore: search-page-hits

* chore: search-suggestion

* chore: search-hits

* chore: no-hits-suggestion

* chore: timeline-pagination

* chore: various profile files

* chore: heat-map

* chore: portfolio

* chore: certifications

* chore: landing-top

* chore: certifications

* chore: campers-image

* chore: big-call-to-action

* chore: paypal related files

* chore: show-user

* chore: show-settings

* chore: show-certification

* test: rename profile snap

* fix: ignore snake case for stripe card form

* refactor: remove duplicate type declarations

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

* fix: handle null solutions in Timeline

* test: add remaining Profile props

* refactor: revert accidental rename

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-11-11 10:09:50 -08:00
9082671475 feat: highlight editable region (#44123)
* feat: give editable region own background

* refactor: remove unused prop

* fix: remove debugging log

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

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-11-05 08:41:55 -07:00
Oliver Eyton-WilliamsandGitHub 0a5c7cbfcf fix(tools): stop multiple prettier runs on large commits (#44124) 2021-11-04 17:41:18 +00:00
Oliver Eyton-WilliamsandGitHub c712f22667 fix(client): keep hints while user edits code (#44085)
* fix: only reset hints and test button on restart

Previously it would be triggered by any change to the editor contents

* refactor: move output node reset into own function

* refactor: reorganise init/update editable region args

* fix: control when line decorations update

* refactor: clean up updateEditableRegion
2021-11-01 16:43:42 +00:00
Oliver Eyton-WilliamsandGitHub 2d5305af7f fix: actually lint staged files on commit (#44036) 2021-10-28 15:32:10 +05:30
e139fbcf13 test: update *test* grammar
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-10-27 21:29:05 +05:30
8538141600 fix: grammar
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-10-27 21:29:05 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra f6999fa8bb test: extract-js-comments error 2021-10-27 21:29:05 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 3e5cffba0f fix: throw better error when JS parse fails
This should help debugging challenges with invalid syntax.
2021-10-27 21:29:05 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra da9e6ad0c1 fix(curriculum): consts must be initialized 2021-10-27 19:42:45 +05:30
Oliver Eyton-WilliamsandMrugesh Mohapatra 21b7a9ee4f chore: fix breaking change in monaco 2021-10-27 13:52:32 +05:30
Oliver Eyton-WilliamsandGitHub 866c9ee9d9 refactor: clean up MultifileEditor (#43996) 2021-10-25 22:06:11 -05:00
Oliver Eyton-WilliamsandGitHub 6c20301204 feat: control editor focus (#43882)
* refactor: MultifileEditor to functional component.

* fix: make editor acquire focus once on mount

Now the editors can leave the dom (e.g. if a tab is clicked), but an
editor will only call for focus if the MultifileEditor itself remounts
2021-10-19 08:52:51 -07:00
Oliver Eyton-WilliamsandGitHub b9c1bc92cd refactor: remove redundant parts of the editor (#43847)
* refactor: remove forbidden regions

We aren't using them and they're implemented badly. To recreate them, we
should simply track the editable region and update them when it's Range
changes.

* refactor: simplify the refs considerably

There's no point keeping an object with properties for all possible
editors when only one is created at once.
2021-10-18 16:23:36 +03:00
Oliver Eyton-WilliamsandGitHub 6a5f586f73 fix: handle challenge resets through redux (#43843)
Instead of relying on heuristics like "does the current content
differ from the initial content?" this just resets if the reset button
has been pressed.
2021-10-18 14:58:06 +03:00
Oliver Eyton-WilliamsandGitHub 6b26ce2e0f fix(client): only target editor calls for focus (#43839)
For legacy challenges, there's only one editor and it must be focused.

For project steps, only the editor with the editable region should call
for focus.
2021-10-15 11:42:50 +01:00
Oliver Eyton-WilliamsandGitHub 9bb1919e83 feat: display instructions on frontend projects (#43862) 2021-10-14 10:55:40 -05:00
Oliver Eyton-WilliamsandGitHub 8a47b60890 chore: remove debugging console logs (#43837) 2021-10-13 15:11:02 +03:00
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