Commit Graph

498 Commits

Author SHA1 Message Date
Oliver Eyton-Williams
0cd3f7671a chore(deps): add missing dependencies (#49703)
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
2023-03-14 17:25:15 +05:30
Tom
b950070f80 feat(curriculum): add college algebra cert as upcoming change (#43605)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-10 10:55:50 +00:00
Oliver Eyton-Williams
16dec4ef86 feat: use pnpm to manage pm2 (#49574)
* fix(api): use pnpm to manage pm2

This means that pm2 will get the correct NODE_PATH environment variable.
Also, if we use pnpm to manage node, this ensure that pm2 will use that
node version.

* docs(devops): update api install and update docs

* feat: set node version via npmrc

This means that all scripts (pnpm run ...) will use this node version.
The only way to get other node versions is to invoke `node` directly.

* fix(docs): update api docs for pnpm installation

* feat: use pm2 from root

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-07 14:54:31 -08:00
Oliver Eyton-Williams
d7848ae01a feat: migrate to pnpm for better workspace DX (#49293)
* feat: npm -> pnpm 

This resolves the issues with the gatsby client (gatsby-plugin-pnpm
deals with the fact that gatsby is relying on its own dependencies
being de-duped)
and challenge-editor (which doesn't seem to want to automatically install
codemirror and needed its own eslint config)

* fix: correct mocha path for curriculum tests

* fix: use select workspace with -F not -w

* fix: reorganise packages and restrict hoisting

pnpm works best if the workspaces keep their own dependencies, since
dependencies are not flattened and then what node resolves from a
require is predictable.

@types seem to be a special case and more care is required to prevent
them getting smushed together in the root (hence the .npmrc)

* fix: add types for tools + root

* fix: decouple challenge-auditor from client

* fix: add ui-components types

* fix(client): use the latest types for react 16

* fix: prettify

* fix: prettierignore pnpm-lock

* fix: relax hoisting

Turns out pnpm works just fine with types. I don't know what was going
wrong before, but there are no-longer any type conflicts.

* fix: add @redux-saga/core to fix eslint issue

It seems to only be redux-saga that import/named can't cope with, so it
is probably okay to work around this one.

* chore: add chai to tools/scripts/build

* fix: add store to root for cypress

* fix: allow cypress to download binaries

If we want to keep preventing cypress from downloading binaries, we can
figure out a workaround, but I'm allowing it to ease the transition to
pnpm.

My guess about why this is happening is that npm triggers Cypress's
postinstall script, but pnpm does not (because pnpm install only
installs if necessary, perferring to link)

* chore: re-enable pre/post scripts

* fix: update build scripts for client

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

* chore: update engines to use pnpm


* fix: enable choice of (super)block for tests

Only 'nix machines for now.

* chore: pin pnpm to version 7

* chore: remove last npms

Except web + curriculum-server. I'll update them when I start work on
them again.

* fix: lockfile check to catch any package-locks

* fix(action): install pnpm for upcoming tests

* chore: add nodemon to new api

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-02 18:17:44 +00:00
Tom
8f63733236 refactor(api): user token db query (#49406) 2023-02-23 17:50:04 +05:30
Mrugesh Mohapatra
c252a84c4d fix(sentry): disable sentry temporarily (#49443) 2023-02-20 17:17:28 +02:00
Mrugesh Mohapatra
537ef39a8d feat(tools): sentry apm and other telemetry (#49385)
* feat(tools): sentry apm and other telemetry

* fix: use middleware json to remove duplication

---------

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-02-17 18:23:18 +05:30
Mrugesh Mohapatra
96a821a2ac revert(tools): sentry apm and other telemetry (#49383)
Revert "feat(tools): sentry apm and other telemetry (#49230)"

This reverts commit b4fa56be3e.
2023-02-14 20:20:01 +05:30
Mrugesh Mohapatra
b4fa56be3e feat(tools): sentry apm and other telemetry (#49230) 2023-02-13 14:32:49 +00:00
Mrugesh Mohapatra
ffc97f15d1 fix(api): update mobile-auth ratelimit config (#49194)
* fix(api): use proper name for collection

* fix(api): use the x-forwarded-for ip address
2023-02-10 13:13:54 +00:00
Mrugesh Mohapatra
9b6042e44d feat: enable mobile auth endpoints (#49298
Reverts #49212
2023-02-09 14:01:13 +05:30
Mrugesh Mohapatra
c3103bae3d revert: mobile auth for unblocking deployments (#49212) 2023-01-31 22:06:17 +05:30
Niraj Nandish
96fc70db1d feat: mobile auth (#48591)
Co-authored-by: sembauke <semboot699@gmail.com>
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-01-27 13:35:48 +05:30
Naomi Carrigan
193e03d286 feat: restrict update flag endpoint (#46314)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Sem Bauke <semboot699@gmail.com>
2023-01-19 16:16:17 +03:00
Ahmad Abdolsaheb
bff61255f9 feat(donation): simplify donation client (#46379)
* feat: unify post payment actions

* feat: handle stripe card error and add donation after auth

* feat: add donation saga stripe test

* feat: add more coverage to stripe tests

* feat: add initial stripe card saga test

* feat: finalize initial stripe card saga test

* feat: add patreon test saga

* feat: test clean up

* feat: do not show processing for Patreon

* feat: normalize donation settings

* feat: turn payment provider/contex to enum

* feat: remove donation-settings.js

* fix: git ignore generated config

* fix: ignore the generate config from everything

* fix: remove types.js

* fix: update linting to include types.js

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-12-20 18:03:06 +05:30
Shaun Hamilton
ec3ee856ec feat(tools): ignore no-unused-vars on underscore (#48386) 2022-11-04 10:43:46 +05:30
Mrugesh Mohapatra
b393d88b9e refactor: s/all-langs/i18n/g (#48258) 2022-10-26 10:08:27 -07:00
Shaun Hamilton
326e00fab8 fix(server): default to log fcc namespaces, unless env set (#48143) 2022-10-21 22:53:04 +05:30
Mrugesh Mohapatra
092d7d04d6 feat(api): add redirect for users blocked by okta (#47992)
* feat(api): add redirect for users blocked by okta

* fix: redirect blocked users immediately

* fix: return early if no userInfo

We can't proceed without it, so we have to ask the user to try again.

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-10-12 20:28:21 +05:30
SADIK KUZU
3522ce6f34 fix(api): write variable names in correct manner (#47883) 2022-10-11 17:25:56 +02:00
Shaun Hamilton
3a4640b678 fix(api): reorder certificate early returns (#47656) 2022-09-29 11:42:34 -07:00
Shaun Hamilton
73c3edb56a fix: certification to private on private timeline (#45562)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-09-29 00:00:22 +05:30
Oliver Eyton-Williams
a2790190b2 refactor: saving portfolio items (#47635) 2022-09-27 21:10:01 +05:30
abe
67217160f6 fix: allow user to add one unsaved item at a time (#47567)
Co-authored-by: kravmaguy <flex4lease@gmail.com>
2022-09-27 12:17:58 +05:30
Oliver Eyton-Williams
71b1d25d54 refactor: stop adding jwt to headers (#46367)
The client never uses the header, so there's no need for the api to set
it.
2022-06-16 09:42:32 -05:00
Oliver Eyton-Williams
3361419e87 fix: set _csrf to be httpOnly (#46366)
There's no need for JS to access it, so we can safely set it to be
httpOnly
2022-06-08 16:54:23 +03:00
Radi Totev
e581bd9081 feat(client): shortcuts legend modal available on pressing the ? key (#45530)
* Add modal texts in translations.json file

* Add shortcuts modal state in redux

* Create shortcuts modal

* Integrate shortcuts modal

* Resolve codefactor.io issues

* Extend list of shortcuts

Based on this comment:
https://github.com/freeCodeCamp/freeCodeCamp/issues/36841#issuecomment-933310078

* Remove temporary placeholder for modal title

* Open modal fom Hotkeys instead of learn.tsx

As suggested in this comment:
https://github.com/freeCodeCamp/freeCodeCamp/pull/45530#issuecomment-1101224993

* Complete list in transaltions

* Change shortcut presentation fo better a11y

Use table instead of list items as suggestedin this comment:
https://github.com/freeCodeCamp/freeCodeCamp/pull/45530#issuecomment-1101796368

* Add aria-labelledby

* Remove GAnalytics

* Remove leftover style

* Remove table caption

* autofocus on modal close button

* Improve modal a11y

- Add requested changes from https://github.com/freeCodeCamp/freeCodeCamp/pull/45530#issuecomment-1104764766
- Leave autofocus and parent div role=dialog changes for later. (https://github.com/freeCodeCamp/freeCodeCamp/pull/45530#issuecomment-1107754148)

* [WIP] Alllow users to turn off keyboard shortcuts

* Add keyboard shortcuts switch in settings

* Disable shortcuts

* Remove toggle switch description

* Refactor and cleanup

* Remove close button from modal header

Suggested by bbsmooth:
https://github.com/freeCodeCamp/freeCodeCamp/pull/45530#issuecomment-1107861091

* Fix lint issues

* Disable shortcuts

* Disable shortcuts by default

* Update challenge output test

* Update challenge-hot-keys test

* Disable shortcuts from inside handlers

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-06-03 09:57:52 -07:00
Mrugesh Mohapatra
85131d7d7b chore(api): update dependencies & apply audit (#46127) 2022-05-24 11:31:23 +05:30
Ahmad Abdolsaheb
1885b6ad96 fix: handle Sentry donation errors (#46074) 2022-05-19 16:32:11 +02:00
Naomi Carrigan
47b5fe90a3 fix(api): optional chaining on fallback fullstack (#46054)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-05-18 22:05:52 +01:00
Tom
f29c66b0dc fix: simplify savedChallenges update (#46032)
* fix: simplify working

* fix: remove unused

* revert: removal of function still needed
2022-05-18 16:56:47 +02:00
Oliver Eyton-Williams
21709a11cb chore: return 404 for update-my-current-challenge (#46042) 2022-05-18 08:39:52 -05:00
Oliver Eyton-Williams
1c8a0778a1 fix: make pm2 name match deployment env (#46035) 2022-05-18 13:40:29 +05:30
Oliver Eyton-Williams
0e77b1523f feat: add ecosystem file for pm2 (#46016)
* feat: add ecosystem file for pm2

* fix: use cluster mode, but with logs

* fix: stop hardcoding DEBUG

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-05-18 02:14:41 +05:30
Oliver Eyton-Williams
b8c61bd229 fix: simplify completedChallenges updates (#45862) 2022-05-17 17:37:50 +05:30
Tom
832e504ced fix: user object on account reset (#45929) 2022-05-12 18:27:11 +01:00
Shaun Hamilton
2717581b2f fix(api): add needsModeration flag to user document root (#45921)
* fix(api): add needsModeration flag to user document root

* fix prettiers complaints

* Update api-server/src/common/models/user.json

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
2022-05-11 15:30:51 -05:00
Tom
f04fbba22d feat: convert RWD cert projects (#44564)
* feat: convert RWD cert projects

* feat: convert original projects

* fix: add usesMultiFileEditor to meta

* feat: add cypress tests for saving and loading to/from database

* fix: broken cypress tests

* fix: inconsistent variable naming

* fix: missed variable name

* fix: more cypress

* feat: add solutions for english

* fix: ctrl+s to database only if signed in

* fix: prioritize code from db

* refactor: expand the comments slightly
2022-05-05 10:58:14 +02:00
Tristan Toye
dfe5a7fd05 Add Sentry to client for error handling (#43920)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-04-15 09:54:02 -05:00
Mrugesh Mohapatra
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
Oliver Eyton-Williams
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
Mrugesh Mohapatra
46cf96fbe1 chore(api): pin and update dependencies (#45282) 2022-02-28 21:59:15 +05:30
Naomi Carrigan
9e03419efb chore: dry out 410 logic (#45257) 2022-02-26 00:38:18 +05:30
Oliver Eyton-Williams
ce23dcb32c fix: return 410 for api/github (#45250) 2022-02-25 10:38:29 +01:00