Commit graph

869 commits

Author SHA1 Message Date
Miodec 18f27c26db added admin endpoints configuration 2023-03-27 15:12:33 +02:00
Miodec f90a8f6e02 inverted property logic 2023-03-27 13:42:13 +02:00
Jack 317f5b23ba
Admin auth (#4101)
* added admin auth

* always decoding token
2023-03-24 12:17:27 +01:00
Miodec ce4087d0bd missing param 2023-03-21 15:40:32 +01:00
Miodec fd0120d075 added duplicate result log 2023-03-21 15:02:25 +01:00
Evan 642e99331e
Require === and !== in Backend (#4086) Ferotiq
* eqeqeq in backend

* simplify
2023-03-20 12:11:21 +01:00
Miodec 0102dc1806 optional for a while 2023-03-16 14:46:49 +01:00
Albert 7ed088a13e
Account graph (#4049) albertying
* Create graph with ao10, ao100, and pb

* Display best ao10 and 100

* Fix ts errors

* Remove old graph

* Remove smoothing slider and toggle chart style button

* Clean up code

* Populate graph if chartData > 0

* Fix filter not displaying data correctly

* Fix wpm cpm labels

* Update colors using theme colors

* brought back accuracy averages

* different colors

* Add toggle ao10 and ao100

* Change opacity based on toggles

* Persist on refresh

* Fix accountActivity chart point color not updating when changing theme in the command line

* Refactor

* Keep pb color consistent

* removed dot

* smaller buttons, in one row, media queries

* hiding bottom scale

* connected the config properties into 1

* Refactor

* Combine into one loop

* cleanup
removed unused functions
reduced repeating code
removed comments
removed console logs

* removed highest avg 10 and 100 stats

* sweep

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2023-03-16 12:57:47 +01:00
Rob Sassack 239c43f240
Added plus three funbox (#4076) robsassack 2023-03-16 12:55:36 +01:00
Miodec 85606bcb6c added strong types to later queue
closes #3966
2023-03-06 15:40:53 +01:00
Miodec 5c93fa7edf added better error to try to identify an issue 2023-03-03 12:10:43 +01:00
Jack 56d8c7c9ae
Added ability to opt out of leaderboards (#4016)
* added button to opt out of leaderboards

* also not allowing daily leaderboards

* also not allowing weekly lb

* added lb opt out notice on the leaderboards

* updated message

* resetting lboptout state on account reset
2023-02-25 23:26:06 +01:00
Miodec 6dab8323a5 updated schema 2023-02-23 21:05:09 +01:00
Miodec 4400ebe538 added duplicate result check 2023-02-21 14:03:56 +01:00
Miodec 6ed5a9422d added zipf funbox 2023-02-21 13:14:36 +01:00
Bruce Berrios 5337a9bb99
Add weekly xp rewards results job (#3939) bruception
* Add weekly xp rewards results job

* Fix formatting

* Pluralize

---------

Co-authored-by: Jack <jack@monkeytype.com>
2023-02-20 12:30:14 +01:00
Miodec 126e67811c removed length check 2023-02-20 11:57:54 +01:00
Rob Sassack 3deb2809a1
Added binary mode to funbox (#4005) robsassack
* Added binary mode to funbox

* changed description and added punctionation off for binary funbox
2023-02-19 13:02:45 +01:00
Miodec 4781755fef replaced email address 2023-02-13 23:55:08 +01:00
Miodec cecfd8b7b5 custom handling error 2023-02-13 15:28:20 +01:00
Miodec aa4f0a41f3 returning false if response was not ok 2023-02-13 15:10:15 +01:00
Jack 1ca0fd1b23
Custom email (#3964)
* added nodemailer and mjml

* added email template

* basic email util file

* added email queue

* email worker

* renamed folder

* showing which queues and workers were initialized

* initializing email on server boot
added some test code

* renamed to email worker

* type fix

* renamed queue

* added queue to list

* added worker to list

* logging when config was verified

* handling send mail result

* not minifying (not supported anymore)
using .html property
returning correct value

* dont send me emails

* added port to .env

* updated example

* updated test email

* using env email

* parseint base

* message

* refactor

* message

* rename

* moved email templates

* using async file read

* typo

* using mustache

* moved file
renamed to email client

* logging with prometheus

* added social links

* line

* using stronger types (object instead of array of any[])
moved prometheus logging into email client
added function to send mail using a template

* fixed templates not working

* removed console log

* name change

* rename

* moved templates

* rename

* string interpolation

* string interpolation

* moved to dev dependencies, exact versions

* moved types

* removed function, remove unnecessary if

* update template params

* updated name

* fixed button not clickable

* throwing

* moved template metadata to one place

* rename

* sending email on account creation

* removed test code
removed await

* fixed button

* not stopping the server if email client validation failed

* added metric for queue lengths

* exposing getjobcounts

* added job to log queue lengths

* added endpoint to request verification email

* using send verification email that calls api instead of firebase built in

* updated route

* renamed function

* recording time to complete

* returning 400 if email already verified

* setting transport initialized to true earlier, setting it to false if caught error

* moved forgot password flow to a simple popup, added new endpoint to ape

* added forgotpasswordemail route

* added email tempalte

* setting transport to false if caught error

* added email queue function

* moved try higher

* fixed log
2023-02-13 13:24:43 +01:00
Jerry Zhou da9b691bb1
New Sound on Click - Pentatonic Scale (#3970)
* added scale function

* cleaned up merge

* cleaned up scale implementation and created closure for previewing scales

* finalized changes

* fixed ci/de

* switched to upper camel case

* undid accidental changes

* updates

* fixed indexing bug and audioCtxt being intialized

* removed mapping

* updated schema with non-inclusive range for two new sound-on-clicks

---------

Co-authored-by: Bruce Berrios <bberr022@fiu.edu>
Co-authored-by: Bruce Berrios <58147810+Bruception@users.noreply.github.com>
2023-02-10 18:11:52 -05:00
Miodec 47c581c5f8 recording time to complete job
closes #3965
2023-02-09 15:27:55 +01:00
Miodec 41834d9c5e logging every 5 minutes 2023-02-01 12:09:08 +01:00
Miodec 666522c0b3 added job to log queue lengths 2023-02-01 02:05:19 +01:00
Miodec bb39afa753 exposing getjobcounts 2023-02-01 02:05:15 +01:00
Miodec 06a2c91eee added metric for queue lengths 2023-02-01 02:05:08 +01:00
Miodec b177232710 refactor 2023-01-31 01:04:04 +01:00
Miodec 921aa94dc7 added cron job to log collection sizes 2023-01-30 16:53:12 +01:00
Miodec 14ad135483 updated messages 2023-01-29 15:20:04 +01:00
Miodec 2dd1baac95 added another custom error handler
changed returned code
2023-01-29 15:14:46 +01:00
Miodec 2aa95b4526 added custom error handling 2023-01-29 14:43:04 +01:00
Jack 6647a81ad1
Structure (#3951)
* created file which holds skeletons for popups

* using skeleton

* saving skeleton after the events are bound

* moved click event to a static element

* using skeleton

* added hide and show functions
using skeleton

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* fixed a bug where updating the preset name would not immediately show the update

* using skeleton

* shorter link transition

* using skeleton

* using skeleton

* using skeleton

* fixed a bug where accounts with no pbs would cause misplaced "show all pbs" button

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* fixed quote mod not being sent to the client

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* using state object instead of html attributes
fixed a bug where no tags text would persist even when tags were added to the test
using skeleton

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* removed unused code

* unnecessary import

* unused code

* using skeleton

* changed click handling element
only hiding and restarting the test if init returned true

* using skeleton
returning boolean from init function

* removed console log

* added function to check if a popup is visible

* better visibility check

* rewrote alerts to use state object instead of pushing straight to dom
using skeleton

* better visibility check

* not using skeleton for now

* using skeleton
using state object
better visibility check

* added parent override

* unnecessary code

* changed function to a more generic one

* fixed cookie popup text possibly overflowing popup

* using "isPopupVisible" function instead of a "hasClass" check
added some missing escape key handlers

* using skeleton

* using skeleton

* using skeleton

* using skeleton

* standard popup animation length

* consistent animation timing

* using iselementvisible function

* removed unused function

* using isElementVisible

* proper show and hide functions, added callback funciton on hide,
added noAnim params

* fixed no animation on the logo sub text

* reordered click handlers

* moved code to a fill function

* using proper show and hide functions
added callback on hide param
added no anim and no callback parameters

* added no anim parameter
callback func is optional

* also applying noanimation to hiding animation

* using proper hide and show functions

* using iselementvisible

* using skeleton

* missing space

* storing text area state in custom text

* using skeleton

* setting state on show instead of on hide

* moved click handler

* unused code

* missing parent override

* using skeleton

* no longer waiting for document to be ready

* settings using skeleton

* profile search using skeleton

* page profile using skeleton

* navigating to account if already logged in

* using skeleton

* using skeleton

* emptying result replay and words history on restart

* optimised theme picker

* optimised settings page fill

* performance optimisation

* awaiting promises

* brought back code that was accidentally removed

* async

* addad param to avoid duplicate group update on settings page load

* added main thread yields to remove long tasks

* optimising performance of about page loading

* not awaiting

* breaking up long tasks to optimise performance

* optimised button appending

* fixed avatar being too big

* optimisation
splitting up code
added yields to split tasks

* fixed merge

* removed sleep

* missing chart color update

* updating main chart first

* disabling animation during update

* updating chart colors once instead of on every update

* added one more sleep

* removed sleep causing graphical issues

* update chart regardless if it has data or not

* hiding estimated words typed when no data was found
2023-01-27 15:10:07 +01:00
Rizwan Mustafa 85f52ff49e
Add typescript support for jest (#3949) rizwanmustafa
* Add typescript support for jest

* Add typescript support for jest setup-tests.ts

* Some more bug fixing
2023-01-26 14:13:14 +01:00
Oxey 6c9ee41444
Make quote actions not break with c++ language (#3925) o-x-e-y
* Make quote actions not break with c++

c++ currently obviously has `+` symbols which means stuff like quote ratings break because of the validation regex. I feel like changing `\w` straight to `.` would also be fine since languages and their names get approved manually, but this should work fine for now

* fix silly mistake

a `.regex()` got removed for whatever reason

* Fix prettier bug

* remove unnecessary spaces

Co-authored-by: Rizwan Mustafa <rizwanmustafa0000@gmail.com>
2023-01-26 14:09:11 +01:00
Miodec 698d43d64e more validation 2023-01-25 23:52:37 +01:00
Miodec 385fc00ea2 more regex validation 2023-01-25 23:52:28 +01:00
Miodec 6bdf6de1f6 added body validation 2023-01-25 23:41:53 +01:00
Jack 59b252389e
fix: backend/package.json & backend/package-lock.json to reduce vulnerabilities (#3945)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-SIMPLEGIT-3177391

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2023-01-25 23:21:53 +01:00
Jack 2f46176f34
Allowing configuration endpoint access if user is configuration mod (#3936)
* showing error when fetch failed

* added function to only use an array of middlewares in production

* allowing patch configuration and get schema if user is a configuration mod

* fixed empty middleware not working as expected
2023-01-24 16:00:29 +01:00
Bruce Berrios b36c842921
Add stricter typing to configuration (#3933) Bruception 2023-01-24 15:41:21 +01:00
Miodec 4c1175e698 showing error when fetch failed 2023-01-24 14:03:31 +01:00
Miodec 178b6ae83d schema update 2023-01-24 13:15:16 +01:00
Bruce Berrios 74fe4c864d
Add later queue (#3789) bruception
* Add later queue

* Fix test

* renamed property

* update name

* missing rename

* try 23 times

Co-authored-by: Miodec <jack@monkeytype.com>
2023-01-23 14:07:11 +01:00
Veemyu d2a8b316c6
Add an upside down mode to the Funbox (#3915) Veemyu
* Add Upside Down to Funbox

* Resolve formatting issues

* Re-add missing css
2023-01-16 22:19:58 +01:00
Miodec 9d11dafd7c not storing incomplete tests 2023-01-15 14:05:41 +01:00
Miodec 75d635eef5 protecting against negative xp 2023-01-11 22:03:51 +01:00
Miodec adf47214db added option to report users 2023-01-09 18:20:56 +01:00
Miodec a926ad4d1f checking with regex 2023-01-07 17:05:21 +01:00