Commit Graph

147 Commits

Author SHA1 Message Date
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
Alys
0891908cba Merge remote-tracking branch 'upstream/develop' into apidocs-comment-fixes 2020-02-20 09:47:44 +10:00
citrusella
80de90cc5f Attempt to fix typos in the API doc 2020-02-12 15:40:44 -05:00
Alys
ac52da5be2 fix lines that are too long
Each line was fixed by one of these:
- changing the wording
- breaking into separate lines
- adding eslint-disable-line max-len (necessary for `@api ` lines because
a line break there causes the first part of the text to not be displayed
on the apidocs website)
2020-02-08 14:55:21 +10:00
Alys
6fe87a8140 make further minor tweaks to apidocs that were previously changed 2020-02-08 14:26:01 +10:00
Alys
c5d0ff63a5 make corrections and improvements to apidocs (no code changes) 2020-02-08 14:12:20 +10:00
Jonathan Duncan
a45b04b1cf APIDoc update for Tasks: fixes #10943 (#11594)
* Adding monthly and yearly to the frequency parameter.

* Adjusting frequency description to be more accurate.

* Adding missing fields: daysOfMonth and weeksOfMonth.

* Adjusting line length to meet lint standards.
2019-12-13 14:18:02 +01:00
Matteo Pagliazzi
e09a70570e finish linting server 2019-10-11 13:03:05 +02:00
Matteo Pagliazzi
8bae0223bb fix linting for server (except for length of apidoc) 2019-10-10 20:11:50 +02:00
Matteo Pagliazzi
621787915c start upgrading eslint 2019-10-08 16:57:10 +02:00
Matteo Pagliazzi
45f7cf04ab remove old module.exports from server aswell 2019-10-02 19:45:27 +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
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
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
Matteo Pagliazzi
eff8db0afd fix issue with language being undefined, refactoring auth middleware, new tests 2019-05-15 16:54:55 +02:00
Sabe Jones
25ed05ab0a Analytics: clean up old A/B test code & add username verify flag (#10754)
* chore(analytics): clean up old A/B test code & add username verify

* fix(lint): more AB cleanup
2018-10-13 13:03:20 -05: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
Keith Holliday
510e01effd Added user field limit to some routes (#10546)
* Added user field limit to some routes

* Added taskOrder and perferences

* Added contributor field
2018-07-20 23:24:33 -05:00
Sabe Jones
284b2cc413 Group Tasks Shared Completion (#10515)
* WIP(groups): add shared completion prop
Also fix an issue where the Needs Approval toggle would not read/save 
correctly.

* fix(groups): save group options on task create
Also, correct count of assigned members when viewing user is among 
assignments

* fix(groups): display correct messages in two places

* fix(tasks): eliminate console error related to filtering
Also localize a group plans string

* WIP(groups): implement single completion for approval workflow

* WIP(groups): Add shared completion handling to no-approval-needed flow

* WIP(groups): cover approval flow case for all-assigned
Also save new field on initial task creation

* fix(tasks): use default sharedCompletion value when creating tasks

* WIP(tests): non-working draft test

* Added completed todo to group query

* WIP(group-tasks): fix bugs, add tests

* refactor(group-tasks): deleteMany op, add more tests

* refactor(group-tasks): move shared completion handling to lib

* WIP(group-tasks): broken refactor

* WIP(group-tasks): await all the things

* Turned complete master task to save

* WIP(group-tasks): show completed

* fix(filtering): don't try to filter if no list is passed

* refactor(group-tasks): load completed to-dos on demand, not at start

* fix(group-tasks): don't double up on repeat visits

* fix(group-tasks): include brief explanation in dropdown

* fix(group-tasks): improve wording some more
2018-07-20 12:29:44 -05:00
Matteo Pagliazzi
accba7fc13 fix bug in task approval notification 2018-07-03 11:23:44 +02:00
Alys
c072935e80 document the dueDate parameter for API task functions - partial fix for #8087 2018-06-30 15:55:27 +10: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
Matteo Pagliazzi
570a8bf0d5 do not load inbox in tasks routes (#10302) 2018-05-04 16:00:57 -05: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
Matteo Pagliazzi
5f0ef2d8f0 Webhooks v2 (and other fixes) (#10265)
* begin implementing global webhooks

* add checklist item scored webhook

* add pet hatched and mount raised webhooks (no tests)

* fix typo

* add lvl up webhooks, remove corrupt notifications and reorganize pre-save hook

* fix typo

* add some tests, globalActivity webhook

* fix bug in global activiy webhook and add more tests

* add tests and fix typo for petHatched and mountRaised webhooks

* fix errors and add tests for level up webhook

* wip: add default data to all webhooks, change signature for WebhookSender.send (missing tests)

* remove unused code

* fix unit tests

* fix chat webhooks

* remove console

* fix lint

* add and fix webhook tests

* add questStarted webhook and questActivity type

* add unit tests

* add finial tests and features
2018-04-29 20:07:14 +02:00
Alys
ade14edcd7 add partial documentation for dueDate parameter in /api/v3/tasks/user and related code 2018-04-18 23:22:11 +10: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
455f7ac59b round priority on update too (#10186)
* round priority on update too

* move the fix to Task sanitizeTransform

* refactor the task.priority parsing
2018-04-14 16:16:25 +02: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
Matteo Pagliazzi
cb42a31c43 Node 8 (WIP) (#9946)
* start upgrade to node 8

* upgrade travis

* improve travis

* Remove bluebird, babel (except for modules) from server (WIP) (#9947)

* remove bluebird, babel from server (except for modules)

* fixes

* fix path

* fix path

* fix export

* fix export

* fix test

* fix tests

* remove plugin for transform-object-rest-spread since it is supported in node8

* babel: correct syntax rest spread

* remove bluebird

* update migrations archive readme

* fix package-lock.json

* fix typo

* add package-loc
2018-03-15 19:59:36 +01:00
Gergely Imreh
4b17f62241 task types: add new error messages for invalid task types (#9983)
* `/task/user` `GET` endpoint takes plurals of task types as allowed
  parameters, plus  another custom `completedTodos` type
* `/tasks/group/:groupId` and `/tasks/challenge/:challengeId`
  `GET` endpoints task plurals of task types as allowed parameters
2018-02-23 14:38:18 -06:00
Matteo Pagliazzi
f947d3562b Remove user wrapping (#9960)
* remove user wrapping, fixes #9146

* update tests

* fix tests
2018-02-09 13:46:55 +01:00
Feywood
7c6dd6a6bd (in)definite articles for food items. Partial fix for https://github.com/HabitRPG/habitica/issues/3571 (#9658)
* testing additional event trigger for sendMessage

* moved keyup event to newmessage

* added keyup event to tavern vue too

* all food items now have version with definite and indefinite article. foodText also adapted in messages json

* modified api.food, and feed, armoire and drop mechanism

* drops now ok, removed dropArticle, corrected feed test

* test correction

* api doc modification for task completion
2018-02-05 19:43:12 +01:00
Matteo Pagliazzi
33b249d078 Notifications v2 and Bailey API (#9716)
* Added initial bailey api

* wip

* implement new panel header

* Fixed lint

* add ability to mark notification as seen

* add notification count, remove top badge from user and add ability to mark multiple notifications as seen

* add support dismissall and mark all as read

* do not dismiss actionable notif

* mark as seen when menu is opened instead of closed

* implement ordering, list of actionable notifications

* add groups messages and fix badges count

* add notifications for received cards

* send card received notification to target not sender

* rename notificaion field

* fix integration tests

* mark cards notifications as read and update tests

* add mystery items notifications

* add unallocated stats points notifications

* fix linting

* simplify code

* refactoring and fixes

* fix dropdown opening

* start splitting notifications into their own component

* add notifications for inbox messages

* fix unit tests

* fix default buttons styles

* add initial bailey support

* add title and tests to new stuff notification

* add notification if a group task needs more work

* add tests and fixes for marking a task as needing more work

* make sure user._v is updated

* remove console.log

* notification: hover status and margins

* start styling notifications, add separate files and basic functionalities

* fix tests

* start adding mystery items notification

* wip card notification

* fix cards text

* initial implementation inbox messages

* initial implementation group messages

* disable inbox notifications until mobile is ready

* wip group chat messages

* finish mystery and card notifications

* add bailey notification and fix a lot of stuff

* start adding guilds and parties invitations

* misc invitation fixes

* fix lint issues

* remove old code and add key to notifications

* fix tests

* remove unused code

* add link for public guilds invite

* starts to implement needs work notification design and feature

* fixes to needs work, add group task approved notification

* finish needs work feature

* lots of fixes

* implement quest notification

* bailey fixes and static page

* routing fixes

* fixes #      this.$store.dispatch(guilds:join, {groupId: group.id, type: party});

* read notifications on click

* chat notifications

* fix tests for chat notifications

* fix chat notification test

* fix tests

* fix tests (again)

* try awaiting

* remove only

* more sleep

* add bailey tests

* fix icons alignment

* fix issue with multiple points notifications

* remove merge code

* fix rejecting guild invitation

* make remove area bigger

* fix error with notifications and add migration

* fix migration

* fix typos

* add cleanup migration too

* notifications empty state, new counter color, fix marking messages as seen in guilds

* fixes

* add image and install correct packages

* fix mongoose version

* update bailey

* typo

* make sure chat is marked as read after other requests
2018-01-31 11:55:39 +01:00
Sabe Jones
18ade8ca65 Analytics: track challenge and task events (#9885)
* feat(analytics): track challenge and task events

* feat(analytics): add more challenge events
Also tweaks data for better troubleshooting utility

* refactor(analytics): include IDs for challenges/groups

* refactor(analytics): term for award challenge is "close"
2018-01-25 17:14:41 -06:00
Keith Holliday
90ffe587dd Added analytics to drop (#9792)
* Added analytics to drop

* Updated tracking category
2018-01-22 09:15:23 -07:00
SabreCat
f3c2c0f901 Merge branch 'release' into develop 2017-12-04 19:23:55 +00:00
Keith Holliday
13cdcedcba Added support for scoring group tasks down after approval (#9623)
* Added support for scoring group tasks down after approval

* Fixed lint issues
2017-12-04 11:23:47 -06:00
Keith Holliday
af095d8450 Revert query optimization (#9636) 2017-12-02 08:35:31 -06:00
Keith Holliday
699de64328 Added more fields to scoring (#9613) 2017-11-30 10:09:04 -06:00
Keith Holliday
a097819b72 User auth performance improvements (#9589)
* Added initial user projecting in auth and fixed projection for get user tasks

* Added fields to score route

* Added another field to get tasks

* Added group fields to user
2017-11-30 08:17:28 -06:00
SabreCat
d72b40d5b0 Merge branch 'release' into develop 2017-11-29 05:07:42 +00:00
Keith Holliday
b03ddf6f7d Added fix for task order using / for arrays (#9590) 2017-11-28 14:57:08 -06:00
Asif Mallik
299e88233c Fixes multiple complete and uncomplete for todos and daily (Fixes #8669) (#8971)
* Fixed bug that allows users to complete todo and daily multiple times

* Added tests

* Fix syntax

* Fix existing tests that rely on multiple complete or uncomplete

* Undoes removal of website/client/README.md

* Change sessionOutdated string to reflect separate client needs

* Fix should update history test by changing lastCron
2017-11-27 20:13:18 -06:00
Keith Holliday
17ce2febf9 [WIP] Add initial fixes for concurrency (#9321)
* Add initial fixes for concurrency

* Added memory edit for notifications

* Fixed tag delete

* Fixed adding and moving task order

* Updated delete task

* Fixed lint

* Fixed task adding

* Switch to mongoose push and pull
2017-11-07 13:19:39 -07:00
Pavel Pletenev
8614f11a31 Refactor api description with @apiParam groups to make it more explicit (#8919)
* Refactor api description for auth.js with @apiParam groups

* Refactor apiDoc toward better consistency

* Fix missing groups for get requests

* Fix missing groups for other request methods
2017-08-15 18:06:19 -05:00
Keith Holliday
eb43f83c71 New client group plan (#8948)
* Added stripe payment for group plan

* Began adding amazon

* Added amazon payments for group

* Added get group plans route

* Added group plan nav

* Added initial task page

* Added create and edit group plans

* Added initial approval header and footer

* Added assignment and approved requirement

* Added minor text fixes

* Added inital approval flow

* Added approval modal

* Removed always true

* Added more styles for filters

* Added search

* Added env vars

* Fixed router issues

* Added env to social login

* Fixed merge conflict
2017-08-14 13:19:41 -06:00
Pavel Pletenev
0da1144635 Make responce codes uniform (#8865)
* Fix 201 responce wrong documentation

* Fix 201 in challenges

* Fix 201 in groups.js

* Fix 201 in tags.js

* Fix 201 in webhooks.js
2017-07-17 14:28:25 -07:00
Keith Holliday
acb4b79078 Added option for getting isDue field for specified date 2017-06-27 22:22:20 -06:00