Commit Graph

409 Commits

Author SHA1 Message Date
9ea7018740 Merge pull request from GHSA-cc3r-grh4-27gj
* feat: restrict update-user-flag endpoint

* feat(api): add dedicated-endpoints for user

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-04-13 20:51:31 +05:30
Tom
9f753a5662 feat: let users save cert project code to db (#44700)
* feat: let users save cert project code to db

fix: move getChallenges call out of request function so it only runs once

fix: use FlashMessages enum

fix: transform challengeFiles earlier

test: make tribute page use multifile editor

stuff I was playing with - revert this to get it to a working state

refactor: allow undefined editableRegionBoundaries

fix: save history

history is not necessarily ["name.ext"] and using the incorrect history
could cause weird bugs

fix: replace files -> challengeFiles on the client

refactor: DRY out ajax

fix: use file -> challengefile map

refactor: rename ajax types

fix: alphatize flash-messages.ts

revert: tribute page project

fix: remove logs

fix: prettier

fix: cypress

fix: prettier

fix: remove submitComplete action

fix: block UI for new projects

fix: handle code size

* fix: catch undefined files

* fix: don't default to undefined when it's already the default

* fix: only update savedChallenges if applicable

* fix: dehumidify backend + fine tune nearby stuff

* fix: prop-types

* fix: dehumidify sagas

* fix: variable name

* fix: types

* Apply suggestions from code review

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

* fix: typo

* fix: prettier

* fix: props types

* fix: flash messages

* Update client/src/utils/challenge-request-helpers.ts

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

* chore: rename function uniformize -> standardize

* fix: flash message

* fix: add link to forum on flash messages

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-03-31 10:34:40 -05:00
Tom
a428284804 feat: release rdbms as beta (#45428) 2022-03-22 11:35:38 +05:30
Tom
daaa2b38cf feat: encode user tokens (#45429) 2022-03-15 14:11:43 +05:30
Tom
9e5f9b2a7c fix: webhook process (#45385)
* fix: token rework functional

fix: clean up

fix: more clean up

fix: more clean up

fix: add widget back to settings

fix:

fix:

fix: cypress

Apply suggestions from code review

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

fix: use flash enum

* chore: rename webhookToken -> userToken

fix: add translations I forgot to save

* fix: add missing tones for flash messages

* fix: node test
2022-03-11 13:58:23 -08:00
Tom
e24c8abc7f revert: release rdbms to production (#45347) 2022-03-04 15:15:20 +01:00
Tom
84c305ab08 feat: release rdbms to production (#45169)
* fix: add cert to email for when all certs are earned

* fix: unhide rdbms from production

* fix: cert project input field

* feat: add cypress tests

* fix: message on project pages to lower expectations

* fix: update instructions

* fix: add quincy's suggestions

* fix: add beta label and reorder

* fix: utils test

* fix: move rdbms to bottom of settings

* fix: cypress tests

* Apply suggestions from code review

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

* fix: only drop seeded users webhook tokens

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-03-04 15:38:09 +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
46cf96fbe1 chore(api): pin and update dependencies (#45282) 2022-02-28 21:59:15 +05:30
9e03419efb chore: dry out 410 logic (#45257) 2022-02-26 00:38:18 +05:30
ce23dcb32c fix: return 410 for api/github (#45250) 2022-02-25 10:38:29 +01:00
d501817207 chore(api): remove d3 (#45248) 2022-02-25 10:36:36 +01:00
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
Tom
fd14608492 feat: release rdbms on staging (#44576)
fix: unhide cert from settings page

fix: add cert variables where missing

fix: show token on settings page

feat: add challenges to certified user data

fix: stylize settings page a little bit

fix: only show rdbms when upcomingChanges = true

fix: relational databases -> relational database
2022-02-18 17:29:30 +01:00
9d7457557a fix(api-server): npm run build on windows (#45120) 2022-02-15 13:09:26 +00:00
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
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
7f027958af chore: migrate to nanoid 3 (#44893) 2022-01-25 11:09:41 +05:30
9cb87d0257 chore: remove verify-can-claim-cert logic (#44574)
* chore: remove verify-can-claim-cert logic

* remove extraneous

* remove console log before Nich wakes up

* add api route back with flash

* remove unnecessary logic in completion-epic

* change tests for new layout

* dynamically use api location

* rename file

* fix Cypress api location

* fix(test): anchor does not have disabled class

* fix(tests): change js test to claim from /settings

* chore: change status to 410 (gone)

* update testing again

* oliver is nitpicky

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

* make oliver happy

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-01-18 08:52:49 -06: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
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
42acc542b7 fix: handle uppercase and missing user verification (#44444)
* fix: hotfix for isHonest null

* fix: early return if no user?

* fix: handle invalid input on api

Also lowerCases the username it receives since the client could send any
case.

* fix: report errors to user when verification fails

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-12-10 11:23:26 +00:00
8372623f69 chore(curriculum): fix + test curriculum order (#44366)
* chore(tools): test curriculum order

* chore: update orders

* fix(tests): temporarily ignore cert super

The Relational Databases cert being 'upcomingChanges' is breaking
the tests.

* fix: graphql query here

* fix: use only one meta

* chore: remove unnecessary superOrders

* chore: zero-based indexing

* fix: update mock

* refactor: remove unused fixture

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-12-06 16:55:13 +00:00
03309bea9e chore: remove old package-locks 2021-12-02 19:57:47 +05:30
67d0061aa1 fix: getting of fallback issued date for fullstack certificate (#43977) 2021-11-25 06:37:34 +00:00
Tom
f0698aa517 feat(client,api): add user tokens and route for submitting coderoad tutorials (#43304)
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-11-17 19:49:24 +05:30
753ea937ea feat: Allow display username with uppercase characters (#43667)
* feat: Allow display username with uppercase characters

* fix: ensure user can change username to uppercased version

* fix: ensure that same username in a different case does not require validation
2021-11-04 11:18:40 +01:00
9179b2fc55 feat: add stripe authentication support (#44060)
* feat: add stripe authentication support

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-11-03 10:32:03 -07:00
0b79725a9e chore(deps): apply npm audit fix on all packages (#44108)
chore(deps): apply npm audit fix on all packages
2021-11-03 16:26:50 +05:30
466f39794b chore: update all lockfiles to v2 2021-11-03 15:06:19 +05:30
6fef483946 chore: update all packages to node v16 & npm v8 2021-11-03 15:06:19 +05:30
2b5c1ed712 chore(deps): updated versions to address vulnerabilities (#44075) 2021-11-02 15:55:05 +05:30
07bfe87419 feat: add campfire mode (#42663)
* feat: add campfire mode

fix: resolve lint issues

feat: add sound to editor

fix: restore flash messages

fix: linter issues

fix: obey sound setting

Update the editor to obey the camper's sound setting.

chore: apply suggestions from code review

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

fix: use @types/store

fix: linter issues

feat: simplify sound saga

Update client/src/redux/sound-mode-saga.js

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

fix: missing bracket

chore: use new s3 bucket

fix: lint

fix: import only needed bits

fix: remove from navbar

(was intermittently broken here anyway)

fix: dynamic imports?

fix: more dynamic imports

fix: tweak theme logic

chore: boolean | undefined

fix: dns

fix: no hammer local storage

* chore: apply oliver's review suggestions

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

* fix: lost an import

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2021-10-27 17:50:29 -05:00
a07a16b38b fix: added possibility to revert back to default profile picture (#43962)
* added possibility to revert to default profile picture

* removed required from picture input

* remove addPlaceholderImage and replaced with empty string

* added test for empty string to avatar-renderer
2021-10-25 21:06:32 +02:00
0a3ce84e5a chore(api): update non-semver axios 2021-10-25 22:49:46 +05:30
9780533fa4 chore(api,deps): housekeeping for patch updates 2021-10-25 22:49:46 +05:30
cb0a502d82 chore: tree shaking - unused / redundant code (#43867) 2021-10-15 13:13:43 +05:30
c8d7f0a782 feat(tools): remove eslint-plugin-prettier for prettier (#42438)
* 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
2021-10-06 21:02:21 +05:30
2ba536d559 refactor: enforce consistent camelCase in const names, add comments, condense multiple single-line comments into one multi-line comment (#43699) 2021-10-04 19:15:44 +05:30
cd8a71c56d fix: wrong flash message when changing email (#43653) 2021-10-01 23:04:54 +05:30
cf309b5349 fix: optionally add name to customer creation (#43486) 2021-09-20 09:56:42 +02:00
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
4dba98eca9 chore(deps): npm audit fix - api-server 2021-08-31 21:38:48 +05:30
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
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
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
Tom
fcadd534e7 fix: stripe issues (#43152) 2021-08-09 11:02:58 +03:00
Tom
8dec120c19 fix(api-server): server not responding for stripe call (#43149) 2021-08-08 19:47:33 -05:00
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
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