Commit graph

734 commits

Author SHA1 Message Date
Bruce Berrios c894a862e4
Add xp reward overrides (#3525) Bruception, Miodec
* Add xp reward overrides

* edge case

* switched to defined brackets instead of just min and max

* foreach

* moved type to its own interface

* updated spec

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-09-08 22:38:28 +02:00
Miodec e9c6534c39 fixed failing test 2022-09-07 13:53:34 +02:00
Miodec 5bf0c9a951 moved streak logic from controller to dal
closes #3515
2022-09-07 13:15:37 +02:00
Miodec 9e7e0fc6ff checking if inventory is undefined 2022-09-06 17:02:35 +02:00
Miodec fada34500d fixed users being unable to claim their rewards 2022-09-06 16:57:54 +02:00
Miodec 1c82d85662 not sending awards if maxXpReward is 0 2022-09-05 15:16:50 +02:00
Miodec ee5c07d10a displaying longest streak on profile 2022-09-05 15:12:24 +02:00
Miodec 949e49cfa2 added maxstreak 2022-09-05 15:05:12 +02:00
Miodec 85dc20e8cd Merge branch 'newnav' 2022-09-05 13:55:09 +02:00
Miodec d461255be1 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-09-05 12:17:59 +02:00
typermonkeyuser b08c194c3d
Implement streaks (#3385) typermonkeyuser, bruception, miodec
* Implement streaks

* Improve code

* Update package.json

* Store streak on the user

* Pretty-fix

* Ensure that streak is up to date

* Fix issue in streak calculation

* Revert prettier changes

* Update polish.json

* Update db.ts

* Remove initial calculation

* Write mandatory test

* using strict equality

* moved functions to the utils file

* importing utils

* adding streak to breakdown,
rounding and parsing streak modifier

* renamed variable

* renamed fields

* using correct field name

* added streaks to configuration

* showing streak during xp breakdown

* incrementing streak earlier
checking configuration before applying modifier

* returning streak to the client

* setting local streak with the number returned from the backedn

* only reading streak when updating profile instead of updating

* sending streak information in profile

* only showing streak if greater than 0

* setting to empty if no streak

* renamed config property

* updated streak calculation

* refactored isYesterday

* refactored streak update

* only displaying if streak larger than 1

* merged configuration properties into 1

* added configuration for max streak bonus

* added isToday check back (derp)

* reverted streaks back to multiplier approach

* using better maprange functin

* removed import

* moved test to dal spec

* clamping

* removed imports

* fixed test

* increased coverage

* removed angry console log

* typo

* using date now instead of dates

* mocking date now
awaiting expect

* not using date

Co-authored-by: Anonymous <110769200+fasttyperdog@users.noreply.github.com>
Co-authored-by: Rizwan Mustafa <rizwanmustafa0000@gmail.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-09-05 12:13:55 +02:00
Miodec de251d0741 checking if xp is nan 2022-09-05 02:19:21 +02:00
Bruce Berrios 20a5cac5e6
Reward daily leaderboards and refactor mail API (#3508) Bruception
* Reward daily leaderboards and refactor mail API

* Reorder

* Change mail template
2022-09-04 23:58:46 +02:00
Miodec 2a7b6a874c updated message 2022-09-04 20:18:27 +02:00
Miodec 93ab0c6116 not using template 2022-09-04 20:16:01 +02:00
Miodec 86371ae432 only sending inbox data if inbox is enabled 2022-09-04 20:06:05 +02:00
Miodec 283c2773c5 Merge branch 'master' into newnav 2022-09-04 20:04:08 +02:00
Miodec 18f9785e04 sending to inbox if user got banned 2022-09-04 20:03:27 +02:00
Miodec 002d007f1f returning if user got banned 2022-09-04 20:03:09 +02:00
Miodec 2f21bff1a2 fixed corrected everything bonus being applied too often 2022-09-04 18:22:24 +02:00
Miodec 2081f29f32 omiting selected field 2022-09-03 14:38:34 +02:00
Miodec f61691d4fe sending max mail in response 2022-09-02 00:03:15 +02:00
Miodec de895a1cd2 converted font size to use an input field allowing any font size 2022-08-30 22:34:27 +02:00
Bruce Berrios 4b49900d57
Add inbox (#3458) Bruception
* Add basic inbox

* Changes

* Remove export

* Move condition

* Use for each
2022-08-30 15:19:26 +02:00
Miodec e43a30b39d building breakdown object on the server 2022-08-29 01:33:18 +02:00
Bruce Berrios 0dfa3ef773
Urgent (#3457) 2022-08-27 20:39:02 +02:00
Bruce Berrios 87a0da839a
Add endpoint for getting server config (#3431) Bruception
* Add endpoint for getting server config

* Fix route stack

* Add comment
2022-08-23 12:24:37 +02:00
Miodec 453e88599f removed another one 2022-08-22 16:16:58 +02:00
Miodec 4c4f20313f removed word from profanities 2022-08-22 16:16:40 +02:00
Miodec 6f41db5575 30 instead of 7 days 2022-08-22 14:27:36 +02:00
Bruce Berrios 5a0e8ae72e
Housekeeping (#3374) 2022-08-08 16:16:07 +02:00
Bruce Berrios 43a384c0e0
Fix/refactor xp (#3373) bruception
* Fix/refactor xp

* Prettier fixes

* Prettier
2022-08-06 16:57:01 +02:00
Miodec cf15878713 calculating daily bonus based on the total user xp, up to 1000 2022-08-05 15:40:35 +02:00
Miodec 115d32ab26 disabled daily bonus for now 2022-08-05 15:19:12 +02:00
Miodec 18c7d7db18 fixed server always reporting daily bonus 2022-08-05 15:13:07 +02:00
Miodec 2ee84972ee catching error 2022-08-05 00:56:17 +02:00
Miodec a32821c02e added min values in result schema 2022-08-05 00:33:11 +02:00
Miodec fdcc1337ae added daily bonus 2022-08-05 00:27:06 +02:00
Miodec 84443d8f8b allowing custom 2022-08-04 18:30:36 +02:00
Miodec 3b4229ffc1 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-08-04 17:41:11 +02:00
Miodec cc6234f2b9 using long 2022-08-03 23:17:50 +02:00
YummyOreo 9cbcdf9062
resets the xp when reseting account (#3359) YummyOreo
* resets the xp when reseting account

* adds test for reseting user
2022-08-03 16:28:46 +02:00
Miodec fb4c47792c removed custom onresponsefinish function 2022-08-02 20:31:41 +02:00
Miodec da4aac9a15 adjusted punctuation and numbers modifiers 2022-08-02 00:49:03 +02:00
Miodec e48fdc2a89 added xp and levels 2022-08-02 00:21:09 +02:00
Jan Golebiowski 3a73954b45
Added config for displaying the keymaps top row (#3353)
* added config for displaying the keymaps top row

* fixed keysplit for top row

* prettier

* lined up top row properly

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-07-31 12:47:31 +02:00
Aayush Paurana 725a074bd8
making profile endpoint accessible with ape keys and adding the relev… (#3317)
* making profile endpoint accessible with ape keys and adding the relevant documentation #3256

* withApeRateLimiter middleware added #3265

* fixed documentation errors #3256

* fixed documentation errors #3256
2022-07-20 11:22:27 +02:00
Miodec b9973f1277 ads 2022-07-12 13:01:26 +02:00
Bruce Berrios af70bc5971
Bump coverage (#3314) 2022-07-06 21:01:58 +02:00
YummyOreo e794bbd68d
Adds a reset account button to the settings page (#3206) YummyOreo
* adds reset button

* moves it up above the delete button

* i am blind

* i cant move stuff

* adds reset for the profile

* Adds reseting for ape keys, and presets, also adds more resets in the user settings

* Delets all ape keys not just one

* Prevents conflicts for delete endpoints

* changes from reset to deleteAll in ape keys

* Refactors the code to use Promise.all

* adds reloading

* unit tests ape key deletion

* fixes some bugs

* Fixes type o

* More typeo fixes

* Returns nothing for reset user

* Simplifies code

* changes from reset to deleteAll for all but users

* Checks db not the memory

* fixes typo

* fixes the tests

* fixes

* fixes bugs and refactors some code

* adds requireFreshToken to the authentication

* migrates all reseting to the user endpoint

* removes the delete all for ape unit test

* to lazy to make commit message

* parallelize the calls to the db (I think)

* also resetting config

* also resetting discordid and avatar

* using unset

* updated wording

* level 1 message

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-07-06 12:59:40 +02:00