Commit Graph

424 Commits

Author SHA1 Message Date
Phillip Thelen
9d16ab7dba Sign in with Apple (#11793)
* add date check

* achievements modal polishing

* refresh private-messages page when you are already on it

* add countbadge knob to change the example

* fix lint

* typos

* typos

* typos

* add toggle for achievements categories

* typo

* fix test

* fix edit avatar modal cannot be closed

* WIP(settings): subscriber page improvements

* WIP(subscriptions): more design build-out

* fix(css): disabled button styles

* fix(css): better Amazon targeting

* fix hide tooltip + align header correctly

* disable perfect scroll

* load messages on refresh event

* fix header label + conversation actions not breaking layout on hover

* WIP(g1g1): notif

* WIP(g1g1): notif cont'd

* fix(test): snowball change

* fix(event): feature NYE card

* chore(sprites): compile

* fix(bgs): include TT required field

* add gifting banner to the max height calculation

* chore(event): enable winter customizations

* WIP(gifting): partial modal implementation

* feat(gifting): select giftee modal

* fix(gifting): notification order, modal dismiss

* Begin implementing sign in with apple

# Conflicts:
#	package-lock.json
#	website/common/script/constants.js
#	website/server/libs/auth/social.js
#	website/server/models/user/schema.js

* Add apple sign in button to website

* fix lint errors

* fix config json

* fix(modals): correct some repops

* fix(gifting): style updates

* fix(buy): modal style changes

* fix(modals): also clean out "prev"

* Attempt workaround for sign in with apple on android

* temporarily log everything as error

* refactor(modals): hide in dismiss event

* fix temporary test failure

* changes to sign in with apple

* fix: first batch of layout issues for private messages + auto sizing textarea

* fix(modals): new dismiss logic

* fix(modals): new dismiss no go??

* Only use email scope

* print debugging

* .

* ..

* ...

* username second line - open profile on face-avatar/conversation name - fix textarea height

* temporarily disable apple auth and just return data for debugging

* Hopefully this works

* .....

* WIP(subscription): unsubscribed state

* .

* ..

* MAYBE THIS ACTUALLY WORKS???

* Implement apple sign in

* fix some urls

* fix urls

* fix redirect and auth

* attempt to also request name

* fix lint error

* WIP(subscription): partial subscribed

* chore(sprites): compile

* Change approach so that it actually works

* fix config error

* fix lint errors

* Fix

* fix lint error

* lint error

* WIP(subscription): finish subscribed

* refresh on sync

* new "you dont have any messages" style + changed min textarea height

* new conversationItem style / layout

* reset message unread on reload

* chore(npm): update package-locks

* fix styles / textarea height

* feat(subscription): revised sub page RC

* list optOut / chatRevoked informations for each conversation + show why its disabled

* Improve apple redirect view

* Fix apple icon on group task registration page

* WIP(adventure): prereqs

* Block / Unblock - correct disabled states - $gray-200 instead of 300/400

* canReceive not checking chatRevoked

* fix: faceAvatar / userLink open the selected conversation user

* check if the target user is blocking the logged-in user

* fix(subs): style tweaks

* fix(profiles): short circuit contributor
Attempted fix for #11830

* chore(sprites): compile

* fix(content): missing potion data

* fix(content): missing string

* WIP(drops): new modal

* fix(subs): moar style tweaks

* check if blocks is undefined

* max-height instead of height

* fix "no messages" state + canReceive on a new conversation

* WIP(adventure): analytics fixes etc

* Improve apple signin handling

* fixed conversations width (280px on max 768 width page)

* feat(adventure): random egg+potion on 2nd task

* fix(lint): noworkies

* fix(modal): correctly construct classes

* fix(tests): expectations and escape

* Fix typo

* use base url from env variables

* fix lint

* call autosize after message is sent

* fix urls

* always verify token

* throw error when social auth could not retrieve id

* Store emails correctly for apple auth

* Retrieve name when authenticating through apple

* Fix lint errors

* fix all lint errors

* fix(content): missing strings

* Revert "always verify token"

This reverts commit 8ac40c76bf.

# Conflicts:
#	website/server/libs/auth/social.js

* Correctly load name

* remove extra changes

* remove extra logger call

* reset package and package-lock

* add back missing packages

* use name from apple

* add support for multiple apple public keys

* add some unit and integration tests

* add apple auth integration test

* tweak social signup buttons

* pixel pushing

Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
Co-authored-by: negue <eugen.bolz@gmail.com>
Co-authored-by: Phillip Thelen <phillip@habitica.com>
2020-04-08 18:44:30 +02:00
Denys Dorokhov
25e72ad907 Reward with negative cost can no longer be created, fixes #11855 (#11870)
* Minor refactoring in scoreTask.js

* Reward value validation added (should be >= 0)
2020-03-24 12:10:10 +01:00
Matteo Pagliazzi
f8aa756d52 Disable Failing Webhooks (#11966)
* todo comment

* add failures field to webhooks and sanitize

* implement logic

* use update instead of save

* specify timeout and maximum number of retries

* add tests
2020-03-20 23:26:21 +01:00
tsukimi2
519af8f1b6 Fix for search guilds result being inconsistent between "My Guilds" and "Discover Guilds" (#11903)
* Fix bug to allow guild summary and description to match against search term in MyGuilds component

* Add unit test to groupUtilities to test filterGroup function

* Changes made after running npm:run:lint

* Fix bug when filter guild function does not match against guild size correctly when the guild has member count = 100 or 1000

According to habitica wiki Guilds Guide, gold-tier guilds are guilds with 1000 or more members.  However, under the current code of filter guild function, it matches guilds as gold-tier as strictly more than 1000 members, excluding 1000 members.  Similar silver-tier guilds should have 100 to 999 members, but the current code it matches guilds as silver-tier for members between 101 and 999 members.

* Added unit tests to test the newly added code in the groupsUtilities mixin for the current issue

* Add unit testing to test search guild name, summary, and description in myGuilds component

* Add suggestions from lint

* Added searching by guild summary and white space handling in search terms.

For discover guilds component, added the following:
1) handling of searching by guild summary
2) preventing white space in search terms to display all guilds
3) added test cases for testing the search functionality in discove guilds to ensure consistent behaviour between the searching in MyGuilds and public guilds.

