Commit Graph

51 Commits

Author SHA1 Message Date
Phillip Thelen
f8d315ff6e Upgrade to mongoose 7 (#14971)
* remove some unused dependencies

* update mongoose version

* make common tests pass

* Make unit tests pass

* make api v3 integration tests pass

* fix lint issues

* fix issue with package-lock

* fix(lint): we don't need no .js

* fix(lint): update to latest config-habitrpg

* chore(npm): update package locks

* fix(test): replace deprecated fn

* chore(package): update eslint-habitrpg again

* fix(lint): server linting

* fix(lint): client linting

* fix(client): correct mangled common imports

* chore(npm): update package-locks

* fix(lint): punctuation, module

---------

Co-authored-by: SabreCat <sabrecat@gmail.com>
Co-authored-by: SabreCat <sabe@habitica.com>
2024-01-16 15:18:47 -06:00
Phillip Thelen
d4a5823916 Fix one-off issue for monthly subs (#14643)
* Fix initial plan.consecutive.offset for 1 month subs

* fix initial values for group plan subs

* Make perkMonthCount editable in admin panel

* Add aditional info to admin panel

* Implement automatic fix for affected users

* fix(lint): exclusive test, code style

* fixes

* fix issue with initialization

---------

Co-authored-by: SabreCat <sabe@habitica.com>
2023-05-24 13:29:42 -05:00
Phillip Thelen
d2d4af227b Fix an issue with gifting subs (#14550)
* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (405 of 405 strings)

Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (2781 of 2781 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (135 of 135 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (217 of 217 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (56 of 56 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (13 of 13 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (112 of 112 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (131 of 131 strings)

Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (405 of 405 strings)

Translated using Weblate (Portuguese)

Currently translated at 81.7% (331 of 405 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (214 of 214 strings)

Translated using Weblate (Portuguese)

Currently translated at 62.5% (5 of 8 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (61 of 61 strings)

Translated using Weblate (Portuguese)

Currently translated at 63.8% (1777 of 2781 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (182 of 182 strings)

Translated using Weblate (Portuguese)

Currently translated at 71.6% (43 of 60 strings)

Translated using Weblate (Portuguese)

Currently translated at 79.7% (609 of 764 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (375 of 375 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (47 of 47 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (770 of 770 strings)

Translated using Weblate (Portuguese)

Currently translated at 100.0% (146 of 146 strings)

Translated using Weblate (German)

Currently translated at 100.0% (404 of 404 strings)

Translated using Weblate (German)

Currently translated at 79.5% (97 of 122 strings)

Translated using Weblate (German)

Currently translated at 97.7% (753 of 770 strings)

Translated using Weblate (German)

Currently translated at 100.0% (146 of 146 strings)

Translated using Weblate (Portuguese)

Currently translated at 77.0% (94 of 122 strings)

Translated using Weblate (Indonesian)

Currently translated at 76.7% (310 of 404 strings)

Translated using Weblate (Portuguese)

Currently translated at 76.2% (93 of 122 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 85.6% (2381 of 2781 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (60 of 60 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (217 of 217 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (112 of 112 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (267 of 267 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (404 of 404 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (182 of 182 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 95.8% (732 of 764 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (122 of 122 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (375 of 375 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (770 of 770 strings)

Translated using Weblate (Chinese (Traditional))

Currently translated at 100.0% (146 of 146 strings)

Translated using Weblate (Portuguese)

Currently translated at 74.5% (91 of 122 strings)

Translated using Weblate (Portuguese)

Currently translated at 72.1% (88 of 122 strings)

Co-authored-by: Ana Beatriz <anabeatriz.augusto06@yahoo.com>
Co-authored-by: Andressa Murari Sudré <andressa@sudre.com.br>
Co-authored-by: Cachinhos <cachnhos@gmail.com>
Co-authored-by: Falzart Werefox <muh_fauzi_ramadhan@yahoo.co.id>
Co-authored-by: Jay <fallacyofwildlifeconservation@gmail.com>
Co-authored-by: Jerry Chen <minecjraft@qq.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Yu-Wei Tien <a38498987911@gmail.com>
Translate-URL: https://translate.habitica.com/projects/habitica/achievements/de/
Translate-URL: https://translate.habitica.com/projects/habitica/achievements/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/achievements/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/de/
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/communityguidelines/de/
Translate-URL: https://translate.habitica.com/projects/habitica/communityguidelines/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/communityguidelines/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/content/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/content/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/contrib/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/faq/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/faq/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/front/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/front/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/gear/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/gear/zh_Hans/
Translate-URL: https://translate.habitica.com/projects/habitica/gear/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/generic/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/de/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/id/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/pt_BR/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/zh_Hans/
Translate-URL: https://translate.habitica.com/projects/habitica/groups/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/limited/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/messages/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/npc/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/overview/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/pets/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/pets/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/questscontent/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/questscontent/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/rebirth/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/spells/pt/
Translate-URL: https://translate.habitica.com/projects/habitica/subscriber/pt_BR/
Translate-URL: https://translate.habitica.com/projects/habitica/subscriber/zh_Hant/
Translate-URL: https://translate.habitica.com/projects/habitica/tasks/pt/
Translation: Habitica/Achievements
Translation: Habitica/Backgrounds
Translation: Habitica/Communityguidelines
Translation: Habitica/Content
Translation: Habitica/Contrib
Translation: Habitica/Faq
Translation: Habitica/Front
Translation: Habitica/Gear
Translation: Habitica/Generic
Translation: Habitica/Groups
Translation: Habitica/Limited
Translation: Habitica/Messages
Translation: Habitica/Npc
Translation: Habitica/Overview
Translation: Habitica/Pets
Translation: Habitica/Questscontent
Translation: Habitica/Rebirth
Translation: Habitica/Spells
Translation: Habitica/Subscriber
Translation: Habitica/Tasks

* gift subscription fix

* remove only

---------

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Ana Beatriz <anabeatriz.augusto06@yahoo.com>
Co-authored-by: Andressa Murari Sudré <andressa@sudre.com.br>
Co-authored-by: Cachinhos <cachnhos@gmail.com>
Co-authored-by: Falzart Werefox <muh_fauzi_ramadhan@yahoo.co.id>
Co-authored-by: Jay <fallacyofwildlifeconservation@gmail.com>
Co-authored-by: Jerry Chen <minecjraft@qq.com>
Co-authored-by: Yu-Wei Tien <a38498987911@gmail.com>
Co-authored-by: SabreCat <sabe@habitica.com>
2023-03-23 14:34:40 -05:00
Phillip Thelen
62b171ffa5 fix linting 2023-02-24 10:47:50 +01:00
Phillip Thelen
3f56b7fa3f fix offset calculation 2023-02-17 15:42:31 +01:00
Phillip Thelen
aec2409227 lint fixes 2023-02-06 12:59:54 +01:00
Phillip Thelen
12479edb77 fix tests and some cases 2023-02-06 11:17:35 +01:00
Phillip Thelen
c0c6657536 handle upgrades and creations better 2023-02-06 11:17:35 +01:00
Phillip Thelen
64a3515c10 Add logic for different types of sub upgrades 2023-02-06 11:17:35 +01:00
Phillip Thelen
8dfa21a4b8 Add field to track when current subscription type started 2023-02-06 11:17:35 +01:00
Phillip Thelen
f07d0f6441 Implement correct handling for when subs are up/downgraded 2023-02-06 11:17:24 +01:00
SabreCat
f1fa6a8456 Revert "Allow sub upgrades/downgrades on iOS (#14303)"
This reverts commit 9e98e56e9b.
2022-11-21 16:40:56 -06:00
SabreCat
f2aaee15f3 Merge branch 'release' into develop 2022-11-18 15:29:06 -06:00
SabreCat
febffb3f07 Revert "Fix double subscriptions, second attempt (#14345)"
This reverts commit 1a5cba57b7.
2022-11-18 14:26:49 -06:00
SabreCat
fdfa2d6df4 Merge branch 'release' into develop 2022-11-15 19:29:37 -06:00
Sabe Jones
1a5cba57b7 Fix double subscriptions, second attempt (#14345)
* fix(subscriptions): reject subs that come in too fast

* fix(lint): remove unused import

* fix(groups): individual subs may come rapidly

* fix(subscriptions): bad paren, handle rapid testing

* fix(test): reset dateUpdated between subs

* fix(test): one more block for dateUpdated

Co-authored-by: SabreCat <sabe@habitica.com>
2022-11-15 19:19:37 -06:00
SabreCat
9b1a726875 Revert "feat(subs): allow upgrade/downgrade on iOS"
This reverts commit 27440772f0.
2022-11-02 09:00:29 -05:00
Phillip Thelen
9e98e56e9b Allow sub upgrades/downgrades on iOS (#14303)
* Allow sub upgrades/downgrades on iOS

* fix check

* fix(lint): line length

* fix(typo): customER

* fix tests

* Implement correct handling for when subs are up/downgraded

* fix lint errors

* fix test

Co-authored-by: SabreCat <sabe@habitica.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
2022-11-01 21:07:23 -05:00
SabreCat
27440772f0 feat(subs): allow upgrade/downgrade on iOS
by @phillipthelen
2022-11-01 20:53:04 -05:00
negue
f7a03d2eb5 improve transactions logs + split createSubscription (#14289)
* improve transactions logs + split createSubscription
2022-10-27 08:39:06 +02:00
SabreCat
40997854dd fix(test): restore event list function 2022-09-30 14:32:21 -05:00
SabreCat
e0eed8238e fix(test): stub full event list 2022-09-23 16:42:15 -05:00
SabreCat
4c34c68d78 fix(test): stub newly relevant function 2022-09-15 12:20:11 -05:00
SabreCat
e2fd6a72c2 fix(test): correct stub restore 2021-12-21 16:25:29 -06:00
SabreCat
60ea8e48a8 fix(test): return empty event list for no promo 2021-12-21 16:01:27 -06:00
SabreCat
64c732e991 fix(test): stub event list not singleton 2021-12-15 16:32:58 -06:00
Sabe Jones
cec01f49bd fix(test): dummy event to test promotions 2021-01-08 13:34:04 -06:00
Sabe Jones
395e1c25d4 fix(g1g1): correct blank private message 2020-12-15 16:07:31 -06:00
Sabe Jones
7c081c4607 fix(test): expect save false 2020-12-11 14:14:07 -06:00
Sabe Jones
cb999d9277 Revert "fix(test): promo no longer handled in library, revert test"
This reverts commit f2281efe99.
2020-12-11 11:07:51 -06:00
Sabe Jones
f2281efe99 fix(test): promo no longer handled in library, revert test 2020-12-10 19:34:52 -06:00
Sabe Jones
53f19c4da3 feat(event): Winter Wonderland 2021 and Gift-One-Get-One Promotion 2020-12-10 16:53:37 -06:00
Matteo Pagliazzi
4e9a2de527 fix(analytics): fix tests and add new ones for getServiceByEnvironment 2020-11-30 11:39:39 +01:00
Sabe Jones
a238b264e5 Merge branch 'release' into develop 2020-10-13 14:38:39 -05:00
Sabe Jones
a5babc493f fix(tests): update analytics expectations 2020-10-13 11:08:35 -05:00
Matteo Pagliazzi
dfa8725c55 upgrade mongoose and fix tests (#12657) 2020-10-10 10:31:42 +02:00
Matteo Pagliazzi
83aca20ce5 Fall Festival Gem Promo (#138)
* content: add gems blocks

* gemsBlocks: include ios and android identifiers

* wip: promo code

* split common constants into multiple files

* add second promo part

* geCurrentEvent, refactor promo

* fix lint

* fix exports, use world state api

* start adding world state tests

* remove console.log

* use gems block for purchases

* remove comments

* fix most unit tests

* restore comment

* fix lint

* prevent apple/google gift tests from breaking other tests when stub is not reset

* fix unit tests, clarify tests names

* iap: use gift object when gifting gems

* allow gift object with less data

* fix iap tests, remove findById stubs

* iap: require less data from the mobile apps

* apply discounts

* add missing worldState file

* fix lint

* add test event

* start removing 20 gems option for web

* start adding support for all gems packages on web

* fix unit tests for apple, stripe and google

* amazon: support all gems blocks

* paypal: support all gems blocks

* fix payments unit tests, add tests for getGemsBlock

* web: add gems plans with discounts, update stripe

* fix amazon and paypal clients, payments success modals

* amazon pay: disabled state

* update icons, start abstracting payments buttons

* begin redesign

* redesign gems modal

* fix buttons

* fix hover color for gems modal close icon

* add key to world state current event

* extend test event length

* implement gems modals designs

* early test fall2020

* fix header banner position

* add missing files

* use iso 8601 for dates, minor ui fixes

* fix time zones

* events: fix ISO8601 format

* fix css indentation

* start abstracting banners

* refactor payments buttons

* test spooky, fix group plans box

* implement gems promo banners, refactor banners, fixes

* fix lint

* fix dates

* remove unused i18n strings

* fix stripe integration test

* fix world state integration tests

* the current active event

* add missing unit tests

* add storybook story for payments buttons component

* fix typo

* fix(stripe): correct label when gifting subscriptions
2020-09-21 16:22:13 +02:00
Sabe Jones
fe9af263dd Merge branch 'release' into develop 2020-01-07 11:48:09 -06:00
Sabe Jones
f6ecc1cb84 chore(promo): end g1g1 2020-01-07 10:13:32 -06:00
Yo
04a9c97393 Fix Typos (#11644)
* Fix Typos

* Fix More Typos
2019-12-23 17:52:55 +01:00
Sabe Jones
ae26cc3244 fix(test): expect two PMs during sub promo 2019-12-17 14:22:43 -06:00
Sabe Jones
9fe28c6d51 fix(g1g1): send promo confirmation to self 2019-12-17 14:16:56 -06:00
Sabe Jones
34983f1221 feat(event): turn on G1G1 2019 2019-12-17 14:04:55 -06:00
Sabe Jones
6395070eb6 Award mystery items at cron (#11519)
* feat(subscriber): award mystery items at cron

* fix(mystery): backfill skipped months

* fix(mystery): adjust subscriber text

* fix(mystery): correct moment logic
and remove irrelevant tests

* fix(mystery): build set one month in advance

* fix(mystery): don't add empty set to Time Travelers

* refactor(mystery): readability
2019-11-27 12:10:56 -06:00
Matteo Pagliazzi
85fb5f33aa fix test lint 2019-10-08 20:45:38 +02:00
Matteo Pagliazzi
d19b3857ee fix unit tests 2019-10-03 17:24:17 +02:00
Matteo Pagliazzi
931e2565b6 Use mandrill for password resets and usernames in emails (#11277)
* use mandrill for password resets

* fix email id

* fix username in emails and tests

* fix tests

* fix package-lock
2019-07-22 19:44:01 +02:00
Sabe Jones
ec37524164 chore(promo): end G1G1 deal 2019-01-15 18:57:10 -06:00
Sabe Jones
8220199e49 Gift 1 Get 1 Promo 2018-19! (#10915)
* feat(subscription): promo banner in modal

* feat(subscription): promo banner on main page

* fix(banners): remove extraneous margin adjustment

* fix(banners): various

* feat(promotion): gift 1, get 1

* fix(promo): various

* chore(promo): add Bailey

* fix(promo): use different email template for promo beneficiary

* fix(promo): turns out Winter is meaningful
2018-12-18 15:28:53 -06:00
Derek Kim
4ed1082558 fix for #10496: Newly subscribed accounts receive erroneous notification that they have Mystery Items (#10759)
* fix
Newly subscribed accounts receive erroneous notification that they have Mystery Items

* Added unit test for #10496

* Restored a previous unit test
2018-10-23 13:47:15 +02:00