Commit Graph

136 Commits

Author SHA1 Message Date
Matteo Pagliazzi
0c27fb24a5 start fixing commong 2019-10-09 16:51:17 +02:00
Matteo Pagliazzi
621787915c start upgrading eslint 2019-10-08 16:57:10 +02:00
Matteo Pagliazzi
90c917f69e fix duplicates in code 2019-10-08 15:05:48 +02:00
Matteo Pagliazzi
50cae0165c Revert "Fix: Antidotes to Avatar Transformation Items should be added to Rewards by API (#11353)" (#11406)
This reverts commit 5b57d91a9b.
2019-10-07 16:55:44 +02:00
Aleksey
5b57d91a9b Fix: Antidotes to Avatar Transformation Items should be added to Rewards by API (#11353)
* Fix: moved debuffPotions from vue component

- Move logic of choosing proper debuf potion from vue component to website commons
- introduce new function to get debuffSpellItems

* Fix: move debuffPotions to server

* Refactoring: move setting of debuff potion to func

* Fix: sanity

* Refactoring & Tests:

- Create test case for get and set DebuffPotionItems functions
- Fix setDebuffPotionItems function to not create duplicated debuff items
- Make debuff potion type of items unpinnable
- Move list of debuffs to constant to reuse it in tests and functions

* Fix: typo in test describe

* Fix: translation of unpin

* Fix: setDebuffPotionItems on cron buffs reset

* Fix: use full path for debuff potions
2019-10-06 18:41:39 +02:00
cheng-shiqi
ca7399f6c1 Repair negative quest scrolls on (gem)purchase (#11399)
* Fix: Reset negative quest scrolls number to zero on purchase(gem)

* Refactor: rename website/common/script/ops/buy/buyQuest.js to website/common/script/ops/buy/buyQuestGold.js and update related files

* Test: add two tests related to negative quest scrolls
2019-10-06 17:06:02 +02:00
Matteo Pagliazzi
17c7a2bad1 fix common tests 2019-10-03 16:27:44 +02:00
Matteo Pagliazzi
cca5b8492b fix exports 2019-10-01 17:53:48 +02:00
Sabe Jones
01d272d2c4 Teams Updates 201908 (#11347)
* fix(teams): no hover bg change for noninteractive checkboxes

* feat(teams): send notification to managers on task claim
Also fix client unit test broken by prev commit

* feat(groups): don't penalize for tasks assigned since last activity

* fix(tests): actually fix client unit

* fix(teams): improve task styles

* fix(teams): let people other than leader see relevant approvals
Also more style fixes

* fix(approvals): better filtering and task headings for approval data

* fix(test): correct test expectations for new GET /approvals behavior

* fix(groups): style tweaks

* different border for group and normal tasks

* fix(teams): remove extra click for claiming

* fix(teams): leaders & managers can check off approval-required tasks

* fix(teams): don't notify user of own claim

* fix group task margin and z-index on hover

* fix(menu): sporadic error in top bar

* fix(teams): more approval header and footer adjustments

* fix(tests): adjust expectations for self-approval

* fix(teams): address PR comments

* refactor(timestamps): date user activity on authenticated requests

* refactor(timestamps): update local user instead of direct db update
2019-09-26 14:49:11 -04:00
negue
3aa2e30815 Purchase API Refactoring: Mounts [Hourglass] (#10482)
* AbstractGemItemOperation - BuyQuestWithGemOperation

* fix purchase
2019-09-20 16:52:15 +02:00
Sabe Jones
56b4008835 Merge branch 'release' into develop 2019-09-17 16:11:30 -05:00
Sabe Jones
7d732b5612 feat(content): new pet color achievements 2019-09-17 16:10:32 -05:00
Gurkirpal
201b4551a3 Check food is Saddle before selling 2019-09-11 19:32:51 +05:30
Gurkirpal
9709b92d33 Use sellWarningNote as warning string 2019-09-11 07:53:36 +05:30
Gurkirpal
c39f53c224 [WIP] Make saddles not sellable 2019-09-11 07:53:35 +05:30
Aleksey
65906f0b71 Fix: reset streak for habits after rebirth (#11345)
* Fix: reset streak for habits after rebirth

- Modify current test of reseting streaks
- Add new if branch for task with "habit" type

* Fix: reset habits by another keys (counterDown/counterUp):

- Fix test for correct way of reseting habits
- Use another keys for reseting habits
2019-09-09 15:46:49 +02:00
Sabe Jones
fc841d0ad4 Hourglass Quest (#11325)
* feat(content): Hourglass Quest

* fix(hourglasses): NaN from undefined

* fix(quests): sanity check for negative scrolls

* fix(hourglasses): don't show quantity selection for binary items

* fix(route): validate number, use body not params

* test(timetrav): add quest tests
2019-08-29 15:22:12 -04:00
Phillip Thelen
6784d23a7c Add translated gear name to open-mystery-item call (#11306)
* Add translated gear name to open-mystery-item call

* Fix test

* fix mystery item text language
2019-08-16 19:40:49 +02:00
Sabe Jones
07ae4134f3 Squashed commit of the following:
commit 0db0a69f0fa00d831b7d90340e045097e8d92343
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jul 16 10:01:49 2019 -0500

    fix(groups): return 0, not empty, when skipping downscore on Dailies
    fixes #11231

commit 1bf5bc714f660345f37bcc4e3587143341521c65
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jul 16 09:48:28 2019 -0500

    fix(groups): correct task creation button

commit 90908211200bc4a3eb204178df5c812ffcd09f37
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jul 16 09:46:04 2019 -0500

    fix(groups): clear approval status at cron for Habits and Dailies

commit 57e8dd0252c3ea45dd6fa1a7670ee197f32e76e5
Merge: d31b0a2d0 c9a56e8f3
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jul 16 09:33:27 2019 -0500

    Merge branch 'develop' into sabrecat/group-tasks

commit d31b0a2d0e3b7a46235696e9b05fa734ac29a2e5
Merge: f2185a91b 043696c22
Author: SabreCat <sabrecat@gmail.com>
Date:   Mon Jun 24 14:58:26 2019 +0000

    Merge branch 'develop' into sabrecat/group-tasks

commit f2185a91bde554c7eb22cd6bdfc1ef9227f1e765
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jun 18 10:10:10 2019 -0500

    fix(groups): divide task delta by number of assigned users

commit af0cde52f22129312d0102ecc5571f59aa2e396e
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jun 18 10:06:01 2019 -0500

    fix(groups): remove chat spam

commit c1c810967a9e34155948a9164862125517372268
Merge: bf4f3fb08 f987585cf
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue Jun 18 08:15:28 2019 -0500

    Merge branch 'develop' into sabrecat/group-tasks

commit bf4f3fb08491b4c4e1dbfaa58a2a6510c3cb78aa
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu May 23 11:29:01 2019 -0500

    fix(test): expect new task class from store

commit ae0379c80519523f68d4d606e1cc4bed8e9e49ec
Merge: ce5096e11 664cf5a47
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu May 23 11:25:15 2019 -0500

    Merge branch 'develop' into sabrecat/group-tasks

commit ce5096e116558419e4a73e8b23a58c78a1f2ab9b
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu May 23 11:02:01 2019 -0500

    feat(group-plans): clarify non-interactive controls on task board

commit ff3cec9530e30d51c43171d6f97d3888ff200352
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Tue May 21 11:10:50 2019 -0500

    feat(group-plans): score shared task when user scores it
2019-08-02 15:49:41 -05:00
Matteo Pagliazzi
14a4f42b50 indentation 2019-06-17 20:47:55 +02:00
Matteo Pagliazzi
2cbb0a85a4 limit free rebirth to once every 45 days 2019-06-17 20:37:18 +02:00
Sabe Jones
81333a3074 feat(notifications): alert user to achievements 2019-06-11 13:06:00 -05:00
Sabe Jones
7094e75dd8 feat(achievements): new pet-related cheevos 2019-06-04 10:31:25 -05:00
Sabe Jones
6f7cd96e9f Improved number validation (#11131)
* fix(purchasing): more number validation

* test(purchasing): add error cases
Also refactor NaN check and create client mixin

* fix(purchasing): cover "purchase" cases
2019-04-23 15:19:49 -05:00
Sabe Jones
6b933914ef fix(pets): disallow hatching quest pets with Wacky potions 2019-04-09 16:25:49 -05:00
Matteo Pagliazzi
0b8ce63c76 WIP: Improve User model performances (#10832)
* wip: define items as mixed objects

* add default owned gear

* mark modified

* more mark modified

* more mark modified

* more mark modified

* more mark modified

* fix common tests

* fix common tests

* update mongoose

* add itemsUtils

* use new util function in hall controller

* add tests for items utils

* update website/server to mark all items as modified

* start updating common code

* update login incentives

* update unlock

* remove changes to package-lock.json

* remove changes to package.json
2019-04-01 19:24:18 +02:00
negue
f35ef3a046 Multiple checks for pinnedItems (#11031)
* remove null/undefined entries from pinnedItems when an item is toggled - more inner checks + test

* drawer: fix when there isn't a page available

* rollback cleaning up pinnedEntries on item-toggle

* remove "re-setting" pinnedItems

* remove the filter
2019-03-31 20:41:37 +02:00
negue
844d3fbf37 refresh gear overview (#10971)
* refresh bought seasonal gear

* just "subscribe" to the _v change instead of returning the value

* subscribe in vue instead of lib
2019-02-10 19:32:14 +01:00
Sabe Jones
4d1b239231 Track specific items dropped by Armoire (#10977)
* feat(analytics): track specific items dropped by Armoire

* fix(lint): remove console log

* fix(analytics): address test failures

* fix(analytics): add missed if block

* fix(analytics): seriously tho actually fix
2019-02-10 19:30:49 +01:00
Sabe Jones
df860c9401 fix(quests): repair negative quest scrolls on purchase (#10953) 2019-01-26 18:46:52 +01:00
negue
e2c5b9058b more checks on the item.klass, also added the specialClass checks (#10859) 2018-11-22 14:35:34 +01:00
negue
eca7382545 prevent buying market gear if class doesn't match (#10818)
* prevent buying market gear if class doesn't match

* add test
2018-11-12 21:32:54 +01:00
Nathanael Farley
a48a6a292d If user's cron will happen later today, start the task yesterday. (#10783)
* If user's cron will happen later today, start the task yesterday.

* Added default dayStart to taskDefaults.

* Removed the need to call shouldDo twice to calculate nextDue.

* Revert "Removed the need to call shouldDo twice to calculate nextDue."

This reverts commit e1467f2fc33cfb11e6a4fc667460df6a48b69d45.

* Removed defaults from taskDefault arguments.

* Got user from $store in copyAsTodoModal.vue.

* Fixed tests for taskDefaults to include mock user.

* Fix shouldDo tests when run in GMT timezone.

* Added test to taskDefault; added utcOffset to taskDefault.

* Replaced utcOffset with zone.

* Removed erroneous import.
2018-11-02 16:58:01 +01:00
Kirsty
1395380dfe Animal ears after death (#10691)
* Animal Ears purchasable with Gold if lost in Death

* remove ears from pinned items when set is bought

* standardise css and error handling for gems and coins

* revert accidental new line
2018-09-24 17:36:26 +02:00
Carl Vuorinen
71c0939a15 Fix API early Stat Point allocation (#10680)
* Refactor hasClass check to common so it can be used in shared & server-side code

* Check that user has selected class before allocating stat points
2018-09-21 16:55:55 +02:00
Matteo Pagliazzi
26c8323e70 Move inbox to its own model (#10428)
* shared model for chat and inbox

* disable inbox schema

* inbox: use separate model

* remove old code that used group.chat

* add back chat field (not used) and remove old tests

* remove inbox exclusions when loading user

* add GET /api/v3/inbox/messages

* add comment

* implement DELETE /inbox/messages/:messageid in v4

* implement GET /inbox/messages in v4 and update tests

* implement DELETE /api/v4/inbox/clear

* fix url

* fix doc

* update /export/inbox.html

* update other data exports

* add back messages in user schema

* add user.toJSONWithInbox

* add compativility until migration is done

* more compatibility

* fix tojson called twice

* add compatibility methods

* fix common tests

* fix v4 integration tests

* v3 get user -> with inbox

* start to fix tests

* fix v3 integration tests

* wip

* wip, client use new route

* update tests for members/send-private-message

* tests for get user in v4

* add tests for DELETE /inbox/messages/:messageId

* add tests for DELETE /inbox/clear in v4

* update docs

* fix tests

* initial migration

* fix migration

* fix migration

* migration fixes

* migrate api.enterCouponCode

* migrate api.castSpell

* migrate reset, reroll, rebirth

* add routes to v4 version

* fix tests

* fixes

* api.updateUser

* remove .only

* get user -> userLib

* refactor inbox.vue to work with new data model

* fix return message when messaging yourself

* wip fix bug with new conversation

* wip

* fix remaining ui issues

* move api.registerLocal, fixes

* keep only v3 version of GET /inbox/messages
2018-09-21 15:12:20 +02:00
Sabe Jones
c78b5ecf7c Analytics: More / improved tracking (#10608)
* WIP(analytics): add / improve tracking

* fix(groups): revert attempt at tracking on group model

* fix(analytics): track questing based on user data

* each buy-operation now has a getItemType method - typo getItemKey - removed unneeded overrides
2018-08-20 14:13:22 -05:00
negue
07991817e7 check balanceRemoved for analytics call (#10506) 2018-07-13 10:51:49 +02:00
Matteo Pagliazzi
e7944b3d98 iOS push notifications, use node-apn (#10517)
* fixing typos in comments. yes, I am that kind of nerd

* replacing push-notify with node-apn in deps and in pushNotifications.js

* updating calling code and tests to use node-apn

* updating APN configs to new format

* migrating team ID and key ID to config.json

* update code to use env variables and add correct topic
2018-07-12 12:56:15 +02:00
negue
d9b573b430 AbstractGemItemOperation - BuyQuestWithGemOperation (#10476) 2018-06-28 12:37:21 +02:00
Matteo Pagliazzi
c1bd7f5dc5 Habits: store one history entry per day (#10442)
* initial refactor

* add scoredUp and scoredDown values for habits history entries, one entry per habit per day

* fix lint and add initial migration

* update old test

* remove scoreNotes

* dry run for migration

* migration fixes

* update migration and remove old test

* fix

* add challenges migration (read only)

* fix challenges migration

* handle custom day start

* update tasks in migration

* scoring: support cds

* add new test
2018-06-21 21:25:19 +02:00
Brian Fenton
ac90a40be5 Api quest restrictions - no purchase/start without fulfilling eligibility requirements (#10387)
* removing duplicate translation key

* fixing typos

* extracting quest prerequisite check. adding check for previous quest completion, if required

* fixing (undoing) static change, adding tests

* more typos

* correcting test failures

* honoring quest prerequisites in quest invite API call. updating format of il8n string replacement arg

* no longer using apiError, use translate method instead (msg key was not defined)

* adding @apiError to docblock as requested in issue

* removing checks on quest invite method. small window of opportunity/low risk
2018-05-27 16:41:56 +02:00
negue
3d39718048 Purchase API Refactoring: Spells [Gold] (#10305)
* convert buySpell operation

* remove purchaseWithSpell - change purchaseType 'special' to 'spells' - fix lint

* fix tests

* rollback 'spells' to 'special'
2018-05-18 17:00:39 +02:00
Sabe Jones
bbbd1f9f73 Merge branch 'release' into develop 2018-05-08 18:41:13 +00:00
Alys
8470f16f4f allow subscribers to buy their final monthly gem (#10331) 2018-05-07 15:20:28 +02:00
negue
c26696a9eb moving developer-only strings to api/common messages (#10258)
* move translatable string to apiMessages

* use apiMessages instead of res.t for groupIdRequired / keepOrRemove

* move pageMustBeNumber to apiMessages

* change apimessages

* move missingKeyParam to apiMessages

* move more strings to apiMessages

* fix lint

* revert lodash imports to fix tests

* fix webhook test

* fix test

* rollback key change of `keepOrRemove`

* remove unneeded `req.language` param

*  extract more messages from i18n

* add missing `missingTypeParam` message

* Split api- and commonMessages

* fix test

* fix sanity

* merge messages to an object, rename commonMessage to errorMessage

* apiMessages -> apiError, commonMessages -> errorMessage, extract messages to separate objects

* fix test

* module.exports
2018-05-04 16:00:19 -05:00
negue
4f963e99dc Purchase API Refactoring: Gems [Gold] (#10271)
* remove `keyRequired` - change to `missingKeyParam` - i18n-string

* extract & convert buyGemsOperation

* fix lint
2018-04-27 19:29:26 +02:00
SabreCat
9f06d78db6 Revert "moving developer-only strings to api messages (#10188)"
This reverts commit a42cb0e3ab. Testing hypothesis that this was causing Staging to break.
2018-04-15 17:09:15 +00:00
negue
a42cb0e3ab moving developer-only strings to api messages (#10188)
* move translatable string to apiMessages

* use apiMessages instead of res.t for groupIdRequired / keepOrRemove

* move pageMustBeNumber to apiMessages

* change apimessages

* move missingKeyParam to apiMessages

* move more strings to apiMessages

* fix lint

* revert lodash imports to fix tests

* fix webhook test

* fix test

* rollback key change of `keepOrRemove`

* remove unneeded `req.language` param

*  extract more messages from i18n

* add missing `missingTypeParam` message
2018-04-14 16:13:13 +02:00
negue
6c4c5b4697 always check for the quantity not (#10251) 2018-04-13 21:04:08 +02:00