* fix: update jaws on resize
Use isProjectStep to determine if the jaws need to be updated
* refactor: isProjectStep -> hasEditableRegion
isProjectStep was misleading. hasEditableRegion correctly describes
that function and leaves isProjectStep to enable features that are
unique to project steps, but nothing to do with the editable region
If the code has changed without the user typing (e.g. they've pushed
the restart button), then we jump them back to the editable region.
Otherwise (e.g. they've typed in the editor) we reset the display, but
do not move the editor.
* feat: remove eslint-plugin-prettier for prettier
This removes the annoying lint warnings when all that needs to change is
formatting
* fix: use .js lint-staged config to ignore properly
* fix: lint everything if a lot of files are changed
It's faster than making lots of individual linter calls
* chore: apply prettier
* fix: ignore code in curriculum-file-structure
* feat: added warning for unreachable server
* fix: update initial state in test file
* fix: make offline warning scroll with page
* adjust z-indexes for warning banners
* add hyperlink for offline warning
* 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: require login as step
* fix: cert rendering temporary
* fix: remove keys from other translation files
* fix: cypress test
* chore: shauns suggestions
* fix: remove steps
* fix: use a seperate UseEffect function
* Suggestions from Shaun
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* fix: certification temp rendering
* fix: cert temp rendering hopefully
* fix: button visibility and cert test
* fix: condition
* test: improve claim cert tests
Without npm run seed, retries will be in a different state.
Check the scroll position to (hopefully) catch the weird cert claim bug.
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix(deps): update monaco editor
* chore: rollback monaco, update react-monaco-editor
The latest version of react-monaco-editor is only compatible with monaco
v0.27
* fix: roll-back monaco-editor-webpack-plugin
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* feat(curriculum): add accessibility-quiz practice project
* add parts 002-006
* add parts 7-8, tentative on logo aspect-ratio
* add parts 008-013
* add parts 013-016
* add parts 017-026
* add parts 026-027
* add parts 027-029
* add parts 029-044
* add parts 044-067 - all parts done
* add tests 001-009
* add tests 010 - 033
* add tests 034 - 039
* update tests 008~033, add tests 040-050
* add all tests
* fix some stuff, remove final.md
* take reasonable suggestions from Nich, ignore rest
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
* replace svg link with actual CDN
* remove getAttribute in potentially bad places
* add method to form
* fix silly querySelectors
* adjust selectors for 028
* fix selectors, and add color transformations
Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
* fix: typos, and make one test lenient
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
* fix: move ActionRow outside the ReflexContainer
It does not need to be resizable.
* fix: make DesktopLayout aware of ActionRow
The ReflexContainer seems to need to be inside a display: flex component
to correctly compute the sizes of it's children.
* refactor: remove unused props
* fix: enforce multifile tab order
* fix: sort challengeFiles to prevent remounts
If the challengeFiles are used unsorted, this can unmount an editor.
The editors rely on the mount hook for initialization, so extra mounts
can cause unwanted behaviour.
* fix: make editor tabs and panes match
* refactor: remove ambiguity about editable region
Since the editable region is implemented via decorations and defined in
challenge object, getEditableRegionFromRedux, makes the source obvious
* fix: make jaws follow the highlighted region
* fix: update the jaws on all content changes
* feat: make editable region 'absorb' text
As the user types, the editable region can move, expand and contract.
With this PR then if the user, say, presses backspace on the line after
the editable region, causing that line to move up, then the new contents
will expand/contract as if they had always been part of the region.
* feat(Cypress): hotkey tests
* fix: test previous next for projects
* fix: link time-out firefox
* feat: test the "r" hotkey
* fix: change select back to body for now
* fix: retain navigation mode for video challenges
* test: find focused elements
* fix: move focus from panel before pressing 'r'
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
* test: add hotkey test for backend
* test: remove redundant {esc} presses
* refactor: naming change
* fix: refactor properly
* fix: actually refactor it properly
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
* fix: message removed when not logged in
* removed unnecessary code from DonateCompletion.tsx that was added
* now using isSignedIn in props and not donationFromState
* feat(curriculum): add initial steps
Add the initial step files for this project.
* feat(curriculum): write test texts
Add some test text (tests coming soon).
* feat: tests for HTML bits
Add tests for the HTML bits - CSS holding off until parser lands.
* feat: CSS tests
New CSS parser works great!
* fix: link href
Fix the href in the boilerplate.
* chore: apply suggestions from code review
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
* fix: clarify link element
* fix: optional chaining
* fix: remove unused meta props
* fix: update helper and fix tests
* chore: apply tom's review suggestions
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
* chore: no console logs
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* feat: intro
Add introductory text, tweak instructions a bit.
Co-authored-by: gikf <60067306+gikf@users.noreply.github.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>