Compare commits

...

892 Commits

Author SHA1 Message Date
Sabe Jones
396362d27e 4.32.0 2018-03-20 22:57:28 +00:00
SabreCat
972efb1878 fix(seasonal-shop): remove quest
it was breaking the API. Wut? Just use canBuy logic and Quest Shop for now
2018-03-20 22:49:54 +00:00
SabreCat
6c18d19d95 fix(test): extra curly 2018-03-20 21:56:55 +00:00
SabreCat
9b8bdb90d8 chore(sprites): compile 2018-03-20 21:31:04 +00:00
SabreCat
a84ea8b1b7 feat(event): Spring Fling 2018 2018-03-20 21:30:43 +00:00
Sabe Jones
67e750a81c 4.31.1 2018-03-15 21:19:44 +00:00
Keith Holliday
7fe62a731b Fixed gem amount on master key (#10140)
* Fixed gem amount on master key

* fix(news): update Bailey text
2018-03-15 16:19:11 -05:00
Sabe Jones
bb6f465ac8 4.31.0 2018-03-15 19:10:37 +00:00
Sabe Jones
a2a79e4607 chore(i18n): update locales 2018-03-15 19:07:38 +00:00
SabreCat
5125cc5f59 chore(news): Bailey 2018-03-15 19:04:00 +00:00
Alys
5ba09c45df adjust comments and word lists in slurs and banned words. TRIGGER / CONTENT WARNING: assault, slurs, swearwords, etc 2018-03-15 20:53:48 +10:00
Matteo Pagliazzi
70dec611e3 Make Kafka dep optional (#10129)
* Made kafka optional

* make kafka optional
2018-03-14 18:21:39 +01:00
Keith Holliday
2195464772 Flag comment (#9991)
* Added initial chat flag comment form

* Added user comment to slack message

* Updated copy and styles

* Fixed comma

* Updated admin messaging
2018-03-14 07:41:13 -05:00
Sabe Jones
b662f8bdff Merge branch 'release' into develop 2018-03-13 21:00:00 +00:00
Sabe Jones
0e6d6336c6 4.30.0 2018-03-13 20:59:13 +00:00
Sabe Jones
d8078adacd chore(i18n): update locales 2018-03-13 20:58:43 +00:00
SabreCat
a88800df78 chore(sprites): compile 2018-03-13 20:54:54 +00:00
SabreCat
42e0095bbd feat(content): spring Hatching Potions 2018-03-13 20:54:27 +00:00
Sabe Jones
ee1aa653f0 fix(groups): Guild badge fencepost errors 2018-03-12 14:43:39 -05:00
SabreCat
8d1b1ff794 chore(npm): update package lock 2018-03-09 21:22:25 +00:00
SabreCat
70500d7c98 Merge branch 'release' into develop 2018-03-09 21:18:56 +00:00
Travis
35849ebdd7 Fixing items sort by number in the market. (#10108)
fixes #10093
2018-03-09 15:17:26 -06:00
Matteo Pagliazzi
1332fd68b0 Mongoose 5 (#9870)
* mongoose 5: remove unused autoinc, remove promise option (it uses native promises now)

* remove mongodb package

* remove mongoskin

* migrate migration away from mongoskin

* fix mongoose hooks

* fix _updateUserWithRetries

* try without next

* remove init

* update sinon

* fix some integration tests

* fix remaining tests

* fix error message

* fix error message

* fix error message

* another fix

* fix mongoose options

* remove greenkeeper exception
2018-03-09 15:13:58 -06:00
Travis
f9a47b1420 Update user pinned items on purchases. (#10085)
fixes #10049
2018-03-09 15:11:42 -06:00
Sabe Jones
090c571f3e 4.29.8 2018-03-09 21:04:14 +00:00
Dexx Mandele
07b3824c4c Stop market background from covering sign (#10067) 2018-03-09 14:59:45 -06:00
Sabe Jones
1bf3736198 chore(i18n): update locales 2018-03-09 20:58:12 +00:00
Travis
92fa6805eb fix: Quest collected items displayed multiple times. (#10111)
fixes #10065
2018-03-09 14:56:59 -06:00
SabreCat
d5efa7b2b0 fix(event): clean up more Valentine's content 2018-03-09 20:45:12 +00:00
Dexx Mandele
f64b34318f Set warrior as default for the choose class pop-up (#10084) 2018-03-09 14:40:53 -06:00
Sabe Jones
5e13a9c503 4.29.7 2018-03-09 03:31:53 +00:00
Sabe Jones
b27aec855c chore(event): end Cupid Potions 2018-03-09 03:31:39 +00:00
Sabe Jones
fe61c0f29e Merge branch 'release' into develop 2018-03-08 21:43:35 +00:00
Sabe Jones
2db3ac7bd3 4.29.6 2018-03-08 21:42:52 +00:00
SabreCat
201ec0e865 fix(world-boss): add achievement badge, correct mount positioning 2018-03-08 21:37:17 +00:00
Sabe Jones
a0253cf289 chore(i18n): update locales 2018-03-08 19:41:22 +00:00
SabreCat
5256569bac fix(world-boss): remove notification 2018-03-08 19:37:27 +00:00
Sabe Jones
5f0b957dc2 fix(logging): only start Stackimpact in prod (#10112) 2018-03-08 13:12:45 -06:00
Sabe Jones
16524d4464 4.29.5 2018-03-08 18:39:00 +00:00
SabreCat
63a11c6c28 chore(event): end Valentines/Dysheartener 2018-03-08 18:37:32 +00:00
Sabe Jones
37650ca674 Merge branch 'release' into develop 2018-03-08 00:30:37 +00:00
Sabe Jones
b5dfa54052 4.29.4 2018-03-08 00:30:20 +00:00
SabreCat
2e7deffb69 fix(user): no more birthday 2018-03-08 00:29:00 +00:00
Sabe Jones
b4dab2e13c Merge branch 'release' into develop 2018-03-07 22:53:09 +00:00
Sabe Jones
535c41dba8 4.29.3 2018-03-07 22:52:45 +00:00
Sabe Jones
7357fb0528 chore(i18n): update locales 2018-03-07 22:49:33 +00:00
Keith Holliday
49e67fa87c Added stackimpact (#10109) 2018-03-07 16:46:50 -06:00
Sabe Jones
b4ca425562 4.29.2 2018-03-06 22:03:34 +00:00
Sabe Jones
deba726afa chore(i18n): update locales 2018-03-06 22:00:31 +00:00
SabreCat
2abf0f4900 feat(content): Hug a Bug Quest Bundle 2018-03-06 21:56:01 +00:00
Sabe Jones
b827b17481 Don't include seasonal class gear in classless category (#10047)
* fix(market): don't include seasonal class gear in classless category

* refactor(shops): use standard indexOf check
2018-03-06 11:03:49 -06:00
Sabe Jones
27ef187e66 Merge branch 'release' into develop 2018-03-05 20:59:17 +00:00
Sabe Jones
0c3b4bba51 4.29.1 2018-03-05 20:58:50 +00:00
Sabe Jones
09948ba319 chore(i18n): update locales 2018-03-05 20:58:16 +00:00
SabreCat
da50d2f495 feat(world-boss): third Rage Strike support 2018-03-05 20:46:22 +00:00
Keith Holliday
9c9b67aa9d Keys kennel fixes (#9848)
* Show keys to pets immediately

* Ensured keys to pets dissapear after use

* Added resdirect to stable after purchase

* Added mount check and updated keys to mounts and to both

* Added api calls

* Added check for beastmaster progress

* Added mount check for release mounts. Added pets and mount check to release both

* Added actions

* Added catch to common tests

* Added beast count and reload

* Removed extra console log
2018-03-02 15:30:11 -06:00
Keith Holliday
7cff331800 Removed uri for client side oauth (#10058)
* Removed uri for client side oauth

* Fixed lint
2018-03-02 14:07:15 -07:00
Keith Holliday
e7bc505b88 Modal popup fixes (#10080)
* Added validation for modal stack

* Lint fixes
2018-03-02 12:43:22 -07:00
Sabe Jones
716393cf91 4.29.0 2018-03-01 23:31:00 +00:00
Sabe Jones
fe102aedd3 chore(i18n): update locales 2018-03-01 23:29:59 +00:00
SabreCat
cf7fc8d578 Merge branch 'develop' into release 2018-03-01 23:23:57 +00:00
SabreCat
b39a5be2d1 chore(sprites): compile 2018-03-01 23:23:36 +00:00
SabreCat
45a1ad501e feat(content): Backgrounds and Armoire 2018/03 2018-03-01 23:23:00 +00:00
Keith Holliday
2959f0afab Removed modify inventory because the Content is causing Garbage Collection issues (#10075) 2018-03-01 08:24:46 -07:00
Sabe Jones
77f8c45e08 fix(world-boss): remove deprecated "recent" field 2018-02-28 15:53:32 +00:00
Sabe Jones
bd2fea6e81 Merge branch 'release' into develop 2018-02-28 15:40:28 +00:00
Sabe Jones
cb7f85037f 4.28.2 2018-02-28 15:39:45 +00:00
Sabe Jones
a9db5310cc chore(i18n): update locales 2018-02-28 15:38:07 +00:00
SabreCat
49af418a29 chore(news): Bailey 2018-02-28 15:33:45 +00:00
Keith Holliday
dee81ee6c9 Reversed order to put newest on top (#10059) 2018-02-28 08:17:54 -07:00
Alys
5265e6d321 add swear words - TRIGGER / CONTENT WARNING: assault, slurs, swearwords, etc 2018-02-28 19:45:07 +10:00
Matteo Pagliazzi
5e5d73816b fixes #10057 (#10063) 2018-02-27 22:24:31 +01:00
Matteo Pagliazzi
3e723ec4de fixes #9952 (#10062) 2018-02-27 22:02:12 +01:00
Sabe Jones
892ba3b741 Merge branch 'release' into develop 2018-02-27 20:55:34 +00:00
Sabe Jones
48e556fa54 4.28.1 2018-02-27 20:55:11 +00:00
Sabe Jones
f687c6f987 chore(i18n): update locales 2018-02-27 20:54:40 +00:00
negue
0b4eafeb28 prevent selling negative items (#10061) 2018-02-27 14:51:10 -06:00
SabreCat
cedfc005f8 feat(world-boss): Market Strike support 2018-02-27 20:04:37 +00:00
Keith Holliday
be71c5f844 Added kafka queue and initial messages for delete account (#10036)
* Added kafka queue and initial messages for delete account

* Checked for env vars
2018-02-27 09:57:37 -07:00
Keith Holliday
7dcd550209 Updated membercount checks (#10006)
* Updated membercount checks

* Added get member count method

* Updated tests to correctly add users
2018-02-26 13:03:04 -07:00
Keith Holliday
6118336a5d Marked new stuff complete when clicking later (#10043)
* Marked new stuff complete when clicking later

* Moved flag set to action
2018-02-26 12:07:54 -07:00
Alys
01dab33b96 adjust loading screen tip to refer to Tags button by its correct name (not Filters) 2018-02-26 19:40:19 +10:00
Keith Holliday
84dc2f8e3c Fixed sorting and model creation for inboxes (#10039) 2018-02-25 08:04:55 -07:00
greenkeeper[bot]
b1bd243892 docs(readme): add Greenkeeper badge (#10050) 2018-02-24 12:46:42 +01:00
Matteo Pagliazzi
67961be575 greenkeeper: exclude mongoose 2018-02-24 12:05:13 +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
Keith Holliday
b850ea9dbf Bulk spell casting (#10007)
* Reorganized spell code

* Added quantity field

* Fixed parameter passing
2018-02-23 11:30:15 -07:00
README Bot
94e615e53e Add CodeTriage badge to habitrpg/habitica (#10028)
Adds a badge showing the number of people helping this repo on CodeTriage.

[![Open Source Helpers](https://www.codetriage.com/habitrpg/habitica/badges/users.svg)](https://www.codetriage.com/habitrpg/habitica)

CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed

[Read more about the CodeTriage project](https://www.codetriage.com/what).

Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly 11 months ago, [chufty](https://github.com/chufty) added this project to CodeTriage in order to start contributing. Since then, 29 people have subscribed to help this repo.

Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project.

You can see an example of a CodeTriage badge on these popular OSS READMEs:

- [![](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails
- [![](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal

While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics.

If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again.

Thanks for making your project Open Source! Any feedback is greatly appreciated.
2018-02-23 15:47:09 +01:00
Matteo Pagliazzi
3a1e56cc8e Upgrade server deps (#10017)
* remove unused apn lib and upgrade moment-recur

* upgrade validator

* upgrade got

* request -> got

* fix validation

* fix tests

* upgrade nodemailer

* fix unit tests

* fix webhook tests, upgrade express-validator (using legacy api)

* upgrade js2xmlparser

* update misc packages

* fix linting

* update packages
2018-02-23 15:21:00 +01:00
Sabe Jones
cea47e5280 4.28.0 2018-02-22 23:06:53 +00:00
Sabe Jones
9ccb60799e chore(i18n): update locales 2018-02-22 23:04:56 +00:00
SabreCat
f86a77608b chore(sprites): compile & cleanup 2018-02-22 22:57:34 +00:00
SabreCat
8b8cee40a7 feat(content): mystery items Feb 2018 2018-02-22 22:56:33 +00:00
SabreCat
9487811d31 fix(world-boss): Tavern layout tweaks 2018-02-22 21:31:57 +00:00
Matteo Pagliazzi
d5e4be85e9 Revert "Task page : task filters (#9898)"
This reverts commit 9919faeed8.
2018-02-22 12:28:24 +01:00
Keith Holliday
deaf7fee81 Added world boss notification (#10030)
* Added world boss notification

* Updated styles
2018-02-21 14:58:56 -06:00
Sabe Jones
72dc7c01c3 Merge branch 'release' into develop 2018-02-21 17:47:56 +00:00
Sabe Jones
00c830372a 4.27.4 2018-02-21 17:47:28 +00:00
Sabe Jones
199ca03b23 chore(i18n): update locales 2018-02-21 17:45:03 +00:00
SabreCat
84dc1ab546 chore(news): Bailey 2018-02-21 17:35:33 +00:00
Sabe Jones
91df5d1565 4.27.3 2018-02-20 21:41:52 +00:00
Sabe Jones
d0a05ad745 fix(lint): disable-line typo 2018-02-20 21:41:33 +00:00
Sabe Jones
c991a3e20f fix(lint): disable-line typo 2018-02-20 21:41:11 +00:00
Sabe Jones
93cfd59ea1 chore(i18n): update locales 2018-02-20 21:32:43 +00:00
Sabe Jones
695f53758a Merge branch 'release' into develop 2018-02-20 21:16:43 +00:00
Sabe Jones
416c24d1e2 fix(auth): initialize Hello for social
fixes #9460
2018-02-20 21:15:36 +00:00
SabreCat
b0974fc4fc feat(rage-strike): Seasonal Shop modal 2018-02-20 20:05:32 +00:00
negue
8fabadfc67 fix genericPurchase test (#10024) 2018-02-19 20:17:41 +01:00
Matteo Pagliazzi
f2e5fdddf1 tests: fix client unit tests 2018-02-19 19:38:20 +01:00
kartik adur
9919faeed8 Task page : task filters (#9898)
* add tasklist getter

* add unit test + refactor for getters

* add task order sorting + update unit tests

* remove direct access to store.state.tasks

* add tag and search filter back to column.vue + unit tests

* add unit test for task order setting function

* add task filters to helper file + modify taskColumn state access to getter

* update column to get values at runtime. TODO set active filter at runtime

* add TaskColumn init state + daily-due-default

* add check for task type daily before set/reset dailyDueView

* remove unused sortBy import in column.vue

* remove unused sortBy

* pr review requested updates

* pr review clean up updates
2018-02-19 19:03:38 +01:00
Josh Sears
f592103754 Partial Fix for #8735 ("Failed party invitations do not indicate which invitations failed") (#9939)
* Updated from origin and added invite error fixes

* Update test for capitalization issue

* New error display

Changed app.vue to display error message using error.response.data.message
2018-02-19 19:00:42 +01:00
kartik adur
80e4f5e745 Replace PhantomJS with ChromeHeadless for unit test support (#9972)
* change PhantomJS to ChromeHeadless + travis support

* pr requested updates

* update api-v3 integration beforAll/afterAll
2018-02-19 18:56:48 +01:00
Mike Tung
119f21ddce New PR for margins in stable - fixes #9651 (#9982)
* made style change for pet item class to have more margins.

* made style change for pet item class to have more margins.

* files got added

* encapsulated the items as stated in #9903

* #9903 moved the css to stable -> petitem.vue for better encapsulation.

* saving pngs

* update on files

* updated files as requested in PR!

* Revert "saving pngs"

This reverts commit a38ea664e1.

* made css changes just to pet slot

* #9982 removed redundant css

* #9982 applied scss to mount slots as well.

* #9982 refactored scss to be in one place.

* #9982 changed selector
2018-02-19 18:55:16 +01:00
Mateus Etto
311a898938 Fix attributes box size being too small on Japanese (#9984) 2018-02-19 18:52:07 +01:00
Ignacio Alvarez
1c1b050e2c If message uuid is set as system append as user 'system message' #9985 (#9988) 2018-02-19 18:51:43 +01:00
Keith Holliday
faa068f690 Challenge small refactor (#9964)
* Removed challenge group duplication

* Removed duplication of joined challenge

* Moved helpers to challenge library

* Passed group to function

* Fixed group response
2018-02-19 08:15:43 -07:00
Matteo Pagliazzi
b619496f8e fix linting 2018-02-17 18:41:49 +01:00
Matteo Pagliazzi
80fe58bc6f Upgrade client deps (#9990)
* upgrade axios

* upgrade axios-progress-bar

* upgrade bootstrap-vue

* fix issues
2018-02-17 18:15:43 +01:00
Matteo Pagliazzi
c3c9dd5d35 Merge branch 'upgrade-client-build' into develop 2018-02-17 18:15:02 +01:00
Matteo Pagliazzi
464613a56a Merge branch 'develop' into upgrade-client-build 2018-02-17 18:14:48 +01:00
Matteo Pagliazzi
74ba55c20b Upgrade tests tools and lint migrations and scripts (part 2) (#9998)
* upgrade gulp-babel

* upgrade babel-eslint

* upgrade eslint-friendly-formatter

* start upgrading chai

* start to upgrade eslint

* restore skipped tests

* start to upgrqde monk

* fix linting and remove unused file

* fix mocha notifications, and common tests

* fix unit tests

* start to fix initrgration tests

* more integration tests fixes

* upgrade monk to latest version

* lint /scripts

* migrations: start moving to /archive unused migrations and run eslint with --fix

* lint migrations

* fix more integration tests

* fix test
2018-02-17 18:11:24 +01:00
SabreCat
ee087e5eee refactor(rage-strike): consts 2018-02-16 21:36:10 +00:00
SabreCat
95179be346 feat(world-boss): Rage Strike support 2018-02-16 21:18:51 +00:00
negue
b0ae0ef4da HOTFIX: purchase marketGear (#9992)
* fix purchase marketGear

* test marketGear purchase in the client
2018-02-16 17:56:05 +01:00
Matteo Pagliazzi
dad4f864ff fixes #10001 (#10002) 2018-02-16 17:55:45 +01:00
Keith Holliday
f7ffc173b1 Prevented of closing bailey without clicking bottom buttons (#9993) 2018-02-16 09:21:59 -07:00
Keith Holliday
ac6a5ae8d2 Registered new funtion as translation (#10005) 2018-02-15 21:25:44 -07:00
Sabe Jones
70fbc83664 Merge branch 'release' into develop 2018-02-16 03:08:22 +00:00
Sabe Jones
c3e41cc5e1 4.27.2 2018-02-16 03:07:52 +00:00
Sabe Jones
cae0120beb chore(i18n): update locales 2018-02-16 03:01:42 +00:00
SabreCat
10b978da4e fix(spoilers): don't reveal quest boss rewards 2018-02-16 02:56:08 +00:00
SabreCat
5987145b86 fix(phobia): show censored art as needed 2018-02-14 22:35:14 +00:00
Sabe Jones
791d711298 Merge branch 'release' into develop 2018-02-14 21:09:30 +00:00
Sabe Jones
ff65c4da78 4.27.1 2018-02-14 20:55:12 +00:00
Sabe Jones
163d56afe9 chore(i18n): update locales 2018-02-14 20:54:50 +00:00
SabreCat
2f46d1bc65 chore(sprites): compile 2018-02-14 20:48:48 +00:00
SabreCat
6ccb841b32 chore(news): Bailey text 2018-02-14 20:47:47 +00:00
Sabe Jones
cdcee8d169 World boss client (#9999)
* WIP(world-boss): client components partial

* WIP(world-boss): more client additions

* WIP(world-boss): some beautification

* WIP(world-boss): more Tavern beauty

* fix(world-boss): gradient adjustment

* fix(style): various WB tweaks

* fix(world-boss): better resolution Rage Strike

* fix(world-boss): alignment fixes

* Added world boss modal

* feat(world-boss): add info button

* fix(world-boss): move SVG and tweak padding
2018-02-14 13:43:10 -06:00
Matteo Pagliazzi
16a227109e upgrade to webpack 3 and extract-text-webpack-plugin 2018-02-14 12:14:11 +01:00
Matteo Pagliazzi
8611bd97ae upgrade webpack-dev-middleware 2018-02-14 12:06:30 +01:00
Matteo Pagliazzi
2f3e6b82cf fix svgo options 2018-02-14 12:05:53 +01:00
Matteo Pagliazzi
adcd9a53c4 upgrade babel-loader 2018-02-14 11:58:12 +01:00
Matteo Pagliazzi
4a7eb768dc ugrade vue-loader 2018-02-14 11:57:47 +01:00
Matteo Pagliazzi
d544a5be6f upgrade svgo-loader 2018-02-14 11:54:36 +01:00
Matteo Pagliazzi
269dac1fe8 upgrade postcss-easy-import 2018-02-14 11:51:01 +01:00
Matteo Pagliazzi
bd90ffa6f8 upgrade svg-inline-loader 2018-02-14 11:49:41 +01:00
Matteo Pagliazzi
7c5d35cf77 upgrade url-loader 2018-02-14 11:48:05 +01:00
Matteo Pagliazzi
0049647c08 upgrade autoprefixer 2018-02-14 11:47:29 +01:00
Sabe Jones
7684f9b26a Merge branch 'release' into develop 2018-02-14 02:31:17 +00:00
Sabe Jones
fd5ab32c43 4.27.0 2018-02-14 02:30:55 +00:00
Sabe Jones
e0933dc0a1 chore(i18n): update locales 2018-02-14 02:29:58 +00:00
Sabe Jones
d69e7e66ee World Boss 2018 (Server) (#9995)
* feat(world-boss): barebones API

* fix(world): use Express respond for better JSON

* fix(api): respond with code 200

* feat(content): canonical Dysheartener desc and Rage

* fix(world-boss): enable progress

* WIP(test): world state API

* WIP(test): refactor world boss setup

* WIP(test): better expectations

* fix(test): more expect polishing

* feat(event): server side World Boss

* fix(strings): accidental deletion

* fix(content): include encouragement after Rage

* refactor(world-boss): address comments
2018-02-13 19:21:39 -06:00
Matteo Pagliazzi
fa06628361 add new locales 2018-02-13 12:41:47 +01:00
Matteo Pagliazzi
7f1067e1ab chore(i18n): update locales 2018-02-13 12:40:05 +01:00
Matteo Pagliazzi
db6644a572 chore(i18n): update locales 2018-02-13 12:35:05 +01:00
Sabe Jones
1e23395c8c Merge branch 'release' into develop 2018-02-12 22:08:03 +00:00
Sabe Jones
b7b8faedd6 4.26.3 2018-02-12 22:07:52 +00:00
Sabe Jones
7da0b641dd chore(i18n): update locales 2018-02-12 22:07:00 +00:00
SabreCat
82ff241e39 chore(sprites): compile 2018-02-12 21:58:54 +00:00
SabreCat
cf4aaf1618 feat(event): enable Valentines 2018-02-12 21:56:29 +00:00
Keith Holliday
6a67cbba65 Refactored spell code to functions (#9908)
* Refactored spell code to functions

* Fixed party member returns
2018-02-12 09:17:15 -07:00
Keith Holliday
037280601a Refactored group chat flagging (#9907) 2018-02-11 08:35:24 -07:00
Keith Holliday
2687fe1ac9 Added message when there will be no notification for group (#9856)
* Added message when there will be no notification for group

* Added constant and removed extra locale

* Added back message
2018-02-11 08:34:57 -07:00
Sabe Jones
31eeb13598 4.26.2 2018-02-10 11:56:30 +00:00
Sabe Jones
818c201afe chore(i18n): update locales 2018-02-10 11:46:36 +00:00
negue
54153ec299 Refactor Purchase API - Part 1 (#9714)
* move to shops/purchase

* move files to /buy/ instead of /purchase/

* refactor buy.js - add more itemtypes

* revert moving special purchases to buy

* only use buyOp from api-routes

* fix buying potion client-side

* undo import buy instead of purchase

* enable potion bulk purchase - use buyGear as fallback (as before)

* move quantity purchase inside buyHealthPotion

* move quantity purchase inside buyQuest

* move quantity purchase inside buySpecialSpell + add analytics

* remove unused quantity variable - set req.type on specialKeys

* fix `buyKnownKeys` on buy api

* test buy-special-spell if not enough gold

* more buy ops coverage

* fix lint

* buyMysterySet: test for window.confirm, buyQuest: check for Masterclassers unlock

* fix test & lint

* re-create package-lock.json to travis build ?

* use global.window instead of method argument

* add back canOwn checks

* remove buyMysterySet confirm request
2018-02-10 11:14:40 +01:00
Matteo Pagliazzi
7abfd1d510 chore: docker: use correct gulp cli, tests: try to reduce timeouts 2018-02-10 11:14:01 +01:00
Sabe Jones
b4cbcb172b Merge branch 'release' into develop 2018-02-10 05:36:49 +00:00
Sabe Jones
f78bcc20c9 chore(i18n): update locales 2018-02-10 05:18:40 +00:00
negue
6506f1d44d fix user avatar transformation - change number of buffs owned when you use them - fixes #9795 (#9824)
* refresh not working - show avatar transformation

*  call store-action from mixin, use mixin from app.vue, add user-target in spells-mixin,

* fix avatar tranformation on user - clean up

* move default message

* fix purchase of cards

* fix casting
2018-02-09 17:04:08 -06:00
negue
6cb1ec4ec5 fix draging-info margin - resize draging icon - resize hatching modal (remove unneeded space) (#9775) 2018-02-09 16:48:48 -06:00
negue
723b4f3451 Attributes UI Refactoring (#9887)
* include class bonus in sorting

* wip - show more information in the attributes grid

* attributes tooltip + dialog redesign

* fix stat calculation

* fix spacings

* show class in equip-gear-modal

* fix buy-modal attributes-grid, clean up css

* show attributes popover in profile-stats overview

* add class / purchase type colors to colors.scss - replace colors by variable - clean up

* translate strings
2018-02-09 16:47:38 -06:00
James Hwang
6c677be9d2 Styles inputs in group modal to be consistent with rest of app #9897 (#9924)
* Styles input in group modal to be consistent with rest of app #9897

* Changed checkbox id to accurately describe the element
2018-02-09 16:44:56 -06:00
Александр
f49c99ee06 replaced an outdated link //habitrpg.wikia.com (#9954)
* replaced an outdated link //habitrpg.wikia.com

Since http://habitica.wikia.com is the official link. Also, there are still incorrect paths in the footer menu, such as "Go to Social > Challenges" and others, when 'Challenges' is already on the menu bar.

* fix  Party to Guilds _mistake

Here is a simple mistake, because of what does not pass the verification
2018-02-09 16:19:02 -06:00
Alexey Pyltsyn
846feb1902 Make images responsive on features page (#9931) 2018-02-09 16:15:03 -06:00
Sabe Jones
da22858ac0 Triumph Theme by anastasiagaskamp (#9323)
* feat(audio): Triumph Theme

* fix(audio): trim silence
2018-02-09 15:57:34 -06:00
SabreCat
dafb6df18b feat(analytics): track account delete/reset 2018-02-09 21:36:14 +00:00
Keith Holliday
9017eea0c4 4.26.1 2018-02-09 10:05:12 -06:00
Keith Holliday
92abb19f9c Docker update (#9976)
* Updated docker prod

* Added new gulp cli
2018-02-09 08:59:49 -07:00
Keith Holliday
3bee0446b8 Loaded profile when not cached (#9977) 2018-02-09 08:57:55 -07:00
Matteo Pagliazzi
1ed58c452c Upgrade amplitude stripe amazon-payments cwait (#9962)
* upgrade amplitude stripe amazon-payments cwait

* correctly import cwait
2018-02-09 13:47:52 +01: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
Matteo Pagliazzi
8e24b0578e upgrade express, passport, ncong and csv-stringify, remove csv package that is only used in super old migrations (#9965) 2018-02-09 13:46:39 +01:00
Matteo Pagliazzi
f87d6e3b31 groups: always fetch basic fields (#9975) 2018-02-09 13:46:17 +01:00
Sabe Jones
e1e5a6cc34 4.26.0 2018-02-09 00:58:23 +00:00
Sabe Jones
9eb70ee9ba Merge branch 'develop' into release 2018-02-09 00:58:13 +00:00
Sabe Jones
7485300ee9 chore(i18n): update locales 2018-02-09 00:43:01 +00:00
SabreCat
762c202154 feat(content): enable Cupid Potions 2018-02-09 00:35:51 +00:00
Matteo Pagliazzi
7613e50917 remove mongoskin and mongodb packages 2018-02-08 19:10:01 +01:00
Matteo Pagliazzi
4c77434bf0 Upgrade karma and related deps (#9974)
* upgrade karma and karma babel

* upgrade karma-chai

* upgrade karma-coverage

* upgrade karma-mocha

* upgrade karma-mocha-reporter

* upgrade karma-sinon-chai

* upgrade karma-spec-reporter
2018-02-08 19:02:19 +01:00
Matteo Pagliazzi
1ab26a200e Upgrade tests packages (#9973)
* upgrade mochat to v5

* upgrade cross-spawn

* upgrade chalk

* try to fix mongoose

* upgrade shelljs

* upgrade expect.js

* upgrade coveralls

* upgrade cross-env

* upgrade lcov-result-merger

* upgrade image-size
2018-02-08 19:00:49 +01:00
Matteo Pagliazzi
b738824f76 fix indentation in app.vue 2018-02-07 18:47:14 +01:00
Sabe Jones
694c440b55 Merge branch 'release' into develop 2018-02-07 02:16:48 +00:00
Sabe Jones
667bb28fe3 4.25.0 2018-02-07 02:16:24 +00:00
Sabe Jones
8993337ad7 chore(i18n): update locales 2018-02-07 02:15:58 +00:00
SabreCat
a251a5d089 chore(sprites): compile 2018-02-07 02:04:37 +00:00
SabreCat
dcdeec6256 feat(content): Badger Pet Quest 2018-02-07 02:03:30 +00:00
SabreCat
9fd0df9f2f fix(food): add missing text functions to Bare Bones Cake 2018-02-06 20:34:33 +00:00
Matteo Pagliazzi
1061fb0c31 remove async (only used for old migrations) (#9961) 2018-02-06 18:13:13 +01:00
Keith Holliday
c14fdd3fed Fixed attribute binding. Removed member url (#9963) 2018-02-06 09:53:43 -07:00
Alys
e219ad6bdf adjust slurs / banned words. TRIGGER / CONTENT WARNING: assault, slurs, swearwords, etc 2018-02-06 08:40:31 +10:00
Alys
42d7fd0861 fix typo in equipment description (Armorie) 2018-02-06 08:37:39 +10:00
Nathan Sollenberger
7ade91a8b8 Updates notification text for armoire items in shops:genericPurchase. (#9240)
Adjusts column widths for 'drop' type notifications to prevent .text from overlapping .icon-item.
Adds new 'flavorMessage' property to Snackbar notifications, which overrides standard computed message.
Vertically center XP gain icon/amount.
Fixes unrelated typo in i18n key name.
2018-02-05 19:43:30 +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
Jon Lim
9a00779698 Adding support for loading more members for Groups (#9740)
* Adding support for loading more members for Groups

Addresses issue #9720

Member modal component was only loading the maximum limit for queries
made to _getMembersForItem in /members, except with Challenges, which
was able to display a "Load More" button to retrieve another set of
users from the Challenge.

Made a few changes to how the GET request was being made when querying
for more members, added an easier way to know whether or not to display
the Load More button, and extracted some of the actions that were
too tightly coupled with the membersModal.vue.

* Fixes for failing lint tests

* Removing unnecessary async/await usage

* Fixing party view in header section

* Resolving missed conflict

* Adding necessary data for View Party in index header for web client to load party members
2018-02-05 19:42:54 +01:00
Lula Villalobos
a61d911c48 Feature - Store Exact Completion Date For Dailies (#9813)
* dailies history date added in scoreTask instead of cron

* fix lint issues

* changes based on feedback. Undo cron code deletion and deleted iteration on scoreTask

* fix lint issues

* add task history entry in cron for dailies that weren't completed

* add history entry after value is fully evaluated
2018-02-05 19:42:20 +01:00
Alexey Pyltsyn
fbacb56700 Fixed footer to bottom of page (#9860) 2018-02-05 19:42:01 +01:00
Alexey Pyltsyn
185717e6c3 Fixed a task tag tooltip position (#9910) 2018-02-05 19:41:46 +01:00
Mason Hahn
505dd4969d add contributor info for inbox tier styling (#9911) 2018-02-05 19:41:28 +01:00
Feywood
944e4fe399 collection items shown in quest progress (#9945) 2018-02-05 19:41:11 +01:00
Keith Holliday
804dd087f8 Updated notes on armoire when purchasing (#9891) 2018-02-05 10:27:10 -07:00
Keith Holliday
cb1136aadc Added markdown to tag edit fields/popup (#9867) 2018-02-05 09:54:42 -07:00
Keith Holliday
0f4b8f5f30 Added summary field tests (#9883)
* Added summary field tests

* Fixed typo
2018-02-05 09:52:44 -07:00
Keith Holliday
2d612b655d Added copy as todo (#9884) 2018-02-05 09:43:00 -07:00
negue
46877fb20c Purchase Card: fixes (#9803)
* prevent re-showing buy-modal after buying a card / fix class-badge in member-selection

* show notifications on card purchase

* move string to generic.json

* translation param "profileName"
2018-02-05 09:39:42 -07:00
Keith Holliday
38cded2083 4.24.6 2018-02-04 23:03:51 -06:00
Matteo Pagliazzi
65074df668 fix build task 2018-02-04 19:30:30 +01:00
Matteo Pagliazzi
b0ab09c352 Upgrade gulp (and gulp deps) (#9950)
* upgrade gulp to v4

* fix imagemin

* fixes
2018-02-04 18:18:10 +01:00
Matteo Pagliazzi
3a60e8de66 Merge branch 'develop' of github.com:HabitRPG/habitrpg into develop 2018-02-04 15:54:35 +01:00
Matteo Pagliazzi
886a96dac9 Merge branch 'release' into develop 2018-02-04 15:53:40 +01:00
Matteo Pagliazzi
20556e2af4 refactor casting spells on the client side (#9949) 2018-02-04 15:51:17 +01:00
Matteo Pagliazzi
3e849ec9a8 Revert "refactor casting spells on the client side (#9921)" (#9948)
This reverts commit 03946e6a87.
2018-02-04 15:50:36 +01:00
Matteo Pagliazzi
03946e6a87 refactor casting spells on the client side (#9921) 2018-02-04 14:47:34 +01:00
Matteo Pagliazzi
fdcc69fe4a Merge branch 'upgrade-universal-analytics' into develop 2018-02-04 14:45:31 +01:00
Matteo Pagliazzi
322b6a5e44 Merge branch 'develop' into upgrade-universal-analytics 2018-02-04 14:45:20 +01:00
Matteo Pagliazzi
2243a2f3dc upgrade winston-loggly-bulk (#9942) 2018-02-04 14:40:33 +01:00
Matteo Pagliazzi
59c848add5 upgrade request (#9941) 2018-02-04 14:39:54 +01:00
Matteo Pagliazzi
2d6a1fe709 remove jade, upgrade pug (#9940) 2018-02-04 14:39:46 +01:00
Matteo Pagliazzi
fac0338437 Merge branch 'release' into develop 2018-02-04 14:39:30 +01:00
Matteo Pagliazzi
e46f30894c fix test timeout 2018-02-04 14:39:16 +01:00
Matteo Pagliazzi
553dc116c5 Merge branch 'release' into develop 2018-02-04 14:21:35 +01:00
Matteo Pagliazzi
2029cd884c notifications: fix tests 2018-02-04 14:20:12 +01:00
Matteo Pagliazzi
ab89941ed5 notifications: fix tests 2018-02-04 14:04:41 +01:00
Matteo Pagliazzi
5dc0f5bb9b Merge branch 'release' into develop 2018-02-04 13:41:53 +01:00
Matteo Pagliazzi
d46a7ba985 notifications: fix typos and add extra check 2018-02-04 13:40:49 +01:00
Matteo Pagliazzi
86b3228a59 Merge branch 'release' into develop 2018-02-04 13:28:34 +01:00
Matteo Pagliazzi
4efbbd7bac notifications: fixes 2018-02-04 13:28:05 +01:00
Matteo Pagliazzi
d39e8a3587 upgrade universal-analytics 2018-02-03 22:40:40 +01:00
Matteo Pagliazzi
8bd3ef6f24 fix mongoose options 2018-02-03 22:17:10 +01:00
Matteo Pagliazzi
6d0917964b fix mongoose options 2018-02-03 22:15:40 +01:00
Sabe Jones
d463e2373e Merge branch 'release' into develop 2018-02-02 20:51:24 +00:00
Sabe Jones
2af99d7c65 4.24.5 2018-02-02 19:53:57 +00:00
Keith Holliday
4e01b14874 Removed required fields from user notifications (#9929) 2018-02-02 12:31:52 -07:00
Keith Holliday
944781c2f8 Added p parameter to group party query (#9857) 2018-02-02 11:24:41 -07:00
Keith Holliday
027eed1b25 Reset market on gear purchase (#9855) 2018-02-02 11:22:25 -07:00
Keith Holliday
803f63d991 Added two handed message to weapons (#9839)
* Added two handed message to weapons

* Added two handed message to content api

* Fixed static notes text. Added support for RTL
2018-02-02 11:21:53 -07:00
Keith Holliday
78ad1cd8b0 Added cache for user styles on chat (#9679)
* Added cache for user styles on chat

* Added loading on new message and other minor checks

* Added null checks

* Updated chat tests

* Added costume preference to chat

* Removed single profile cacheing for new chat messages

* Remove owned gear from cache

* Updated stats to only use buffs
2018-02-02 11:18:25 -07:00
Sabe Jones
a3ddd0746c 4.24.4 2018-02-02 16:55:55 +00:00
SabreCat
94845ec629 fix(event): remove seasonal pinned items 2018-02-02 16:54:25 +00:00
Sabe Jones
7e63856e64 4.24.3 2018-02-02 16:44:09 +00:00
Matteo Pagliazzi
3727d69d51 Merge branch 'release' into develop 2018-02-02 16:38:27 +01:00
Matteo Pagliazzi
1fbdb7dbd0 Mongoose 4.x (#9928)
* update mongoose to ^4.x

* another fix
2018-02-02 16:37:36 +01:00
Matteo Pagliazzi
b430b6ccb6 Revert "Mongoose 4.13 (#9926)" (#9927)
This reverts commit 7859f20a40.
2018-02-02 16:36:54 +01:00
Matteo Pagliazzi
7859f20a40 Mongoose 4.13 (#9926)
* update mongoose to ^4.x

* another fix
2018-02-02 16:35:05 +01:00
Matteo Pagliazzi
389d6f18b4 travis split unit and integration tests (#9925) 2018-02-02 15:07:39 +01:00
Sabe Jones
fd1d1da509 Revert "fix(test): update for event"
This reverts commit ede28ac33a.
2018-02-02 12:09:45 +00:00
Matteo Pagliazzi
014b367f56 do not use lodash to find notification 2018-02-02 12:24:43 +01:00
Matteo Pagliazzi
4580b33e43 fix progress bar hidden behind the menu 2018-02-02 09:57:39 +01:00
Sabe Jones
48bcc1e968 4.24.2 2018-02-02 03:35:00 +00:00
Sabe Jones
35368eb6ad chore(i18n): update locales 2018-02-02 03:33:27 +00:00
Sabe Jones
9b337983ed fix(strings): Capital Party, comrade 2018-02-02 03:27:19 +00:00
Sabe Jones
cd4951d204 fix(notifs): brevity 2018-02-02 03:19:13 +00:00
Sabe Jones
bd83d6f5aa 4.24.1 2018-02-02 01:51:08 +00:00
Sabe Jones
9c241a6159 fix(classes): remove winter preview
Also adds a new index to the Mongo doc and fixes a typo in that file.
2018-02-02 01:49:33 +00:00
Sabe Jones
7a6baeadbd 4.24.0 2018-02-02 00:48:36 +00:00
Sabe Jones
5495acea96 chore(i18n): update locales 2018-02-02 00:46:45 +00:00
SabreCat
a3aa2cc175 chore(sprites): compile 2018-02-02 00:33:04 +00:00
SabreCat
8b0d02a16b feat(content): backgrounds and Armoire Feb 2018
Also ends Winter Wonderland event
2018-02-02 00:31:38 +00:00
SabreCat
c3c0eb974a Merge branch 'develop' into release 2018-02-02 00:29:58 +00:00
Keith Holliday
56539100e3 Fixed zindex for progress bar (#9922) 2018-02-01 18:12:34 -06:00
SabreCat
b706db43e4 Merge branch 'release' into develop 2018-02-01 21:09:57 +00:00
Keith Holliday
3e0a7c70ed Event off fixes (#9918)
* Added removes for all events

* Moved to beforeDestroy
2018-02-01 10:14:21 -07:00
Sabe Jones
6a5bd1b0a5 Merge branch 'release' into develop 2018-01-31 22:23:15 +00:00
Sabe Jones
7f8a9be766 4.23.2 2018-01-31 22:20:51 +00:00
Sabe Jones
dbdf679e4a chore(i18n): update locales 2018-01-31 22:20:39 +00:00
SabreCat
eb28dfadf9 chore(news): Last Chance Bailey
Also fixes a linting issue with birthday fun.
2018-01-31 22:10:50 +00:00
SabreCat
ede28ac33a fix(test): update for event 2018-01-31 22:00:54 +00: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
Matteo Pagliazzi
a85282763f Upgrade sinonjs (and related libs) (#9914)
* update sinon

* remove errors

* fix unit tests
2018-01-31 10:56:32 +01:00
Sabe Jones
ba9d7b3b5e 4.23.1 2018-01-31 00:53:27 +00:00
Sabe Jones
3b794c017a fix(event): update birthday vars and hooks 2018-01-31 00:41:06 +00:00
SabreCat
47dbe4561f fix(test): update for event 2018-01-30 22:22:02 +00:00
Sabe Jones
97135a1ac3 Merge branch 'release' into develop 2018-01-30 21:38:56 +00:00
Sabe Jones
a636e15d11 4.23.0 2018-01-30 21:38:34 +00:00
Sabe Jones
3cc15e869e chore(i18n): update locales 2018-01-30 21:38:00 +00:00
SabreCat
88c8b92a68 chore(sprites): compile 2018-01-30 21:26:15 +00:00
SabreCat
cee4d7e87b feat(event): Habit Birthday 2018 2018-01-30 21:25:19 +00:00
Matteo Pagliazzi
9488ec2eb0 Merge branch 'release' into develop 2018-01-30 18:56:25 +01:00
Keith Holliday
4fe6c8db64 Clone challenges api (#9684)
* Added clone api

* Added new clone UI

* Fixed challenge clone

* Fixed lint and added mongo toObject

* Removed clone field, fixed type, fixed challenge task query

* Auto selected group

* Accounted for group balance when creating challenge

* Added check for if user is leader of guild

* Added leader existence check

* Added fix for leader and prizecost equal to
2018-01-30 08:23:20 -07:00
Keith Holliday
ccf8e0b320 Removed gitattributes 2018-01-29 21:34:18 -06:00
Matteo Pagliazzi
1dc558ddba prevent ex-participants appearing in challenge export file - Fix #9844 (#9846)
* possible fix for 9844

* fix typo in challengeModal file

* remove lines for empty users
2018-01-29 16:23:40 -06:00
Alexey Pyltsyn
ae27ae0090 Improved Party page UI (#9892) 2018-01-29 15:44:22 -06:00
Alys
47c2a3a21a prevent "Zero-day streak" giving a 21-day streak achievement + tests - fixes #2578 (#9688)
* prevent "Zero-day streak" giving a 21-day streak achievement - fixes #2578

* add tests for streak achievements

* remove .only from set of tests

* refactor(test): fix linting
2018-01-29 15:43:59 -06:00
Cassidy Pignatello
5d4e1362bb updates Orb of Rebirth description to more accurately list its effects (#9894) 2018-01-29 15:32:21 -06:00
James Hwang
25cecf298f Fixed formatting of modal strings to correctly display message #9818 (#9862) 2018-01-29 15:30:05 -06:00
Alexey Pyltsyn
2de3b63e87 Fixed a community guidelines layout (#9893)
* Fixed a community guidelines layout

* Refactoring: add community guidelines component
2018-01-29 15:18:20 -06:00
John Zhou
7abb8a81a7 Do not show visual buffs on choose class avatars (#9812) 2018-01-29 15:16:49 -06:00
Daniel Reeves
3eb3891899 Update copyright year 2017->2018 (#9889) 2018-01-29 15:14:00 -06:00
Alexey Pyltsyn
4b0ad422f1 Use translatable strings in footer (#9866) 2018-01-29 15:11:30 -06:00
Alexey Pyltsyn
3c603e3bb1 Fixed horizontal scrollbar (#9853) 2018-01-29 15:07:59 -06:00
Nicole Massaro
4ee788f541 Hide stats points allocation on locked or disabled class system (#9826) (#9851) 2018-01-29 15:05:06 -06:00
Sabe Jones
99ab9726b4 Allow user to buy numbered special gear (#9823)
* fix(buy): allow user to buy numbered special gear

* fix(buy): correct content constant
2018-01-29 15:02:55 -06:00
Maru de Vera
23dd402e79 Unpin Regained Items from Enchanted Armoire (#9766) 2018-01-29 15:00:19 -06:00
Irina Brennen
6bd90807f3 Fixing issue with hair bangs, styles and colors not getting the option.active class (#9759) 2018-01-29 14:57:35 -06:00
Alys
563a5845f0 refund gems when deleting a "Public Challenge" (Tavern challenge) (#9752) 2018-01-29 14:56:46 -06:00
Brad Lugo
2e580baf27 Update the docker compose process (#9724)
Since the client side code and server side code run independently, the
docker compose process needed to be updated to reflect this change.
This fix included updating the docker-compose files' versions.
2018-01-29 14:56:08 -06:00
Clement134
44ded25f6d Add .gitattributes file fixes #9717 (#9722)
* chore(gitattributes): add .gitattributes file

*  chore(gitattributes): specify file type for each extension

* fix(presskit): use LF line endings
2018-01-29 14:53:14 -06:00
Alys
70da5940a7 clarify that "Leave" refers to guild/party; fix pluralisation in keep/remove challenge tasks (#9706)
* change "Keep/Remove It" to "Keep/Remove Them" when asking about all challenge tasks while leaving a challenge

* change "Leave" button on groups to "Leave Guild" or "Leave Party"

This is because the button is underneath the challenges so this
clarifies that it is referring to the group, not a challenge.

* change "Keep/Remove Them" to "Keep/Remove Tasks"
2018-01-29 14:52:28 -06:00
Cai Lu
12aa8a78c1 Track sleeping in the inn with analytics (fixes #9561) (#9685)
* Sleep status is tracked by analytics when toggled.

* Modify test: test that analytics is called with 'sleep' event and data passed includes the user's new sleep status
2018-01-29 14:48:24 -06:00
Keith Holliday
94619737e8 Adjusted zindex of navbar to be above snackbars and modals (#9873) 2018-01-29 08:25:07 -07:00
Alys
ccc9e6611c adjust terminology in delete To-Dos message; move similar messages together 2018-01-28 12:29:24 +10:00
Keith Holliday
1f1459b0d8 4.22.1 2018-01-27 11:31:59 -06:00
Keith Holliday
6489e74b6b Added tests for new username restrictions (#9900) 2018-01-27 10:30:17 -07:00
Alys
c1e264955f describe Login Name limitations on Registration form and Add Local Auth form (#9896)
* describe Login Name limitations on registration form and Add Local Auth form

* adjust text in response to this change: c69687f935

* update max length
2018-01-27 09:38:23 -07:00
Alys
f302d15bc4 add length and character limitations for login name (username) (#9895)
* update API comments to for `username` restrictions and to use Login Name terminology

We use "login name" rather than "username" in user-visible text
on the website and (usually) when communicating with users because
"username" could be confused with "profile name".
Using it in the docs allows you to search for that term.

* add alphanumeric and length validation for creating new login name (username)

The 'en-US' locale is specified explicitly to ensure we never use
another locale. The point of this change is to limit the character
set to prevent login names being used to send spam in the Welcome
emails, such as Chinese language spam we've had trouble with.

* add error messages for bad login names

* allow login name to also contain hyphens

This is because our automated tests generate user accounts using:
  let username = generateUUID();

* allow login names to be up to 36 characters long because we use UUIDs as login names in our tests

* revert back to using max 20 characters and only a-z, 0-9 for login name.

It's been decided to change the username generation in the tests instead.

* disable test that is failing because it's redundant

Spaces are now prohibited by other code.

We can probably delete this test later. I don't want to delete it
now, but instead give us time to think about that.

* fix typos

* revert to login name restrictions that allow us to keep using our existing test code

I'm really not comfortable changing our test suite in ways that
aren't essential, especially since we're working in a hurry with
a larger chance than normal of breaking things.
The 36 character length is larger than we initially decided but
not so much larger that it's a huge problem.
We can reduce it to 20 when we have more time.

* limit username length to 20 chars

* fix tests
2018-01-27 09:33:56 -07:00
Keith Holliday
8c70c8839b 4.22.0 2018-01-25 17:35:45 -06:00
Keith Holliday
3fcd04fd8a Updated encryption 2018-01-25 17:33:50 -06:00
Sabe Jones
d85f18751c chore(i18n): update locales 2018-01-25 23:26:24 +00:00
SabreCat
1390c4eae5 Merge branch 'develop' into release 2018-01-25 23:20:01 +00: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
7b026fa32c Added existence check for lastMessageText (#9886) 2018-01-25 13:46:49 -07:00
Keith Holliday
33698c219f Added existence check for lastMessageText (#9881) 2018-01-25 11:33:37 -07:00
Matteo Pagliazzi
b76d731cee fix gold icon alignment 2018-01-25 16:53:53 +01:00
Matteo Pagliazzi
4d1ac51543 upgrade datepicker 2018-01-25 15:13:21 +01:00
Matteo Pagliazzi
3818fbdd3e update boostrap and bootstrap-vue (no breaking changes) 2018-01-24 19:08:07 +01:00
Sabe Jones
af245b63d9 Merge branch 'release' into develop 2018-01-24 01:31:27 +00:00
Sabe Jones
028da1d6a9 4.21.0 2018-01-23 23:07:20 +00:00
Sabe Jones
49397244c4 chore(i18n): update locales 2018-01-23 23:07:05 +00:00
SabreCat
2b04ed3246 feat(content): Mystery Items 2018/01 2018-01-23 22:38:23 +00:00
Keith Holliday
51aebb540c Removed display of users personal checklist on challenge tasks (#9837) 2018-01-23 10:55:55 -07:00
Keith Holliday
f5d7777b2c Reloaded user data after cancelling subscription (#9836) 2018-01-23 10:28:44 -07:00
Keith Holliday
be1ffbd671 Removed promot to leader from challenge member modal (#9831) 2018-01-23 09:58:12 -07:00
Keith Holliday
5640139ef1 Awaited unlink so the UI refreshes removed tasks (#9815) 2018-01-23 09:36:46 -07:00
Keith Holliday
0959499450 Changed width to maxwidth (#9830) 2018-01-22 09:15:55 -07:00
Keith Holliday
90ffe587dd Added analytics to drop (#9792)
* Added analytics to drop

* Updated tracking category
2018-01-22 09:15:23 -07:00
Keith Holliday
38aafb6c7b Added clear completed todos (#9782) 2018-01-22 08:28:42 -07:00
Keith Holliday
ecfcf09184 Added more responsive styles to filters (#9820) 2018-01-22 08:20:34 -07:00
Keith Holliday
7083dc7e05 Added resync for completed todos (#9821) 2018-01-22 08:19:47 -07:00
Keith Holliday
d4e0417c48 Added challenge tag when challenge task is added to existing challenge (#9833) 2018-01-22 08:19:27 -07:00
Matteo Pagliazzi
ec7c25de9f add new notifications types 2018-01-22 11:46:51 +01:00
Matteo Pagliazzi
6f9db87843 Upgrade travis (#9850)
* upgrade travis

* upgrade travis
2018-01-21 22:47:58 +01:00
Matteo Pagliazzi
46c9038f54 Remove unused packages (#9849)
* remove unused packages

* update lock package

* try with paypal-rest-sdk 1.7.1

* setup nconf
2018-01-21 21:23:25 +01:00
Keith Holliday
1ce09aeb34 Added chatscroll check (#9814) 2018-01-20 17:00:54 -07:00
Keith Holliday
2ba327ef14 Fixed gem purchasing and error catching 2018-01-20 15:09:08 -06:00
Matteo Pagliazzi
de93b47493 add new notifications types 2018-01-20 17:28:50 +01:00
Sabe Jones
b0a21e116a 4.20.3 2018-01-19 03:59:29 +00:00
Sabe Jones
53d1a5f9dc chore(i18n): update locales 2018-01-19 03:58:59 +00:00
SabreCat
274f942b1e chore(news): Add note re audio themes 2018-01-18 21:45:15 +00:00
SabreCat
4aad52242c chore(news): iOS + Blog Bailey 2018-01-18 21:25:59 +00:00
Keith Holliday
166a48e139 Temporarily removed task allocation settings (#9822) 2018-01-18 14:16:30 -06:00
SabreCat
13de97dde6 fix(market): hide nav buttons when too few items
Fixes https://github.com/HabitRPG/habitica/issues/9802#issuecomment-358687806
2018-01-18 20:05:16 +00:00
Matteo Pagliazzi
6d8407ff94 fix tags selection in groups 2018-01-18 17:39:50 +01:00
Alys
663b794435 adjust Ram Barbarian equipment set to say "(Item .. of 3)"
"Item" had been missing.
2018-01-18 21:25:26 +10:00
Keith Holliday
c0276e3663 More staging fixes (#9816)
* Added ability to adjust challenge task copy's streak

* Disabled stat allocation if method is incorrect
2018-01-18 11:51:56 +01:00
Matteo Pagliazzi
6d57ce3050 fix typo 2018-01-18 11:41:19 +01:00
Matteo Pagliazzi
2159df785f Staging fixes (#9819)
* categories can be selected

* quick inventory fixes
2018-01-18 11:30:39 +01:00
Matteo Pagliazzi
9762258975 Merge branch 'develop' of github.com:HabitRPG/habitrpg into develop 2018-01-17 19:33:30 +01:00
Matteo Pagliazzi
deea64e839 more fixes for the task modal 2018-01-17 19:33:21 +01:00
Matteo Pagliazzi
9e615ba862 move delete task btn outside of advanced settings 2018-01-17 19:27:53 +01:00
SabreCat
d34beca3cc Merge branch 'release' into develop 2018-01-17 18:24:48 +00:00
Sabe Jones
07ed989862 4.20.2 2018-01-16 22:46:08 +00:00
Sabe Jones
049844ea7d chore(i18n): update locales 2018-01-16 22:35:00 +00:00
SabreCat
ff4c76165a fix(event): end New Year's cards 2018-01-16 22:09:24 +00:00
Keith Holliday
c3220e7c03 Pushed zindex of progress bar above modals (#9781)
* Pushed zindex of progress bar above modals

* Moved notifications above modals
2018-01-15 13:30:03 -07:00
Keith Holliday
cb4c6b3ca6 Added redirects for old url styles (#9780) 2018-01-15 12:43:02 -07:00
Keith Holliday
ba36ba0157 Added max width to profile image (#9783) 2018-01-15 12:34:00 -07:00
Keith Holliday
dd95acf436 Added coupon purchasing back to stripe (#9794) 2018-01-15 12:12:19 -07:00
Keith Holliday
a73b03452a Fixed overflow for member lists larger than 10 (#9777) 2018-01-15 10:32:32 -07:00
Keith Holliday
935fa1baae Fixed update query to revert challenge tags when broken (#9791) 2018-01-15 10:31:33 -07:00
Keith Holliday
745f930749 Added docs for mongo indexes (#9790) 2018-01-15 10:30:49 -07:00
Keith Holliday
d87db40c52 Staging fixes (#9804)
* Fixed party member loading

* Fixed quest details

* Fixed party creating

* Fixed challenge habit restore streak permissions

* Fixed fetch recent messages for party

* Adjusted category box placement for challenges

* Fixed zindex for input on group

* Changed reset streak restriction and allowed for adjust streak
2018-01-15 10:21:08 -07:00
Keith Holliday
0ea91016f8 Trimmed username spaces (#9793) 2018-01-15 10:20:36 -07:00
Keith Holliday
d4f634c3d8 Fixed disabling button and dismissing modals (#9805) 2018-01-15 09:16:15 -07:00
Matteo Pagliazzi
286566fc0c misc fixes for task modal 2018-01-13 11:27:02 +01:00
Cassidy Pignatello
2ed4df0b7c unhides scroll bar and adjusts overflow to remove whitespace at bottom (#9767) 2018-01-12 16:38:54 -06:00
Alys
9bb7c6ece0 allow user to restore streak on their copy of a challenge Daily (#9757) 2018-01-12 16:37:36 -06:00
Lula Villalobos
db0a6f6bb8 Fix Server Errors Appear As Blank Red Bar (#9747)
* fix path to error message

* changed error message path to check user auth error
2018-01-12 16:33:00 -06:00
Brad Lugo
b6305826be Update Vagrantfile.example to forward port 8080 (#9732)
There was a change in how the code is run locally and part
of this change included using port 8080. This change includes
the port forwarding for said port in the example file for Vagrant
2018-01-12 16:32:09 -06:00
Mel
f00ab86eff Update tier icons to correct size and color (#9727)
* update tier icons to correct size and color

* make tier text bold
2018-01-12 16:29:37 -06:00
Cassidy Pignatello
a44f29dad8 replaces btn-default with btn-secondary (#9704) 2018-01-12 16:25:02 -06:00
Pizilden
67b396bf16 Added Lunasol Theme (#9635) 2018-01-12 16:22:57 -06:00
Grayson Gilmore
ce14a9dadb Challenge modal optimization - remove unnecessary API call - partial fix for #9371 (#9546)
* Attempt to use party data from the store rather than always fetching it from the API

* Move init code to shown() to prevent unnecessary network requests

* Use store party data in getGroup action if possible to save an API call

* Use store data rather than API call for party in challengeModal; remove unnecessary code in guilds:getGroup action

* Create party:getParty action and employ it in Group and ChallengeModal

* Use store instead of action return for party data

* Change how party data is stored
2018-01-12 16:18:56 -06:00
MathWhiz
183c90ac3a Fix presskit (#9418)
* Move presskit to static folder

* Fix image location

* Add press kit FAQ strings

* Add faq section, fix images

* Update Images

* Add images to presskit page

* Remove unecessary parts
2018-01-12 16:18:20 -06:00
borisabramovich86
9e1a262f96 Fixes Purchase contributor equipment (fixes #9179) (#9306)
* Able to see all non class related items in market

* Fix lint errors

* Able to see all non class related items in market

* Fix lint errors

* add test for showing contributor gear

* Added previously owned items to test with eslint exception
2018-01-12 16:16:28 -06:00
MathWhiz
06dd9fe859 Add SpacePenguin's Theme (#9237)
* Add SpacePenguin's Theme

* Fix files
2018-01-12 16:15:55 -06:00
zags
2a2c525c2d Add support for multiDaysCountAsOneDay == false to evasion (#9077)
* Add support for `multiDaysCountAsOneDay == false` to evasion

`if (dailiesDaysMissed > 1) dailiesDaysMissed = 1;` causes the evasion for-loop to only evaluate once even if `multiDaysCountAsOneDay == false`.  This statement isn't necessary because `if (multiDaysCountAsOneDay) break;` will cause the for-loop to evaluate only once if `multiDaysCountAsOneDay == true`.  Removing this statement makes the `dailiesDaysMissed` variable unnecessary.

* Moves break statement out of conditional
2018-01-12 16:12:19 -06:00
Sabe Jones
b2c1c9d9dc Merge branch 'release' into develop 2018-01-12 21:54:20 +00:00
Sabe Jones
c33eba6736 4.20.1 2018-01-12 21:47:21 +00:00
Sabe Jones
56434cce71 chore(i18n): update locales 2018-01-12 21:46:32 +00:00
SabreCat
c41123c36c chore(news): Blog Bailey 2018-01-12 21:38:16 +00:00
SabreCat
043a6cd4ba chore(shops): update Featured Items 2018-01-12 21:25:09 +00:00
SabreCat
0ca2f9034f Revert "WIP: Buy-1-Get-1 Gift Subs (#9719)"
This reverts commit dc3d694d0e, with the exception of locale strings that need not be purged.
2018-01-12 21:15:42 +00:00
Keith Holliday
4c7157807b Synced isdue/next due when user joins challenge (#9779) 2018-01-12 10:16:51 -06:00
Keith Holliday
0afe797bae Fixed display when quest has no completion function (#9778) 2018-01-12 10:16:21 -06:00
Alys
1c8797e473 change Attribute to Stat and upper-case Stat Points and a couple of other terms 2018-01-12 08:09:31 +10:00
Keith Holliday
e0bf6d2e55 Reverted group flag code (#9784)
* Reverted group flag code

* Reverted all flagging code

* Added hyphens back
2018-01-11 12:04:07 -06:00
Matteo Pagliazzi
e96d0659cb fix typos in migration to convert field for Apple subscribers 2018-01-10 18:19:32 +01:00
Matteo Pagliazzi
72d70236ea fix typos in migration to convert field for Apple subscribers 2018-01-10 18:10:01 +01:00
Matteo Pagliazzi
ee2fc8c763 add migration to convert field for Apple subscribers 2018-01-10 18:08:32 +01:00
Sabe Jones
b53c03bca8 Merge branch 'release' into develop 2018-01-10 16:42:13 +00:00
Sabe Jones
9545f692ef 4.20.0 2018-01-10 16:41:44 +00:00
Sabe Jones
0112bd9b5a chore(i18n): update locales 2018-01-10 16:40:59 +00:00
SabreCat
d235576e18 chore(sprites): compile 2018-01-10 16:32:34 +00:00
SabreCat
3d5d5da933 feat(content): Pept quest 2018-01-10 16:31:56 +00:00
Alys
9b19477e2f adjust wording for Keys to Kennels
Also moves the new Keys text strings to the same place as the old ones in the locales file.
Also fixes minor typos in code that was preventing the new text from being displayed.
2018-01-10 21:21:58 +10:00
Sabe Jones
5a9c95f07e fix(guilds): include exact breakpoints 2018-01-09 18:29:59 -06:00
Keith Holliday
3000e2b72c Removed keys and inbox flagging (#9776) 2018-01-09 12:58:01 -06:00
Matteo Pagliazzi
c1f6f0398e fix positioning of checkmarks for checklist items 2018-01-09 11:31:02 +01:00
Matteo Pagliazzi
cb6488fa05 fix path for KeysToKennel module 2018-01-09 11:29:12 +01:00
Keith Holliday
126d90f471 Added keys to the kennel (#9772)
* Added keys to the kennel

* Added titles and descriptions
2018-01-08 13:15:19 -06:00
Keith Holliday
98d4fb0f34 Chat flag inbox (#9761)
* Refactored chat reporting

* Added inbox flag chat

* Added flag chat to inbox

* Added you have flagged message
2018-01-08 13:13:25 -06:00
Keith Holliday
d3ee3ca53d Updated plan updated date if user has cancelled (#9773)
* Updated plan updated date if user has cancelled

* Added test for plan with only date updated
2018-01-08 12:50:15 -06:00
Matteo Pagliazzi
7eac5cebf5 fix typo 2018-01-08 18:47:59 +01:00
Matteo Pagliazzi
6a109adbc5 Task Modal Improvements (#9560)
* start adding advanced options

* new imput

* partial colors

* update deps

* misc adds

* fix text color

* add advanced options

* initial reordering of task modal labels

* start to fix colors in the modal

* wip colors

* update package-lock.json

* fix merge

* finish modal

* refactor colors

* fix quick add

* fix colors

* new icon colors

* add markdown formatting help

* fix habits colors

* fix rewards colors

* fixed remaining colors

* start to inline inputs

* fix typ

* fixes

* habits hover state

* wip new task modal inputs

* bootstrap: upgrade to v4-beta3

* finish reward edit modal

* fix attributes allocation, checklists and add help tooltips for attributes and difficulty

* lots of fixes

* update datepicker

* misc fixes
2018-01-08 18:43:57 +01:00
Sabe Jones
587847f5e9 4.19.1 2018-01-08 17:23:28 +00:00
Sabe Jones
7842cd8a41 chore(i18n): update locales 2018-01-08 17:18:12 +00:00
SabreCat
2f9cf02932 fix(sprites): rename 2018/01 background icons 2018-01-08 17:11:20 +00:00
Pizilden
daa796454c Added Farvoid Theme (new, clean branch) (#9634)
* Added Farvoid Theme

* Updated generic.json and index.js

* fix(merge): address conflicts
2018-01-05 14:34:19 -06:00
Cassidy Pignatello
c531239618 Fixes equipment sorting by name in inventory (#9692)
* returns items sorted in ascending order when sorted by name

* returns items sorted in ascending order when sorted by name
2018-01-05 13:51:47 -06:00
Matti Petrelius
f6ac7b890a Both eggs and potions should hatch pets from Items (#9645)
* Show click on hatching potion when egg is clicked

* Fix translation parameter name

* Show egg as active when clicked

* Remove itemDragStart event handler from egg items

* Change isHatchable to take in potion and egg objects

* Add margin to item popover content
2018-01-05 13:31:34 -06:00
kartik adur
229e39facf Other user checkins: user profile modal checkin count (#9646)
* add loginIncentives to public fields to show non-loggedin user checkins

* update integration tests for update in api response
2018-01-05 13:29:38 -06:00
Allison Virgil
75b00ce2df Fixed Challenge Winner Text (partial fix for #9629) (#9664)
* Fixed Challenge Winner Text (#9629)

* Fixing typo
2018-01-05 13:29:00 -06:00
Julius Jung
4576353f26 inital commit to add confirmation to animalEars (#9666) 2018-01-05 13:26:45 -06:00
Allister
acf4b4da63 Change focused state of introjs button (#9677) 2018-01-05 13:24:32 -06:00
josteins1
8b5933177a Given back header the priority over snackbar with z-index value and a padding to avoid collision. (#9687)
* increased top padding to match main header

referring to issue 9678
https://github.com/HabitRPG/habitica/issues/9678

* adjusted the z value to appropriate levels

z-index adjusted from 99999 to 999
2018-01-05 13:23:03 -06:00
Julius Jung
a6ddd6d233 fix drawer-slider carousel function && convert to pointer logic (fixes #9366 AND #9638) (#9711)
* fix drawer-slider carousel function && convert to pointer logic

* refactor conditional logic

* get rid of absolute value
2018-01-05 13:20:21 -06:00
Sabe Jones
5ca5adc774 4.19.0 2018-01-04 21:49:53 +00:00
Sabe Jones
005ffe850a chore(i18n): update locales 2018-01-04 21:44:47 +00:00
SabreCat
71cb4e8510 feat(content): enable Wintery Skins and Hair 2018-01-04 21:35:26 +00:00
SabreCat
40244ab81b Merge branch 'develop' into release 2018-01-04 21:11:44 +00:00
Keith Holliday
15b65b342a Removed extra achievement sound (#9763) 2018-01-04 10:17:33 -06:00
Matteo Pagliazzi
7df3aba71b make search case insensitive in equipment and inventory pages (#9762) 2018-01-04 13:06:15 +01:00
Keith Holliday
6bb535c129 Reset chat options when change guild routes (#9743) 2018-01-02 22:56:31 -07:00
Sabe Jones
e3bf3d29f7 4.18.1 2018-01-03 00:54:23 +00:00
SabreCat
df9c42c1b5 fix(backgrounds): add 2018 group 2018-01-03 00:52:54 +00:00
Sabe Jones
7e241bb76f Merge branch 'release' into develop 2018-01-03 00:07:42 +00:00
Sabe Jones
17fb681671 4.18.0 2018-01-03 00:05:22 +00:00
Sabe Jones
0069aee5b0 chore(i18n): update locales 2018-01-03 00:00:07 +00:00
SabreCat
240dd1b965 chore(sprites): compile 2018-01-02 23:52:35 +00:00
SabreCat
88e6b2da7c feat(content): Armoire and BGs 2018-01
Also ends New Year's hat fanciness
2018-01-02 23:49:50 +00:00
Sabe Jones
6e7f4a231d chore(sprites): compile 2018-01-02 21:41:37 +00:00
Sabe Jones
822a0e56af feat(notifications): recanvas sprites for notifs 2018-01-02 21:38:34 +00:00
Sabe Jones
da73c5c418 Merge branch 'release' into develop 2017-12-31 02:45:04 +00:00
Sabe Jones
2cf8439bd1 4.17.0 2017-12-31 02:44:43 +00:00
Sabe Jones
0e404ad6ba chore(i18n): update locales 2017-12-31 02:43:40 +00:00
SabreCat
b9f709ab30 chore(sprites): compile 2017-12-31 02:35:50 +00:00
SabreCat
d57c525fab feat(event): New Year's 2017-18 2017-12-31 02:34:52 +00:00
Alys
9a3a104ba4 fix typo in apidocs comment block 2017-12-30 08:43:11 +10:00
Keith Holliday
63bba13b5f Changed paypal redirect to subscription page (#9742) 2017-12-26 17:31:23 -06:00
Keith Holliday
d90d781740 Added mobile style fixes (#9741) 2017-12-26 17:31:00 -06:00
Alys
a3bf329c44 make reset password apidocs comment more accurate 2017-12-24 09:23:32 +00:00
Sabe Jones
22a12e37fa 4.16.2 2017-12-22 21:58:16 +00:00
SabreCat
446e0422c7 Merge branch 'release' into develop 2017-12-22 21:57:43 +00:00
SabreCat
5220cc1bf3 fix(market): add broken Armoire items 2017-12-22 21:56:39 +00:00
Sabe Jones
e8976b40f4 Merge branch 'release' into develop 2017-12-22 21:42:02 +00:00
Sabe Jones
3b4b459e68 4.16.1 2017-12-22 21:41:37 +00:00
Sabe Jones
bbbdd89ade chore(i18n): update locales 2017-12-22 21:41:18 +00:00
Sabe Jones
a20c1ba751 Include seasonal gear in Market class lists (#9739)
* fix(shops): include seasonal gear in Market class lists

* fix(market): display non-seasonal broken special items
Also fixes a bug where if a current seasonal item was broken, it would show up twice.
2017-12-22 15:29:51 -06:00
Alys
d725b5be19 fix typo in loading screen tip 8 2017-12-22 20:45:35 +00:00
Keith Holliday
545b052c10 Added fix for quantity confirmation (#9735) 2017-12-22 10:23:55 -06:00
SabreCat
028b9d569d Merge branch 'release' into develop 2017-12-21 23:20:51 +00:00
Sabe Jones
85b861c4a9 4.16.0 2017-12-21 23:20:00 +00:00
Sabe Jones
762e87a82a chore(i18n): update locales 2017-12-21 23:19:35 +00:00
SabreCat
b68e69e1a1 chore(sprites): compile 2017-12-21 23:12:06 +00:00
SabreCat
4764f115b1 feat(content): Subscriber Items Dec 2017 2017-12-21 23:10:54 +00:00
Keith Holliday
95c99295c1 Removed gold locally when user buys a card (#9736) 2017-12-21 10:27:09 -06:00
Keith Holliday
a7617fa947 Added broken megaphone icon (#9737) 2017-12-21 10:25:54 -06:00
Sabe Jones
2da2a47f32 4.15.3 2017-12-20 19:28:52 +00:00
Sabe Jones
8f744565e2 chore(i18n): update locales 2017-12-20 19:28:22 +00:00
SabreCat
714512b0a3 fix(promo): send payment method with promo 2017-12-20 18:41:19 +00:00
SabreCat
9538c86d02 fix(seasonal): include current season gear in Shop 2017-12-20 18:31:10 +00:00
Keith Holliday
afc1ffd90b Refactored duplicate card section (#9730)
* Refactored duplicate card section

* Updated to new computed methods
2017-12-20 12:27:21 -06:00
Matteo Pagliazzi
6988875e8a fix promo gifting 2017-12-20 19:09:15 +01:00
Keith Holliday
6e0b6171c6 Many ie style fixes (#9728) 2017-12-20 10:33:21 -06:00
Sabe Jones
53bbd93d80 4.15.2 2017-12-20 04:44:07 +00:00
Sabe Jones
75092336c4 fix(news): Holly, not Peppermint, potions 2017-12-20 04:43:43 +00:00
Sabe Jones
310bdf8cb5 4.15.1 2017-12-20 02:43:46 +00:00
Sabe Jones
9435a3089a chore(i18n): update locales 2017-12-20 02:43:00 +00:00
SabreCat
bb6dac2e84 4.15.0 2017-12-20 02:27:56 +00:00
SabreCat
acf34e2344 chore(sprites): compile 2017-12-20 02:27:43 +00:00
SabreCat
1aac4c713d feat(event): Winter Wonderland sprites (2/2) 2017-12-20 02:27:13 +00:00
SabreCat
bb527caa06 feat(content): Winter Wonderland sprites (1/2) 2017-12-20 02:26:21 +00:00
SabreCat
98bb6fd7ce feat(content): Winter Wonderland 2017-18
and Starry Night Hatching Potions
2017-12-20 02:23:11 +00:00
Keith Holliday
b8c716ff82 Fixed pending damage display and nav size (#9723) 2017-12-18 12:31:16 -06:00
Sabe Jones
9830fce760 4.14.2 2017-12-15 19:26:15 +00:00
Sabe Jones
7fccf59f50 Merge branch 'release' into develop 2017-12-15 15:54:09 +00:00
Sabe Jones
dd79f2be60 4.14.1 2017-12-15 15:02:22 +00:00
Sabe Jones
fbdcd4b0a3 chore(i18n): update locales 2017-12-15 15:01:52 +00:00
SabreCat
e229bc5042 Merge branch 'release' into develop 2017-12-15 05:37:04 +00:00
SabreCat
44c7e8c9dc 4.14.0 2017-12-15 05:36:01 +00:00
SabreCat
c4ffe39ec9 chore(news): Bailey 2017-12-15 05:34:30 +00:00
Sabe Jones
dc3d694d0e WIP: Buy-1-Get-1 Gift Subs (#9719)
* feat(promo): Buy-1-Get-1 Gift Subs

* feat(promo): add explanatory text to subscription screens
Also adds some add'l test coverage and creates a test context for this event
2017-12-14 23:09:02 -06:00
Sabe Jones
4f0ce77205 Winter Quest Bundle (#9718)
* feat(content): Winter Quest Bundle

* fix(sprites): revert spritesheet changes
2017-12-14 22:40:42 -06:00
Keith Holliday
c28ec24c33 Added notification for when leader is updated (#9674)
* Added notification for when leader is updated

* Abstracted challenge member search component

* Added challenge member search modal to challenge detail

* Added group search
2017-12-14 12:12:43 -06:00
Keith Holliday
54db84fddc Payment tests refactor (#9695)
* Reorganized files, reduced function size, reduced duplication

* Refactored amazon tests organization

* Reduced duplication

* Reorganized paypal tests

* Reorganized stripe tests

* Fixed lint issues

* Fixed gem purchase expectations

* Added cloning so we don't modify the common block
2017-12-14 09:59:45 -06:00
Keith Holliday
e7fd2b4c79 [WIP] Added initial inapp loading screen with tips (#9710)
* Added initial inapp loading screen with tips

* Added new tips and styles

* Removed unrelated readme
2017-12-14 09:35:10 -06:00
Keith Holliday
05640f513e Added test to recreate early cron issue (#9668)
* Added test to recreate early cron issue

* Gave user extra time based on reverse timezone change
2017-12-14 09:09:11 -06:00
SabreCat
b0ebdfeb65 Merge branch 'release' into develop 2017-12-13 22:16:30 +00:00
SabreCat
6c01db8d81 4.13.4 2017-12-13 22:15:11 +00:00
SabreCat
5a3751cbac chore(news): Blog Bailey 2017-12-13 22:14:19 +00:00
Keith Holliday
7802e30e80 Added static/front and meta tags (#9712)
* Added static/front and meta tags

* Moved meta to index
2017-12-13 15:11:22 -06:00
Matteo Pagliazzi
899452279b fix ie 11 rendering (#9713) 2017-12-13 13:51:04 -06:00
Keith Holliday
566716e2fe Added display logic for npcs (#9709)
* Added display logic for npcs

* Fixed lint
2017-12-12 19:05:18 -06:00
SabreCat
2a42bc9450 Merge branch 'release' into develop 2017-12-12 21:27:04 +00:00
SabreCat
1ef62d1b66 4.13.3 2017-12-12 21:25:39 +00:00
SabreCat
355773ecf3 chore(news): FCC CTA
Also fixes an issue with sprite alignment of the Lamplighter Set.
2017-12-12 21:24:18 +00:00
Keith Holliday
2bb5751f33 Added float rounding (#9657)
* Added float rounding

* Changed to isNaN
2017-12-11 11:48:50 -06:00
Keith Holliday
2570c59130 Ensured admin can always PM user (#9653)
* Ensured admin can always PM user

* Fixed lint issues

* Updated admin check and removed async

* Removed console log
2017-12-11 11:48:17 -06:00
Keith Holliday
2dfcda068b Added streak to export of challenge tasks (#9625)
* Added streak to export of challenge tasks

* Fixed tests
2017-12-11 11:39:43 -06:00
Keith Holliday
507133c76e Added client side logging (#9643) 2017-12-11 11:07:16 -06:00
Keith Holliday
a7c115877f Added query option to limit query fields (#9642)
* Added query option to limit query fields

* Removed only
2017-12-11 10:24:19 -06:00
Keith Holliday
1750a0c2e6 Updated responsive styles (#9696)
* Updated responsive styles

* Font adjustments

* Changed to max height
2017-12-09 23:23:16 -06:00
Keith Holliday
759ce61492 Added support for party invites by email (#9665)
* Added support for party invites by email

* Changed to groupInvite
2017-12-07 12:57:01 -05:00
Keith Holliday
57193bd5f3 Ensured quest drops are only from incomplete progress (#9671)
* Ensured quest drops are only from incomplete progress

* Fixed spelling error
2017-12-07 12:33:40 -05:00
Keith Holliday
e1a1b4eab6 Added body param for remove message (#9669)
* Added body param for remove message

* Removed console.log
2017-12-07 11:52:28 -05:00
Keith Holliday
350894f985 Added achievement restore migration (#9641)
* Added achievement restore migration

* Updated checks
2017-12-07 10:18:16 -05:00
Keith Holliday
0184d774c2 Disabled challenge button when loading (#9686) 2017-12-06 20:16:40 -05:00
Sabe Jones
d136162d48 4.13.2 2017-12-06 19:16:35 +00:00
SabreCat
2be8ddb60d fix(news): winner typo 2017-12-06 19:15:34 +00:00
Keith Holliday
3c67f91525 Quest refactor (#9681)
* Separated out quest sidebar component

* Added accepted count
2017-12-06 11:13:44 -05:00
Keith Holliday
c02aadfac4 Made user pay for amoire locally (#9673) 2017-12-06 10:50:15 -05:00
Julius Jung
2f956252ab Don't show shield when previewing two-handed weapon (fixes #9495) (#9676)
* initial commit to not show shield when previewing two-hand weapon

* revert error made

* update to fix all combinations of equipping / trying two-handed weapons

* clarify conditional logic

* refactor to let avatar check for twoHanded display/hide logic

* add case when avatar doesn't have weapon equipped
2017-12-05 17:05:59 -06:00
Andrew Bustos
341f16cc82 Fixed block icon not showing in profile modal. (#9667)
* Fixed block and add icon not showing and the ordering of the buttons. Also fixed and added tooltips for buttons.

* Changed unnecessary change of color in svg icon files and changed tooltip attribute to not be empty
2017-12-05 15:01:18 -06:00
Julius Jung
ec179182e7 submit initial working solution to disallow selling of Saddle (#9663) 2017-12-05 14:22:59 -06:00
Pizilden
b886d7bb33 Added MAFL Theme (#9633) 2017-12-05 14:20:58 -06:00
Pizilden
a8f8f4f544 Added Pizilden's Theme (#9632) 2017-12-05 14:14:45 -06:00
Feywood
4047bf6943 Rewards permit decimal value. Fixes https://github.com/HabitRPG/habitica/issues/9513 (#9617)
* testing additional event trigger for sendMessage

* moved keyup event to newmessage

* added keyup event to tavern vue too

* removed number.toFixed, changed to placeholder and step
2017-12-05 14:13:54 -06:00
Julius Jung
a5a985fd00 Don't show shield when previewing two-handed weapon (fixes #9495) (#9607)
* initial commit to not show shield when previewing two-hand weapon

* revert error made

* update to fix all combinations of equipping / trying two-handed weapons

* clarify conditional logic

* refactor to let avatar check for twoHanded display/hide logic
2017-12-05 14:11:19 -06:00
Alys
444d6889de add subscription cancellation instructions for free Group Plans subscriptions (#9606) 2017-12-05 14:10:15 -06:00
negue
c56c69d464 market fixes 28th nov (#9593)
* list special gear by the `specialClass` - fixes #9485

* only disable the currencly label + value not the amount input - fixes #9492

* disable transformations on equipment previews - fixes #9497

* show boss strength - fixes #9522

* pin time travelers animals - closes #9382

* clean up + package-lock ?

* fix quest info
2017-12-05 14:09:34 -06:00
Kip Raske
4b610ba3f1 Fixing the pig flying too high in the stable square bug (#9592)
The `.FlyingPig` css class necessary to re-center the pig in its square
is no longer applied when the square is greyed out. So I am adding that
to the greyed out square. It seems to not have any affect on the other
pets.
2017-12-05 14:06:35 -06:00
Feywood
65e3b599e6 Fix for sending chat with ctrl enter for windows chrome/firefox. Fixes https://github.com/HabitRPG/habitica/issues/9380 (#9588)
* testing additional event trigger for sendMessage

* moved keyup event to newmessage

* added keyup event to tavern vue too

* removed obsolete check from _updateCarretPosition

* fixed lint issue
2017-12-05 14:05:01 -06:00
aalsehly86
7caf211bec Fix issue #9534 - changed the character-name (#9547)
* Fix issue #9534 - changed the character-name from $white to $header-dark-background

* changes to #9534 - changed character-name color from -dark-background to -color.

* character-name color is back to  #9534

* changed character-name color to -200

* Changed colors for character name and level details #9534
2017-12-05 14:02:29 -06:00
Julius Jung
d4bc7c77a9 Check previous gear owned before purchasing next level gear (fixes #9071) (#9466)
* add another check if previous gear is owned

* respect gear purchase order

* catch error with miscalculation of equipment number floor

* add integration test for proper equipment purchasing order

* fix syntax

* add 'previousGearNotOwned' string

* rewrite logic for different starting levels for wep vs others

* separate and add tests for armor and weapon

* rename variable for clarification

* skip check if itemIndex is NaN

* change obscure NaN check for readability

* change conditional from checking NaN to Int
2017-12-05 13:58:12 -06:00
Tyler Nychka
bfaa7c0fea Validate that everyX values in dailies are integers bounded by 0 and 9999 fixes #8782 (#9268)
* Validate that everyX values are integers bounded by 0 and 9999

* Added client side check

* Updated tests

* Added migration for bad dailies

Near idential to the other task migration.

* fix(typo): camelCase function call
2017-12-05 13:55:32 -06:00
Sabe Jones
8367de34bf Merge branch 'release' into develop 2017-12-05 19:47:52 +00:00
Sabe Jones
ea6b78b7ca 4.13.1 2017-12-05 19:47:26 +00:00
Sabe Jones
401067bfed chore(i18n): update locales 2017-12-05 19:46:40 +00:00
Sabe Jones
b457daa616 Merge branch 'release' into develop 2017-12-05 19:29:34 +00:00
Sabe Jones
54c2441934 4.13.0 2017-12-05 19:29:06 +00:00
Sabe Jones
9e8807c40d Armoire and Backgrounds December 2017 (#9659)
* feat(content): Armoire and Backgrounds 2017/12

* chore(sprites): compile

* chore(news): Bailey
2017-12-05 19:29:00 +00:00
Sabe Jones
9bfbeaf93e Armoire and Backgrounds December 2017 (#9659)
* feat(content): Armoire and Backgrounds 2017/12

* chore(sprites): compile

* chore(news): Bailey
2017-12-05 13:25:52 -06:00
Keith Holliday
860efefdb2 Removed client side armoire call (#9660) 2017-12-05 12:23:31 -06:00
Keith Holliday
6310482b9d Added popovers to quests (#9655) 2017-12-05 10:57:28 -05:00
Keith Holliday
2d4928cd2b Removed challenge access restriction (#9652) 2017-12-04 15:57:38 -05:00
SabreCat
f3c2c0f901 Merge branch 'release' into develop 2017-12-04 19:23:55 +00:00
Keith Holliday
1fc84c2357 Added calculated property (#9637) 2017-12-04 11:24:04 -06: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
Matteo Pagliazzi
72f0b8ed7c send correct email when user is removed from group plan 2017-12-04 12:04:07 +01:00
thehollidayinn
95f9479d7a 4.12.6 2017-12-02 08:37:36 -06:00
Keith Holliday
af095d8450 Revert query optimization (#9636) 2017-12-02 08:35:31 -06:00
Sabe Jones
470495387c 4.12.5 2017-12-02 03:28:44 +00:00
Keith Holliday
bdef1ca23c Fixed max width none (#9631) 2017-12-01 21:26:52 -06:00
SabreCat
1835804e86 4.12.4 2017-12-01 21:33:06 +00:00
SabreCat
cb58994bdf Merge branch 'release' into develop 2017-12-01 21:32:28 +00:00
SabreCat
44f3b73183 fix(avatar): layer base/bangs correctly 2017-12-01 21:10:33 +00:00
Luan Muniz
7e23fdc22a Fix install node permissions (#9621)
Signed-off-by: Luan <luan@luanmuniz.com.br>
2017-12-01 16:05:17 +00:00
Keith Holliday
e138d2b67b Added needs cron check to achievements (#9624) 2017-12-01 09:54:43 -06:00
Keith Holliday
3e3248fecb Changed row adding when user blurs/focuses (#9610) 2017-12-01 08:37:37 -06:00
Keith Holliday
78ee60611a Remove cancel button when clicked (#9616) 2017-12-01 08:03:54 -06:00
Keith Holliday
3c7aaa605b Fixed text being cut off (#9612) 2017-12-01 08:03:36 -06:00
Keith Holliday
00343da266 Added max width seetings to screens larger than 1300 (#9609) 2017-12-01 07:47:45 -06:00
Sabe Jones
56d09411d9 Merge branch 'release' into develop 2017-12-01 00:31:23 +00:00
Sabe Jones
ae0df2242a 4.12.3 2017-12-01 00:30:49 +00:00
Sabe Jones
5b06b28c97 chore(event): end Thunderstorm Potions 2017-12-01 00:30:06 +00:00
Keith Holliday
c6a3bfb291 Added exp reset when changing level (#9611) 2017-11-30 15:45:26 -06:00
Keith Holliday
7797794cd5 Deselect a tag if it is selected when removing (#9614) 2017-11-30 15:45:14 -06:00
Keith Holliday
d9e09a5f3d Fixed streak bonus style (#9608) 2017-11-30 12:37:53 -06:00
Keith Holliday
4e73c8513e Hide progress if user is not on quest (#9597) 2017-11-30 12:37:31 -06:00
Keith Holliday
9421fd7ced Added analytics to backgrounds (#9615) 2017-11-30 12:10:49 -06:00
Keith Holliday
699de64328 Added more fields to scoring (#9613) 2017-11-30 10:09:04 -06:00
Keith Holliday
6f9cbf9ca1 Only update the user when editing profile (#9601) 2017-11-30 08:19:03 -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
Keith Holliday
77f71b5415 Fixed saving in progress tag when clicking save (#9598) 2017-11-30 08:16:54 -06:00
Keith Holliday
ced3621dea Fixed leaving from guild list item (#9599) 2017-11-30 08:16:00 -06:00
Keith Holliday
e321d85b3c Donate buy modal fix (#9604)
* Added donate back and buy modal

* Fixed login check

* Added ability to remove mustache
2017-11-30 08:15:28 -06:00
SabreCat
d72b40d5b0 Merge branch 'release' into develop 2017-11-29 05:07:42 +00:00
SabreCat
54443a2980 4.12.2 2017-11-29 05:04:46 +00:00
SabreCat
00dc990974 chore(event): end Thanksgiving, add Bailey 2017-11-29 05:03:01 +00:00
Keith Holliday
3737aa045d Fixed text when cloning (#9594) 2017-11-28 19:18:04 -06:00
Keith Holliday
b03ddf6f7d Added fix for task order using / for arrays (#9590) 2017-11-28 14:57:08 -06:00
tim1234ltp
4ab89fd3e0 Bug fixes on Subscription termination date format [Fixes Issues #9186] (#9583)
* Fixed date.

* Got rid of the filter and returned moment.

* fix the return value

* Stupid typo.
2017-11-28 09:19:29 +01:00
negue
f1e200c0f5 autofix pinned seasonal gear - fixes #9448 (#9570)
* auto-remove officialPinned item from userPinned-array on pinning

* hide event limited message if an item was already owned by the user
2017-11-28 09:11:40 +01:00
Ryan Holinshead
218664dfcc (ISSUE-9353) Fix pinned item alignment (#9358)
* (ISSUE-9353) Fix pinned item alignment
- Get rid of justify-content: space-between to allow flex-start default to be used
- Add margin to direct children (item-wrappers)

* Issue-9353: Change selector to & > div instead of just > for more explicit selection of direct child divs

* Fix rewards item spacing to match Zeplin mockups
- Make sure horizontal/vertical spacing between items is 16px
- Add use of grid if supported, else use flex
2017-11-27 20:54:03 -06:00
Trevor Ford
a0f29e970d fix Stable sidebar width and center inventory drawer (fixes #9263) (#9419)
* fix Stable sidebar width and center inventory drawer (fixes #9263)

* hide all .standard-sidebars on small/mobile devices
2017-11-27 20:48:52 -06:00
MathWhiz
200cd66d66 Use config when starting development server (#9410)
* Use config when starting development server

* import nconf setup from website

* Add comment explaining choice

* Fix lint issues
2017-11-27 20:38:27 -06:00
MathWhiz
dd05a8d608 Contributor Title tooltip (#9413)
* Remove usage of cachedProfileData when determining contributor level

* Add tooltip

* Remove directive import

* /s/msg.contributor.title/msg.contributor.text

* move tooltip placement

* update tooltip position
2017-11-27 20:37:36 -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
Ryan Holinshead
26bde1f766 Character Create Modal - Prevent Options From Jumping When Selected (#9252)
* Prevent options from jumping when selected due to border being added/removed based on active option. Instead, always have a border on the option but set its color when active

* Use gray instead of white border in order to match background so that it isn't visible while unselected. Add margin-bottom back

* Make sure the locked option style remains unchanged
- Nest .locked in .customize-options .option to get specificity
- Override border, border-radius, and margin-top for .locked
- Set the override values to what would be applied without other style changes
2017-11-27 20:11:15 -06:00
Garrett Scott
d95836b881 Translator minor changes fixes #8917 (#9297)
* Updated userItemsNotEnough string

* Added a variable to be passed to the deleteSocialAccountText string. This variable name is `magic_word` and is set as DELETE where used

* modified incorrectDeletePhrase to use a variable rather than translatable string for the word DELETE. Updated the DELETE-user test and the user api

* Changed noSudoAccess from translatable string to static

* Changed enterprisePlansEmailSubject from a translatable string to a static string within groupPlans.vue

* Fixed test problems with translation fixes

* Added no sudo access string to api messages

* changed plain string to apiMessage for no sudo access messages
2017-11-27 20:08:39 -06:00
Tyler Nychka
fac81bb9ee Long names overflow task box fixes #9403 (#9404)
* Issue 9403 Long names overflow task box

* Added padding

* Enabled overflow-wrap: break-word;

Added min width to allow overflow-wrap to actually break content
2017-11-27 20:07:13 -06:00
Sarvesh Kakodkar
b323abd225 Added confirmation step at begin button for quest (#9199)
* Added confirmation step at begin button for quest

* Fixed the 3 errors caused by questConfirm method in travis-ci
2017-11-27 20:05:05 -06:00
negue
b3870e5f34 multiple market fixes (#9468)
* show `selectMemberModal` to send a card, even if the user doesn't have a party yet

* market - prevent filter reset on pinning items

* hide buy amount for gear, backgrounds, mystery_set, card, rebirth_orb, fortify, armoire - fix mystery set preview in timetravelers

* purchase confirmation on gem / hourglass purchases

* fix lint
2017-11-27 19:54:55 -06:00
kartik adur
29dc56c12f Party roster sorter: Member Modal Component (#9472)
* modify sort options for party members

* add unittest for membersModalComponent sort

* updates as requested in PR

* removed duplicates for `class` and `background` from flavour text

* fix linting error thrown by travis ci
2017-11-27 19:54:13 -06:00
Esben Sparre Andreasen
b62f08d500 Misc. bug fixes from lgtm.com (2) (#9474)
* Remove dead branch of ternary: `gift` is always truthy here

Problem found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/server/libs/amazonPayments.js?sort=name&dir=ASC&mode=heatmap&excluded=false#x5a22f31110a55091:1

* Remove superfluous argument, preenUserHistory only takes two args

Problem found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/server/libs/cron.js?sort=name&dir=ASC&mode=heatmap&excluded=false#xf16a045ecabb07f6:1

* Cleanup: remove useless assignments

Problems found here:

- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/store/actions/shops.js?sort=name&dir=ASC&mode=heatmap&excluded=false#xf782ed2cf920441%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/app.vue?sort=name&dir=ASC&mode=heatmap&excluded=false#x172c1dda85e84dc8%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/components/settings/site.vue#x9b3afee802a3a8f8%3A1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/client/components/selectMembersModal.vue?sort=name&dir=ASC&mode=heatmap&excluded=false#x1fbc2a3d62facd70:1
- https://lgtm.com/projects/g/HabitRPG/habitrpg/snapshot/dist-98076885-1510577633582/files/website/common/script/libs/taskClasses.js?sort=name&dir=ASC&mode=heatmap&excluded=false#x41ce0e121a4defee:1

* Fix online editor whitespace change.
2017-11-27 19:51:25 -06:00
Esben Sparre Andreasen
f62177fb1a Misc. bug fixes from lgtm.com (#9325)
* Bugfix: declare variable locally

* Bugfix: fix syntax error

* Bugfix: regex char-class with alternatives

The old implementation used character classes instead of
alternatives. As a consequence, the regex would match:

- a_warrior_0
- r_warrior_0
- m_warrior_0
- o_warrior_0
- r_warrior_0
- |_warrior_0
- h_warrior_0
- ...

The regex will now match:

- armor_warrior_0
- head_warrior_0
- shield_warrior_0
2017-11-27 19:51:02 -06:00
Paul
885f2998ae System messages flaggable (#9408)
* Remove flag from system messages, throw an error if system messages are flagged

* Modify unflag system message test to check if flagging a system message throws an error

* Move email from nconf to top
2017-11-27 19:45:04 -06:00
Paul
2afd96e11c Remove spaces from filters (#9524) 2017-11-27 19:44:33 -06:00
Paul
cd92f44365 Fix difficult to edit checklists in Firefox (#9525)
* Change checklist item hover from move to text

* Add vue draggable

* Add vue draggable

* Replace sortablejs directive with Vue Draggable component

* Indent draggable properties
2017-11-27 19:43:24 -06:00
Paul
863177902a Remove extra 'to' paramater from router link (#9529) 2017-11-27 19:42:53 -06:00
Cassidy Pignatello
96974461e5 Change badge tooltips fixes https://github.com/HabitRPG/habitica/issues/9520 (#9539)
* updates text for costume contestant

* updates text for contributor badge

* removes unnecessary "Badge" text from contribName
2017-11-27 19:37:18 -06:00
Paul
8895b70ffa Adjust left positioning of the left-panel to unobscure sroll-bar, change left panel overflow to overflow-y (#9544) 2017-11-27 19:35:30 -06:00
Kip Raske
03480ebfc7 Passing quantity to the API call when buying quests from the shop (#9565)
You can buy multiple quests from the buy modal, but the quanitity is
never passed to the server. So the client thinks that you are buying the
number you said you did, but the server only buys one regardless. This
can lead to syncing problems down the road.
2017-11-27 19:33:08 -06:00
Joseti
9b8676f02e Changed "Donate" button to "Contribute" button (#9581)
* Changed functionality of "donate"-button on static pages

* Changed strings to reflect change from "donate" to "contribute"
2017-11-27 19:29:45 -06:00
Keith Holliday
3e7738b5b1 Added keys to for loops (#9584) 2017-11-27 12:46:25 -06:00
Keith Holliday
33a235b46c Fixed equiping glasses and ears (#9585) 2017-11-27 12:19:36 -06:00
Keith Holliday
137d6c1f9d Set default empty array when party members haven't loaded (#9579)
* Set default empty array when party members haven't loaded

* Corrected variable usage
2017-11-27 11:59:42 -06:00
Keith Holliday
1a5e820d88 Fixed when user unclaims a task assigned to them (#9578)
* Fixed when user unclaims a task assigned to them

* Removed test

* Fixed lint
2017-11-27 11:38:59 -06:00
Keith Holliday
0c7f9ca6bb Changed search to regex (#9575)
* Changed search to regex

* Changed  to array
2017-11-27 11:10:26 -06:00
Keith Holliday
3e6b3ce3ff Added habitica event for profile display (#9576) 2017-11-27 10:29:20 -06:00
Keith Holliday
ea5ba965e7 Fixed promoting group leader (#9574) 2017-11-27 10:27:30 -06:00
Keith Holliday
7215a550b5 Added page increment when page is loaded to prevent scroll stopping (#9573) 2017-11-27 10:23:04 -06:00
Keith Holliday
3235dfa236 Added equipment filter (#9572) 2017-11-27 10:22:34 -06:00
Keith Holliday
9baf7a7c67 Do not reset item when buying cards (#9571) 2017-11-27 10:22:00 -06:00
Alys
cd629ef7fa add missing @ before a contributor's name in quest content 2017-11-27 09:16:13 +00:00
Keith Holliday
9ef7c45241 Ensured user is saved after validation checks (#9569) 2017-11-23 20:46:02 -06:00
Alys
fef3d09f2d remove words related to alcohol
This is because they're causing problems in housework guilds (alcohol
is used for cleaning) and since it's coming up to Christmas a lot of
guilds are starting to have permissible conversations about drinks,
rum balls, etc.

We might put these back after Christmas but make specific exceptions
for the housework guilds.

When a more advanced word blocker is introduced, we'll be able to
ban alcohol words only in the Tavern. For irony.
2017-11-23 17:52:22 +00:00
Matteo Pagliazzi
53c83c585a fix navbar not showing up in homepage 2017-11-23 16:07:58 +01:00
Keith Holliday
e628c5dc3b Fixed task best color (#9563) 2017-11-21 14:02:53 -06:00
Keith Holliday
9eaa531f66 Amazon payment fixes (#9562)
* Added custom amazon event, removed redundency, fixed variable names

* Fixed more variables and group plan data
2017-11-21 14:02:40 -06:00
Keith Holliday
3ffea4332e Added extra confirmation incase the class modal shows multiple times (#9557) 2017-11-20 15:57:33 -06:00
Sabe Jones
4618fd8954 Merge branch 'release' into develop 2017-11-20 19:21:17 +00:00
Sabe Jones
791c19b5f1 4.12.1 2017-11-20 19:20:54 +00:00
Sabe Jones
7193cc6bae chore(i18n): update locales 2017-11-20 19:20:03 +00:00
Keith Holliday
1845bd1e35 Fixed display of RYA behind bailey (#9555) 2017-11-20 12:38:26 -06:00
Keith Holliday
5f468d16b7 Cancel users free group plan when they leave a group (#9543)
* Cancel users free group plan when they leave a group

* Fixed lint
2017-11-20 12:34:41 -06:00
Keith Holliday
20a99e526d Should do diff week fix (#9551)
* Fixed week difference when changing year

* Added year switchover test

* Fixed start date setting
2017-11-20 12:22:01 -06:00
Keith Holliday
1e69f42d0f Added account transfer migration (#9548)
* Added account transfer migration

* Removed bad comment
2017-11-19 16:53:08 -06:00
Keith Holliday
9c2f5213cb Challenge fixes (#9528)
* Added challenge member search to progress dropdown

* Added leave challenge modal

* Allowed editing for challenge leader only

* Pevented users from editing challenge task info

* Set default progress default to daily

* Removed reward filters from user challenge progress
2017-11-17 17:13:07 -06:00
Sabe Jones
c06d5107ac Merge branch 'release' into develop 2017-11-17 22:50:27 +00:00
Sabe Jones
1eb0f5baa5 4.12.0 2017-11-17 22:50:05 +00:00
Sabe Jones
b28189fff5 chore(i18n): update locales 2017-11-17 22:30:34 +00:00
SabreCat
82497e4041 chore(sprites): compile 2017-11-17 22:22:27 +00:00
SabreCat
2a5e9c0780 feat(event): Turkey Day 2017
and (content) November Subscriber Items
2017-11-17 22:21:05 +00:00
SabreCat
c8ca67aa64 fix(seasonal-shop): short circuit if categories empty 2017-11-17 18:32:55 +00:00
MathWhiz
89e4cbcffe Disable immutable inputs when editing a challenge (#9412)
* Disable uneditable inputs when editing a challenge

* Revert prize display when creating
2017-11-17 23:45:38 +11:00
Keith Holliday
67564317fb Group plan fixes (#9518)
* Fixed group plan editing

* Added translations

* Abstracted query for group or challenge tasks
2017-11-17 20:31:39 +11:00
Keith Holliday
dc2269a307 Hot fixes nov 15 (#9519)
* Added fortify sync. Removed multiple buy

* Added yesterdaily check

* Fixed checks for running yesterdailies
2017-11-17 20:31:29 +11:00
Sabe Jones
0c713ab368 4.11.1 2017-11-16 22:08:24 +00:00
Sabe Jones
be5d776fb4 chore(i18n): update locales 2017-11-16 22:07:54 +00:00
SabreCat
b0051c45b4 fix(group-plans): more claim/unclaim alignment 2017-11-16 21:21:39 +00:00
Matteo Pagliazzi
b82044e07b fix Remove Claim positioning 2017-11-16 22:05:35 +01:00
Matteo Pagliazzi
b4c4769208 fix: correctly handle bootstrap variables 2017-11-16 21:59:55 +01:00
SabreCat
42a05446c0 fix(notifications): extend snackbar duration 2017-11-16 20:32:57 +00:00
MathWhiz
9f7c0b4861 Fix regex for message highlighting (#9516) 2017-11-16 14:12:26 -06:00
Alys
4814b0c52b allow banned word / swearword blocker to apply to most public guilds (#9253)
* allow banned word / swearword blocker to apply to all public guilds, with specified exceptions

* add another guild

* add more guilds to those that do not have the bannedWords blocker applied

* fix lint errors
2017-11-16 19:52:17 +01:00
SabreCat
67b16d91a3 fix(drawer): remove overflow CSS 2017-11-16 16:38:38 +00:00
Alys
8d444980de remove unneeded space from in front of a full stop 2017-11-16 19:29:38 +10:00
MathWhiz
08ccd595f2 Add quantity information when purchasing items (#9481) 2017-11-16 10:08:11 +01:00
Alys
6b625a60ab remove client-side purchase of Armoire - fixes #9432 (#9463) 2017-11-16 10:06:45 +01:00
Matteo Pagliazzi
6bdb695616 Merge branch 'CSE2410-TeamZero-issue9334' into develop 2017-11-15 17:47:27 +01:00
Matteo Pagliazzi
b999d46142 Merge branch 'issue9334' of https://github.com/CSE2410-TeamZero/habitica into CSE2410-TeamZero-issue9334 2017-11-15 17:47:17 +01:00
Matteo Pagliazzi
ce0f5af08d update package-lock.json 2017-11-15 17:44:55 +01:00
Allister
c5296d4cb0 Add variable placeholder. (#9465)
Changes the character translation string `charactersRemaining`  in
groups.json to include a variable placeholder `<%= characters %>`
2017-11-15 17:41:18 +01:00
MathWhiz
22b683b1d9 Fix regex for chat highlighting (#9411)
* Fix regex for chat highlighting

* Fix lint errors
2017-11-15 17:39:29 +01:00
Joseti
229fd06ee3 Removed "Tag list in tasks starts collapsed" settings and strings (#9406) 2017-11-15 17:37:15 +01:00
Stephanie Wu
eb8f84aae0 #9354 Indicate that Orb of Rebirth is instant (#9357)
* #9354 Indicate that Orb of Rebirth is instant

Clarified the text

* #9354 Indicate that Orb of Rebirth is instant

Reverted changes in all but locales/en
2017-11-15 17:35:51 +01:00
Andrew
69b69e9d27 Update appFooter.vue in attempt to fix #9336 (#9348)
* Update appFooter.vue in attempt to fix #9336

Make whole social circle clickable.
Replace div with `a` tag allowing whole circle to become a link.

* Indent and reformat "Not ready yet" Instagram button.
2017-11-15 17:35:16 +01:00
dnlup
8033e7c0a0 Fix Incorrect Heading margins (#9311)
* fix(style): Fix margin of headers in inventory page

Set the `mb-0` class in h1 header to `mb-4`.
Set the class if `h2` header to `mb-3`.

* fix(style): Fix margin of headers in shops section

Set the `mb-0` class in h1 header to `mb-4`.
Set the class of `h2` header to `mb-3`.

* fix(style): Fix margin of headers in shops adn time traveler section

Set the `mb-0` class in h1 header to `mb-4`.
Set the class of `h2` header to `mb-3`.
2017-11-15 17:34:57 +01:00
Emily Ong
e39b80bb9a changed to 'createChallengeCloneTasks' (#9300)
* changed to 'createChallengeCloneTasks'

* createChallengeCloneTasks

* Added new i18n strings
2017-11-15 17:34:33 +01:00
Ryan Holinshead
2038d5e7c8 Choose class modal remove tooltip (#9298)
* Change chooseClass modal opt out button and tooltip
- Remove hover tooltip from opt out
- Fix centering of choose class button
- Add some margin between opt out and choose class buttons
- Make cursor on opt out text the pointer to make it obvious it's clickable

* Alphabetical order class selector
2017-11-15 17:32:49 +01:00
Aquib Master
46a8ee52d4 Modify relative dueIn time on tasks to be in days (#9251)
* Modify relative dueIn time on tasks to be in days

- Normalizes the current time and task due time to the ends of their respective days.
- Returns 'today' if the dates are the same day else uses moment's humanize function to allow for weeks, months, years and so on.

* Modify task due date to appear grey when due the next day
2017-11-15 17:32:30 +01:00
William Perry
52064f6b2a Changes animal attribute that A-Z sort is applied to. (#9241) 2017-11-15 17:31:10 +01:00
Łukasz Dobrogowski
f15a27a7f1 added favicons to the new client (#9235) 2017-11-15 17:29:58 +01:00
Blade Barringer
fcf0dd87f9 Rename constant for restricted email domains (#9459) 2017-11-15 17:14:13 +01:00
Matteo Pagliazzi
ab974675b9 More Tasks page fixes (#9475)
* fix datepicker not closing when clicking outside of it, fixes #9346

* fixes #9441
2017-11-15 17:06:32 +01:00
Sabe Jones
cb612d99d7 chore(sprites): recompile 2017-11-15 01:31:01 +00:00
Unknown
cb5a47ec7b Deleted unnessecary import. 2017-11-14 20:18:36 -05:00
Sabe Jones
838b9a5822 Merge branch 'release' into develop 2017-11-15 01:03:07 +00:00
Sabe Jones
6c65056e2b 4.11.0 2017-11-15 01:01:18 +00:00
Sabe Jones
2bf0fdf4a2 chore(i18n): update locales 2017-11-15 01:00:56 +00:00
SabreCat
cd5ff04ee4 chore(sprites): compile 2017-11-15 00:53:27 +00:00
SabreCat
dbc5b9f850 feat(content): Yarn Pet Quest 2017-11-15 00:53:10 +00:00
Unknown
ca3437d676 Added pin.scss to index.scss. 2017-11-14 19:26:11 -05:00
Keith Holliday
c43ca62bc4 Added check for balance with respect to quantity (#9469) 2017-11-14 16:55:08 -07:00
Keith Holliday
eaa91b2a09 Group plan fixes (#9437)
* Prevented title editing on personal page

* Fixed claim/unlclaim from user task page

* Removed task from local on delete

* Immediately show unassigned bar

* Add move to group tasks

* Fixed group member count increase

* Added upgrade when group plan is canceled
2017-11-14 16:54:11 -07:00
Unknown
6259b68b4f Does not reuse same css classes, imports them from pin.scss. For the togglePin function the notification. 2017-11-14 18:10:33 -05:00
Unknown
08073acf11 Solved Issue #9334. Added unpin feature for rewards list in tasks. 2017-11-14 12:24:11 -05:00
Matteo Pagliazzi
bddafd4392 fix bailey css 2017-11-13 12:12:41 +01:00
Matteo Pagliazzi
3ab14e4e5a fix checklist deleting 2017-11-13 12:08:42 +01:00
Matteo Pagliazzi
d9830950aa fix modal handling 2017-11-10 12:43:50 +01:00
Matteo Pagliazzi
45696a6273 remove outline from focused inputs 2017-11-10 12:02:20 +01:00
Sabe Jones
3f92317b9e Revert "Implements repeat every X days since last completion (Fixes #6941) (#8962)"
This reverts commit 9d69d4b863.
2017-11-09 22:13:34 +00:00
Sabe Jones
848883736d 4.10.1 2017-11-09 21:23:55 +00:00
Alys
69e0ab11c0 swap achievement badge icons for Challenges Won and Quests 2017-11-10 07:10:03 +10:00
Matteo Pagliazzi
d8d7a81edf Tasks: fixes and new edit task design (#9442)
* add missing tooltips

* makes sure due date is update correctly, fixes #9436

* do not collapse checklist when casting spells, fixes #9345

* start to fix spells drawer

* fix drawer requiring two clicks to open
2017-11-09 19:38:48 +01:00
Matteo Pagliazzi
03a09b7546 Fix issues with Bootstrap Vue and Boostrap upgrades (#9452)
* start to fix modals

* fixed cards paddings

* fix notifications not being marked as read

* add tests for reading a notification

* fixed indentation and added tests for reading multiple notifications

* register from home page using enter key
2017-11-09 19:37:47 +01:00
Sabe Jones
0d2737572d Merge branch 'release' into develop 2017-11-09 17:57:48 +00:00
Sabe Jones
28149202db chore(i18n): update locales 2017-11-09 17:53:06 +00:00
Alys
4b23cd9f23 add missing string for dateEndNovember 2017-11-09 17:46:12 +00:00
Alys
8aaabdc086 add missing removeInvite string 2017-11-09 17:45:59 +00:00
SabreCat
6e6ca05352 fix(sprites): missing Guild image 2017-11-09 17:44:48 +00:00
SabreCat
74d8ecc732 Merge branch 'release' into develop 2017-11-09 17:24:48 +00:00
Alys
63c8a09e22 add missing string for dateEndNovember 2017-11-09 21:58:16 +10:00
Alys
865f623c99 add missing removeInvite string 2017-11-09 18:16:58 +10:00
Matteo Pagliazzi
061968dd1a intro tour: fix justin position 2017-11-08 19:55:28 +01:00
Matteo Pagliazzi
21bc91c3ae chore(npm): upgrade bootstrap-vue 2017-11-08 18:56:28 +01:00
Matteo Pagliazzi
0bfc6608c1 update package-lock.json 2017-11-08 18:44:18 +01:00
negue
4108a22d78 [WIP] bootstrap-vue upgrade (#9178)
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue

* change modal action names from show::modal to bv::show::modal

* check if drops are undefined

* fix modal widths - sellModal now using input instead of dropbox

* upgrade to bootstrap 4.0beta

* include package-lock changes

* fix app menu dropdown position

* upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position

* fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width)

* show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ )

* fix package-lock?

* fix active button style / app header toggle button

* fix package-lock !

* update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable

* mixin naming style

* fix buyQuestModal marginTop

* fix customMenuDropdown position

* fix userDropdown items
2017-11-08 18:40:37 +01:00
Matteo Pagliazzi
34f6b63968 remove unused loggin for ios purchases 2017-11-08 16:12:11 +01:00
Sabe Jones
8d1ebff7e9 4.10.0 2017-11-07 23:55:16 +00:00
Sabe Jones
993df72708 chore(i18n): update locales 2017-11-07 23:53:47 +00:00
SabreCat
50d3226a86 feat(content): change to Thunderstorm Hatching Potions 2017-11-07 22:02:46 +00: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
Matteo Pagliazzi
0caa195c6f fix confetti image on home page 2017-11-07 20:34:52 +01:00
Keith Holliday
f964e3c0a5 Updated avatar menu icons and style (#9409) 2017-11-07 11:57:42 -07:00
Asif Mallik
9d69d4b863 Implements repeat every X days since last completion (Fixes #6941) (#8962)
* Implemented repeat after completion

* Added tests for repeat after completion in shouldDo.test.js

* Remove lastTicked

* Undoes removal of website/client/README.md
2017-11-07 12:56:46 -06:00
Matteo Pagliazzi
19500600bc cache sprites and fix images caching (#9422) 2017-11-07 11:48:23 +01:00
Matteo Pagliazzi
f25fe9e263 remove forked vue version 2017-11-06 23:46:18 +00:00
Matteo Pagliazzi
5f37487c23 Fix guilds fetching (#9416)
* fix guilds fetching

* fix missing categories
2017-11-06 17:16:41 +01:00
Alys
12fd79059b adjust login messages to indicate case-sensitivity and hint about google sign-in 2017-11-04 20:34:17 +10:00
Alys
232061a629 improve wording for Brutal Smash skill 2017-11-04 20:24:35 +10:00
Alys
3fcc1c522d allow "visit the stable" text to be translated 2017-11-04 20:16:47 +10:00
Matteo Pagliazzi
8302c50302 remove forked vue version 2017-11-04 10:24:45 +01:00
Sabe Jones
6eb06fb054 4.9.1 2017-11-03 22:58:12 +00:00
Keith Holliday
286c8c7530 Ensured sort value is true for checklists (#9386) 2017-11-03 15:50:11 -05:00
Keith Holliday
47ab8f2073 Added exitence checks (#9383) 2017-11-03 15:38:05 -05:00
Sabe Jones
83353f6481 Merge branch 'paglias/fix-sprites' into release 2017-11-03 20:35:20 +00:00
Matteo Pagliazzi
9cbd7ad62d fix customize-options sprites 2017-11-03 19:06:06 +01:00
thehollidayinn
3485a1d0bc Reloaded completed todos if we are unlinking a todo 2017-11-03 10:33:20 -06:00
thehollidayinn
2e5106fda1 Removed old state item 2017-11-03 10:24:46 -06:00
thehollidayinn
2e5f5714e4 Added broken task event 2017-11-03 10:24:00 -06:00
Sabe Jones
3cf7b2c96c 4.9.0 2017-11-03 03:04:52 +00:00
Sabe Jones
286db39478 chore(i18n): update locales 2017-11-03 03:04:15 +00:00
SabreCat
4d4c1cfaf3 chore(sprites): compile 2017-11-03 02:54:26 +00:00
SabreCat
d7ad3efabf fix(news): proper Take This announcement 2017-11-03 02:49:41 +00:00
SabreCat
f8876fe055 feat(content): Backgrounds and Armoire 2017-11
End Habitoween and Fall Festival
2017-11-03 01:56:15 +00:00
Keith Holliday
b973335d69 Added extra months to account for months with larger amount of days (#9379) 2017-11-02 15:44:24 -06:00
Phillip Thelen
3b6fce0708 Add "stats" as a tutorial step (#9377)
This is used mostly for the mobile apps to identify if the tutorial step about stats has be shown yet or not.
2017-11-02 15:57:16 -05:00
Keith Holliday
ff6bd6de71 Ensured user selects plan (#9378) 2017-11-02 14:26:00 -06:00
Keith Holliday
042afe1df3 Add close to tags popup (#9376) 2017-11-02 14:25:37 -06:00
Matteo Pagliazzi
a208ba4aba Tasks v2 Part 2 (#9236)
* start updating colors for tasks controls

* finish updating controls colors

* change hoevr behavior

* change transition duration

* update color with transition

* refactor menu wip

* wip

* upgrade vue deps

* fix warnings

* fix menu

* misc fixes

* more fixes

* fix badge

* fix margins in menu

* wip tooltips

* tooltips

* fix checklist colors

* add badges

* fix quick add input

* add transition to task controls too

* add batch add

* fix task filtering

* finish tasks badges

* fix menu

* upgrade deps

* fix shop items using all the same image

* fix animation

* disable client tests until we remove phantomjs

* revert changes to tasks colors

* fix opacity in task modal inputs

* remove client unit tests from travis

* wip task dropdown

* fix z-index for task footer/header

* fixes and add files

* fixes

* bigger clickable area

* more space to open task dropdown

* droddown position

* fix menu position

* make sure other dropdowns get closed correctly

* fixes

* start to fix z-index

* draggable = false for task dropdown

* fix for dropdown position

* implement move to top / bottom

* fix push to bottom

* typo

* fix drag and drop

* use standard code

* wider click area for dropdown

* unify badge look

* fix padding

* misc fixes

* more fixes

* make dropdown scrollable

* misc fixes

* fix padding for notes

* use existing code instead of new props
2017-11-02 21:07:38 +01:00
Keith Holliday
0e958fd306 Prevented challenge edit during RYA (#9373) 2017-11-02 11:37:29 -06:00
Keith Holliday
d98fe79e9c Fixed member modal search (#9375) 2017-11-02 11:36:08 -06:00
Keith Holliday
0e5a811b98 Prevented challenge prize edit. Fixed edit to create modal (#9374) 2017-11-02 11:30:01 -06:00
Keith Holliday
a28aea65f8 Added reward text (#9332) 2017-11-01 10:03:23 -06:00
Keith Holliday
0f92349902 Added fix for multiple level up (#9330) 2017-11-01 10:01:58 -06:00
Sabe Jones
d4881cb73a Merge branch 'release' into develop 2017-10-31 19:22:58 +00:00
Sabe Jones
b3216fdb85 4.8.0 2017-10-31 19:22:27 +00:00
Keith Holliday
3e37941e0a Bulk stats (#9260)
* Reorganized stats

* Organized allocation common code

* Added bulk allocate to common

* Added allocate bulk route

* Fixed structure and lint

* Fixed import and apidoc
2017-10-31 12:57:44 -06:00
Alys
32088767ac update github templates for new website and wiki page locations 2017-10-31 21:25:01 +10:00
Alys
f4d021ab8c fix an inaccurate comment about guilds needing summaries 2017-10-31 20:54:23 +10:00
SabreCat
8532203717 Merge branch 'release' into develop 2017-10-31 01:03:07 +00:00
SabreCat
365daba6fc 4.7.1 2017-10-31 00:49:58 +00:00
SabreCat
70692752c7 fix(sprites): bad shirt centering 2017-10-31 00:48:37 +00:00
Sabe Jones
95d4016678 Merge branch 'release' into develop 2017-10-30 20:50:32 +00:00
Sabe Jones
061457b268 4.7.0 2017-10-30 20:50:11 +00:00
Sabe Jones
e7ec9a6d65 chore(i18n): update locales 2017-10-30 20:49:09 +00:00
SabreCat
d1396e7bc6 chore(sprites): compile 2017-10-30 20:41:32 +00:00
SabreCat
d5cedaa925 feat(event): Habitoween 2017-10-30 20:40:29 +00:00
Sabe Jones
bea813b318 Merge branch 'release' into develop 2017-10-26 22:47:18 +00:00
Sabe Jones
b31268fbc2 4.6.3 2017-10-26 22:46:51 +00:00
thehollidayinn
35727228f0 Removed autorefresh 2017-10-26 17:20:52 -05:00
SabreCat
feb7ab8345 Merge branch 'release' into develop 2017-10-26 21:16:09 +00:00
SabreCat
f4422b8d6c 4.6.2 2017-10-26 21:14:13 +00:00
SabreCat
2d4dc9e23c chore(news): blog Bailey 2017-10-26 21:13:04 +00:00
Tyler Nychka
bba2e71af3 Task order fix (#8928) 2017-10-26 10:37:51 -05:00
Mel
26123ac6ae API - Get challenges for a group does not allow party or habitrpg (#8882)
* test get party challenges by party ID

* tavern challenge tests; failing tests with ID 'party' or 'habitrpg'

* allow finding challenges by groupid 'party' or 'habitrpg'

* use single quotes in strings
2017-10-25 15:35:23 -05:00
Zobdek
addee73e4d Set _cronSignature to current time instead of uuid (#8565)
* Changes made to satisfy #8163. _cronSignature is set to current time when cron starts so that if cron fails to set _cronSignature to 'NOT_RUNNING' for any reason a new cron can be started after a set amount of time (1 hour for now)

* fix lint errors

* changed cronTimeout to CRON_TIMEOUT

* Changed variable names and comments to be more clear

* Fixed stub for failing test so that it matches new mongo db update call signature

* First pass at unit tests, error messages and some other things need to be determined

* Fixed a tab that snuck in :/

* Fixed lint issues (issues with spaces)

* Fix infix operator spacing

* Created constant. Make sure cron failure test verifies that it is failing for the right reason

* Fixed lint errors

* Removed no longer used uuid import
2017-10-25 15:29:16 -05:00
Keith Holliday
c39505d41c Hotfix/add autoreload (#9269)
* Added auto refresh on server update back

* Fixed lint

* Updated copy
2017-10-25 15:22:26 -05:00
Lachlan Heywood
9736ef0d25 Add ESLint to gulp scripts (#9259)
* Remove gulp/* and gulpfile from ESLint ignores

* Update .eslintrc in local gulp folder

* Start work on refactoring gulp files

* add radix

* Add line-specific eslint exceptions

* removed redundant eslint file for gulp

* add more exceptions

* Add exceptions to main gulpfile.js
2017-10-25 10:45:03 +02:00
Sabe Jones
638259b885 Merge branch 'release' into develop 2017-10-24 22:42:20 +00:00
Sabe Jones
c24545cae5 4.6.1 2017-10-24 22:41:58 +00:00
Keith Holliday
6bc70ca471 Hotfix/oct 24 fixes (#9261)
* Removed max height from text section

* Added items to mystery sets

* Group manager fixes

* Fixed promo code apply
2017-10-24 17:41:36 -05:00
Sabe Jones
d2f0d7b20b Merge branch 'release' into develop 2017-10-24 20:36:24 +00:00
Sabe Jones
b445bc8261 4.6.0 2017-10-24 20:35:17 +00:00
Sabe Jones
31281b43d3 chore(i18n): update locales 2017-10-24 20:34:47 +00:00
SabreCat
a8a915ea8e chore(sprites): compile 2017-10-24 20:23:42 +00:00
SabreCat
dc3ee25e65 feat(content): subscriber items
Also fix(sprites): resize and recanvas gift boxes
2017-10-24 20:21:30 +00:00
Lula Villalobos
3c9f7ff9d8 Bug Fix on ScoreTask: Gp added instead of append [fixes #9180] (#9207)
* added parseInt to stats.gp so it can add the new value

* added radix parameter to fix lint issue

* revert changes in scoreTask.js

* convert restoreValues into numbers before setting to users.stats
2017-10-24 16:23:12 +02:00
Sabe Jones
54f57445da 4.5.0 2017-10-23 22:40:41 +00:00
Sabe Jones
95ef2b1789 Merge branch 'develop' into release 2017-10-23 22:40:30 +00:00
Keith Holliday
4d32977e5c Quick fix (#9257)
* Removed hard refresh

* Changed sorting to happen during compute
2017-10-23 17:27:26 -05:00
Keith Holliday
7fe2504906 Bulk purchasing (#9196)
* Moved buy tests

* Added mystery buy to buy.js

* Added quest purchasing to buy

* Added buy special

* Moved integration tests to buy folder

* Removed buyGear dependency

* Removed buyArmoire dependency

* Removed buyHealthPotion dependency

* Removed myster, quest and special dependency

* Replaced functions with factory

* Added bulk purchasing to common

* Added bulk purchasing to the api

* Added bulk purchasing to client

* Refactored purchasing function to reduce long method

* Added bulk purchase to gem purchases

* Added bulk purchasing to api

* Added bulk purchasing to gem items on client

* Removed bulk from equipment

* Removed recentlyPurchased

* Fixed style issues and prevented puchasing more gems than are left

* Fixed lint

* Fixed missing keys

* Fixed gem amount notice

* Added quest modal to pinned item

* Added bulk purchase to gem modal

* Fixed styles

* Fixed bulk purchase for spells

* Fixed modal size

* Hid autofill
2017-10-23 16:05:35 -05:00
Matteo Pagliazzi
b74cee3d21 API Token Changes (#9202)
* hide API token by default

* wip

* add route to reset the api token

* remove dead code
2017-10-23 22:58:33 +02:00
Keith Holliday
5af7733150 Task order fixes (#9255)
* Reset todo task order

* Disabled sorting on todo due

* Revert to task order

* Fixed task sorting sync with server
2017-10-23 12:59:52 -05:00
Keith Holliday
824bf62e0a Force refresh is server version is updated (#9239)
* Force refresh is server version is updated

* Added reload true

* Added confirmation of update

* Forced refresh on cron

* Updated response tests
2017-10-23 12:58:11 -05:00
Keith Holliday
ac24a5dddd Moved ponytails to styles (#9254) 2017-10-22 15:48:50 -05:00
Alys
9111f59da4 change price for backgrounds set from 5 to 15 2017-10-22 09:24:32 +10:00
Sabe Jones
6a550b34df 4.4.5 2017-10-21 03:35:51 +00:00
SabreCat
0c973b1cf0 chore(news): Bailey 2017-10-21 03:33:42 +00:00
SabreCat
4170ef5e79 Merge branch 'release' into develop 2017-10-21 03:23:13 +00:00
Keith Holliday
506275c30e Oct 19 fixes (#9234)
* Add more checks for user achievements

* Began to add ajax request for bailey

* Prevented purchase of locked item

* Refactored notifications to have unique id and use actions

* Added feature banner when gear is bought

* Removed debug code

* Mark group notifications as read

* Fixed lint issues

* Added gem icon to purchase all
2017-10-20 15:22:13 +02:00
Alys
6838b7d0a6 remove duplicated word "caused" from Masterclassers quest text 2017-10-20 23:12:26 +10:00
Sabe Jones
e987cd52a6 4.4.4 2017-10-18 21:06:05 +00:00
Sabe Jones
1df8668d38 chore(i18n): update locales 2017-10-18 20:57:03 +00:00
Stephy
1af42aa7fe Set a max-width for Markdown images (#9230)
Prevents images from overflowing in tavern chat, guild sidebars, tasks,
and anywhere else using Markdown

Closes https://github.com/HabitRPG/habitica/issues/9171
2017-10-18 15:47:16 -05:00
maurnoc
9dc9faa70d fixes bug #9173 notification menu having unneeded scroll bars (#9229) 2017-10-18 15:44:50 -05:00
Cezary Piątek
7fbcc0a263 Replace raw HTML internal hyperlinks with router links #9209 (#9212)
* Replace raw HTML internal hyperlinks with router links #9209

* Fix improper route-link
2017-10-18 15:40:53 -05:00
borisabramovich86
0450e9c3ae Added empty state values for photo and description in user profile (#9201) 2017-10-18 15:36:26 -05:00
borisabramovich86
15626b8ae1 Prevent user from blocking himself - fixes #9097 (#9194)
* Added check - user can't block himself

* removed exclusive test
2017-10-18 15:26:01 -05:00
borisabramovich86
444f393f3a stops Orb of Rebirth being visible after rebirth - fixes #8593 (#9172)
* remove link between rebirth and beastmaster, and fix tests

* add test checking rebirth is reset when beastmaster is enabled

* remove exclusive test
2017-10-18 15:23:27 -05:00
q--
d711bf4085 Enable browser spell-checking for task titles (#9100)
This is disabled by default in Firefox for <input> elements.

It can also be enabled document-wide by adding spellcheck=true to the <html> tag, but I haven't done so because I don't know if there might be elements on the page where spell checking is not warranted.

See also: https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck
2017-10-18 15:13:57 -05:00
John Montgomery
7b93e326fc Re-add the relevant attribute to the Stealth tooltip (#9198) 2017-10-18 23:39:39 +10:00
maurnoc
c62ea522c0 duplicate readme (#9219) 2017-10-18 09:41:45 +10:00
Alys
810362a404 fix typo in apidocs comment and my screwup in the previous commit - so sorry :( 2017-10-18 08:13:16 +10:00
Alys
2e429513da fix typo in apidocs comment 2017-10-18 08:04:53 +10:00
Matteo Pagliazzi
c8625cb23f Misc fixes (#9215)
* quick add assign tags

* fix columns descriptions

* fix changing language not taking effect immediately
2017-10-17 23:38:42 +02:00
tim1234ltp
ad50f90ba0 Bug fixes on Merchandise Page [Fixes Issues #9144] (#9195)
* Moved pictures of merch items from assets/images/merch/ to /website/static/merch
Image src in merch.vue is linked to the new path.

* Rebased and fixed.

* Reverted changes of package-lock.json
2017-10-17 10:48:23 -05:00
Sabe Jones
d5305f74e3 4.4.3 2017-10-17 00:01:54 +00:00
Sabe Jones
5ea20e4c8c fix(news): add links 2017-10-17 00:01:39 +00:00
Sabe Jones
9e4e2d0b34 4.4.2 2017-10-16 23:12:41 +00:00
Sabe Jones
6456e6b8e3 Merge branch 'develop' into release 2017-10-16 23:12:30 +00:00
Sabe Jones
af961ff16c chore(i18n): update locales 2017-10-16 23:11:52 +00:00
Sabe Jones
eb2a6095c2 Fixes 2017/10/16 (#9203)
* fix(various): small issues
* Rename "Gold-Purchasable Quests" to "Masterclasser Quest Lines"
* Use "getting_organized" instead of "organization" as task category
* Use pixel gem instead of SVG gem for Market
* Recanvas shop sprites for Fall 2017 seasonal items

* chore(news): update Bailey
2017-10-16 18:04:49 -05:00
Matteo Pagliazzi
ee82f5a774 Client: Tasks and Header v2 (#9168)
* wip: footer

* pin bootstrap-vue

* compact footer and fixes

* compact header

* fix member details in other views

* fix first party member in header

* fix unread notifications badge color

* sync + menu fixes

* loading bar styles

* new filter button

* create button

* create fixes

* quick add

* fix quick add inputs

* tooltips for create buttons

* fix create task moda

* fix class badge

* fixed footer links

* revert change that caused problems with tests and old browsers

* misc
2017-10-16 22:04:16 +02:00
Alys
f1c8c4c54b add 'declined' string, needed for quest participants list 2017-10-16 21:41:37 +10:00
Sabe Jones
79b15d7ddf 4.4.1 2017-10-15 17:31:13 +00:00
Trevor Ford
f2fed7ea39 fix Stable component to correctly count pets (#9182) 2017-10-15 12:20:40 -05:00
Aivan Monceller
ca81ff5af6 #9184 case insensitive search (#9190) 2017-10-15 12:12:30 -05:00
Sabe Jones
e28c214696 chore(i18n): update locales 2017-10-15 17:07:09 +00:00
SabreCat
792f45e9bd fix(tasks): incorrect string for text field 2017-10-15 02:37:11 +00:00
Sabe Jones
a69c0999d3 Fixes 2017/10/14 (#9191)
* fix(shops): event date range for mobile

* fix(profile): clean up equipment grids

* fix(strings): remove unused string

* fix(sprites): recanvas Lost Masterclasser scrolls
2017-10-14 19:59:28 -05:00
Sabe Jones
37ff35306c 4.4.0 2017-10-14 01:45:57 +00:00
Sabe Jones
fd430e95b2 chore(i18n): update locales 2017-10-14 01:45:08 +00:00
Sabe Jones
0ea472b3af Merge branch 'develop' into release 2017-10-14 01:34:12 +00:00
Sabe Jones
6d0496fbd0 Lost Masterclasser Quest Line (#9183)
* fix(sprites): serve animated GIFs
Also add new GIF for upcoming quest line

* feat(content): Masterclasser capstone quest
Also fixes Quests page for clearer lock/unlock display

* chore(sprites): compile

* feat(achievements): award quest completionist cheevo

* feat(quests): Siphoning Void
fix Achievements page styling and text spacing
fix display of Rage bar on party page

* test(quests): Lost Masterclasser

* chore(news): Bailey

* fix(test): only use Masterclasser in relevant scenario
2017-10-13 20:32:55 -05:00
Keith Holliday
fac1889776 Oct 11 fxes (#9181)
* Added unqequip for hair styles

* Added quest rewards to quest completed modal

* Fixed display of task approvals

* Ensured the user is welcomed before showing login notification

* Added new message modal

* fixed manager functions

* Fixed group edit on group plan
2017-10-13 06:40:53 +02:00
SabreCat
9ca6da0f75 fix(sprites): include sprite CSS in new client build 2017-10-12 18:57:23 +00:00
Matteo Pagliazzi
99f50f825a Old Client Cleanup (#9141)
* move emails images to website/static/emails and remove old files

* remove old client tests

* remove more files

* add sprites back

* cleanup gulp

* cleanup gulp

* remove old files

* more fixes

* pin bootstrap-vue

* disable old test

* remove old tasks

* fix apidoc
2017-10-12 16:44:28 +02:00
Sabe Jones
2308f2397e 4.3.0 2017-10-10 22:55:47 +00:00
Sabe Jones
f10d5110e5 Merge branch 'develop' into release 2017-10-10 22:55:39 +00:00
Sabe Jones
5ced47f590 Content 2017/10/10 (#9177)
* feat(content): bundle, customizations

* chore(sprites): update
2017-10-10 17:30:44 -05:00
Sabe Jones
24b2bc9aa1 4.2.3 2017-10-10 17:12:43 +00:00
Sabe Jones
aea08a971a Merge branch 'develop' into release 2017-10-10 17:12:35 +00:00
Sabe Jones
e3452b3ba7 chore(i18n): update locales 2017-10-10 17:11:48 +00:00
Michael Hibbs
3db666eb9e Show error message in empty market inventory drawer (#9041)
* client/tasks/user: (create dropdown) change icon color on menuitem hover

Previously the color was only changing when you hovered over the
text or icon.

This change changes the icon color when you hover anywhere over
the `menuitem`

* client/shops/market: fix search field in market

* Hide drawer sliders if number of items for type is empty
* Move drawer-help-text icon down to line up vertically with text
* Add TODO for error thrown when trying to sell special item types

* client/tasks/taskModal: display all selected tags for task

* i18n/groups: religous to religious

* client/shops/market: Add error message to empty drawer slider

* Create new locale file to hold inventory locales

* client/tasks/user: Revert change to create dropdown

* Revert tag changes

This will be picked up in a separate PR.

* Fix missing space before function paren
2017-10-10 11:18:50 -05:00
negue
cf5985e38c oct 9 fixes (#9175)
* hide hatching modal before opening the hatched modal

* fix Options not sticking: Costume, Auto Equip

* Hall of Heroes - Collapse Items & Auth

* prevent wrapping currency icon+text

* fix spacing of remaining gems (if two digits)

* fix logo in safari (removed <mask />)

* update seasonal shop items on purchase
2017-10-09 22:40:39 -05:00
Sabe Jones
d88a8247d1 Fixes 2017/10/09 (#9176)
* fix(quests): correctly divide owner-only/all

* fix(equipment): clarify locked items
2017-10-09 22:15:52 -05:00
Keith Holliday
7e1ae6a571 Oct 9 fixes (#9174)
* Prevented purchasing of locked quest

* Fixed category filters for challenges

* Added armoire equipment directly to user

* Halfed the time notifications display

* Added quest accept/reject to party page
2017-10-09 14:40:45 -05:00
Sabe Jones
d117117885 4.2.2 2017-10-09 19:17:49 +00:00
Sabe Jones
5dd168eee4 chore(i18n): update locales 2017-10-09 19:14:21 +00:00
Keith Holliday
a7c9355dd5 Fixed breaking api change (#9170) 2017-10-06 16:06:48 -05:00
Matteo Pagliazzi
81d3e8a68f add extra logging for ios/verify 2017-10-06 18:07:26 +02:00
Sabe Jones
e0fbfffbf2 4.2.1 2017-10-06 00:49:02 +00:00
Sabe Jones
36b968a74a fix(news): remove Last Chance blurb 2017-10-06 00:48:34 +00:00
Sabe Jones
fff249fb00 4.2.0 2017-10-06 00:39:47 +00:00
Sabe Jones
ce5c6b9517 Merge branch 'develop' into release 2017-10-06 00:39:40 +00:00
Sabe Jones
702013f9ed chore(i18n): update locales 2017-10-06 00:38:10 +00:00
Sabe Jones
3503b307b2 Content and fixes 2017-10-05 (#9165)
* fix(market): display classless equipment

* fix(challenges): more missing Markdown

* feat(content): backgrounds and Enchanted Armoire 2017-10

* chore(sprites): compile
2017-10-05 19:00:39 -05:00
Keith Holliday
f1ec8bbf2c Added styles to selecting challenge winner (#9164) 2017-10-05 18:02:26 -05:00
Keith Holliday
58b033db9e Oct 5 fixes (#9163)
* Added removing invites

* Addeed messages for empty gems to icon

* Added member for challenge members

* Fixed task cloning ending

* Fixed group task assignment

* Added small hack to prevent scrolling issues

* Fixed lint
2017-10-05 14:41:03 -05:00
thehollidayinn
b0dcc2f6ef 4.1.4 2017-10-04 18:35:50 -05:00
SabreCat
3377f8a916 Merge branch 'develop' into release 2017-10-04 23:30:39 +00:00
Keith Holliday
22f83d09c4 Release with develop (#9162)
* Client: fix Apidoc and move email files (#9139)

* fix apidoc

* move emails files

* quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140)

* enable link to markdown info on group and challenge edit screen

* allow admin (moderators and staff) to edit challenges

* allow admin (moderators and staff) to edit guilds

Also add some unrelated TODO comments.

* allow any party member (not just leader) to start quest from party page

* allow quest owner to cancel, begin, abort quest

Previously only the party leader could see those buttons. The leader still can.

This also hides those buttons from all other party members.

* enable reverse chat in guilds and party

* remove outdated videos from press kit

* adjust various wordings

* Be consistent with capitalization of Check-In. (#9118)

* limit for inlined svg images and make home leaner by not bundling it with the rest of static pages

* sep 27 fixes (#9088)

* fix item paddings / drawer width

* expand the width of item-rows by the margin of an item

* fix hatchedPet-dialog

* fix hatching-modal

* remove min-height

* Oct 3 fixes (#9148)

* Only show level after yesterdailies modal

* Fixed zindex

* Added spcial spells to rewards column

* Added single click buy for health and armoire

* Prevented task scoring when casting a spell

* Renamed generic purchase method

* Updated nav for small screen

* Hide checklist while casting

* fix some text describing menu items (#9145)

* 4.1.3

* use `selectGearToPin` instead of updateStore in migration-script (#9102)

* Tags redesign in edit-task modal (#9122)

* Truncate tags list to maximum number of tasks

This commit truncates the list of tags in the edit task modal and
displays the remaining selected tasks as a number.

* Align tags-select dropdown with "Tags" label

* Add tags popup component

* Use solid purple for tags-select dropdown

* Remove shadow when tags-select is active
* Add border-radius to tags-select
* Re-add previously disabled transitions
* Remove unused template element

* Add Clear Tags button to footer of tags popup

* Decrease column size for tags to better match design
* Truncate tag name to avoid overflows
* Add tag name as title to show full name on hover

* Grow inline tags select from left to right

* Style none button
* Add spacing to streak reset button to line up with tags select

* Add top offset to tags dropdown toggle to line up with label

* Ability to collapse checklists (#9158)

* ability to collapse checklists

* typo

* show warning to use the mobile apps (#9152)

* Oct 4 fixes (#9159)

* Added gem purchase note

* Added notification count

* Added party reload

* Added description when user can no longer purchase gems this month

* Prevent modal from showing when pruchasing recently purchased items

* Added progress bar

* Prevented non leader from loading approvals

* Added group billing

* Release fix (#9161)

* Merge Develop onto Release (#9123)

* Some random quick (#9111)

* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning

* Tasks tags (#9112)

* Added auto apply and exit

* Add challenge tag editing

* Fixed lint

* Skill fixes (#9113)

* Added local storage setting for spell drawer

* Added new spell styles

* Fixed typo

* Reset local creds if access is denied (#9114)

* various fixes: group leader's name at top of edit drop-down; Members List; etc (#9117)

* fix text describing location of subscription/gem gift box

* disable Copy As To-Do in Tavern, guilds, party because it's not working

* change members label on group pages to Member List

* remove outdated info about seeing number of Gems available to buy

* allow Danger Zone to be seen by players without local authentication

Also add an hr because the Danger Zone heading was crammed up against the button above it.

* put current group leader's name at top of Leader change drop-down

* Client Fixes (#9120)

* unduplicate logout code

* re-enable debug menu

* fix pets badge and equipping mounts

* close gift modal after sending gems

* armoire notifications

* Oct 1 fixes (#9121)

* Added default tags to task

* Added seasonal gear check and show spooky

* Disabled spooky sparkles

* Fixed challenge remove tasks modal

* Hid checklist

* Added group gems modal

* Purchase with amazon

* Added check for user health

* Added missing notification file

* 4.1.1

* 4.1.2

* Merge develop into release (#9154)

* Client: fix Apidoc and move email files (#9139)

* fix apidoc

* move emails files

* quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140)

* enable link to markdown info on group and challenge edit screen

* allow admin (moderators and staff) to edit challenges

* allow admin (moderators and staff) to edit guilds

Also add some unrelated TODO comments.

* allow any party member (not just leader) to start quest from party page

* allow quest owner to cancel, begin, abort quest

Previously only the party leader could see those buttons. The leader still can.

This also hides those buttons from all other party members.

* enable reverse chat in guilds and party

* remove outdated videos from press kit

* adjust various wordings

* Be consistent with capitalization of Check-In. (#9118)

* limit for inlined svg images and make home leaner by not bundling it with the rest of static pages

* sep 27 fixes (#9088)

* fix item paddings / drawer width

* expand the width of item-rows by the margin of an item

* fix hatchedPet-dialog

* fix hatching-modal

* remove min-height

* Oct 3 fixes (#9148)

* Only show level after yesterdailies modal

* Fixed zindex

* Added spcial spells to rewards column

* Added single click buy for health and armoire

* Prevented task scoring when casting a spell

* Renamed generic purchase method

* Updated nav for small screen

* Hide checklist while casting

* fix some text describing menu items (#9145)
2017-10-04 18:26:05 -05:00
Keith Holliday
496534ab4b Release fix (#9161)
* Merge Develop onto Release (#9123)

* Some random quick (#9111)

* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning

* Tasks tags (#9112)

* Added auto apply and exit

* Add challenge tag editing

* Fixed lint

* Skill fixes (#9113)

* Added local storage setting for spell drawer

* Added new spell styles

* Fixed typo

* Reset local creds if access is denied (#9114)

* various fixes: group leader's name at top of edit drop-down; Members List; etc (#9117)

* fix text describing location of subscription/gem gift box

* disable Copy As To-Do in Tavern, guilds, party because it's not working

* change members label on group pages to Member List

* remove outdated info about seeing number of Gems available to buy

* allow Danger Zone to be seen by players without local authentication

Also add an hr because the Danger Zone heading was crammed up against the button above it.

* put current group leader's name at top of Leader change drop-down

* Client Fixes (#9120)

* unduplicate logout code

* re-enable debug menu

* fix pets badge and equipping mounts

* close gift modal after sending gems

* armoire notifications

* Oct 1 fixes (#9121)

* Added default tags to task

* Added seasonal gear check and show spooky

* Disabled spooky sparkles

* Fixed challenge remove tasks modal

* Hid checklist

* Added group gems modal

* Purchase with amazon

* Added check for user health

* Added missing notification file

* 4.1.1

* 4.1.2

* Merge develop into release (#9154)

* Client: fix Apidoc and move email files (#9139)

* fix apidoc

* move emails files

* quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140)

* enable link to markdown info on group and challenge edit screen

* allow admin (moderators and staff) to edit challenges

* allow admin (moderators and staff) to edit guilds

Also add some unrelated TODO comments.

* allow any party member (not just leader) to start quest from party page

* allow quest owner to cancel, begin, abort quest

Previously only the party leader could see those buttons. The leader still can.

This also hides those buttons from all other party members.

* enable reverse chat in guilds and party

* remove outdated videos from press kit

* adjust various wordings

* Be consistent with capitalization of Check-In. (#9118)

* limit for inlined svg images and make home leaner by not bundling it with the rest of static pages

* sep 27 fixes (#9088)

* fix item paddings / drawer width

* expand the width of item-rows by the margin of an item

* fix hatchedPet-dialog

* fix hatching-modal

* remove min-height

* Oct 3 fixes (#9148)

* Only show level after yesterdailies modal

* Fixed zindex

* Added spcial spells to rewards column

* Added single click buy for health and armoire

* Prevented task scoring when casting a spell

* Renamed generic purchase method

* Updated nav for small screen

* Hide checklist while casting

* fix some text describing menu items (#9145)
2017-10-04 17:39:34 -05:00
Keith Holliday
7325d2020e Oct 4 fixes (#9159)
* Added gem purchase note

* Added notification count

* Added party reload

* Added description when user can no longer purchase gems this month

* Prevent modal from showing when pruchasing recently purchased items

* Added progress bar

* Prevented non leader from loading approvals

* Added group billing
2017-10-04 16:47:19 -05:00
negue
1a0d39e566 show warning to use the mobile apps (#9152) 2017-10-04 21:19:10 +02:00
Matteo Pagliazzi
dc62ab7577 Ability to collapse checklists (#9158)
* ability to collapse checklists

* typo
2017-10-04 20:35:59 +02:00
Michael Hibbs
c4e5633e48 Tags redesign in edit-task modal (#9122)
* Truncate tags list to maximum number of tasks

This commit truncates the list of tags in the edit task modal and
displays the remaining selected tasks as a number.

* Align tags-select dropdown with "Tags" label

* Add tags popup component

* Use solid purple for tags-select dropdown

* Remove shadow when tags-select is active
* Add border-radius to tags-select
* Re-add previously disabled transitions
* Remove unused template element

* Add Clear Tags button to footer of tags popup

* Decrease column size for tags to better match design
* Truncate tag name to avoid overflows
* Add tag name as title to show full name on hover

* Grow inline tags select from left to right

* Style none button
* Add spacing to streak reset button to line up with tags select

* Add top offset to tags dropdown toggle to line up with label
2017-10-04 12:33:35 -05:00
negue
d977656e96 use selectGearToPin instead of updateStore in migration-script (#9102) 2017-10-04 10:59:44 -05:00
Keith Holliday
b0a980d56e Merge develop into release (#9154)
* Client: fix Apidoc and move email files (#9139)

* fix apidoc

* move emails files

* quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140)

* enable link to markdown info on group and challenge edit screen

* allow admin (moderators and staff) to edit challenges

* allow admin (moderators and staff) to edit guilds

Also add some unrelated TODO comments.

* allow any party member (not just leader) to start quest from party page

* allow quest owner to cancel, begin, abort quest

Previously only the party leader could see those buttons. The leader still can.

This also hides those buttons from all other party members.

* enable reverse chat in guilds and party

* remove outdated videos from press kit

* adjust various wordings

* Be consistent with capitalization of Check-In. (#9118)

* limit for inlined svg images and make home leaner by not bundling it with the rest of static pages

* sep 27 fixes (#9088)

* fix item paddings / drawer width

* expand the width of item-rows by the margin of an item

* fix hatchedPet-dialog

* fix hatching-modal

* remove min-height

* Oct 3 fixes (#9148)

* Only show level after yesterdailies modal

* Fixed zindex

* Added spcial spells to rewards column

* Added single click buy for health and armoire

* Prevented task scoring when casting a spell

* Renamed generic purchase method

* Updated nav for small screen

* Hide checklist while casting

* fix some text describing menu items (#9145)
2017-10-03 21:15:00 -05:00
Alys
3d75c99f8d fix some text describing menu items (#9145) 2017-10-04 09:24:44 +10:00
Keith Holliday
0aa16d7021 Oct 3 fixes (#9148)
* Only show level after yesterdailies modal

* Fixed zindex

* Added spcial spells to rewards column

* Added single click buy for health and armoire

* Prevented task scoring when casting a spell

* Renamed generic purchase method

* Updated nav for small screen

* Hide checklist while casting
2017-10-03 16:33:01 -05:00
negue
4fa3046104 sep 27 fixes (#9088)
* fix item paddings / drawer width

* expand the width of item-rows by the margin of an item

* fix hatchedPet-dialog

* fix hatching-modal

* remove min-height
2017-10-03 21:44:45 +02:00
Matteo Pagliazzi
fda4be01b8 limit for inlined svg images and make home leaner by not bundling it with the rest of static pages 2017-10-03 17:31:53 +02:00
Brian Murray
67436fbef1 Be consistent with capitalization of Check-In. (#9118) 2017-10-04 00:25:58 +10:00
Alys
ffb92a5faa quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140)
* enable link to markdown info on group and challenge edit screen

* allow admin (moderators and staff) to edit challenges

* allow admin (moderators and staff) to edit guilds

Also add some unrelated TODO comments.

* allow any party member (not just leader) to start quest from party page

* allow quest owner to cancel, begin, abort quest

Previously only the party leader could see those buttons. The leader still can.

This also hides those buttons from all other party members.

* enable reverse chat in guilds and party

* remove outdated videos from press kit

* adjust various wordings
2017-10-04 00:19:49 +10:00
Matteo Pagliazzi
4a44d60fac Client: fix Apidoc and move email files (#9139)
* fix apidoc

* move emails files
2017-10-03 15:34:12 +02:00
Sabe Jones
122cc510d3 4.1.2 2017-10-03 01:44:30 +00:00
Sabe Jones
29a7a07d14 Merge branch 'develop' into release 2017-10-03 01:39:53 +00:00
Sabe Jones
18783aefe3 chore(i18n): update locales 2017-10-03 01:38:52 +00:00
Sabe Jones
a5e242759c chore(news): Bailey 20171002 (#9131)
Extend subscriber item and Farm Friends duration
Parse Markdown in achievement challenges list
2017-10-02 20:32:13 -05:00
Keith Holliday
e01c6cc9a6 Added buy special support to buy route (#9130) 2017-10-02 20:31:06 -05:00
Keith Holliday
8a75383c43 Added spooky sparkles to features (#9129) 2017-10-02 19:46:21 -05:00
Matteo Pagliazzi
47ebee9ae8 Client Fixes Oct 1 (#9126)
* fix exp notifications for armoire

* open the profile modal only if data is available
2017-10-02 23:01:27 +02:00
Keith Holliday
4e97355110 Oct 2 fixes (#9124)
* Prevented filters from closing when editing tags

* Fixed group plan upgrade

* Add check for class change

* Fixed scrolling stopping on bailey

* Added server side results for armoire

* Added persistend equipment drawer toggle

* Updated reactivity in amazon payments
2017-10-02 12:51:17 -05:00
Matteo Pagliazzi
7045b5c214 update notifications lib 2017-10-02 09:26:41 +02:00
Sabe Jones
e41dccf6d5 4.1.1 2017-10-02 02:01:31 +00:00
Sabe Jones
d0815ea9ee Merge branch 'develop' into release 2017-10-02 01:51:08 +00:00
Sabe Jones
d0bd62bf02 chore(i18n): update locales 2017-10-02 01:49:12 +00:00
Keith Holliday
39d7581c6c Merge Develop onto Release (#9123)
* Some random quick (#9111)

* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning

* Tasks tags (#9112)

* Added auto apply and exit

* Add challenge tag editing

* Fixed lint

* Skill fixes (#9113)

* Added local storage setting for spell drawer

* Added new spell styles

* Fixed typo

* Reset local creds if access is denied (#9114)

* various fixes: group leader's name at top of edit drop-down; Members List; etc (#9117)

* fix text describing location of subscription/gem gift box

* disable Copy As To-Do in Tavern, guilds, party because it's not working

* change members label on group pages to Member List

* remove outdated info about seeing number of Gems available to buy

* allow Danger Zone to be seen by players without local authentication

Also add an hr because the Danger Zone heading was crammed up against the button above it.

* put current group leader's name at top of Leader change drop-down

* Client Fixes (#9120)

* unduplicate logout code

* re-enable debug menu

* fix pets badge and equipping mounts

* close gift modal after sending gems

* armoire notifications

* Oct 1 fixes (#9121)

* Added default tags to task

* Added seasonal gear check and show spooky

* Disabled spooky sparkles

* Fixed challenge remove tasks modal

* Hid checklist

* Added group gems modal

* Purchase with amazon

* Added check for user health

* Added missing notification file
2017-10-01 20:42:02 -05:00
Keith Holliday
fdf146dd01 Merge branch 'release' into develop 2017-10-01 19:46:57 -05:00
thehollidayinn
023b3ffd88 Added missing notification file 2017-10-01 19:45:21 -05:00
Keith Holliday
f01e552637 Oct 1 fixes (#9121)
* Added default tags to task

* Added seasonal gear check and show spooky

* Disabled spooky sparkles

* Fixed challenge remove tasks modal

* Hid checklist

* Added group gems modal

* Purchase with amazon

* Added check for user health
2017-10-01 19:17:02 -05:00
Matteo Pagliazzi
9f11820a02 Client Fixes (#9120)
* unduplicate logout code

* re-enable debug menu

* fix pets badge and equipping mounts

* close gift modal after sending gems

* armoire notifications
2017-10-01 23:25:32 +02:00
Alys
ca6c7b8e5f various fixes: group leader's name at top of edit drop-down; Members List; etc (#9117)
* fix text describing location of subscription/gem gift box

* disable Copy As To-Do in Tavern, guilds, party because it's not working

* change members label on group pages to Member List

* remove outdated info about seeing number of Gems available to buy

* allow Danger Zone to be seen by players without local authentication

Also add an hr because the Danger Zone heading was crammed up against the button above it.

* put current group leader's name at top of Leader change drop-down
2017-10-01 22:15:44 +10:00
Keith Holliday
02f8ba1638 4.1.0 (#9116) 2017-09-30 23:59:52 -05:00
Keith Holliday
8eb7c67f12 Merge develop to release (#9115)
* Some random quick (#9111)

* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning

* Tasks tags (#9112)

* Added auto apply and exit

* Add challenge tag editing

* Fixed lint

* Skill fixes (#9113)

* Added local storage setting for spell drawer

* Added new spell styles

* Fixed typo

* Reset local creds if access is denied (#9114)
2017-09-30 23:54:12 -05:00
Keith Holliday
1f895fda44 Reset local creds if access is denied (#9114) 2017-09-30 23:15:24 -05:00
Keith Holliday
e87c180e9b Skill fixes (#9113)
* Added local storage setting for spell drawer

* Added new spell styles

* Fixed typo
2017-09-30 23:04:18 -05:00
Keith Holliday
dbf9fd54be Tasks tags (#9112)
* Added auto apply and exit

* Add challenge tag editing

* Fixed lint
2017-09-30 21:49:00 -05:00
Keith Holliday
c9b99d1ecf Some random quick (#9111)
* Switch group button directions

* Allowed admins to export challenges

* Added scoping to some stable styles

* Fixed challenge cloning
2017-09-30 17:54:27 -05:00
Sabe Jones
fd8120c80d 4.0.9 2017-09-30 17:38:49 +00:00
Sabe Jones
053e75562f Merge branch 'develop' into release 2017-09-30 17:38:34 +00:00
Sabe Jones
1d50027f51 fix(challenges): Markdown titles 2017-09-30 17:10:57 +00:00
Sabe Jones
7fe74fd06a Serve static news page for mobile (#9109)
* fix(news): serve static page for mobile

* fix(news): commit new component

* refactor(news): computed prop DRY
2017-09-30 10:48:24 -05:00
Sabe Jones
173a8561b6 4.0.8 2017-09-30 13:37:29 +00:00
Sabe Jones
f21bef707b Merge branch 'develop' into release 2017-09-30 13:36:40 +00:00
Keith Holliday
9cf2ccf7c4 Style fixes (#9108)
* fixed some columns on smaller screens

* changed mystic hourglass check

* Checked for bad data

* Groupped pets and mounts

* Added show more

* Fixed lint

* Fixed lint
2017-09-30 08:34:25 -05:00
Keith Holliday
77d75c4669 Pending quest styles (#9106)
* Added pending quest modal

* Added quest completed modal

* Removed duplicate string
2017-09-30 08:28:39 -05:00
Trevor Ford
d89fc209d1 fix allocate() function in (#9105)
website/client/components/userMenu/profile.vue
2017-09-29 18:48:24 -05:00
9705 changed files with 111763 additions and 169645 deletions

View File

@@ -1,3 +0,0 @@
{
"directory": "website/client-old/bower_components"
}

View File

@@ -20,11 +20,7 @@ container_commands:
command: "touch /tmp/.babel.json"
02_ownBabel:
command: "chmod a+rw /tmp/.babel.json"
03_installBower:
command: "$NODE_HOME/bin/npm install -g bower"
04_installGulp:
03_installGulp:
command: "$NODE_HOME/bin/npm install -g gulp"
05_runBower:
command: "$NODE_HOME/lib/node_modules/bower/bin/bower --config.interactive=false --allow-root install -f"
06_runGulp:
04_runGulp:
command: "$NODE_HOME/lib/node_modules/gulp/bin/gulp.js build"

View File

@@ -6,15 +6,9 @@ website/transpiled-babel/
website/common/transpiled-babel/
dist/
dist-client/
apidoc_build/
content_cache/
node_modules/
# Not linted
website/client-old/
test/client-old/spec/**/*
# Temporarilly disabled. These should be removed when the linting errors are fixed TODO
migrations/*
scripts/*
website/common/browserify.js
Gruntfile.js
gulpfile.js
gulp
# Old migrations, disabled
migrations/archive/*

View File

@@ -4,7 +4,7 @@
# Pull Request
[Please see these instructions for adding a pull request](http://habitica.wikia.com/wiki/Using_Habitica_Git#Pull_Request)
[Please see these instructions for adding a pull request](http://habitica.wikia.com/wiki/Using_Your_Local_Install_to_Modify_Habitica%27s_Website_and_API)
# Requesting a feature

View File

@@ -6,7 +6,7 @@
[//]: # (For more guidelines see https://github.com/HabitRPG/habitica/issues/2760)
[//]: # (Fill out relevant information - UUID is found in Settings -> API)
[//]: # (Fill out relevant information - UUID is found from the Habitia website at User Icon > Settings > API)
### General Info
* UUID:
* Browser:

View File

@@ -1,4 +1,4 @@
[//]: # (Note: See http://habitica.wikia.com/wiki/Using_Habitica_Git#Pull_Request for more info)
[//]: # (Note: See http://habitica.wikia.com/wiki/Using_Your_Local_Install_to_Modify_Habitica%27s_Website_and_API for more info)
[//]: # (Put Issue # or URL here, if applicable. This will automatically close the issue if your PR is merged in)
Fixes put_issue_url_here
@@ -8,7 +8,7 @@ Fixes put_issue_url_here
[//]: # (Put User ID in here - found in Settings -> API)
[//]: # (Put User ID in here - found on the Habitica website at User Icon > Settings > API)
----
UUID:

3
.gitignore vendored
View File

@@ -2,11 +2,14 @@
website/client-old/gen
website/client-old/common
website/client-old/apidoc
website/build
website/client-old/js/habitrpg-shared.js*
website/client-old/css/habitrpg-shared.css
website/transpiled-babel/
website/common/transpiled-babel/
node_modules
content_cache
apidoc_build
*.swp
.idea*
config.json

View File

@@ -1,36 +1,29 @@
language: node_js
node_js:
- '6'
sudo: required
dist: precise
services:
- mongodb
cache:
directories:
- 'node_modules'
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
chrome: stable
before_install:
- $CXX --version
- npm install -g npm@5
- if [ $REQUIRES_SERVER ]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10; echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list; sudo apt-get update; sudo apt-get install mongodb-org-server; fi
install:
- npm install &> npm.install.log || (cat npm.install.log; false)
before_script:
- npm run test:build
- cp config.json.example config.json
- sleep 15
- sleep 5
script:
- npm run $TEST
- if [ $COVERAGE ]; then ./node_modules/.bin/lcov-result-merger 'coverage/**/*.info' | ./node_modules/coveralls/bin/coveralls.js; fi
env:
global:
- CXX=g++-4.8
- DISABLE_REQUEST_LOGGING=true
matrix:
- TEST="lint"
- TEST="test:api-v3" REQUIRES_SERVER=true COVERAGE=true
- TEST="test:api-v3:unit" REQUIRES_SERVER=true COVERAGE=true
- TEST="test:api-v3:integration" REQUIRES_SERVER=true COVERAGE=true
- TEST="test:sanity"
- TEST="test:content" COVERAGE=true
- TEST="test:common" COVERAGE=true

View File

@@ -4,7 +4,7 @@ FROM node:boron
# The used solution is suggested here https://github.com/npm/npm/issues/16807#issuecomment-313591975
RUN yarn global add npm@5
# Install global packages
RUN npm install -g gulp grunt-cli bower mocha
RUN npm install -g gulp-cli mocha
# Clone Habitica repo and install dependencies
RUN mkdir -p /usr/src/habitrpg
@@ -12,7 +12,6 @@ WORKDIR /usr/src/habitrpg
RUN git clone https://github.com/HabitRPG/habitica.git /usr/src/habitrpg
RUN cp config.json.example config.json
RUN npm install
RUN bower install --allow-root
# Create Build dir
RUN mkdir -p ./website/build

View File

@@ -1,17 +1,27 @@
FROM node:boron
ENV ADMIN_EMAIL admin@habitica.com
ENV AMAZON_PAYMENTS_CLIENT_ID amzn1.application-oa2-client.68ed9e6904ef438fbc1bf86bf494056e
ENV AMAZON_PAYMENTS_SELLER_ID AMQ3SB4SG5E91
ENV AMPLITUDE_KEY e8d4c24b3d6ef3ee73eeba715023dd43
ENV BASE_URL https://habitica.com
ENV FACEBOOK_KEY 128307497299777
ENV GA_ID UA-33510635-1
ENV GOOGLE_CLIENT_ID 1035232791481-32vtplgnjnd1aufv3mcu1lthf31795fq.apps.googleusercontent.com
ENV NODE_ENV production
ENV STRIPE_PUB_KEY pk_85fQ0yMECHNfHTSsZoxZXlPSwSNfA
# Upgrade NPM to v5 (Yarn is needed because of this bug https://github.com/npm/npm/issues/16807)
# The used solution is suggested here https://github.com/npm/npm/issues/16807#issuecomment-313591975
RUN yarn global add npm@5
# Install global packages
RUN npm install -g gulp grunt-cli bower mocha
RUN npm install -g gulp-cli mocha
# Clone Habitica repo and install dependencies
RUN mkdir -p /usr/src/habitrpg
WORKDIR /usr/src/habitrpg
RUN git clone --branch v4.0.3 https://github.com/HabitRPG/habitica.git /usr/src/habitrpg
RUN git clone --branch v4.29.8 https://github.com/HabitRPG/habitica.git /usr/src/habitrpg
RUN npm install
RUN bower install --allow-root
RUN gulp build:prod --force
# Create Build dir

View File

@@ -1,142 +0,0 @@
/*global module:false*/
require('babel-register');
var _ = require('lodash');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
unit: {
configFile: 'test/client-old/spec/karma.conf.js'
},
continuous: {
configFile: 'test/client-old/spec/karma.conf.js',
singleRun: true,
autoWatch: false
}
},
clean: {
build: ['website/build']
},
cssmin: {
dist: {
options: {
report: 'gzip'
},
files:{
"website/client-old/css/habitrpg-shared.css": [
"website/assets/sprites/dist/spritesmith*.css",
"website/assets/sprites/css/backer.css",
"website/assets/sprites/css/Mounts.css",
"website/assets/sprites/css/index.css"
]
}
}
},
stylus: {
build: {
options: {
compress: false, // AFTER
'include css': true,
paths: ['website/client-old']
},
files: {
'website/build/app.css': ['website/client-old/css/index.styl'],
'website/build/static.css': ['website/client-old/css/static.styl']
}
}
},
copy: {
build: {
files: [
{expand: true, cwd: 'website/client-old/', src: 'favicon.ico', dest: 'website/build/'},
{expand: true, cwd: 'website/client-old/', src: 'favicon_192x192.png', dest: 'website/build/'},
{expand: true, cwd: 'website/assets/sprites/dist/', src: 'spritesmith*.png', dest: 'website/build/static/sprites'},
{expand: true, cwd: 'website/assets/sprites/', src: 'backer-only/*.gif', dest: 'website/build/'},
{expand: true, cwd: 'website/assets/sprites/', src: 'npc_ian.gif', dest: 'website/build/'},
{expand: true, cwd: 'website/assets/sprites/', src: 'quest_*.gif', dest: 'website/build/'},
{expand: true, cwd: 'website/client-old/', src: 'bower_components/bootstrap/dist/fonts/*', dest: 'website/build/'}
]
}
},
// UPDATE IT WHEN YOU ADD SOME FILES NOT ALREADY MATCHED!
hashres: {
build: {
options: {
fileNameFormat: '${name}-${hash}.${ext}'
},
src: [
'website/build/*.js',
'website/build/*.css',
'website/build/favicon.ico',
'website/build/favicon_192x192.png',
'website/build/*.png',
'website/build/static/sprites/*.png',
'website/build/*.gif',
'website/build/bower_components/bootstrap/dist/fonts/*'
],
dest: 'website/build/*.css'
}
}
});
//Load build files from client-old/manifest.json
grunt.registerTask('loadManifestFiles', 'Load all build files from client-old/manifest.json', function(){
var files = grunt.file.readJSON('./website/client-old/manifest.json');
var uglify = {};
var cssmin = {};
_.each(files, function(val, key){
var js = uglify['website/build/' + key + '.js'] = [];
_.each(files[key].js, function(val){
var path = "./";
if( val.indexOf('common/') == -1)
path = './website/client-old/';
js.push(path + val);
});
var css = cssmin['website/build/' + key + '.css'] = [];
_.each(files[key].css, function(val){
var path = "./";
if( val.indexOf('common/') == -1) {
path = (val == 'app.css' || val == 'static.css') ? './website/build/' : './website/client-old/';
}
css.push(path + val)
});
});
grunt.config.set('uglify.build.files', uglify);
grunt.config.set('uglify.build.options', {compress: false});
grunt.config.set('cssmin.build.files', cssmin);
// Rewrite urls to relative path
grunt.config.set('cssmin.build.options', {'target': 'website/client-old/css/whatever-css.css'});
});
// Register tasks.
grunt.registerTask('build:prod', ['loadManifestFiles', 'clean:build', 'uglify', 'stylus', 'cssmin', 'copy:build', 'hashres']);
grunt.registerTask('build:dev', ['cssmin', 'stylus']);
grunt.registerTask('build:test', ['build:dev']);
// Load tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-hashres');
if (process.env.NODE_ENV !== 'production') grunt.loadNpmTasks('grunt-karma');
};

View File

@@ -1,6 +1,8 @@
Habitica [![Build Status](https://travis-ci.org/HabitRPG/habitica.svg?branch=develop)](https://travis-ci.org/HabitRPG/habitica) [![Code Climate](https://codeclimate.com/github/HabitRPG/habitrpg.svg)](https://codeclimate.com/github/HabitRPG/habitrpg) [![Coverage Status](https://coveralls.io/repos/github/HabitRPG/habitica/badge.svg?branch=develop)](https://coveralls.io/github/HabitRPG/habitica?branch=develop) [![Bountysource](https://api.bountysource.com/badge/tracker?tracker_id=68393)](https://www.bountysource.com/trackers/68393-habitrpg?utm_source=68393&utm_medium=shield&utm_campaign=TRACKER_BADGE)
Habitica [![Build Status](https://travis-ci.org/HabitRPG/habitica.svg?branch=develop)](https://travis-ci.org/HabitRPG/habitica) [![Code Climate](https://codeclimate.com/github/HabitRPG/habitrpg.svg)](https://codeclimate.com/github/HabitRPG/habitrpg) [![Coverage Status](https://coveralls.io/repos/github/HabitRPG/habitica/badge.svg?branch=develop)](https://coveralls.io/github/HabitRPG/habitica?branch=develop) [![Bountysource](https://api.bountysource.com/badge/tracker?tracker_id=68393)](https://www.bountysource.com/trackers/68393-habitrpg?utm_source=68393&utm_medium=shield&utm_campaign=TRACKER_BADGE) [![Open Source Helpers](https://www.codetriage.com/habitrpg/habitica/badges/users.svg)](https://www.codetriage.com/habitrpg/habitica)
===============
[![Greenkeeper badge](https://badges.greenkeeper.io/HabitRPG/habitica.svg)](https://greenkeeper.io/)
[Habitica](https://habitica.com) is an open source habit building program which treats your life like a Role Playing Game. Level up as you succeed, lose HP as you fail, earn money to buy weapons and armor.
We need more programmers! Your assistance will be greatly appreciated.

View File

@@ -16,5 +16,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "habitrpg"
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
config.vm.usable_port_range = (3000..3050)
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.usable_port_range = (8080..8130)
config.vm.provision :shell, :path => "vagrant_scripts/vagrant.sh"
end

View File

@@ -1,56 +0,0 @@
{
"name": "HabitRPG",
"version": "0.1.1",
"homepage": "https://github.com/lefnire/habitrpg",
"authors": [
"Tyler Renelle <tylerrenelle@gmail.com>"
],
"private": true,
"ignore": [
"**/.*",
"node_modules",
"website/client-old/bower_components",
"test",
"tests"
],
"dependencies": {
"Angular-At-Directive": "snicker/Angular-At-Directive#c27bae207aa06d1e",
"angular": "1.3.9",
"angular-bootstrap": "0.13.0",
"angular-filter": "0.5.1",
"angular-loading-bar": "0.6.0",
"angular-resource": "1.3.9",
"angular-sanitize": "1.3.9",
"angular-ui": "0.4.0",
"angular-ui-router": "0.2.13",
"angular-ui-select2": "angular-ui/ui-select2#afa6589a54cb72815f",
"angular-ui-utils": "0.1.0",
"bootstrap": "3.1.0",
"bootstrap-growl": "ifightcrime/bootstrap-growl#162daa41cd1155f",
"bootstrap-tour": "0.10.1",
"css-social-buttons": "samcollins/css-social-buttons#v1.1.1 ",
"github-buttons": "mdo/github-buttons#v3.0.0",
"hello": "1.14.1",
"jquery": "2.1.0",
"jquery-colorbox": "1.4.36",
"jquery-ui": "1.10.3",
"jquery.cookie": "1.4.0",
"js-emoji": "snicker/js-emoji#f25d8a303f",
"ngInfiniteScroll": "1.1.0",
"pnotify": "1.3.1",
"sticky": "1.0.3",
"swagger-ui": "wordnik/swagger-ui#v2.0.24",
"smart-app-banner": "78ef9c0679723b25be1a0ae04f7b4aef7cbced4f",
"habitica-markdown": "1.2.2",
"pusher-js-auth": "^2.0.0",
"pusher-websocket-iso": "pusher#^3.2.0",
"taggle": "^1.11.1"
},
"devDependencies": {
"angular-mocks": "1.3.9"
},
"resolutions": {
"angular": "1.3.9",
"jquery": ">=1.9.0"
}
}

View File

@@ -22,6 +22,8 @@
"CRON_SEMI_SAFE_MODE":"false",
"MAINTENANCE_MODE": "false",
"SESSION_SECRET":"YOUR SECRET HERE",
"SESSION_SECRET_KEY": "1234567891234567891234567891234567891234567891234567891234567891",
"SESSION_SECRET_IV": "12345678912345678912345678912345",
"ADMIN_EMAIL": "you@example.com",
"SMTP_USER":"user@example.com",
"SMTP_PASS":"password",
@@ -71,6 +73,7 @@
},
"IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/",
"LOGGLY_TOKEN": "token",
"LOGGLY_CLIENT_TOKEN": "token",
"LOGGLY_ACCOUNT": "account",
"PUSH_CONFIGS": {
"GCM_SERVER_API_KEY": "",
@@ -102,5 +105,13 @@
"LOGGLY" : {
"TOKEN" : "example-token",
"SUBDOMAIN" : "exmaple-subdomain"
}
},
"KAFKA": {
"GROUP_ID": "",
"CLOUDKARAFKA_BROKERS": "",
"CLOUDKARAFKA_USERNAME": "",
"CLOUDKARAFKA_PASSWORD": "",
"CLOUDKARAFKA_TOPIC_PREFIX": ""
},
"STACK_IMPACT_KEY": "aaaabbbbccccddddeeeeffffgggg111100002222"
}

View File

@@ -1,3 +1,10 @@
web:
volumes:
- '.:/usr/src/habitrpg'
version: "3"
services:
client:
volumes:
- '.:/usr/src/habitrpg'
server:
volumes:
- '.:/usr/src/habitrpg'

View File

@@ -1,13 +1,36 @@
web:
build: .
ports:
- "3000:3000"
links:
- mongo
environment:
- NODE_DB_URI=mongodb://mongo/habitrpg
version: "3"
services:
mongo:
image: mongo
ports:
- "27017:27017"
client:
build: .
networks:
- habitica
environment:
- BASE_URL=http://server:3000
ports:
- "8080:8080"
command: ["npm", "run", "client:dev"]
depends_on:
- server
server:
build: .
ports:
- "3000:3000"
networks:
- habitica
environment:
- NODE_DB_URI=mongodb://mongo/habitrpg
depends_on:
- mongo
mongo:
image: mongo
ports:
- "27017:27017"
networks:
- habitica
networks:
habitica:
driver: bridge

View File

@@ -1,10 +0,0 @@
{
"root": true,
"env": {
"node": true,
},
"extends": [
"habitrpg/server",
"habitrpg/babel"
],
}

View File

@@ -2,13 +2,13 @@ import gulp from 'gulp';
import clean from 'rimraf';
import apidoc from 'apidoc';
const APIDOC_DEST_PATH = './website/build/apidoc';
const APIDOC_DEST_PATH = './apidoc_build';
const APIDOC_SRC_PATH = './website/server';
gulp.task('apidoc:clean', (done) => {
clean(APIDOC_DEST_PATH, done);
});
gulp.task('apidoc', ['apidoc:clean'], (done) => {
gulp.task('apidoc', gulp.series('apidoc:clean', (done) => {
let result = apidoc.createDoc({
src: APIDOC_SRC_PATH,
dest: APIDOC_DEST_PATH,
@@ -19,8 +19,8 @@ gulp.task('apidoc', ['apidoc:clean'], (done) => {
} else {
done();
}
});
}));
gulp.task('apidoc:watch', ['apidoc'], () => {
return gulp.watch(APIDOC_SRC_PATH + '/**/*.js', ['apidoc']);
});
gulp.task('apidoc:watch', gulp.series('apidoc', (done) => {
return gulp.watch(`${APIDOC_SRC_PATH}/**/*.js`, gulp.series('apidoc', done));
}));

View File

@@ -1,31 +0,0 @@
import gulp from 'gulp';
import browserify from 'browserify';
import source from 'vinyl-source-stream';
import buffer from 'vinyl-buffer';
import uglify from 'gulp-uglify';
import sourcemaps from 'gulp-sourcemaps';
import babel from 'babelify';
gulp.task('browserify', function () {
let bundler = browserify({
entries: './website/common/browserify.js',
debug: true,
transform: [[babel, { compact: false }]],
});
return bundler.bundle()
.pipe(source('habitrpg-shared.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(uglify())
.on('error', function (err) {
console.error(err);
this.emit('end');
})
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./website/client-old/js/'));
});
gulp.task('browserify:watch', () => {
gulp.watch('./website/common/script/**/*.js', ['browserify']);
});

View File

@@ -1,36 +0,0 @@
import gulp from 'gulp';
import fs from 'fs';
// Copy Bootstrap 4 config variables from /website /node_modules so we can check
// them into Git
const BOOSTRAP_NEW_CONFIG_PATH = 'website/client/assets/scss/bootstrap_config.scss';
const BOOTSTRAP_ORIGINAL_CONFIG_PATH = 'node_modules/bootstrap/scss/_custom.scss';
// https://stackoverflow.com/a/14387791/969528
function copyFile(source, target, cb) {
let cbCalled = false;
function done(err) {
if (!cbCalled) {
cb(err);
cbCalled = true;
}
}
let rd = fs.createReadStream(source);
rd.on('error', done);
let wr = fs.createWriteStream(target);
wr.on('error', done);
wr.on('close', () => done());
rd.pipe(wr);
}
gulp.task('bootstrap', (done) => {
// use new config
copyFile(
BOOSTRAP_NEW_CONFIG_PATH,
BOOTSTRAP_ORIGINAL_CONFIG_PATH,
done,
);
});

View File

@@ -1,16 +1,6 @@
import gulp from 'gulp';
import runSequence from 'run-sequence';
import babel from 'gulp-babel';
import webpackProductionBuild from '../webpack/build';
require('gulp-grunt')(gulp);
gulp.task('build', () => {
if (process.env.NODE_ENV === 'production') {
gulp.start('build:prod');
} else {
gulp.start('build:dev');
}
});
gulp.task('build:src', () => {
return gulp.src('website/server/**/*.js')
@@ -24,33 +14,30 @@ gulp.task('build:common', () => {
.pipe(gulp.dest('website/common/transpiled-babel/'));
});
gulp.task('build:server', ['build:src', 'build:common']);
gulp.task('build:server', gulp.series('build:src', 'build:common', done => done()));
// Client Production Build
gulp.task('build:client', ['bootstrap'], (done) => {
gulp.task('build:client', (done) => {
webpackProductionBuild((err, output) => {
if (err) return done(err);
console.log(output);
console.log(output); // eslint-disable-line no-console
done();
});
});
gulp.task('build:dev', ['browserify', 'prepare:staticNewStuff'], (done) => {
gulp.start('grunt-build:dev', done);
});
gulp.task('build:dev:watch', ['build:dev'], () => {
gulp.watch(['website/client-old/**/*.styl', 'website/common/script/*']);
});
gulp.task('build:prod', [
'browserify',
'build:server',
'prepare:staticNewStuff',
gulp.task('build:prod', gulp.series(
'build:server',
'build:client',
], (done) => {
runSequence(
'grunt-build:prod',
'apidoc',
done
);
});
'apidoc',
done => done()
));
let buildArgs = [];
if (process.env.NODE_ENV === 'production') { // eslint-disable-line no-process-env
buildArgs.push('build:prod');
}
gulp.task('build', gulp.series(buildArgs, (done) => {
done();
}));

View File

@@ -1,5 +1,4 @@
import mongoose from 'mongoose';
import autoinc from 'mongoose-id-autoinc';
import logger from '../website/server/libs/logger';
import nconf from 'nconf';
import repl from 'repl';
@@ -7,10 +6,11 @@ import gulp from 'gulp';
// Add additional properties to the repl's context
let improveRepl = (context) => {
// Let "exit" and "quit" terminate the console
['exit', 'quit'].forEach((term) => {
Object.defineProperty(context, term, { get () { process.exit(); }});
Object.defineProperty(context, term, { get () {
process.exit();
}});
});
// "clear" clears the screen
@@ -18,30 +18,28 @@ let improveRepl = (context) => {
process.stdout.write('\u001B[2J\u001B[0;0f');
}});
context.Challenge = require('../website/server/models/challenge').model;
context.Group = require('../website/server/models/group').model;
context.User = require('../website/server/models/user').model;
context.Challenge = require('../website/server/models/challenge').model; // eslint-disable-line global-require
context.Group = require('../website/server/models/group').model; // eslint-disable-line global-require
context.User = require('../website/server/models/user').model; // eslint-disable-line global-require
var isProd = nconf.get('NODE_ENV') === 'production';
var mongooseOptions = !isProd ? {} : {
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
const isProd = nconf.get('NODE_ENV') === 'production';
const mongooseOptions = !isProd ? {} : {
keepAlive: 1,
connectTimeoutMS: 30000,
};
autoinc.init(
mongoose.connect(
nconf.get('NODE_DB_URI'),
mongooseOptions,
function (err) {
if (err) throw err;
logger.info('Connected with Mongoose');
}
)
mongoose.connect(
nconf.get('NODE_DB_URI'),
mongooseOptions,
(err) => {
if (err) throw err;
logger.info('Connected with Mongoose');
}
);
};
gulp.task('console', (cb) => {
gulp.task('console', (done) => {
improveRepl(repl.start({
prompt: 'Habitica > ',
}).context);
done();
});

View File

@@ -1,10 +0,0 @@
import gulp from 'gulp';
import jade from 'jade';
import {writeFileSync} from 'fs';
gulp.task('prepare:staticNewStuff', () => {
writeFileSync(
'./website/client-old/new-stuff.html',
jade.compileFile('./website/views/shared/new-stuff.jade')()
);
});

View File

@@ -7,85 +7,43 @@ import mergeStream from 'merge-stream';
import {basename} from 'path';
import {sync} from 'glob';
import {each} from 'lodash';
import vinylBuffer from 'vinyl-buffer';
// https://github.com/Ensighten/grunt-spritesmith/issues/67#issuecomment-34786248
const MAX_SPRITESHEET_SIZE = 1024 * 1024 * 3;
const DIST_PATH = 'website/assets/sprites/dist/';
const IMG_DIST_PATH_NEW_CLIENT = 'website/static/sprites/';
const CSS_DIST_PATH_NEW_CLIENT = 'website/client/assets/css/sprites/';
const IMG_DIST_PATH = 'website/client/assets/images/sprites/';
const CSS_DIST_PATH = 'website/client/assets/css/sprites/';
gulp.task('sprites:compile', ['sprites:clean', 'sprites:main', 'sprites:largeSprites', 'sprites:checkCompiledDimensions']);
function checkForSpecialTreatment (name) {
let regex = /^hair|skin|beard|mustach|shirt|flower|^headAccessory_special_\w+Ears|^eyewear_special_\w+TopFrame/;
return name.match(regex) || name === 'head_0';
}
gulp.task('sprites:main', () => {
let mainSrc = sync('website/assets/sprites/spritesmith/**/*.png');
return createSpritesStream('main', mainSrc);
});
function calculateImgDimensions (img, addPadding) {
let dims = sizeOf(img);
gulp.task('sprites:largeSprites', () => {
let largeSrc = sync('website/assets/sprites/spritesmith_large/**/*.png');
return createSpritesStream('largeSprites', largeSrc);
});
gulp.task('sprites:clean', (done) => {
clean(`{${DIST_PATH}spritesmith*,${IMG_DIST_PATH_NEW_CLIENT}spritesmith*,${CSS_DIST_PATH_NEW_CLIENT}spritesmith*}`, done);
});
gulp.task('sprites:checkCompiledDimensions', ['sprites:main', 'sprites:largeSprites'], () => {
console.log('Verifiying that images do not exceed max dimensions');
let numberOfSheetsThatAreTooBig = 0;
let distSpritesheets = sync(`${DIST_PATH}*.png`);
each(distSpritesheets, (img, index) => {
let spriteSize = calculateImgDimensions(img);
if (spriteSize > MAX_SPRITESHEET_SIZE) {
numberOfSheetsThatAreTooBig++;
let name = basename(img, '.png');
console.error(`WARNING: ${name} might be too big - ${spriteSize} > ${MAX_SPRITESHEET_SIZE}`);
}
});
if (numberOfSheetsThatAreTooBig > 0) {
console.error(`${numberOfSheetsThatAreTooBig} sheets might too big for mobile Safari to be able to handle them, but there is a margin of error in these calculations so it is probably okay. Mention this to an admin so they can test a staging site on mobile Safari after your PR is merged.`); // https://github.com/HabitRPG/habitica/pull/6683#issuecomment-185462180
} else {
console.log('All images are within the correct dimensions');
let requiresSpecialTreatment = checkForSpecialTreatment(img);
if (requiresSpecialTreatment) {
let newWidth = dims.width < 90 ? 90 : dims.width;
let newHeight = dims.height < 90 ? 90 : dims.height;
dims = {
width: newWidth,
height: newHeight,
};
}
});
function createSpritesStream (name, src) {
let spritesheetSliceIndicies = calculateSpritesheetsSrcIndicies(src);
let stream = mergeStream();
let padding = 0;
each(spritesheetSliceIndicies, (start, index) => {
let slicedSrc = src.slice(start, spritesheetSliceIndicies[index + 1]);
if (addPadding) {
padding = dims.width * 8 + dims.height * 8;
}
let spriteData = gulp.src(slicedSrc)
.pipe(spritesmith({
imgName: `spritesmith-${name}-${index}.png`,
cssName: `spritesmith-${name}-${index}.css`,
algorithm: 'binary-tree',
padding: 1,
cssTemplate: 'website/assets/sprites/css/css.template.handlebars',
cssVarMap: cssVarMap,
}));
if (!dims.width || !dims.height) console.error('MISSING DIMENSIONS:', dims); // eslint-disable-line no-console
let imgStream = spriteData.img
.pipe(imagemin())
.pipe(gulp.dest(IMG_DIST_PATH_NEW_CLIENT))
.pipe(gulp.dest(DIST_PATH));
let totalPixelSize = dims.width * dims.height + padding;
let cssStream = spriteData.css
.pipe(gulp.dest(CSS_DIST_PATH_NEW_CLIENT))
.pipe(gulp.dest(DIST_PATH));
stream.add(imgStream);
stream.add(cssStream);
});
return stream;
return totalPixelSize;
}
function calculateSpritesheetsSrcIndicies (src) {
@@ -105,37 +63,6 @@ function calculateSpritesheetsSrcIndicies (src) {
return slices;
}
function calculateImgDimensions (img, addPadding) {
let dims = sizeOf(img);
let requiresSpecialTreatment = checkForSpecialTreatment(img);
if (requiresSpecialTreatment) {
let newWidth = dims.width < 90 ? 90 : dims.width;
let newHeight = dims.height < 90 ? 90 : dims.height;
dims = {
width: newWidth,
height: newHeight,
};
}
let padding = 0;
if (addPadding) {
padding = (dims.width * 8) + (dims.height * 8);
}
if (!dims.width || !dims.height) console.error('MISSING DIMENSIONS:', dims);
let totalPixelSize = (dims.width * dims.height) + padding;
return totalPixelSize;
}
function checkForSpecialTreatment (name) {
let regex = /^hair|skin|beard|mustach|shirt|flower|^headAccessory_special_\w+Ears|^eyewear_special_\w+TopFrame/;
return name.match(regex) || name === 'head_0';
}
function cssVarMap (sprite) {
// For hair, skins, beards, etc. we want to output a '.customize-options.WHATEVER' class, which works as a
// 60x60 image pointing at the proper part of the 90x90 sprite.
@@ -144,18 +71,95 @@ function cssVarMap (sprite) {
if (requiresSpecialTreatment) {
sprite.custom = {
px: {
offset_x: `-${ sprite.x + 25 }px`,
offset_y: `-${ sprite.y + 15 }px`,
offsetX: `-${ sprite.x + 25 }px`,
offsetY: `-${ sprite.y + 15 }px`,
width: '60px',
height: '60px',
},
};
}
if (~sprite.name.indexOf('shirt'))
sprite.custom.px.offset_y = `-${ sprite.y + 30 }px`; // even more for shirts
if (~sprite.name.indexOf('hair_base')) {
let styleArray = sprite.name.split('_').slice(2,3);
if (sprite.name.indexOf('shirt') !== -1)
sprite.custom.px.offsetY = `-${ sprite.y + 35 }px`; // even more for shirts
if (sprite.name.indexOf('hair_base') !== -1) {
let styleArray = sprite.name.split('_').slice(2, 3);
if (Number(styleArray[0]) > 14)
sprite.custom.px.offset_y = `-${ sprite.y }px`; // don't crop updos
sprite.custom.px.offsetY = `-${ sprite.y }px`; // don't crop updos
}
}
function createSpritesStream (name, src) {
let spritesheetSliceIndicies = calculateSpritesheetsSrcIndicies(src);
let stream = mergeStream();
each(spritesheetSliceIndicies, (start, index) => {
let slicedSrc = src.slice(start, spritesheetSliceIndicies[index + 1]);
let spriteData = gulp.src(slicedSrc)
.pipe(spritesmith({
imgName: `spritesmith-${name}-${index}.png`,
cssName: `spritesmith-${name}-${index}.css`,
algorithm: 'binary-tree',
padding: 1,
cssTemplate: 'website/raw_sprites/css/css.template.handlebars',
cssVarMap,
}));
let imgStream = spriteData.img
.pipe(vinylBuffer())
.pipe(imagemin())
.pipe(gulp.dest(IMG_DIST_PATH));
let cssStream = spriteData.css
.pipe(gulp.dest(CSS_DIST_PATH));
stream.add(imgStream);
stream.add(cssStream);
});
return stream;
}
gulp.task('sprites:main', () => {
let mainSrc = sync('website/raw_sprites/spritesmith/**/*.png');
return createSpritesStream('main', mainSrc);
});
gulp.task('sprites:largeSprites', () => {
let largeSrc = sync('website/raw_sprites/spritesmith_large/**/*.png');
return createSpritesStream('largeSprites', largeSrc);
});
gulp.task('sprites:clean', (done) => {
clean(`${IMG_DIST_PATH}spritesmith*,${CSS_DIST_PATH}spritesmith*}`, done);
});
gulp.task('sprites:checkCompiledDimensions', gulp.series('sprites:main', 'sprites:largeSprites', (done) => {
console.log('Verifiying that images do not exceed max dimensions'); // eslint-disable-line no-console
let numberOfSheetsThatAreTooBig = 0;
let distSpritesheets = sync(`${IMG_DIST_PATH}*.png`);
each(distSpritesheets, (img) => {
let spriteSize = calculateImgDimensions(img);
if (spriteSize > MAX_SPRITESHEET_SIZE) {
numberOfSheetsThatAreTooBig++;
let name = basename(img, '.png');
console.error(`WARNING: ${name} might be too big - ${spriteSize} > ${MAX_SPRITESHEET_SIZE}`); // eslint-disable-line no-console
}
});
if (numberOfSheetsThatAreTooBig > 0) {
// https://github.com/HabitRPG/habitica/pull/6683#issuecomment-185462180
console.error( // eslint-disable-line no-console
`${numberOfSheetsThatAreTooBig} sheets might too big for mobile Safari to be able to handle
them, but there is a margin of error in these calculations so it is probably okay. Mention
this to an admin so they can test a staging site on mobile Safari after your PR is merged.`);
} else {
console.log('All images are within the correct dimensions'); // eslint-disable-line no-console
}
done();
}));
gulp.task('sprites:compile', gulp.series('sprites:clean', 'sprites:main', 'sprites:largeSprites', 'sprites:checkCompiledDimensions', done => done()));

View File

@@ -3,9 +3,7 @@ import nodemon from 'gulp-nodemon';
let pkg = require('../package.json');
gulp.task('run:dev', ['nodemon', 'build:dev:watch']);
gulp.task('nodemon', () => {
gulp.task('nodemon', (done) => {
nodemon({
script: pkg.main,
ignore: [
@@ -14,4 +12,5 @@ gulp.task('nodemon', () => {
'common/dist/script/content/*',
],
});
done();
});

View File

@@ -1,21 +1,11 @@
import {
pipe,
awaitPort,
kill,
runMochaTests,
} from './taskHelper';
import { server as karma } from 'karma';
import mongoose from 'mongoose';
import { exec } from 'child_process';
import psTree from 'ps-tree';
import gulp from 'gulp';
import Bluebird from 'bluebird';
import runSequence from 'run-sequence';
import os from 'os';
import nconf from 'nconf';
import fs from 'fs';
const i18n = require('../website/server/libs/i18n');
// TODO rewrite
@@ -24,25 +14,23 @@ let server;
const TEST_DB_URI = nconf.get('TEST_DB_URI');
const API_V3_TEST_COMMAND = 'npm run test:api-v3';
const SANITY_TEST_COMMAND = 'npm run test:sanity';
const COMMON_TEST_COMMAND = 'npm run test:common';
const CONTENT_TEST_COMMAND = 'npm run test:content';
const CONTENT_OPTIONS = {maxBuffer: 1024 * 500};
const KARMA_TEST_COMMAND = 'npm run test:karma';
/* Helper methods for reporting test summary */
let testResults = [];
let testCount = (stdout, regexp) => {
let match = stdout.match(regexp);
return parseInt(match && match[1] || 0);
return parseInt(match && match[1] || 0, 10);
};
let testBin = (string, additionalEnvVariables = '') => {
if (os.platform() === 'win32') {
if (additionalEnvVariables != '') {
if (additionalEnvVariables !== '') {
additionalEnvVariables = additionalEnvVariables.split(' ').join('&&set ');
additionalEnvVariables = 'set ' + additionalEnvVariables + '&&';
additionalEnvVariables = `set ${additionalEnvVariables}&&`;
}
return `set NODE_ENV=test&&${additionalEnvVariables}${string}`;
} else {
@@ -50,56 +38,48 @@ let testBin = (string, additionalEnvVariables = '') => {
}
};
gulp.task('test:nodemon', (done) => {
process.env.PORT = TEST_SERVER_PORT;
process.env.NODE_DB_URI = TEST_DB_URI;
runSequence('nodemon');
});
gulp.task('test:nodemon', gulp.series(function setupNodemon (done) {
process.env.PORT = TEST_SERVER_PORT; // eslint-disable-line no-process-env
process.env.NODE_DB_URI = TEST_DB_URI; // eslint-disable-line no-process-env
done();
}, 'nodemon'));
gulp.task('test:prepare:mongo', (cb) => {
mongoose.connect(TEST_DB_URI, (err) => {
if (err) return cb(`Unable to connect to mongo database. Are you sure it's running? \n\n${err}`);
mongoose.connection.db.dropDatabase();
mongoose.connection.close();
cb();
mongoose.connection.dropDatabase((err2) => {
if (err2) return cb(err2);
mongoose.connection.close(cb);
});
});
});
gulp.task('test:prepare:server', ['test:prepare:mongo'], () => {
gulp.task('test:prepare:server', gulp.series('test:prepare:mongo', (done) => {
if (!server) {
server = exec(testBin('node ./website/server/index.js', `NODE_DB_URI=${TEST_DB_URI} PORT=${TEST_SERVER_PORT}`), (error, stdout, stderr) => {
if (error) { throw `Problem with the server: ${error}`; }
if (stderr) { console.error(stderr); }
if (error) {
throw new Error(`Problem with the server: ${error}`);
}
if (stderr) {
console.error(stderr); // eslint-disable-line no-console
}
done();
});
}
});
}));
gulp.task('test:prepare:translations', (cb) => {
fs.writeFile(
'test/client-old/spec/mocks/translations.js',
`if(!window.env) window.env = {};
window.env.translations = ${JSON.stringify(i18n.translations['en'])};`, cb);
gulp.task('test:prepare:build', gulp.series('build', done => done()));
});
gulp.task('test:prepare:build', ['build', 'test:prepare:translations']);
// exec(testBin('grunt build:test'), cb);
gulp.task('test:prepare:webdriver', (cb) => {
exec('npm run test:prepare:webdriver', cb);
});
gulp.task('test:prepare', [
gulp.task('test:prepare', gulp.series(
'test:prepare:build',
'test:prepare:mongo',
'test:prepare:webdriver',
]);
done => done()
));
gulp.task('test:sanity', (cb) => {
let runner = exec(
testBin(SANITY_TEST_COMMAND),
(err, stdout, stderr) => {
(err) => {
if (err) {
process.exit(1);
}
@@ -109,10 +89,10 @@ gulp.task('test:sanity', (cb) => {
pipe(runner);
});
gulp.task('test:common', ['test:prepare:build'], (cb) => {
gulp.task('test:common', gulp.series('test:prepare:build', (cb) => {
let runner = exec(
testBin(COMMON_TEST_COMMAND),
(err, stdout, stderr) => {
(err) => {
if (err) {
process.exit(1);
}
@@ -120,20 +100,20 @@ gulp.task('test:common', ['test:prepare:build'], (cb) => {
}
);
pipe(runner);
});
}));
gulp.task('test:common:clean', (cb) => {
pipe(exec(testBin(COMMON_TEST_COMMAND), () => cb()));
});
gulp.task('test:common:watch', ['test:common:clean'], () => {
gulp.watch(['common/script/**/*', 'test/common/**/*'], ['test:common:clean']);
});
gulp.task('test:common:watch', gulp.series('test:common:clean', () => {
return gulp.watch(['common/script/**/*', 'test/common/**/*'], gulp.series('test:common:clean', done => done()));
}));
gulp.task('test:common:safe', ['test:prepare:build'], (cb) => {
gulp.task('test:common:safe', gulp.series('test:prepare:build', (cb) => {
let runner = exec(
testBin(COMMON_TEST_COMMAND),
(err, stdout, stderr) => {
(err, stdout) => { // eslint-disable-line handle-callback-err
testResults.push({
suite: 'Common Specs\t',
pass: testCount(stdout, /(\d+) passing/),
@@ -144,13 +124,13 @@ gulp.task('test:common:safe', ['test:prepare:build'], (cb) => {
}
);
pipe(runner);
});
}));
gulp.task('test:content', ['test:prepare:build'], (cb) => {
gulp.task('test:content', gulp.series('test:prepare:build', (cb) => {
let runner = exec(
testBin(CONTENT_TEST_COMMAND),
CONTENT_OPTIONS,
(err, stdout, stderr) => {
(err) => {
if (err) {
process.exit(1);
}
@@ -158,21 +138,21 @@ gulp.task('test:content', ['test:prepare:build'], (cb) => {
}
);
pipe(runner);
});
}));
gulp.task('test:content:clean', (cb) => {
pipe(exec(testBin(CONTENT_TEST_COMMAND), CONTENT_OPTIONS, () => cb()));
});
gulp.task('test:content:watch', ['test:content:clean'], () => {
gulp.watch(['common/script/content/**', 'test/**'], ['test:content:clean']);
});
gulp.task('test:content:watch', gulp.series('test:content:clean', () => {
return gulp.watch(['common/script/content/**', 'test/**'], gulp.series('test:content:clean', done => done()));
}));
gulp.task('test:content:safe', ['test:prepare:build'], (cb) => {
gulp.task('test:content:safe', gulp.series('test:prepare:build', (cb) => {
let runner = exec(
testBin(CONTENT_TEST_COMMAND),
CONTENT_OPTIONS,
(err, stdout, stderr) => {
(err, stdout) => { // eslint-disable-line handle-callback-err
testResults.push({
suite: 'Content Specs\t',
pass: testCount(stdout, /(\d+) passing/),
@@ -183,105 +163,12 @@ gulp.task('test:content:safe', ['test:prepare:build'], (cb) => {
}
);
pipe(runner);
});
gulp.task('test:karma', ['test:prepare:build'], (cb) => {
let runner = exec(
testBin(KARMA_TEST_COMMAND),
(err, stdout) => {
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
});
gulp.task('test:karma:watch', ['test:prepare:build'], (cb) => {
let runner = exec(
testBin(`${KARMA_TEST_COMMAND}:watch`),
(err, stdout) => {
cb(err);
}
);
pipe(runner);
});
gulp.task('test:karma:safe', ['test:prepare:build'], (cb) => {
let runner = exec(
testBin(KARMA_TEST_COMMAND),
(err, stdout) => {
testResults.push({
suite: 'Karma Specs\t',
pass: testCount(stdout, /(\d+) tests? completed/),
fail: testCount(stdout, /(\d+) tests? failed/),
pend: testCount(stdout, /(\d+) tests? skipped/),
});
cb();
}
);
pipe(runner);
});
gulp.task('test:e2e', ['test:prepare', 'test:prepare:server'], (cb) => {
let support = [
'Xvfb :99 -screen 0 1024x768x24 -extension RANDR',
testBin('npm run test:e2e:webdriver', 'DISPLAY=:99'),
].map(exec);
support.push(server);
Bluebird.all([
awaitPort(TEST_SERVER_PORT),
awaitPort(4444),
]).then(() => {
let runner = exec(
'npm run test:e2e',
(err, stdout, stderr) => {
support.forEach(kill);
if (err) {
process.exit(1);
}
cb();
}
);
pipe(runner);
});
});
gulp.task('test:e2e:safe', ['test:prepare', 'test:prepare:server'], (cb) => {
let support = [
'Xvfb :99 -screen 0 1024x768x24 -extension RANDR',
'npm run test:e2e:webdriver',
].map(exec);
Bluebird.all([
awaitPort(TEST_SERVER_PORT),
awaitPort(4444),
]).then(() => {
let runner = exec(
'npm run test:e2e',
(err, stdout, stderr) => {
let match = stdout.match(/(\d+) tests?.*(\d) failures?/);
testResults.push({
suite: 'End-to-End Specs\t',
pass: testCount(stdout, /(\d+) passing/),
fail: testCount(stdout, /(\d+) failing/),
pend: testCount(stdout, /(\d+) pending/),
});
support.forEach(kill);
cb();
}
);
pipe(runner);
});
});
}));
gulp.task('test:api-v3:unit', (done) => {
let runner = exec(
testBin('node_modules/.bin/istanbul cover --dir coverage/api-v3-unit --report lcovonly node_modules/mocha/bin/_mocha -- test/api/v3/unit --recursive --require ./test/helpers/start-server'),
(err, stdout, stderr) => {
(err) => {
if (err) {
process.exit(1);
}
@@ -293,14 +180,14 @@ gulp.task('test:api-v3:unit', (done) => {
});
gulp.task('test:api-v3:unit:watch', () => {
gulp.watch(['website/server/libs/*', 'test/api/v3/unit/**/*', 'website/server/controllers/**/*'], ['test:api-v3:unit']);
return gulp.watch(['website/server/libs/*', 'test/api/v3/unit/**/*', 'website/server/controllers/**/*'], gulp.series('test:api-v3:unit', done => done()));
});
gulp.task('test:api-v3:integration', (done) => {
let runner = exec(
testBin('node_modules/.bin/istanbul cover --dir coverage/api-v3-integration --report lcovonly node_modules/mocha/bin/_mocha -- test/api/v3/integration --recursive --require ./test/helpers/start-server'),
{maxBuffer: 500 * 1024},
(err, stdout, stderr) => {
(err) => {
if (err) {
process.exit(1);
}
@@ -312,36 +199,33 @@ gulp.task('test:api-v3:integration', (done) => {
});
gulp.task('test:api-v3:integration:watch', () => {
gulp.watch(['website/server/controllers/api-v3/**/*', 'common/script/ops/*', 'website/server/libs/*.js',
'test/api/v3/integration/**/*'], ['test:api-v3:integration']);
return gulp.watch([
'website/server/controllers/api-v3/**/*', 'common/script/ops/*', 'website/server/libs/*.js',
'test/api/v3/integration/**/*',
], gulp.series('test:api-v3:integration', done => done()));
});
gulp.task('test:api-v3:integration:separate-server', (done) => {
let runner = exec(
testBin('mocha test/api/v3/integration --recursive --require ./test/helpers/start-server', 'LOAD_SERVER=0'),
{maxBuffer: 500 * 1024},
(err, stdout, stderr) => done(err)
(err) => done(err)
);
pipe(runner);
});
gulp.task('test', (done) => {
runSequence(
'test:sanity',
'test:content',
'test:common',
'test:karma',
'test:api-v3:unit',
'test:api-v3:integration',
done
);
});
gulp.task('test', gulp.series(
'test:sanity',
'test:content',
'test:common',
'test:api-v3:unit',
'test:api-v3:integration',
done => done()
));
gulp.task('test:api-v3', (done) => {
runSequence(
'test:api-v3:unit',
'test:api-v3:integration',
done
);
});
gulp.task('test:api-v3', gulp.series(
'test:api-v3:unit',
'test:api-v3:integration',
done => done()
));

View File

@@ -1,6 +1,5 @@
import fs from 'fs';
import _ from 'lodash';
import nconf from 'nconf';
import gulp from 'gulp';
import { postToSlack, conf } from './taskHelper';
@@ -12,18 +11,89 @@ const SLACK_CONFIG = {
const LOCALES = './website/common/locales/';
const ENGLISH_LOCALE = `${LOCALES}en/`;
function getArrayOfLanguages () {
let languages = fs.readdirSync(LOCALES);
languages.shift(); // Remove README.md from array of languages
return languages;
}
const ALL_LANGUAGES = getArrayOfLanguages();
function stripOutNonJsonFiles (collection) {
let onlyJson = _.filter(collection, (file) => {
return file.match(/[a-zA-Z]*\.json/);
});
return onlyJson;
}
function eachTranslationFile (languages, cb) {
let jsonFiles = stripOutNonJsonFiles(fs.readdirSync(ENGLISH_LOCALE));
_.each(languages, (lang) => {
_.each(jsonFiles, (filename) => {
let parsedTranslationFile;
try {
const translationFile = fs.readFileSync(`${LOCALES}${lang}/${filename}`);
parsedTranslationFile = JSON.parse(translationFile);
} catch (err) {
return cb(err);
}
let englishFile = fs.readFileSync(ENGLISH_LOCALE + filename);
let parsedEnglishFile = JSON.parse(englishFile);
cb(null, lang, filename, parsedEnglishFile, parsedTranslationFile);
});
});
}
function eachTranslationString (languages, cb) {
eachTranslationFile(languages, (error, language, filename, englishJSON, translationJSON) => {
if (error) return;
_.each(englishJSON, (string, key) => {
const translationString = translationJSON[key];
cb(language, filename, key, string, translationString);
});
});
}
function formatMessageForPosting (msg, items) {
let body = `*Warning:* ${msg}`;
body += '\n\n```\n';
body += items.join('\n');
body += '\n```';
return body;
}
function getStringsWith (json, interpolationRegex) {
let strings = {};
_.each(json, (fileName) => {
const rawFile = fs.readFileSync(ENGLISH_LOCALE + fileName);
const parsedJson = JSON.parse(rawFile);
strings[fileName] = {};
_.each(parsedJson, (value, key) => {
const match = value.match(interpolationRegex);
if (match) strings[fileName][key] = match;
});
});
return strings;
}
const malformedStringExceptions = {
messageDropFood: true,
armoireFood: true,
feedPet: true,
};
gulp.task('transifex', ['transifex:missingFiles', 'transifex:missingStrings', 'transifex:malformedStrings']);
gulp.task('transifex:missingFiles', () => {
gulp.task('transifex:missingFiles', (done) => {
let missingStrings = [];
eachTranslationFile(ALL_LANGUAGES, (error) => {
@@ -37,10 +107,10 @@ gulp.task('transifex:missingFiles', () => {
let formattedMessage = formatMessageForPosting(message, missingStrings);
postToSlack(formattedMessage, SLACK_CONFIG);
}
done();
});
gulp.task('transifex:missingStrings', () => {
gulp.task('transifex:missingStrings', (done) => {
let missingStrings = [];
eachTranslationString(ALL_LANGUAGES, (language, filename, key, englishString, translationString) => {
@@ -55,10 +125,10 @@ gulp.task('transifex:missingStrings', () => {
let formattedMessage = formatMessageForPosting(message, missingStrings);
postToSlack(formattedMessage, SLACK_CONFIG);
}
done();
});
gulp.task('transifex:malformedStrings', () => {
gulp.task('transifex:malformedStrings', (done) => {
let jsonFiles = stripOutNonJsonFiles(fs.readdirSync(ENGLISH_LOCALE));
let interpolationRegex = /<%= [a-zA-Z]* %>/g;
let stringsToLookFor = getStringsWith(jsonFiles, interpolationRegex);
@@ -66,25 +136,23 @@ gulp.task('transifex:malformedStrings', () => {
let stringsWithMalformedInterpolations = [];
let stringsWithIncorrectNumberOfInterpolations = [];
let count = 0;
_.each(ALL_LANGUAGES, function (lang) {
_.each(stringsToLookFor, function (strings, file) {
let translationFile = fs.readFileSync(LOCALES + lang + '/' + file);
_.each(ALL_LANGUAGES, (lang) => {
_.each(stringsToLookFor, (strings, filename) => {
let translationFile = fs.readFileSync(`${LOCALES}${lang}/${filename}`);
let parsedTranslationFile = JSON.parse(translationFile);
_.each(strings, function (value, key) {
_.each(strings, (value, key) => { // eslint-disable-line max-nested-callbacks
let translationString = parsedTranslationFile[key];
if (!translationString) return;
let englishOccurences = stringsToLookFor[file][key];
let englishOccurences = stringsToLookFor[filename][key];
let translationOccurences = translationString.match(interpolationRegex);
if (!translationOccurences) {
let malformedString = `${lang} - ${file} - ${key} - ${translationString}`;
let malformedString = `${lang} - ${filename} - ${key} - ${translationString}`;
stringsWithMalformedInterpolations.push(malformedString);
} else if (englishOccurences.length !== translationOccurences.length && !malformedStringExceptions[key]) {
let missingInterpolationString = `${lang} - ${file} - ${key} - ${translationString}`;
let missingInterpolationString = `${lang} - ${filename} - ${key} - ${translationString}`;
stringsWithIncorrectNumberOfInterpolations.push(missingInterpolationString);
}
});
@@ -102,75 +170,11 @@ gulp.task('transifex:malformedStrings', () => {
let formattedMessage = formatMessageForPosting(message, stringsWithIncorrectNumberOfInterpolations);
postToSlack(formattedMessage, SLACK_CONFIG);
}
done();
});
function getArrayOfLanguages () {
let languages = fs.readdirSync(LOCALES);
languages.shift(); // Remove README.md from array of languages
return languages;
}
function eachTranslationFile (languages, cb) {
let jsonFiles = stripOutNonJsonFiles(fs.readdirSync(ENGLISH_LOCALE));
_.each(languages, (lang) => {
_.each(jsonFiles, (filename) => {
try {
var translationFile = fs.readFileSync(LOCALES + lang + '/' + filename);
var parsedTranslationFile = JSON.parse(translationFile);
} catch (err) {
return cb(err);
}
let englishFile = fs.readFileSync(ENGLISH_LOCALE + filename);
let parsedEnglishFile = JSON.parse(englishFile);
cb(null, lang, filename, parsedEnglishFile, parsedTranslationFile);
});
});
}
function eachTranslationString (languages, cb) {
eachTranslationFile(languages, (error, language, filename, englishJSON, translationJSON) => {
if (error) return;
_.each(englishJSON, (string, key) => {
var translationString = translationJSON[key];
cb(language, filename, key, string, translationString);
});
});
}
function formatMessageForPosting (msg, items) {
let body = `*Warning:* ${msg}`;
body += '\n\n```\n';
body += items.join('\n');
body += '\n```';
return body;
}
function getStringsWith (json, interpolationRegex) {
var strings = {};
_.each(json, function (file_name) {
var raw_file = fs.readFileSync(ENGLISH_LOCALE + file_name);
var parsed_json = JSON.parse(raw_file);
strings[file_name] = {};
_.each(parsed_json, function (value, key) {
var match = value.match(interpolationRegex);
if (match) strings[file_name][key] = match;
});
});
return strings;
}
function stripOutNonJsonFiles (collection) {
let onlyJson = _.filter(collection, (file) => {
return file.match(/[a-zA-Z]*\.json/);
});
return onlyJson;
}
gulp.task(
'transifex',
gulp.series('transifex:missingFiles', 'transifex:missingStrings', 'transifex:malformedStrings'),
(done) => done()
);

View File

@@ -12,7 +12,7 @@ import { resolve } from 'path';
* Get access to configruable values
*/
nconf.argv().env().file({ file: 'config.json' });
export var conf = nconf;
export const conf = nconf;
/*
* Kill a child process and any sub-children that process may have spawned.
@@ -26,11 +26,12 @@ export function kill (proc) {
pids.forEach(kill); return;
}
try {
exec(/^win/.test(process.platform)
? `taskkill /PID ${pid} /T /F`
: `kill -9 ${pid}`);
exec(/^win/.test(process.platform) ?
`taskkill /PID ${pid} /T /F` :
`kill -9 ${pid}`);
} catch (e) {
console.log(e); // eslint-disable-line no-console
}
catch (e) { console.log(e); }
});
};
@@ -44,21 +45,25 @@ export function kill (proc) {
* before failing.
*/
export function awaitPort (port, max = 60) {
return new Bluebird((reject, resolve) => {
let socket, timeout, interval;
return new Bluebird((rej, res) => {
let socket;
let timeout;
let interval;
timeout = setTimeout(() => {
clearInterval(interval);
reject(`Timed out after ${max} seconds`);
rej(`Timed out after ${max} seconds`);
}, max * 1000);
interval = setInterval(() => {
socket = net.connect({port: port}, () => {
socket = net.connect({port}, () => {
clearInterval(interval);
clearTimeout(timeout);
socket.destroy();
resolve();
}).on('error', () => { socket.destroy; });
res();
}).on('error', () => {
socket.destroy();
});
}, 1000);
});
}
@@ -67,8 +72,12 @@ export function awaitPort (port, max = 60) {
* Pipe the child's stdin and stderr to the parent process.
*/
export function pipe (child) {
child.stdout.on('data', (data) => { process.stdout.write(data); });
child.stderr.on('data', (data) => { process.stderr.write(data); });
child.stdout.on('data', (data) => {
process.stdout.write(data);
});
child.stderr.on('data', (data) => {
process.stderr.write(data);
});
}
/*
@@ -78,8 +87,8 @@ export function postToSlack (msg, config = {}) {
let slackUrl = nconf.get('SLACK_URL');
if (!slackUrl) {
console.error('No slack post url specified. Your message was:');
console.log(msg);
console.error('No slack post url specified. Your message was:'); // eslint-disable-line no-console
console.log(msg); // eslint-disable-line no-console
return;
}
@@ -89,15 +98,15 @@ export function postToSlack (msg, config = {}) {
channel: `#${config.channel || '#general'}`,
username: config.username || 'gulp task',
text: msg,
icon_emoji: `:${config.emoji || 'gulp'}:`,
icon_emoji: `:${config.emoji || 'gulp'}:`, // eslint-disable-line camelcase
})
.end((err, res) => {
if (err) console.error('Unable to post to slack', err);
.end((err) => {
if (err) console.error('Unable to post to slack', err); // eslint-disable-line no-console
});
}
export function runMochaTests (files, server, cb) {
require('../test/helpers/globals.helper');
require('../test/helpers/globals.helper'); // eslint-disable-line global-require
let mocha = new Mocha({reporter: 'spec'});
let tests = glob(files);
@@ -108,7 +117,7 @@ export function runMochaTests (files, server, cb) {
});
mocha.run((numberOfFailures) => {
if (!process.env.RUN_INTEGRATION_TEST_FOREVER) {
if (!process.env.RUN_INTEGRATION_TEST_FOREVER) { // eslint-disable-line no-process-env
if (server) kill(server);
process.exit(numberOfFailures);
}

View File

@@ -8,13 +8,12 @@
require('babel-register');
if (process.env.NODE_ENV === 'production') {
require('./gulp/gulp-apidoc');
require('./gulp/gulp-newstuff');
require('./gulp/gulp-build');
require('./gulp/gulp-babelify');
require('./gulp/gulp-bootstrap');
const gulp = require('gulp');
if (process.env.NODE_ENV === 'production') { // eslint-disable-line no-process-env
require('./gulp/gulp-apidoc'); // eslint-disable-line global-require
require('./gulp/gulp-build'); // eslint-disable-line global-require
} else {
require('glob').sync('./gulp/gulp-*').forEach(require);
require('gulp').task('default', ['test']);
require('glob').sync('./gulp/gulp-*').forEach(require); // eslint-disable-line global-require
require('gulp').task('default', gulp.series('test')); // eslint-disable-line global-require
}

7
migrations/.eslintrc Normal file
View File

@@ -0,0 +1,7 @@
{
"root": false,
"rules": {
"no-console": 0,
"no-use-before-define": ["error", { "functions": false }]
}
}

View File

@@ -1,5 +0,0 @@
db.users.update(
{ lastCron: { $exists: false} },
{ $set: { lastCron: +new Date } },
{ multi: true }
);

View File

@@ -1,15 +0,0 @@
db.users.find({ completedIds: { $exists: true } }).forEach(function(user) {
var newTodoIds = user.todoIds;
user.completedIds.forEach(function(value) {
if (newTodoIds.indexOf(value) === -1) {
newTodoIds.push(value)
}
});
db.users.update(
{ _id: user._id },
{
$set: { todoIds: newTodoIds },
$unset: { completedIds: 1 }
}
);
});

View File

@@ -1,5 +0,0 @@
db.users.update(
{preferences:{$exists:false}},
{$set:{preferences:{gender: 'm', armorSet: 'v1'}}},
{multi:true}
)

View File

@@ -1,20 +0,0 @@
// %mongo server:27017/dbname underscore.js my_commands.js
// %mongo server:27017/dbname underscore.js --shell
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var habits = 0,
dailies = 0,
todos = 0,
registered = { $or: [ { 'auth.local': { $exists: true } }, { 'auth.facebook': { $exists: true} } ]};
db.user.find(registered).forEach(function(u){
//TODO this isn't working??
habits += _.where(u.tasks, {type:'habit'}).length;
dailies += _.where(u.tasks, {type:'daily'}).length;
todos += _.where(u.tasks, {type:'todo'}).length;
})

View File

@@ -1,102 +0,0 @@
// %mongo server:27017/dbname underscore.js my_commands.js
// %mongo server:27017/dbname underscore.js --shell
//db.users.find({'auth.facebook.email': 'tylerrenelle@gmail.com'}).forEach(function(user){
db.users.find().forEach(function(user){
if (!user._id) {
print("User has null _id");
return; // need to figure out how to delete these buggers if they don't have an id to delete from
}
if (!!user.idLists) {
print("User " + user._id + " has already been migrated")
return
}
if (user._id.indexOf("$") === 0) {
print("User id starts with $ (" + user._id + ")")
return;
}
// even though we're clobbering user later, sometimes these are undefined and crash the script
// this saves us some ternaries
user.stats = user.stats || {};
user.items = user.items || {};
user.preferences = user.preferences || {};
user.notifications = user.notifications || {};
user.flags = user.flags || {};
user.habitIds = user.habitIds || [];
user.dailyIds = user.dailyIds || [];
user.todoIds = user.todoIds || [];
user.rewardIds = user.rewardIds|| [];
_.each(user.tasks, function(task, key){
if (!task.type) {
delete user.tasks[key];
// idList will take care of itself on page-load
return
}
if (key == '$spec') {
print("$spec was found: " + user._id);
return
}
if (key.indexOf("$_") === 0) {
var newKey = key.replace("$_", ''),
index = user[task.type + "Ids"].indexOf(key)
user[task.type + "Ids"][index] = newKey;
task.id = newKey
user.tasks[newKey] = task
// TODO make sure this is ok, that we're not deleting the original
// Otherwise use lodash.cloneDeep
delete user.tasks[key]
}
});
// New user schema has public and private paths, so we can setup proper access control with racer
// Note 'public' and 'private' are reserved words
var newUser = {
auth: user.auth, // we need this top-level due to derby-auth
apiToken: user.preferences.api_token || null, // set on update, we need derby.uuid()
preferences: {
armorSet: user.preferences.armorSet || 'v1',
gender: user.preferences.gender || 'm'
},
balance: user.balance || 2,
lastCron: user.lastCron || +new Date,
history: user.history || [],
stats: {
gp: user.stats.money || 0,
hp: user.stats.hp || 50,
exp: user.stats.exp || 0,
lvl: user.stats.lvl || 1
},
items: {
armor: user.items.armor || 0,
weapon: user.items.weapon || 0
},
tasks: user.tasks || {},
idLists: {
habit: user.habitIds || [],
daily: user.dailyIds || [],
todo: user.todoIds || [],
reward: user.rewardIds || []
},
flags: {
partyEnabled: false,
itemsEnabled: user.items.itemsEnabled || false,
kickstarter: user.notifications.kickstarter || 'show',
ads: user.flags.ads || null // null because it's set on registration
},
party: {
current: null,
invitation: null
}
};
try {
db.users.update({_id:user._id}, newUser);
} catch(e) {
print(e);
}
})

View File

@@ -1,19 +0,0 @@
// move idList back to root-level, is what's causing the sort bug - see https://github.com/codeparty/racer/pull/73
// We could just delete user.idLists, since it's re-created on refresh. However, users's first refresh will scare them
// since everything will dissappear - second refresh will bring everything back.
db.users.find().forEach(function(user){
if (!user.idLists) return;
db.users.update(
{_id:user._id},
{
$set:{
'habitIds':user.idLists.habit,
'dailyIds':user.idLists.daily,
'todoIds':user.idLists.todo,
'rewardIds':user.idLists.reward
}
//$unset:{idLists:true} // run this after the code has been pushed
}
)
})

View File

@@ -1,20 +0,0 @@
db.users.update(
{items:{$exists:0}},
{$set:{items:{weapon: 0, armor: 0, head: 0, shield: 0 }}},
{multi:true}
);
db.users.find().forEach(function(user){
var updates = {
// I'm not racist, these were just the defaults before ;)
'preferences.skin': 'white',
'preferences.hair': 'blond',
'items.head': user.items.armor,
'items.shield': user.items.armor,
}
db.users.update({_id:user._id}, {$set:updates});
})

View File

@@ -1,39 +0,0 @@
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130307_normalize_algo_values.js
/**
* Make sure people aren't overflowing their exp with the new system
*/
db.users.find().forEach(function(user){
function oldTnl(level) {
return (Math.pow(level,2)*10)+(level*10)+80
}
function newTnl(level) {
var value = 0;
if (level >= 100) {
value = 0
} else {
value = Math.round(((Math.pow(level,2)*0.25)+(10 * level) + 139.75)/10)*10; // round to nearest 10
}
return value
}
var newTnl = newTnl(user.stats.lvl);
if (user.stats.exp > newTnl) {
var percent = user.stats.exp / oldTnl(user.stats.lvl);
percent = (percent>1) ? 1 : percent;
user.stats.exp = newTnl * percent;
try {
db.users.update(
{_id:user._id},
{$set: {'stats.exp': user.stats.exp}},
{multi:true}
);
} catch(e) {
print(e);
}
}
})

View File

@@ -1,47 +0,0 @@
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130307_normalize_algo_values.js
/**
* Users were experiencing a lot of extreme Exp multiplication (https://github.com/lefnire/habitrpg/issues/594).
* This sets things straight, and in preparation for another algorithm overhaul
*/
db.users.find().forEach(function(user){
if (user.stats.exp >= 3580) {
user.stats.exp = 0;
}
if (user.stats.lvl > 100) {
user.stats.lvl = 100;
}
_.each(user.tasks, function(task, key){
// remove corrupt tasks
if (!task) {
delete user.tasks[key];
return;
}
// Fix busted values
if (task.value > 21.27) {
task.value = 21.27;
}
else if (task.value < -47.27) {
task.value = -47.27;
}
});
try {
db.users.update(
{_id:user._id},
{$set:
{
'stats.lvl': user.stats.lvl,
'stats.exp': user.stats.exp,
'tasks' : user.tasks
}
},
{multi:true}
);
} catch(e) {
print(e);
}
})

View File

@@ -1,28 +0,0 @@
/**
* Remove duff histories for dailies
*/
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130307_remove_duff_histories.js
db.users.find().forEach(function(user){
_.each(user.tasks, function(task, key){
if (task.type === "daily") {
// remove busted history entries
task.history = _.filter(task.history, function(h){return !!h.value})
}
});
try {
db.users.update(
{_id:user._id},
{$set:
{
'tasks' : user.tasks
}
},
{multi:true}
);
} catch(e) {
print(e);
}
})

View File

@@ -1,98 +0,0 @@
/**
* Migrate old pets to new system
*/
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130326_migrate_pets.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mapping = {
bearcub: {name:'BearCub', modifier: 'Base'},
cactus: {name:'Cactus', modifier:'Base'},
dragon: {name:'Dragon', modifier:'Base'},
flyingpig: {name:'FlyingPig', modifier:'Base'},
fox: {name:'Fox', modifier:'Base'},
lioncub: {name:'LionCub', modifier:'Base'},
pandacub: {name:'PandaCub', modifier:'Base'},
tigercub: {name:'TigerCub', modifier:'Base'},
wolfBorder: {name:'Wolf', modifier:'Base'},
wolfDesert: {name:'Wolf', modifier:'Desert'},
wolfGolden: {name:'Wolf', modifier:'Golden'},
wolfRed: {name:'Wolf', modifier:'Red'},
wolfShade: {name:'Wolf', modifier:'Shade'},
wolfSkeleton: {name:'Wolf', modifier:'Skeleton'},
wolfVeteran: {name:'Wolf', modifier:'Veteran'},
wolfWhite: {name:'Wolf', modifier:'White'},
wolfZombie: {name:'Wolf', modifier:'Zombie'}
}
/**
== Old Style ==
pet: Object
icon: "Pet-Wolf-White.png"
index: 14
name: "wolfWhite"
text: "White Wolf"
value: 3
pets: Object
bearcub: true
cactus: true
== New Style ==
currentPet: Object
modifier: "Red"
name: "Wolf"
notes: "Find some Hatching Powder to sprinkle on this egg, and one day it will hatch into a loyal pet."
str: "Wolf-Red"
text: "Wolf"
value: 3
pets: Array
0: "PandaCub-Base"
1: "Wolf-Base"
*/
db.users.find().forEach(function(user){
if (!user.items || (!user.items.pets && !user.items.pet)) return;
// migrate items.pet to items.currentPet
if (!!user.items.pet) {
var mapped = mapping[user.items.pet.name];
delete user.items.pet;
user.items.currentPet = {
modifier: mapped.modifier,
name: mapped.name,
str: mapped.name + "-" + mapped.modifier,
text: '' // FIXME?
}
}
// migrate items.pets
if (!!user.items.pets) {
var newPets = [];
_.each(user.items.pets, function(val, key){
if (_.isNumber(key)) {
newPets.push(val)
//FIXME why is this happening? seems the user gets migrated already...
//throw "Error: User appears already migrated, this shouldn't be happening!"
} else {
newPets.push(mapping[key].name + "-" + mapping[key].modifier);
}
});
user.items.pets = newPets;
}
try {
db.users.update(
{_id:user._id},
{$set:
{ 'items' : user.items }
}
);
} catch(e) {
print(e);
}
})

View File

@@ -1,110 +0,0 @@
/**
* Applies backer tokens & items (this file will be updated periodically
*/
// mongo habitrpg ./node_modules/underscore/underscore.js migrations/20130327_apply_tokens.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mapping = [
{
tier: 1,
tokens: 0,
users: []
},
{
tier: 5,
tokens: 20,
users: []
},
{
tier: 10,
tokens: 50,
users: []
},
{
tier: 15,
tokens: 100,
users: []
},
{
tier: 30,
tokens: 150,
users: []
},
{
tier: 45,
tokens: 170,
users: []
},
{
tier: 60,
tokens: 200,
users: []
},
{
tier: 70,
tokens: 240,
users: []
},
{
tier: 80,
tokens: 240,
users: []
},
{
tier: 90,
tokens: 280,
users: []
},
{
tier: 300,
tokens: 500,
users: []
},
{
tier: 800,
tokens: 500,
users: []
}
];
db.users.find().forEach(function(user){
if (!user._id) return;
var possibleUserIds = [user._id];
if (!!user.local) {
if (!!user.local.username) possibleUserIds.push(user.local.username);
if (!!user.local.email) possibleUserIds.push(user.local.email);
}
_.each(mapping, function(tier){
var userInTier = !_.isEmpty(_.intersection(tier.users, possibleUserIds));
if (userInTier) {
var tokenInc = 0,
backer = user.backer || {};
if (!backer.tokensApplied) {
tokenInc = tier.tokens;
backer.tokensApplied = true;
}
backer.tier = tier.tier;
try {
db.users.update(
{_id:user._id},
{
$set: { backer: backer, 'flags.ads': 'hide' },
$inc: { balance: (tokenInc/4) }
}
);
} catch(e) {
print(e);
}
}
})
})

View File

@@ -1,22 +0,0 @@
/**
* For users who already have max gear, they earned the achievement
*/
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130503_max_gear_achievement.js
db.users.find().forEach(function(user){
var items = user.items;
if (!items) { return; }
if ( parseInt(items.armor) == 5 &&
parseInt(items.head) == 5 &&
parseInt(items.shield) == 5 &&
parseInt(items.weapon) == 6) {
try {
db.users.update(
{_id:user._id},
{$set: {'achievements.ultimateGear':true}}
);
} catch(e) {
print(e);
}
}
})

View File

@@ -1,12 +0,0 @@
/**
* users getting broken tags when they try to edit the first blank tag on accident
*
* mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130507_fix_broken_tags.js
*/
db.users.find().forEach(function(user){
if(!_.isArray(user.tags)) {
db.users.update({_id:user._id}, {$set:{tags:[]}});
}
})

View File

@@ -1 +0,0 @@
db.users.update({'backer.tier':{$gte:80}}, {$push:{'items.pets':'Wolf-Cerberus'}}, {multi:true});

View File

@@ -1,41 +0,0 @@
/**
* 745612d and fedc5b6 added a db-subscription optimization to the initial subscribe.
* However, it requires the user only be to one party. That should be the case anyway, but user.party.current was letting
* us look past the fact that a user was erroneously subscribed to multiple parties. This fixes
*
* mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130508_fix_duff_party_subscriptions.js
*/
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
// since our primary subscription will first hit parties now, we *definitely* need an index there
db.parties.ensureIndex( { 'members': 1}, {background: true} );
db.parties.find().forEach(function(party){
if(!party.members) {
return db.parties.remove({_id:party._id});
}
// Find all members
db.users.find( {_id: {$in:party.members} }, {_id:1,party:1} ).forEach(function(user){
// user somehow is subscribed to this party in the background, but they're it's not their primary party
if (user.party && user.party.current !== party._id) {
var i = party.members.indexOf(user._id);
party.members.splice(i, 1);
}
// if after we remove the user, the party is empty - delete this party
if (_.isEmpty(party.members)) {
db.parties.remove({_id:party._id});
// else just set it
} else {
db.parties.update({_id:party._id}, {$set:{members:party.members}});
}
})
})

View File

@@ -1,48 +0,0 @@
/**
* In adding the Guilds feature (which supports the Challenges feature), we are consolidating parties and guilds
* into one collection: groups, with group.type either 'party' or 'guild'. We are also creating the 'habitrpg' guild,
* which everyone is auto-subscribed to, and moving tavern chat into that guild
*
* mongo habitrpg ./node_modules/lodash/lodash.js ./migrations/20130518_setup_groups.js
*/
/**
* TODO
* 1) rename collection parties => groups
* 2) add group.type = 'party' for each current group
* 3) create habitrpg group, .type='guild'
* 4) move tavern.chat.chat into habitrpg guild
* 5) subscribe everyone to habitrpg (be sure to set that for default user too!)
*/
db.parties.renameCollection('groups',true);
//db.parties.dropCollection(); // doesn't seem to do this step during rename...
//db.parties.ensureIndex( { 'members': 1, 'background': 1} );
db.groups.update({}, {$set:{type:'party'}}, {multi:true});
//migrate invitation mechanisms
db.users.update(
{},
{
$remove:{party:1},
$set:{invitations:{party:null,guilds:[]}}
},
{multi:1}
);
tavern = db.tavern.findOne();
db.tavern.drop();
//TODO make as a callback of previous, or make sure group.type is still 'guild' for habitrpg in the end
db.groups.insert({
_id: "habitrpg",
leader: '9',
type: 'guild',
name: "HabitRPG",
chat: tavern.messages,
info: {
blurb: '',
websites: []
}
});

View File

@@ -1,31 +0,0 @@
//mongo habitrpg ./node_modules/lodash/lodash.js migrations/20130602_survey_rewards.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var members = []
members = _.uniq(members);
var query = {
_id: {$exists:1},
$or:[
{_id: {$in: members}},
//{'profile.name': {$in: members}},
{'auth.facebook.name': {$in: members}},
{'auth.local.username': {$in: members}},
{'auth.local.email': {$in: members}}
]
};
print(db.users.count(query));
db.users.update(query,
{
$set: { 'achievements.helpedHabit': true },
$inc: { balance: 2.5 }
},
{multi:true}
)

View File

@@ -1,9 +0,0 @@
//mongo habitrpg migrations/20130612_survey_rewards_individual.js
var query = {_id: ""};
db.users.update(query,
{
$set: { 'achievements.helpedHabit': true },
$inc: { balance: 2.5 }
})

View File

@@ -1,4 +0,0 @@
db.users.ensureIndex( { _id: 1, apiToken: 1 }, {background: true} )
db.groups.ensureIndex( { members: 1 }, {background: true} )
db.groups.ensureIndex( { type: 1 }, {background: true} )
db.groups.ensureIndex( { type: 1, privacy: 1 }, {background: true} )

View File

@@ -1,16 +0,0 @@
//mongo habitrpg ./node_modules/lodash/lodash.js migrations/20130908_cleanup_corrupt_tags.js
// Racer was notorious for adding duplicates, randomly deleting documents, etc. Once we pull the plug on old.habit,
// run this migration to cleanup all the corruption
db.users.find().forEach(function(user){
user.tags = _.filter(user.tags, (function(t) {
return !!t ? t.id : false;
}));
try {
db.users.update({_id:user._id}, {$set:{tags:user.tags}});
} catch(e) {
print(e);
}
})

View File

@@ -1,57 +0,0 @@
//mongo habitrpg ./node_modules/lodash/lodash.js migrations/20130908_cleanup_derby_corruption.js
// Racer was notorious for adding duplicates, randomly deleting documents, etc. Once we pull the plug on old.habit,
// run this migration to cleanup all the corruption
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
db.users.find().forEach(function(user){
// remove corrupt tasks, which will either be null-value or no id
user.tasks = _.reduce(user.tasks, function(m,task,k) {
if (!task || !task.id) return m;
if (isNaN(+task.value)) task.value = 0;
m[k] = task;
return m;
}, {});
// fix NaN stats
_.each(user.stats, function(v,k) {
if (!v || isNaN(+v)) user.stats[k] = 0;
return true;
});
// remove duplicates, restore ghost tasks
['habit', 'daily', 'todo', 'reward'].forEach(function(type) {
var idList = user[type + "Ids"];
var taskIds = _.pluck(_.where(user.tasks, {type: type}), 'id');
var union = _.union(idList, taskIds);
var preened = _.filter(union, function(id) {
return id && _.contains(taskIds, id);
});
if (!_.isEqual(idList, preened)) {
user[type + "Ids"] = preened;
}
});
// temporarily remove broken eggs. we'll need to write a migration script to grant gems for and remove these instead
if (user.items && user.items.eggs) {
user.items.eggs = _.filter(user.items.eggs,function(egg){
if (_.isString(egg)) {
user.balance += 0.75; // give them 3 gems for each broken egg
} else {
return true;
}
})
}
try {
db.users.update({_id:user._id}, user);
} catch(e) {
print(e);
}
})

View File

@@ -1,5 +0,0 @@
db.users.find().forEach(function(user){
if (!user.purchased) user.purchased = {hair: {}, skin: {}};
user.purchased.ads = user.flags && !!user.flags.ads;
db.users.update({_id:user._id}, {$set:{'purchased': user.purchased, 'flags.newStuff': true}, $unset: {'flags.ads':1}});
});

View File

@@ -1,12 +0,0 @@
// node .migrations/20131022_restore_ads.js
var mongo = require('mongoskin');
var _ = require('lodash');
var dbBackup = mongo.db('localhost:27017/habitrpg?auto_reconnect');
var dbLive = mongo.db('localhost:27017/habitrpg2?auto_reconnect');
var count = 89474;
dbBackup.collection('users').findEach({$or: [{'flags.ads':'show'}, {'flags.ads': null}]}, {batchSize:10}, function(err, item) {
if (err) return console.error({err:err});
if (!item || !item._id) return console.error('blank user');
dbLive.collection('users').update({_id:item._id}, {$set:{'purchased.ads':false}, $unset: {'flags.ads': 1}});
if (--count <= 0) console.log("DONE!");
});

View File

@@ -1,132 +0,0 @@
// mongo habitrpg ./node_modules/lodash/lodash.js ./migrations/20131028_task_subdocs_tags_invites.js
// TODO it might be better we just find() and save() all user objects using mongoose, and rely on our defined pre('save')
// and default values to "migrate" users. This way we can make sure those parts are working properly too
// @see http://stackoverflow.com/questions/14867697/mongoose-full-collection-scan
//Also, what do we think of a Mongoose Migration module? something like https://github.com/madhums/mongoose-migrate
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
db.users.find().forEach(function(user){
// Add invites to groups
// -------------------------
if(user.invitations){
if(user.invitations.party){
db.groups.update({_id: user.invitations.party.id}, {$addToSet:{invites:user._id}});
}
if(user.invitations.guilds){
_.each(user.invitations.guilds, function(guild){
db.groups.update({_id: guild.id}, {$addToSet:{invites:user._id}});
});
}
}
// Cleanup broken tags
// -------------------------
_.each(user.tasks, function(task){
_.each(task.tags, function(val, key){
_.each(user.tags, function(tag){
if(key == tag.id) delete task.tags[key];
});
});
});
// Fix corrupt dates
// -------------------------
user.lastCron = new Date(user.lastCron);
if (user.lastCron == 'Invalid Date') user.lastCron = new Date();
if (user.auth) { // what to do with !auth?
_.defaults(user.auth, {timestamps: {created:undefined, loggedin: undefined}});
_.defaults(user.auth.timestamps, {created: new Date(user.lastCron), loggedin: new Date(user.lastCron)});
}
// Fix missing history
// -------------------------
_.defaults(user, {history:{}});
_.defaults(user.history,{exp:[], todos:[]});
// Add username
// -------------------------
if (!user.profile) user.profile = {name:undefined};
if (_.isEmpty(user.profile.name) && user.auth) {
var fb = user.auth.facebook;
user.profile.name =
(user.auth.local && user.auth.local.username) ||
(fb && (fb.displayName || fb.name || fb.username || (fb.first_name && fb.first_name + ' ' + fb.last_name))) ||
'Anonymous';
}
// Migrate to TaskSchema Sub-Docs!
// -------------------------
if (!user.tasks) {
// So evidentaly users before 02/2013 were ALREADY setup based on habits[], dailys[], etcs... I don't remember our schema
// ever being that way... Anyway, print busted users here (they don't have tasks, but also don't have the right schema)
if (!user.habits || !user.dailys || !user.todos || !user.rewards) {
print(user._id);
}
} else {
_.each(['habit', 'daily', 'todo', 'reward'], function(type) {
// we use _.transform instead of a simple _.where in order to maintain sort-order
user[type + "s"] = _.reduce(user[type + "Ids"], function(m, tid) {
var task = user.tasks[tid],
newTask = {};
if (!task) return m; // remove null tasks
// Cleanup tasks for TaskSchema
newTask._id = newTask.id = task.id;
newTask.text = (_.isString(task.text)) ? task.text : '';
if (_.isString(task.notes)) newTask.notes = task.notes;
newTask.tags = (_.isObject(task.tags)) ? task.tags : {};
newTask.type = (_.isString(task.type)) ? task.type : 'habit';
newTask.value = (_.isNumber(task.value)) ? task.value : 0;
newTask.priority = (_.isString(task.priority)) ? task.priority : '!';
switch (newTask.type) {
case 'habit':
newTask.up = (_.isBoolean(task.up)) ? task.up : true;
newTask.down = (_.isBoolean(task.down)) ? task.down : true;
newTask.history = (_.isArray(task.history)) ? task.history : [];
break;
case 'daily':
newTask.repeat = (_.isObject(task.repeat)) ? task.repeat : {m:1, t:1, w:1, th:1, f:1, s:1, su:1};
newTask.streak = (_.isNumber(task.streak)) ? task.streak : 0;
newTask.completed = (_.isBoolean(task.completed)) ? task.completed : false;
newTask.history = (_.isArray(task.history)) ? task.history : [];
break;
case 'todo':
newTask.completed = (_.isBoolean(task.completed)) ? task.completed : false;
break;
}
m.push(newTask);
return m;
}, []);
delete user[type + 'Ids'];
});
delete user.tasks;
}
try {
db.users.update({_id:user._id}, user);
} catch(e) {
print(e);
}
});
// Remove old groups.*.challenges, they're not compatible with the new system, set member counts
// -------------------------
db.groups.find().forEach(function(group){
db.groups.update({_id:group._id}, {
$set:{memberCount: _.size(group.members)},
$pull:{challenges:1}
})
});
// HabitRPG => Tavern
// -------------------------
db.groups.update({_id:'habitrpg'}, {$set:{name:'Tavern'}});

View File

@@ -1,25 +0,0 @@
// mongo habitrpg ./node_modules/lodash/lodash.js ./migrations/20131028_task_subdocs_tags_invites.js
db.challenges.find().forEach(function(chal){
_.each(chal.habits.concat(chal.dailys).concat(chal.todos).concat(chal.rewards), function(task){
task.id = task.id || task._id;
})
try {
db.challenges.update({_id:chal._id}, chal);
db.groups.update({_id:chal.group}, {$addToSet:{challenges:chal._id}})
} catch(e) {
print(e);
}
});
db.users.find().forEach(function(user){
_.each(user.habits.concat(user.dailys).concat(user.todos).concat(user.rewards), function(task){
task.id = task.id || task._id;
})
try {
db.users.update({_id:user._id}, user);
} catch(e) {
print(e);
}
});

View File

@@ -1,7 +0,0 @@
db.users.find({},{todos:1}).forEach(function(user){
_.each(user.todos, function(task){
if (moment(task.date).toDate() == 'Invalid Date')
task.date = moment().format('MM/DD/YYYY');
})
db.users.update({_id:user._id}, {$set:{todos: user.todos}});
});

View File

@@ -1,60 +0,0 @@
// node .migrations/20131104_restore_lost_task_data.js
/**
* After the great challenges migration, quite a few things got inadvertently dropped from tasks since their
* schemas became more strict. See conversation at https://github.com/HabitRPG/habitrpg/issues/1712 ,
* this restores task tags, streaks, due-dates, values
*/
var mongo = require('mongoskin');
var _ = require('lodash');
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var backupUsers = mongo.db('localhost:27017/habitrpg_old?auto_reconnect').collection('users');
var liveUsers = mongo.db('localhost:27017/habitrpg_new?auto_reconnect').collection('users');
backupUsers.count(function(err, count){
if (err) return console.error(err);
backupUsers.findEach({}, {batchSize:250}, function(err, before){
if (err) return console.error(err);
if (!before) return console.log('!before');
liveUsers.findById(before._id, function(err, after){
if (err) return console.error(err);
if (!after) {
count--;
return console.log(before._id + ' deleted?');
}
if (before._id == '9') console.log('lefnire processed');
_.each(before.tasks, function(tBefore){
var tAfter = _.find(after[tBefore.type+'s'], {id:tBefore.id});
if (!tAfter) return; // task has been deleted since launch
// Restore deleted tags
if (!_.isEmpty(tBefore.tags) && _.isEmpty(tAfter.tags))
tAfter.tags = tBefore.tags;
// Except tags which are no longer available on the updated user
_.each(tAfter.tags, function(v,k){ //value is true, key is tag.id
if (!_.find(after.tags,{id:k})) delete tAfter.tags[k];
})
// Restore deleted streaks
if (+tBefore.streak > tAfter.streak)
tAfter.streak = +tBefore.streak;
if (!!tBefore.date && !tAfter.date)
tAfter.date = tBefore.date;
// Restore deleted values
if (+tBefore.value != 0 && tAfter.value == 0)
tAfter.value = +tBefore.value;
})
after._v++;
liveUsers.update({_id:after._id}, after);
if (--count <= 0) console.log("DONE!");
})
});
});

View File

@@ -1,21 +0,0 @@
function deleteId(h){
delete h._id;
}
db.users.find({},{habits:1,dailys:1,history:1}).forEach(function(user){
if (user.history) {
_.each(['todos','exp'], function(type){
if (user.history[type]) {
_.each(user.history.exp, deleteId);
}
})
} else {
user.history = {exp:[],todos:[]};
}
_.each(['habits', 'dailys'], function(type){
_.each(user[type].history, deleteId);
});
db.users.update({_id:user._id}, {$set:{history: user.history, habits: user.habits, dailys: user.dailys}});
});

View File

@@ -1,18 +0,0 @@
db.users.find({
$or: [
{'backer.admin':{$exists:1}},
{'backer.contributor':{$exists:1}}
]
},{backer:1}).forEach(function(user){
user.contributor = {};
user.contributor.admin = user.backer.admin;
delete user.backer.admin;
// this isnt' the proper storage format, but I'm going to be going through the admin utility manually and setting things properly
if (user.backer.contributor) {
user.contributor.text = user.backer.contributor;
delete user.backer.contributor;
}
db.users.update({_id:user._id}, {$set:{backer:user.backer, contributor:user.contributor}});
});

View File

@@ -1,4 +0,0 @@
// Increase everyone's gems per their contribution level
db.users.find({'contributor.level':{$gt:0}},{contributor:1, balance:1}).forEach(function(user){
db.users.update({_id:user._id}, {$inc: {balance: (user.contributor.level * .5)} });
});

View File

@@ -1,39 +0,0 @@
db.users.find(
{$where: "Array.isArray(this.items.pets) || Array.isArray(this.items.eggs) || Array.isArray(this.items.hatchingPotions)"},
{backer: 1, items:1}
).forEach(function(user){
if (_.isArray(user.items.pets)) {
user.items.pets = _.reduce(user.items.pets, function(m,v){ m[v] = 5; return m;}, {});
}
if (!_.isString(user.items.currentPet)) {
user.items.currentPet = user.items.currentPet ? user.items.currentPet.str : '';
}
if (_.isArray(user.items.eggs)) {
user.items.eggs = _.reduce(user.items.eggs, function(m,v){
if (!m[v.name]) m[v.name] = 0;
m[v.name]++;
return m;
}, {});
}
if (_.isArray(user.items.hatchingPotions)) {
user.items.hatchingPotions = _.reduce(user.items.hatchingPotions, function(m,v){
if (!m[v]) m[v] = 0;
m[v]++;
return m;
}, {});
}
user.items.food = {};
user.items.mounts = {};
user.items.currentMount = '';
if (user.backer && user.backer.tier && user.backer.tier >= 90) {
user.items.mounts['LionCub-Ethereal'] = true;
}
db.users.update({_id:user._id}, {$set:{items:user.items}});
});

View File

@@ -1,15 +0,0 @@
// This migration has already been run in the past. It's vital to fix these users presently, but we need to find
// out why task values are ever getting in as NaN. My guess is API PUT /tasks/:tid routes
db.users.find({},{habits:1,dailys:1,todos:1,rewards:1}).forEach(function(user){
_.each(['habits','dailys','todos','rewards'], function(type){
_.each(user[type], function(task){
task.value = +task.value;
if (_.isNaN(task.value)) {
task.value = 0;
print(user._id);
}
})
})
db.users.update({_id:user._id}, {$set:{habits: user.habits, dailys: user.dailys, todos: user.todos, rewards: user.rewards}});
});

View File

@@ -1,14 +0,0 @@
// Migrate all users websites to the profile blurb field
db.users.find({'profile.websites':{$exists: true}}).forEach(function(user){
db.users.update({_id: user._id}, {
$set: {"profile.blurb": user.profile.blurb + '\n * ' + user.profile.websites.join('\n * ')},
$unset: {'profile.websites': 1}
})
})
db.groups.find({'websites.0':{$exists: true}}).forEach(function(group){
db.groups.update({_id: group._id}, {
$set: {"description": group.description + '\n * ' + group.websites.join('\n * ')},
$unset: {websites: 1}
})
})

View File

@@ -1,10 +0,0 @@
//Add defaults to show gears in all users
db.users.update(
{},
{$set:{
'preferences.showWeapon': true,
'preferences.showShield': true,
'preferences.showArmor': true,
}},
{multi:true}
)

View File

@@ -1,18 +0,0 @@
// TODO figure out why this is happening in the first place
db.users.find({},{habits:1, dailys:1, todos:1, rewards:1}).forEach(function(user){
_.each(user.habits, function(task){
task.type = 'habit';
})
_.each(user.dailys, function(task){
task.type = 'daily';
})
_.each(user.todos, function(task){
task.type = 'todo';
})
_.each(user.rewards, function(task){
task.type = 'reward';
})
db.users.update({_id:user._id}, {$set:{habits: user.habits, dailys: user.dailys, todos: user.todos, rewards: user.rewards}});
});

View File

@@ -1,12 +0,0 @@
// once and for all!
db.users.find({'items.pets':{$exists:1}},{'items.pets':1}).forEach(function(user){
_.reduce(user.items.pets, function(m,v,k){
if (!k.indexOf('undefined')) m.push(k);
return m;
}, []).forEach(function(key){
delete user.items.pets[key];
})
db.users.update({_id:user._id}, { $set:{'items.pets':user.items.pets} });
});

View File

@@ -1,13 +0,0 @@
// Cleanup broken tags
// -------------------------
db.users.find().forEach(function(user){
var tasks = user.habits.concat(user.dailys).concat(user.todos).concat(user.rewards);
_.each(tasks, function(task){
_.each(task.tags, function(value, key){ //value is true, key is tag.id
if (!_.find(user.tags,{id:key})) delete task.tags[key];
});
});
db.users.update({_id:user._id}, user);
});

View File

@@ -1,8 +0,0 @@
//Add default to randomize party members list
db.users.update(
{},
{$set:{
'party.order': 'random',
}},
{multi:true}
)

View File

@@ -1,5 +0,0 @@
db.users.find({'preferences.dayStart':{$exists:1}},{'preferences.dayStart':1}).forEach(function(user){
var dayStart = +user.preferences.dayStart;
dayStart = (_.isNaN(dayStart) || dayStart < 0 || dayStart > 24) ? 0 : dayStart;
db.users.update({_id:user._id}, {$set:{'preferences.dayStart':dayStart}});
});

View File

@@ -1 +0,0 @@
db.users.update({},{$set:{'items.pets.Turkey-Base':5, 'flags.newStuff':true}}, {multi:true});

View File

@@ -1,38 +0,0 @@
// node .migrations/20131127_restore_dayStart.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mongo = require('mongoskin');
var _ = require('lodash');
var backupUsers = mongo.db('localhost:27017/habitrpg_old?auto_reconnect').collection('users');
var liveUsers = mongo.db('localhost:27017/habitrpg_new?auto_reconnect').collection('users');
var query = {'preferences.dayStart':{$exists:1,$ne:0}};
var select = {'preferences.dayStart': 1};
backupUsers.count(query, function(err, count){
if (err) return console.error(err);
backupUsers.findEach(query, select, {batchSize:20}, function(err, before){
if (err) return console.error(err);
if (!before) { count--; return console.log('!before'); }
liveUsers.findById(before._id, function(err, after){
if (err) return console.error(err);
if (!after) { count--; return console.log(before._id + ' deleted?'); }
var dayStart = +before.preferences.dayStart;
if (after.preferences.dayStart == 0 && dayStart != 0){
dayStart = (_.isNaN(dayStart) || dayStart < 0 || dayStart > 24) ? 0 : dayStart;
} else {
dayStart = after.preferences.dayStart;
}
liveUsers.update({_id:after._id}, {$inc:{_v:1}, $set:{'preferences.dayStart':dayStart}});
if (--count <= 0) console.log("DONE!");
})
});
});

View File

@@ -1,20 +0,0 @@
var query = {
'$or': [
{'items.gear.owned.weapon_special_0': true},
{'items.gear.owned.armor_special_0': true},
{'items.gear.owned.head_special_0': true},
{'items.gear.owned.shield_special_0': true}
]
};
db.users.find(query, {'items.gear.owned':1,backer:1}).forEach(function(user){
var owned = user.items.gear.owned;
var tier = (user.backer && user.backer.tier) || 0;
if (tier < 70) delete owned.weapon_special_0;
if (tier < 45) delete owned.armor_special_0;
if (tier < 45) delete owned.head_special_0;
if (tier < 45) delete owned.shield_special_0;
db.users.update({_id:user._id}, {$set:{'items.gear.owned':owned}});
});

View File

@@ -1,51 +0,0 @@
// node .migrations/20131221_restore_NaN_history.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
/**
* After the classes migration, users lost some history entries
*/
var mongo = require('mongoskin');
var _ = require('lodash');
var backupUsers = mongo.db('localhost:27017/habitrpg_old?auto_reconnect').collection('users');
var liveUsers = mongo.db('localhost:27017/habitrpg?auto_reconnect').collection('users');
function filterNaNs(h) {
return h && _.isNumber(+h.value) && !_.isNaN(+h.value);
}
var fields = {history:1,habits:1,dailys:1,migration:1};
var count = 0;
liveUsers.findEach({migration: {$ne:'20131221_restore_NaN_history'}}, fields, {batchSize:500}, function(err, after){
if (!after) err = '!after';
if (err) {count++;return console.error(err);}
backupUsers.findById(after._id, fields, function(err, before){
if (err) {count++;return console.error(err);}
_.each(['todos','exp'],function(type){
if (!_.isEmpty(after.history[type]))
after.history[type] = _.filter(after.history[type], filterNaNs);
if (before && !_.isEmpty(before.history[type]))
after.history[type] = before.history[type].concat(after.history[type]);
})
_.each(['habits','dailys'], function(type){
_.each(after[type], function(t){
t.history = _.filter(t.history, filterNaNs);
var found = before && _.find(before[type],{id:t.id});
if (found && found.history) t.history = found.history.concat(t.history);
})
})
liveUsers.update({_id:after._id}, {$set:{history:after.history, dailys:after.dailys, habits:after.habits, migration:'20131221_restore_NaN_history'}, $inc:{_v:1}});
//if (--count <= 0) console.log("DONE! " + after._id);
if (++count%1000 == 0) console.log(count);
if (after._id == '9') console.log('lefnire processed');
})
});

View File

@@ -1,38 +0,0 @@
// node .migrations/20131225_restore_streaks.js
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
/**
* After the classes migration, users lost some history entries
*/
var mongo = require('mongoskin');
var _ = require('lodash');
var backupUsers = mongo.db('localhost:27017/habitrpg_old?auto_reconnect').collection('users');
var liveUsers = mongo.db('lefnire:mAdn3s5s@charlotte.mongohq.com:10015/habitrpg_large?auto_reconnect').collection('users');
var fields = {dailys:1,migration:1};
var count = 0;
liveUsers.findEach({migration: {$ne:'20131225_restore_streaks'}}, fields, {batchSize:250}, function(err, after){
if (!after) err = '!after';
if (err) {count++;return console.error(err);}
backupUsers.findById(after._id, fields, function(err, before){
if (!before) err = '!before';
if (err) {count++;return console.error(err);}
_.each(before.dailys,function(d){
var found = _.find(after.dailys,{id: d.id});
if (found && !found.streak) found.streak = d.streak;
})
liveUsers.update({_id:after._id}, {$set:{dailys:after.dailys, migration:'20131225_restore_streaks'}, $inc:{_v:1}});
//if (--count <= 0) console.log("DONE! " + after._id);
if (++count%1000 == 0) console.log(count);
if (after._id == '9') console.log('lefnire processed');
})
});

View File

@@ -1,8 +0,0 @@
db.users.find({},{todos:1,dailys:1,rewards:1,habits:1}).forEach(function(user){
_.each(user.habits.concat(user.dailys).concat(user.todos).concat(user.rewards), function(t){
t.dateCreated = t.created || new Date;
delete t.created;
if (t.type == 'todo' && t.completed) t.dateCompleted = new Date;
})
db.users.update({_id:user._id}, {$set:{habits:user.habits,dailys:user.dailys,todos:user.todos,rewards:user.rewards}});
});

View File

@@ -1 +0,0 @@
db.users.update({},{$set:{'achievements.habitBirthday':true}},{multi:1})

View File

@@ -1,12 +0,0 @@
db.users.update({},{$set:{
'items.food.Cake_Skeleton':1,
'items.food.Cake_Base':1,
'items.food.Cake_CottonCandyBlue':1,
'items.food.Cake_CottonCandyPink':1,
'items.food.Cake_Shade':1,
'items.food.Cake_White':1,
'items.food.Cake_Golden':1,
'items.food.Cake_Zombie':1,
'items.food.Cake_Desert':1,
'items.food.Cake_Red':1
}},{multi:1})

View File

@@ -1,3 +0,0 @@
db.challenges.find({},{members:1}).forEach(function(chal){
db.challenges.update({_id:chal._id}, {$set:{memberCount:chal.members.length}});
});

View File

@@ -1,14 +0,0 @@
db.users.update(
{
'purchased.plan.dateCreated':{$gte:new Date('2014-02-22'),$lt:new Date('2014-02-29')},
'items.gear.owned.armor_mystery_201402':null,
'items.gear.owned.head_mystery_201402': null,
'items.gear.owned.back_mystery_201402': null,
'purchased.plan.mysteryItems':{$nin:['armor_mystery_201402','head_mystery_201402','back_mystery_201402']}
},
//{_id:1,'purchased.plan':1,'items.gear.owned':1}
{$push: {'purchased.plan.mysteryItems':{$each:['armor_mystery_201402','head_mystery_201402','back_mystery_201402']}}},
{multi:true}
)/*.forEach(function(user){
printjson(user);
});*/

View File

@@ -1 +0,0 @@
db.users.update({'backer.tier':{$gt:69}},{$set:{'items.mounts.LionCub-Ethereal':true}},{multi:1})

View File

@@ -1,11 +0,0 @@
//mongo habitrpg node_modules/lodash/lodash.js ./migrations/20140712_wiped_quest_membership.js
db.groups.find({type:'party','quest.key':{$ne:null},'quest.active':true},{quest:1}).forEach(function(group){
var activeMembers = _.reduce(group.quest.members, function(m,v,k){
if (v===true) m.push(k); return m;
},[]);
db.users.update(
{_id:{$in: activeMembers}},
{$set:{'party.quest.key':group.quest.key,'party.quest.completed':null}},
{multi:true}
);
});

View File

@@ -1,13 +0,0 @@
var _ = require('lodash');
db.users.find({}).forEach(function(user){
var newNewMessages = {};
_.each(user.newMessages, function(val, key){
if(key != "undefined"){
newNewMessages[key] = val;
};
});
db.users.update({_id: user._id}, {$set: {'newMessages': newNewMessages}});
});

View File

@@ -1,51 +0,0 @@
// node .migrations/20140823_remove_undefined_and_false_notifications.js
var migrationName = '20140823_remove_undefined_and_false_notifications';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
/**
* https://github.com/HabitRPG/habitrpg/pull/3907
*/
var mongo = require('mongoskin');
var _ = require('lodash');
// XXX @lefnire, choose wisely:
// var liveUsers = mongo.db('lefnire:mAdn3s5s@charlotte.mongohq.com:10015/habitrpg_large?auto_reconnect').collection('users');
// var liveUsers = mongo.db('localhost:27017/habitrpg_old?auto_reconnect').collection('users');
// For local testing by script author:
// var liveUsers = mongo.db('localhost:27017/habitrpg?auto_reconnect').collection('users');
var fields = {migration:1,newMessages:1};
var progressCount = 1000;
// var progressCount = 1;
var count = 0;
liveUsers.findEach({migration: {$ne:migrationName}}, fields, {batchSize:250}, function(err, user){
count++;
if (!user) err = '!user';
if (err) {return console.error(err);}
var newNewMessages = {};
_.each(user.newMessages,function(val,key){
// console.log(key + " " + val.name);
if(key != "undefined" && val['value']){
newNewMessages[key] = val;
}
})
liveUsers.update({_id:user._id}, {$set:{newMessages:newNewMessages, migration:migrationName}, $inc:{_v:1}});
if (count%progressCount == 0) console.log(count + ' ' + user._id);
if (user._id == '9') console.log('lefnire processed');
if (user._id == authorUuid) console.log(authorName + ' processed');
});

View File

@@ -1,81 +0,0 @@
// node .migrations/20140829_change_headAccessory_to_eyewear.js
var migrationName = '20140829_change_headAccessory_to_eyewear';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
/**
* https://github.com/HabitRPG/habitrpg/issues/3645
*/
var mongo = require('mongoskin');
var _ = require('lodash');
var liveUsers = mongo.db('localhost:27017/habitrpg2?auto_reconnect').collection('users');
var fields = {'migration':1,
'items.gear.costume.headAccessory':1,
'items.gear.equipped.headAccessory':1,
'items.gear.owned.headAccessory_special_wondercon_black':1,
'items.gear.owned.headAccessory_special_wondercon_red':1,
'items.gear.owned.headAccessory_special_summerRogue':1,
'items.gear.owned.headAccessory_special_summerWarrior':1
};
var progressCount = 1000;
var count = 0;
liveUsers.findEach({ $and: [
{ migration: {$ne:migrationName} },
{ $or: [
{'items.gear.owned.headAccessory_special_summerRogue': {'$exists':true}},
{'items.gear.owned.headAccessory_special_summerWarrior':{'$exists':true}},
{'items.gear.owned.headAccessory_special_wondercon_red':{'$exists':true}},
{'items.gear.owned.headAccessory_special_wondercon_black':{'$exists':true}}
]}
]}, fields, {batchSize:250}, function(err, user){
count++;
if (!user) err = '!user';
if (err) {return console.error(err);}
var set = {'migration': migrationName};
var unset = {};
var oldToNew = {
'headAccessory_special_summerRogue': 'eyewear_special_summerRogue',
'headAccessory_special_summerWarrior': 'eyewear_special_summerWarrior',
'headAccessory_special_wondercon_red': 'eyewear_special_wondercon_red',
'headAccessory_special_wondercon_black':'eyewear_special_wondercon_black'
};
// items.gear.costume, items.gear.equipped:
_.each(['costume','equipped'],function(type){
_.each(oldToNew,function(newName,oldName){
if (user.items.gear[type].headAccessory === oldName) {
unset['items.gear.'+type+'.headAccessory'] = "";
set['items.gear.'+type+'.eyewear'] = newName;
}
});
});
// items.gear.owned:
_.each(oldToNew,function(newName,oldName){
if (oldName in user.items.gear.owned) {
unset['items.gear.owned.'+oldName] = "";
set['items.gear.owned.'+newName] = user.items.gear.owned[oldName];
}
});
//console.log(JSON.stringify(user, null, " "));
//console.log("set: " + JSON.stringify(set, null, " "));
//console.log("unset: " + JSON.stringify(unset, null, " "));
liveUsers.update({_id:user._id}, {$set:set, $unset:unset, $inc:{_v:1}});
if (count%progressCount == 0) console.log(count + ' ' + user._id);
if (user._id == '9') console.log('lefnire processed');
if (user._id == authorUuid) console.log(authorName + ' processed');
});

View File

@@ -1,131 +0,0 @@
// IMPORTANT:
//
// run like this to capture all output:
//
// node 20140831_increase_gems_for_previous_contributions.js > 20140831_increase_gems_for_previous_contributions_output.txt
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var migrationName = '20140831_increase_gems_for_previous_contributions';
/**
* https://github.com/HabitRPG/habitrpg/issues/3933
* Increase Number of Gems for Contributors
* author: Alys (d904bd62-da08-416b-a816-ba797c9ee265)
*
* Increase everyone's gems per their contribution level.
* Originally they were given 2 gems per tier.
* Now they are given 3 gems per tier for tiers 1,2,3
* and 4 gems per tier for tiers 4,5,6,7
* So that means an EXTRA 1 for tier 1,
* 2 for tier 2,
* 3 for tier 3,
* 5 for tier 4,
* 7 for tier 5,
* 9 for tier 6,
* 11 for tier 7,
* 11 for tier 8 (moderators = tier 7 + admin privileges),
* none for tier 9 (staff)
*/
var mongo = require('mongoskin');
var _ = require('lodash');
var dbUsers = mongo.db('localhost:27017/habitrpg?auto_reconnect').collection('users');
var query = {
'contributor.level': {$gt: 0, $lt: 9},
'migration': {$ne: migrationName}
};
var fields = {
'migration':1,
'contributor.level':1,
'balance':1
};
var userResults = {}; // each key is a UUID, each value is a string
// describing what changed for that user
console.warn('Updating users...');
var progressCount = 50;
var count = 0;
dbUsers.findEach(query, fields, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All users found. Fetching final balances...');
return fetchFinalBalances();
}
count++;
var set = {'migration': migrationName};
var tier = user.contributor.level;
var extraGems = tier; // tiers 1,2,3
if (tier > 3) { extraGems = 3 + (tier - 3) * 2; }
if (tier == 8) { extraGems = 11; }
extraBalance = extraGems / 4;
set['balance'] = user.balance + extraBalance;
// Capture current state of user:
userResults[user._id] =
user._id + ' ' + ':\n' +
' contrib tier : ' + tier + '\n' +
' balance before : ' + user.balance + '\n' +
' balance (gems) added : ' + extraBalance + ' (' +
extraGems + ')' + '\n' +
' expected balance after: ' + (user.balance + extraBalance) + '\n';
// Update user:
dbUsers.update({_id:user._id}, {$set:set, $inc:{_v:1}});
if (count%progressCount == 0) console.warn(count + ' ' + user._id);
});
function fetchFinalBalances() {
var query = {_id: {$in: Object.keys(userResults)}};
var fields = {
'balance':1,
};
var count1 = 0;
dbUsers.findEach(query, fields, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All final balances found.');
return displayData();
}
count1++;
userResults[user._id] = userResults[user._id] +
user._id + ' ' + ':\n' +
' actual balance after : ' + user.balance + '\n';
if (count1%progressCount == 0) console.warn(count1 + ' ' + user._id);
});
}
function displayData() {
_.each(userResults, function(text, uuid) {
console.log(text); // text contains uuid
});
console.log('\n' + count +
' users processed (should be roughly 335 according to the Hall)\n');
return exiting(0);
}
function exiting(code, msg) {
code = code || 0; // 0 = success
if (code && !msg) { msg = 'ERROR!'; }
if (msg) {
if (code) { console.error(msg); }
else { console.log( msg); }
}
process.exit(code);
}

View File

@@ -1,79 +0,0 @@
var migrationName = '20140914_upgrade_admin_contrib_tiers';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
/**
* https://github.com/HabitRPG/habitrpg/issues/3801
* Convert Tier 8 contributors to Tier 9 (staff) (all current Tier 8s are admins).
* Convert Tier 7 contributors with admin flag to Tier 8 (moderators).
*/
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mongo = require('mongoskin');
var _ = require('lodash');
var dbUsers = mongo.db('localhost:27017/habitrpg?auto_reconnect').collection('users');
var query =
{ 'contributor.level':{$gte:7}, 'contributor.admin':true, 'migration': {$ne: migrationName} };
var fields = {'migration':1,
'contributor.admin':1,
'contributor.level':1,
'auth.local.username':1,
'profile.name':1,
};
var userResults = {}; // each key is a UUID, each value is a username;
// contains only the users changed
console.warn('Updating users...');
var progressCount = 1000;
var count = 0;
dbUsers.findEach(query, fields, {batchSize:250}, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All appropriate users found and modified.');
return displayData();
}
count++;
var set = {'migration': migrationName};
var inc = {'contributor.level':1, _v:1};
userResults[user._id] = user.profile.name;
dbUsers.update({_id:user._id}, {$set:set, $inc:inc});
if (count%progressCount == 0) console.warn(count + ' ' + user._id);
if (user._id == authorUuid) console.warn(authorName + ' processed');
if (user._id == '9' ) console.warn('lefnire' + ' processed');
});
function displayData() {
console.log('users modified:');
_.each(userResults, function(name, uuid) {
console.log(name);
});
console.warn('\n' + count +
' users processed (should be 11 according to the Hall)\n');
return exiting(0);
}
function exiting(code, msg) {
code = code || 0; // 0 = success
if (code && !msg) { msg = 'ERROR!'; }
if (msg) {
if (code) { console.error(msg); }
else { console.log( msg); }
}
process.exit(code);
}

View File

@@ -1,18 +0,0 @@
db.users.update(
{},
{
$inc: {
'items.food.Candy_Base':1,
'items.food.Candy_CottonCandyBlue':1,
'items.food.Candy_CottonCandyPink':1,
'items.food.Candy_Desert':1,
'items.food.Candy_Golden':1,
'items.food.Candy_Red':1,
'items.food.Candy_Shade':1,
'items.food.Candy_Skeleton':1,
'items.food.Candy_White':1,
'items.food.Candy_Zombie':1
}
},
{multi:1}
);

View File

@@ -1 +0,0 @@
db.users.update({_id:'9'},{$set:{'items.pets.JackOLantern-Base':5, 'flags.newStuff':true}}, {multi:true});

View File

@@ -1,20 +0,0 @@
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
// require moment, lodash
db.users.find(
{'purchased.plan.customerId':{$ne:null}},
{_id:1, 'purchased.plan':1}
).forEach(function(user){
var p = user.purchased.plan
, latestMonth = p.dateTerminated || new Date() // their last sub date, or on-going (now)
, count = moment(latestMonth).diff(p.dateCreated, 'months');
db.users.update({_id: user._id}, {$set: {
'purchased.plan.consecutive.count': count,
'purchased.plan.consecutive.gemCapExtra': _.min([ Math.floor(count/3)*5, 25 ]),
'purchased.plan.consecutive.trinkets': Math.floor(count/3)
}});
});

View File

@@ -1,11 +0,0 @@
db.users.update(
{'items.pets.Turkey-Base':{$ne:null}},
{$set:{'items.mounts.Turkey-Base':true}},
{multi:1}
)
db.users.update(
{'items.pets.Turkey-Base':null},
{$set:{'items.pets.Turkey-Base':5}},
{multi:1}
)

View File

@@ -1,4 +0,0 @@
db.users.update({'purchased.plan.consecutive.count':NaN}, {$set:{'purchased.plan.consecutive.count':0}}, {multi:1});
db.users.update({'purchased.plan.consecutive.offset':NaN}, {$set:{'purchased.plan.consecutive.offset':0}}, {multi:1});
db.users.update({'purchased.plan.consecutive.gemCapExtra':NaN}, {$set:{'purchased.plan.consecutive.gemCapExtra':0}}, {multi:1});
db.users.update({'purchased.plan.consecutive.trinkets':NaN}, {$set:{'purchased.plan.consecutive.trinkets':0}}, {multi:1});

View File

@@ -1,11 +0,0 @@
db.users.update(
{'items.gear.owned.head_special_nye':{$ne:null}},
{$set:{'items.gear.owned.head_special_nye2014':false}},
{multi:1}
)
db.users.update(
{'items.gear.owned.head_special_nye':null},
{$set:{'items.gear.owned.head_special_nye':false}},
{multi:1}
)

View File

@@ -1,8 +0,0 @@
db.users.update(
{'purchased.plan.customerId':{$ne:null}, 'purchased.plan.dateUpdated':null},
{
$set: {'purchased.plan.dateUpdated': new Date('12/01/2014')},
$unset: {'purchased.plan.datedUpdated':''}
},
{multi:true}
);

View File

@@ -1,88 +0,0 @@
var migrationName = '20150124_mountmaster_fix.js';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
/**
* https://github.com/HabitRPG/habitrpg/pull/4374#issuecomment-71038795
* Convert false to null for mounts that used to be owned.
*/
var dbserver = 'localhost:27017' // CHANGE THIS FOR PRODUCTION DATABASE
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mongo = require('mongoskin');
var _ = require('lodash');
var dbUsers = mongo.db(dbserver + '/habitrpg?auto_reconnect').collection('users');
var query = {
'items.mounts':{$exists:true}
};
var fields = {
'items.mounts':1
};
var animals = [ "Wolf-Base", "Wolf-White", "Wolf-Desert", "Wolf-Red", "Wolf-Shade", "Wolf-Skeleton", "Wolf-Zombie", "Wolf-CottonCandyPink", "Wolf-CottonCandyBlue", "Wolf-Golden", "TigerCub-Base", "TigerCub-White", "TigerCub-Desert", "TigerCub-Red", "TigerCub-Shade", "TigerCub-Skeleton", "TigerCub-Zombie", "TigerCub-CottonCandyPink", "TigerCub-CottonCandyBlue", "TigerCub-Golden", "PandaCub-Base", "PandaCub-White", "PandaCub-Desert", "PandaCub-Red", "PandaCub-Shade", "PandaCub-Skeleton", "PandaCub-Zombie", "PandaCub-CottonCandyPink", "PandaCub-CottonCandyBlue", "PandaCub-Golden", "LionCub-Base", "LionCub-White", "LionCub-Desert", "LionCub-Red", "LionCub-Shade", "LionCub-Skeleton", "LionCub-Zombie", "LionCub-CottonCandyPink", "LionCub-CottonCandyBlue", "LionCub-Golden", "Fox-Base", "Fox-White", "Fox-Desert", "Fox-Red", "Fox-Shade", "Fox-Skeleton", "Fox-Zombie", "Fox-CottonCandyPink", "Fox-CottonCandyBlue", "Fox-Golden", "FlyingPig-Base", "FlyingPig-White", "FlyingPig-Desert", "FlyingPig-Red", "FlyingPig-Shade", "FlyingPig-Skeleton", "FlyingPig-Zombie", "FlyingPig-CottonCandyPink", "FlyingPig-CottonCandyBlue", "FlyingPig-Golden", "Dragon-Base", "Dragon-White", "Dragon-Desert", "Dragon-Red", "Dragon-Shade", "Dragon-Skeleton", "Dragon-Zombie", "Dragon-CottonCandyPink", "Dragon-CottonCandyBlue", "Dragon-Golden", "Cactus-Base", "Cactus-White", "Cactus-Desert", "Cactus-Red", "Cactus-Shade", "Cactus-Skeleton", "Cactus-Zombie", "Cactus-CottonCandyPink", "Cactus-CottonCandyBlue", "Cactus-Golden", "BearCub-Base", "BearCub-White", "BearCub-Desert", "BearCub-Red", "BearCub-Shade", "BearCub-Skeleton", "BearCub-Zombie", "BearCub-CottonCandyPink", "BearCub-CottonCandyBlue", "BearCub-Golden" ]; // all Gen1 mounts
console.warn('Updating users...');
var progressCount = 1000;
var count = 0;
dbUsers.findEach(query, fields, {batchSize:250}, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All appropriate users found and modified.');
return displayData();
}
count++;
var mounts = user.items.mounts;
var changed = false;
for(var a in animals) {
if(mounts[animals[a]] == false) {
mounts[animals[a]] = null;
changed = true;
}
}
if (changed) {
dbUsers.update(
{ _id: user._id},
{
$set: { "migration": migrationName,
"items.mounts" : mounts
}
}
);
}
// var set = {'migration': migrationName};
// var inc = {'xyz':1, _v:1};
// dbUsers.update({_id:user._id}, {$set:set, $inc:inc});
if (count%progressCount == 0) console.warn(count + ' ' + user._id);
if (user._id == authorUuid) console.warn(authorName + ' processed');
if (user._id == '9' ) console.warn('lefnire' + ' processed');
});
function displayData() {
console.warn('\n' + count + ' users processed\n');
return exiting(0);
}
function exiting(code, msg) {
code = code || 0; // 0 = success
if (code && !msg) { msg = 'ERROR!'; }
if (msg) {
if (code) { console.error(msg); }
else { console.log( msg); }
}
process.exit(code);
}

View File

@@ -1,36 +0,0 @@
db.users.update(
{'items.gear.owned.armor_special_birthday':{$ne:null}},
{$set:{'items.gear.owned.armor_special_birthday2015':false}},
{multi:1}
)
db.users.update(
{'items.gear.owned.armor_special_birthday':null},
{$set:{'items.gear.owned.armor_special_birthday':false}},
{multi:1}
)
db.users.update({},{$inc:{
'items.food.Cake_Skeleton':1,
'items.food.Cake_Base':1,
'items.food.Cake_CottonCandyBlue':1,
'items.food.Cake_CottonCandyPink':1,
'items.food.Cake_Shade':1,
'items.food.Cake_White':1,
'items.food.Cake_Golden':1,
'items.food.Cake_Zombie':1,
'items.food.Cake_Desert':1,
'items.food.Cake_Red':1
}},{multi:1})
db.users.update(
{'achievements.habitBirthday':true},
{$set:{'achievements.habitBirthdays':1}},
{multi:1}
)
db.users.update(
{},
{$inc:{'achievements.habitBirthdays':1}},
{multi:1}
)

View File

@@ -1,78 +0,0 @@
var migrationName = '20150131_birthday_goodies_fix__one_birthday__1';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
/*
* remove new birthday robes and second achievement from people who shouldn't have them
*/
var dbserver = 'localhost:27017' // CHANGE THIS FOR PRODUCTION DATABASE
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mongo = require('mongoskin');
var _ = require('lodash');
var dbUsers = mongo.db(dbserver + '/habitrpg?auto_reconnect').collection('users');
// 'auth.timestamps.created':{$gt:new Date('2014-02-01')},
var query = {
'achievements.habitBirthdays':1,
'auth.timestamps.loggedin':{$gt:new Date('2014-12-20')}
};
// '_id': 'c03e41bd-501f-438c-9553-a7afdf52a08c',
// 'achievements.habitBirthday':{$exists:false},
// 'items.gear.owned.armor_special_birthday2015':1
var fields = {
// 'auth.timestamps.created':1,
// 'achievements.habitBirthday':1,
// 'achievements.habitBirthdays':1,
'items.gear.owned.armor_special_birthday2015':1,
// 'items.gear.owned.armor_special':1
};
console.warn('Updating users...');
var progressCount = 1000;
var count = 0;
dbUsers.findEach(query, fields, {batchSize:250}, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All appropriate users found and modified.');
return displayData();
}
count++;
var unset = {'items.gear.owned.armor_special_birthday2015': 1};
// var set = {'migration':migrationName, 'achievements.habitBirthdays':1 };
// var inc = {'xyz':1, _v:1};
dbUsers.update({_id:user._id}, {$unset:unset}); // , $inc:inc});
// dbUsers.update({_id:user._id}, {$unset:unset, $set:set});
// console.warn(user.auth.timestamps.created);
if (count%progressCount == 0) console.warn(count + ' ' + user._id);
if (user._id == authorUuid) console.warn(authorName + ' processed');
if (user._id == '9' ) console.warn('lefnire' + ' processed');
});
function displayData() {
console.warn('\n' + count + ' users processed\n');
return exiting(0);
}
function exiting(code, msg) {
code = code || 0; // 0 = success
if (code && !msg) { msg = 'ERROR!'; }
if (msg) {
if (code) { console.error(msg); }
else { console.log( msg); }
}
process.exit(code);
}

View File

@@ -1,112 +0,0 @@
var migrationName = '20150201_convert_creation_date_from_string_to_object__no_date_recent_signup';
//// var migrationName = '20150201_convert_creation_date_from_string_to_object';
var authorName = 'Alys'; // in case script author needs to know when their ...
var authorUuid = 'd904bd62-da08-416b-a816-ba797c9ee265'; //... own data is done
/*
* For users that have no value for auth.timestamps.created, assign them
* a recent value.
*
* NOTE:
* Before this script was used as described above, it was first used to
* find all users that have a auth.timestamps.created field that is a string
* rather than a date object and set it to be a date object. The code used
* for this has been commented out with four slashes: ////
*
* https://github.com/HabitRPG/habitrpg/issues/4601#issuecomment-72339846
*/
var dbserver = 'localhost:27017' // CHANGE THIS FOR PRODUCTION DATABASE
// IMPORTANT NOTE: this migration was written when we were using version 3 of lodash.
// We've now upgraded to lodash v4 but the code used in this migration has not been
// adapted to work with it. Before this migration is used again any lodash method should
// be checked for compatibility against the v4 changelog and changed if necessary.
// https://github.com/lodash/lodash/wiki/Changelog#v400
var mongo = require('mongoskin');
var _ = require('lodash');
var moment = require('moment');
var dbUsers = mongo.db(dbserver + '/habitrpg?auto_reconnect').collection('users');
var uuidArrayRecent=[ // recent users with no creation dates
'1a0d4b75-73ed-4937-974d-d504d6398884',
'1c7ebe27-1250-4f95-ba10-965580adbfd7',
'5f972121-4a6d-411c-95e9-7093d3e89b66',
'ae85818a-e336-4ccd-945e-c15cef975102',
'ba273976-d9fc-466c-975f-38559d34a824',
];
var query = {
'_id':{$in: uuidArrayRecent}
//// 'auth':{$exists:true},
//// 'auth.timestamps':{$exists:true},
//// 'auth.timestamps.created':{$not: {$lt:new Date('2018-01-01')}}
};
var fields = {
'_id':1,
'auth.timestamps.created':1
};
// 'achievements.habitBirthdays':1
console.warn('Updating users...');
var progressCount = 1000;
var count = 0;
dbUsers.findEach(query, fields, {batchSize:250}, function(err, user) {
if (err) { return exiting(1, 'ERROR! ' + err); }
if (!user) {
console.warn('All appropriate users found and modified.');
return displayData();
}
count++;
//// var oldDate = user.auth.timestamps.created;
//// var newDate = moment(oldDate).toDate();
var oldDate = 'none';
var newDate = moment('2015-01-11').toDate();
console.warn(user._id + ' == ' + oldDate + ' == ' + newDate);
//// var set = { 'migration': migrationName,
//// 'auth.timestamps.created': newDate,
//// 'achievements.habitBirthdays': 2,
//// 'items.gear.owned.head_special_nye':true,
//// 'items.gear.owned.head_special_nye2014':true,
//// 'items.gear.owned.armor_special_birthday':true,
//// 'items.gear.owned.armor_special_birthday2015':true,
//// };
var set = { 'migration': migrationName,
'auth.timestamps.created': newDate,
'achievements.habitBirthdays': 1,
'items.gear.owned.armor_special_birthday':true,
};
// var unset = {'items.gear.owned.armor_special_birthday2015': 1};
// var inc = {'xyz':1, _v:1};
dbUsers.update({_id:user._id}, {$set:set});
// dbUsers.update({_id:user._id}, {$unset:unset, $set:set, $inc:inc});
if (count%progressCount == 0) console.warn(count + ' ' + user._id);
if (user._id == authorUuid) console.warn(authorName + ' processed');
if (user._id == '9' ) console.warn('lefnire' + ' processed');
});
function displayData() {
console.warn('\n' + count + ' users processed\n');
return exiting(0);
}
function exiting(code, msg) {
code = code || 0; // 0 = success
if (code && !msg) { msg = 'ERROR!'; }
if (msg) {
if (code) { console.error(msg); }
else { console.log( msg); }
}
process.exit(code);
}

View File

@@ -1,7 +0,0 @@
db.users.update({
'flags.recaptureEmailsPhase': {
$gt: 0
}
},{$inc:{
'flags.recaptureEmailsPhase':1
}},{multi:1})

Some files were not shown because too many files have changed in this diff Show More