Commit Graph

1842 Commits

Author SHA1 Message Date
Felix Yan
b923a32736 fix: a typo in ga-saga.test.js (#43673) 2021-10-02 15:03:19 +02:00
Oliver Eyton-Williams
e4ba0e23ea feat: enable reset in multifile editor (#43617)
* 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
2021-10-01 10:36:20 +02:00
Sem Bauke
cfc9b7258d fix(client): cert rendering temporarily (#43335)
* 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>
2021-10-01 10:00:14 +05:30
Shaun Hamilton
2deb73c8d1 feat(curriculum): add accessibility-quiz practice project (#43244)
* 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>
2021-09-28 15:38:44 -05:00
renovate[bot]
8beb26e84e chore(deps): update dependency typescript to v4.4.3 (#43316)
* chore(deps): update dependency typescript to v4.4.3

* fix: use UserType correctly

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-09-28 10:56:46 +02:00
Oliver Eyton-Williams
0f32cabef9 fix: move ActionRow outside the ReflexContainer (#43532)
* 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
2021-09-27 13:16:29 +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
Oliver Eyton-Williams
48f2c02c5d refactor(client): remove unused axios dependents (#43579) 2021-09-27 14:32:42 +05:30
Sem Bauke
e44610f1d0 chore: remove coder survey text (#43559) 2021-09-25 00:54:24 +01:00
Oliver Eyton-Williams
b5019000bb fix(client): errors with multiple editor tabs (#43549)
* 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
2021-09-24 15:40:18 +01:00
Sem Bauke
aa3c6987e3 fix: redundant scrollbar on codeally Iframe (#43503) 2021-09-23 10:31:56 -05:00
Oliver Eyton-Williams
41e428d23d feat: update editable region behaviour (#43537)
* 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.
2021-09-23 17:27:44 +03:00
Raymen Deol
0036aa8969 feat(client): ts-migrate (/client/src/components/layouts/Certification.js) (#42939)
* change name to certification.tsx

* migrate certification.js to ts

* update ceritification import in index and fix prettier errors

* Update client/src/components/layouts/certification.tsx

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>

* Update client/src/components/layouts/certification.tsx

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

* Update client/src/components/layouts/certification.tsx

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

* Update client/src/components/layouts/certification.tsx

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>

* fix: reorder imports

Co-authored-by: Raymen Deol <raymen.deol@outlook.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-09-23 09:15:16 +02:00
Oliver Eyton-Williams
7200269534 refactor(client): use the view zones to place the widgets (#43519)
Rather than calculating the widget (i.e. the jaws) position ourselves,
we can use the fact that monaco knows where the view zones are.
2021-09-22 09:29:29 +05:30
Oliver Eyton-Williams
222fc3f255 refactor: minor clean up of editor (#43513) 2021-09-21 18:05:12 +05:30
Nicole Aldurien
cc1b945fab refactor(client): migrating ActionRow.js to TypeScript (#43490) 2021-09-21 10:13:54 +02:00
Sem Bauke
c0e0241440 feat(Cypress): hotkey tests (#43434)
* 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>
2021-09-20 20:53:42 +02:00
EhEhRon91
35bee5ca68 fix: message removed when not logged in (#43411)
* fix: message removed when not logged in

* removed unnecessary code from DonateCompletion.tsx that was added

* now using isSignedIn in props and not donationFromState
2021-09-20 12:57:05 +03:00
Ahmad Abdolsaheb
e5523bf16e feat: add Stripe card form (#43433)
* eat: add Stripe card form

* Apply suggestions from code review

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

* feat: adjust payload and error handling

* feat:  readjust error handling

* Apply suggestions from code review

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

* feat: refactors from comments

* feat: prevent submition during processing

* feat: redefine isSubmitting

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

* fix: show the proper paypal button on donate page

* fix: handle errors from stripe

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
2021-09-17 22:15:56 +03:00
Igor Cunha
2dd106eb2f feat(client): migrate to ts - (HelpModal, Preview, VideoModal, Side-Panel) (#42857)
* refactor: migrate HelpModal, Preview, VideoModal, Side-Panel

* refactor: import order

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-09-17 18:37:53 +01:00
Ahmad Abdolsaheb
a48091a012 fix(client): avoid calling the api for signed out users (#42383)
* feat(client): call api for singed in paypal subs

* feat(client): update tests

* feat(client): add kebab case

* fix: clarify tests
2021-09-07 21:24:18 -05:00
EhEhRon91
88385e46bb fix: button width and text not matching (#43380) 2021-09-07 20:18:25 +05:30
Shaun Hamilton
7857756062 chore(client): meta and yml certificate -> certification (#43353)
* chore(client): meta and yml certificate -> certification

* make translators lives more difficult - rename everything
2021-09-03 08:08:45 -07:00
awu43
f8aa621672 delete old ts-ignore comments (#43329) 2021-08-27 23:38:30 +02:00
awu43
58ed9330bf fix(client): ensure unmount effect has most recent values (#43282)
* ensure unmount effect has most recent values

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-26 18:03:11 -05:00
Ismail Tlemcani
67ee31cbfc feat(client): ts-migration for layout index file, Intro Component and header test file (#43094) 2021-08-26 17:17:25 -05:00
Sem Bauke
cd005668b9 feat: change logos on chinese language (#43269)
* feat: change logos on chinese language

* fix: use Ahmads logos

* fix: error

* fix: tencent logo size

* feat: include chinese traditional

* Apply suggestions from code review

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

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-25 18:21:56 +02:00
Nicholas Carrigan (he/him)
b9d08f2fea feat: locale specific help posts (#43290) 2021-08-25 21:43:40 +05:30
Oliver Eyton-Williams
d161998acc test: check that JS projects can be submitted. (#43222)
* test: check that JS projects can be submitted.

* refactor: remove stale workflow comments

* refactor: remove redundant build

* chore: update Cypress version in CI

* test: create separate electron-only workflow

* test: put data-cy on correct button

* test: drop mailhog from electron CI

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

* refactor: update differences comment

* test: separate toggling from logging in

* test: check solutions can be viewed on cert

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-08-24 20:26:48 +02:00
Christian Z. Tamayo
a42348d3b9 test: Privacy terms redirection (#43195) 2021-08-24 22:36:23 +05:30
Oliver Eyton-Williams
5e49521fc2 fix(client): some editor edge cases (#43256)
* fix: handle erm on line zero

* refactor: fix eslint errors

* fix: prevent crash on zero height editable region
2021-08-23 11:34:53 -07:00
Mohamed Naufal A
498805c235 fix(client): use en top contributor link for i18n (#43248)
* Changes made as directed in the instructions

* second revision

* Third revision

* Cypress Test updated

* cypress test updation

* directly linking to top-contributors news page

Co-authored-by: Ilenia <nethleen@gmail.com>
2021-08-23 16:50:28 +01:00
ABHINAV SHARMA
bd7a6780a9 feat(client): ts-migrate Map component (#42845)
* feat(client) Renamed index.js to index.tsx

* feat(client): ts-migrate Map component
2021-08-21 12:06:09 +01:00
Nicholas Carrigan (he/him)
b99ee5e7de feat: english forum for guide posts (#43246) 2021-08-20 11:58:07 +05:30
Ahmad Abdolsaheb
1fec73cdf7 feat(client): Unify donation loading state (#43179)
* initial loading state unification

* feat(client): show buttons after 3 seconds

* fix: use window.setInterval explicitly

Otherwise TS assumes that it's node's setInterval

* feat(client): remove spinner when first button load

* feat(client): move the loader to the donate page button area

* feat(client): extract grid from modal donation form

* feat(client): remove duplicate donation forms

* feat(client):extract unused components from donationForm

* feat(client): load paypal on load not onInit (for perf)

* feat(client): set paypal loading state if stripe already loaded

* feat(clinet):make lpaypal oading condition strickt.

* Apply suggestions from code review

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

* feat: clean up

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-19 14:47:25 -05:00
Victor Duarte
84760cba9e fix(client): removes cut off in certificate page (#43090) 2021-08-18 09:23:34 -05:00
Shaun Hamilton
5806c3047d fix(client): convert challengeFiles->files before sending to api (#43204)
* fix(client): convert challengeFiles->files before sending to api

* update use of user.completeChallenges

* parse response in ajax, pre-typing

* add typing to getSessionUser

* refactor: use Omit

* fix: reorganise getSessionUser

* refactor ajax for simplicity

* refactor to be worse

* allow for undefined completedChallenges

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

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-17 12:31:25 -05:00
Tom
7ef9afcec4 Revert "fix(client): open curriculum links in new tabs (#43136)" (#43215)
This reverts commit 925891858c.
2021-08-16 19:19:23 +02:00
Shaun Hamilton
c2a11ad00d feat: add 'back/front end' in curriculum (#42596)
* chore: rename APIs and Microservices to include "Backend" (#42515)

* fix typo

* fix typo

* undo change

* Corrected grammar mistake

Corrected a grammar mistake by removing a comma.

* change APIs and Microservices cert title

* update title

* Change APIs and Microservices certi title

* Update translations.json

* update title

* feat(curriculum): rename apis and microservices cert

* rename folder structure

* rename certificate

* rename learn Markdown

* apis-and-microservices -> back-end-development-and-apis

* update backend meta

* update i18n langs and cypress test

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

* fix: add development to front-end libraries (#42512)

* fix: added-the-word-Development-to-front-end-libraries

* fix/added-the-word-Development-to-front-end-libraries

* fix/added-word-development-to-front-end-libraries-in-other-related-files

* fix/added-the-word-Development-to-front-end-and-all-related-files

* fix/removed-typos-from-last-commit-in-index.md

* fix/reverted-changes-that-i-made-to-dependecies

* fix/removed xvfg

* fix/reverted changes that i made to package.json

* remove unwanted changes

* front-end-development-libraries changes

* rename backend certSlug and README

* update i18n folder names and keys

* test: add legacy path redirect tests

This uses serve.json from the client-config repo, since we currently use
that in production

* fix: create public dir before moving serve.json

* fix: add missing script

* refactor: collect redirect tests

* test: convert to cy.location for stricter tests

* rename certificate folder to 00-certificates

* change crowdin config to recognise new certificates location

* allow translations to be used

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>

* add forwards slashes to path redirects

* fix cypress path tests again

* plese cypress

* fix: test different challenge

Okay so I literally have no idea why this one particular challenge
fails in Cypress Firefox ONLY. Tom and I paired and spun a full build
instance and confirmed in Firefox the page loads and redirects as
expected. Changing to another bootstrap challenge passes Cypress firefox
locally. Absolutely boggled by this.

AAAAAAAAAAAAAAA

* fix: separate the test

Okay apparently the test does not work unless we separate it into
a different `it` statement.

>:( >:( >:( >:(

Co-authored-by: Sujal Gupta <55016909+heysujal@users.noreply.github.com>
Co-authored-by: Noor Fakhry <65724923+NoorFakhry@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
2021-08-13 21:57:13 -05:00
Shaun Hamilton
e98d3dd3da fix(client): allow old local-storage code (#43196) 2021-08-13 13:15:50 -05: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
Tom
925891858c fix(client): open curriculum links in new tabs (#43136) 2021-08-12 09:02:57 +02:00
Nicholas Carrigan (he/him)
c8ec196dbc fix: scrollable nav (#42600)
* fix: scrollable nav

Modify the drop down menu to be scrollable.

* fix: account for really small screens
2021-08-11 18:17:21 +01:00
Nicholas Carrigan (he/him)
28003256c3 fix: restore navatar class (#43176) 2021-08-11 09:38:31 +02:00
Victor Duarte
7c6524186e refactor(client): docs, ts and test challenges (#42978)
* refactor(client): relocate to learn path tests file

* refactor(client): add docs for to learn path

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>

* fix: order imports

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-10 15:22:39 +02:00
Ahmad Abdolsaheb
b0b438a40f Revert "fix(client): remove wallets (#43159)" (#43163)
This reverts commit 5a4c02addd.
2021-08-09 16:39:48 -05:00
Ahmad Abdolsaheb
5a4c02addd fix(client): remove wallets (#43159) 2021-08-09 21:28:38 +03:00
Tom
0ae8b0c0e8 chore: clean-up unsed things in stripe integration (#43156)
* chore: clean-up unsed things in stripe integration

* fix: use logged in users email over email given to payment form
2021-08-09 21:27:14 +03: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
Ahmad Abdolsaheb
b623c340a9 feat(client): add google pay (#43117)
* feat: initial button setup client

* feat: rename walletsButton to .tsx

* chore: typescriptize wallet component

* chore: re-add keys to config, env, etc + check in gatsby-node

* feat: refactor donate form and wallet component

* feat(client): set labels correctly

* chore: add stripe package back to server

* chore: add stripe back to allowed paths

* chore: copy donate.js code from PR #41924

* feat: attempt to make back end work

* feat: make redux work

* feat: clean up

* feat: hokify

* feat: add error handling

* fix: back-end should be working

* fix: type errors

* fix: clean up back-end

* feat:addd styles

* feat: connect the client to the api

* feat: display wallets button everywhere

* test: add stripe key for cypress action

* test: fix for cypress tests

* test: cypress tests again

* test: maybe?

* test: more

* test: more

* test: more

* test

* askdfjasklfj

* fix: tests finally?

* revert: remove space from cypress yaml action

* remove logs

Co-authored-by: moT01 <20648924+moT01@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-08-08 23:22:25 +03:00