* Remove console statements from test file

* Implement suggestions from lint.

Co-authored-by: osiris <eynsan@yahoo.co.uk>
2020-03-16 20:03:48 +01:00
Alec Brickner
88bfed7efe Ensure official challenges are listed first (fixes #11018) (#11030)
* Ensure official challenges are listed first

* Fix lint errors

* Move query creation into separate function

* switching branches

* Fixes and tests

* Formatting fixes

* Linting

* fix tests
2020-03-09 20:08:28 +01:00
Sabe Jones
7064b363e0 fix(test): comment unreliable error message 2020-03-07 13:31:31 -06:00
Sabe Jones
bd8e67a2ea Adventure Guide Prep (#11883)
* WIP(adventure): prereqs

* WIP(drops): new modal

* WIP(adventure): analytics fixes etc

* feat(adventure): random egg+potion on 2nd task

* fix(lint): noworkies

* fix(modal): correctly construct classes

* fix(tests): expectations and escape

* fix(first-drops): address comments

* fix(first-drops): don't give random drops until first drops

* fix(drops): remove more Level 3 references

* refactor(drops): no need for cloning

* refactor(drops): unnecessary export

* fix(first-drops): force sync

* fix(first-drops): move to server

* fix(first-drops): escape in case we get here with >0 items

* fix(lint): line length

* fix(pet-food): remove unused string
2020-03-07 13:03:13 -06:00
Matteo Pagliazzi
2ff9dfe965 Fix username links resulting in truncated chat messages (#11945)
* introduce MAX_MESSAGE_LENGTH constant

* add test

* fix path

* fix and tests

* fix typo in tests
2020-03-04 11:49:14 +01:00
Ian McKenzie
6a483edfe1 Resolves #11861 — Makes "quest already started" error descriptive (#11862)
* Resolves #11861

* Fix unit tests for translation changes

* Remove non-en quest.json locales
2020-02-19 16:07:17 +01:00
Matteo Pagliazzi
9510b2345c Merge pull request #11636 from tsukimi2/bugfix-send-pmsg
Fix incorrect error when sending private messages to a player you have blocked (fixes #11612)
2020-01-14 13:24:05 +01:00
Matteo Pagliazzi
fa9f962e45 Merge pull request #11707 from cvuorinen/11682-quest-invitation-webhook
Quest invitation webhook
2020-01-14 13:06:31 +01:00
Carl Vuorinen
9258f8ad26 Send questInvited webhooks 2020-01-11 00:32:10 +02:00
Carl Vuorinen
04180fe974 Add integration tests for questActivity webhook 2020-01-10 20:58:21 +02:00
Yo
04a9c97393 Fix Typos (#11644)
* Fix Typos

* Fix More Typos
2019-12-23 17:52:55 +01:00
Matteo Pagliazzi
e4edab2b9d Minimum password length + Static Pages fixes (was #11474) (#11506)
* Revert "Revert "Minimum password length + Static Pages fixes (#11474)""

This reverts commit d1afbf4b92.

* add min length for reset password
2019-12-18 19:02:15 +01:00
osiris
104d888bfb Fix incorrect error when sending private messages (PMs) to a player you have blocked #11612
Introduce a new error type blockedToSendToThisUser for the cases where you have blocked a player from sending private messages to you, if you try to message them or if you try to transfer gems to them, you will see the error "You can't send to this player because you have block this player."
2019-12-15 19:18:16 +08:00
Xaz16
aa1fcb4956 Merge remote-tracking branch 'upstream/develop' into fix-antidotes-from-revert 2019-12-07 22:32:25 +03:00
Phillip Thelen
b108b047cd Improvements and fixes for push notifications (#11507)
* Strip markdown from push notifications

* Revert "Strip markdown from push notifications"

This reverts commit 4741e584c6.

* correctly set type for mention push notifications

* Add unformattedText field to chat messages

* fiix lint errors

* Add check that markdown formatting is stripped from messages

* Add check for markdown formatting in messages.
2019-11-29 18:46:26 +01:00
Xaz16
960985dee5 Merge branch 'develop' into fix-antidotes-from-revert 2019-11-17 23:54:09 +03:00
Evelyn Stender
5f0672f3a6 Allow update webhook label with an empty string (#11479)
* Allow update webhook label with an empty string

* Adding comment to explain the label check
2019-11-16 17:52:27 +01:00
Adam Fitzgibbon
dfd79c9c1a Use username in challenge member dropdown (#11478)
* update challenge member dropdown and api to display and search by username rather than display name

* remove accidental whitespace

* fix api test
2019-11-01 19:00:42 +01:00
Sabe Jones
d1afbf4b92 Revert "Minimum password length + Static Pages fixes (#11474)"
This reverts commit e1d30eec98.
2019-10-31 13:16:09 -05:00
Matteo Pagliazzi
e1d30eec98 Minimum password length + Static Pages fixes (#11474)
* password min length: server + client side registering

* tweak text, add tests

* misc

* use red border for invalid inputs

* fix auth form for groups

* remove default firefox box shadown on invalid elements

* fix css in authForm

* fix margings

* misc fixes to forms and buttons

* fix typo
2019-10-30 13:47:35 +01:00
Xaz16
60a12e8090 after merge 2019-10-28 23:15:45 +03:00
Matteo Pagliazzi
c3a8305a40 Mentions Fix and Test (#11475)
* Fix issue with mentioned members not being loaded enough

* mentions: add integration tests and fix saved message
2019-10-24 11:35:15 +02:00
Sabe Jones
51726d8d8e fix(pets): correct achievement logic 2019-10-23 08:21:51 -05:00
Sabe Jones
2b8e25833d fix(schema): add missing notif types 2019-10-23 08:10:43 -05:00
Matteo Pagliazzi
3e12774e40 Merge branch 'develop' into client-monorepo 2019-10-18 20:26:12 +02:00
Phillip Thelen
360aaa9f0b Add more achievements to notifications list (#11332)
* Add more achievements to notifications list

* use addNotification

* Fix logic to not award stable achievements over and over

* Improve achievement display

* Fix setting notifications for party inviter

* Add tests that notifications are added correctly

* Fix tests
2019-10-18 17:04:33 +02:00
Matteo Pagliazzi
a1e3127d36 fix mongoose issue 2019-10-13 18:31:43 +02:00
Matteo Pagliazzi
85fb5f33aa fix test lint 2019-10-08 20:45:38 +02:00
Matteo Pagliazzi
90f732f545 Revert "Revert "Fix: Antidotes to Avatar Transformation Items should be added to Rewards by API (#11353)" (#11406)"
This reverts commit 50cae0165c.
2019-10-07 16:55:55 +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
Matteo Pagliazzi
2a4e103812 fix integration tests and paths for client tests 2019-10-03 17:40:38 +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
Matteo Pagliazzi
2a9f5e1667 remove BETA comment and fix tests 2019-09-20 16:44:46 +02:00
Carl Vuorinen
67de080391 Add test for GET /user/webhook 2019-09-14 23:36:37 +03: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
Jawad Jahangir
5a83f93ade Free group plan subscription from a party/guild no longer gets cancelled after leaving a guild - fixes #11055 (#11228)
* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* Added tests to check if a member of a group plan maintains free subscription when leaving another group without a plan

* Added tests to check if member of a group plan still keeps free subscription when leaving some other group without a plan

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* Added tests to check if a member of a group plan maintains free subscription when leaving another group without a plan

* Added tests to check if member of a group plan still keeps free subscription when leaving some other group without a plan
2019-08-15 11:06:56 -04: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
Alys
c80de38572 add shadow-muting chat hiding feature (automatic flagging of public posts from shadow-muted players) - fixes 10851 (#11239)
* move existing tests for chatRevoked users to 'mute user' describe block

* give consistent names to chatRevoked tests and use const not let

* improve methods for restoring chat permissions to test users

* add tests for shadow-muting and define constants for flag-related numbers

* update user profile URLs and reverse private/public 'if' statements

* implement shadow muting in the API and schemas

* add interface for mods to turn shadow muting on/off for a user

- checkbox in the Hall
- icon in the user's profile

* mark chat posts as being shadow muted (marking is visible to mods only)

* convert Admin Tools in profile from icons to text; make crown icon a toggle

* move logic for displaying flag count to a computed property

* prevent chat notifications for shadow-muted posts
2019-07-30 19:09:42 +02:00
negue
c9a56e8f3e Performance/inbox paging (#11258)
* merge all changes to one commit of PR #11157 / #11226

* rename the new paged messages route

* rename event, move map-method to the Inbox schema, fix lint

* move `mapMessage`-call to `getUserInbox`

* revert schema.method back to a normal one
2019-07-15 11:25:22 +02:00
Forrest Hatfield
684a615a07 Allow admins to edit challenge tasks - fixes #8149 (#10658)
* Allow admins to edit challenges

* add test for admin creating a task in a challenge they don't own
2019-07-12 15:56:09 +02:00
Sabe Jones
5a5f1d6895 Revert "Performance: Inbox Paging / loading (#11157)"
This reverts commit 5630e8cc8e.
2019-06-14 12:34:38 +00:00
Sabe Jones
6b59262e3e Challenge privacy fix (#11222)
* fix(challenges): filter out private content API-side

* fix(challenges): cleaner fix + test
2019-06-13 09:27:47 -05:00
negue
5630e8cc8e Performance: Inbox Paging / loading (#11157)
* load messages per conversation

* only sort ones in ui

*  add contributor to message

* fix correct message layout/message

* mugenScroll on chatMessages

* fix lint, no mugen-scroll, use own scroll handler

* fix height / margin of modal + use button to load more

* fix tests

* user data from inbox

* style "load earlier messages"

*  move mapMessage to the inbox api result / extract sentMessage of members-api-controller

* fix test back

* fix test

* keep last scroll position

* just set the Id of the returned message instead of all other properties

* fix add new messages (buttons were hidden) + load more

* item-mounted debounce to trigger the re-scrolling
2019-06-13 15:18:50 +02:00
Matteo Pagliazzi
7baa7427a0 Merge pull request #11178 from Alys/mute-ban-block-notification-messages
adjust error messages for muted and banned users, and system flagging error
2019-05-26 11:49:24 +02:00
Matteo Pagliazzi
270078a030 Merge pull request #11170 from HabitRPG/Yutsuten-party-chat-translations
Party Chat Translations (Continuation of #10019)
2019-05-26 11:45:12 +02:00