Compare commits

..

145 Commits

Author SHA1 Message Date
Sabe Jones 8c4d1a67ac 4.90.1 2019-03-28 16:23:28 -05:00
Sabe Jones e58fbcc34c chore(news): Bailey 2019-03-28 16:23:11 -05:00
Matteo Pagliazzi 1a66a680dc Revert "Add <button> and focus styles for keyboard users" (#11089) 2019-03-27 20:56:00 +01:00
Sabe Jones fc08b753cd Merge branch 'release' into develop 2019-03-26 20:23:22 -05:00
Sabe Jones 7a73f5bb83 4.90.0 2019-03-26 20:22:52 -05:00
Sabe Jones 6ce1f6f32e chore(sprites): compile 2019-03-26 20:22:35 -05:00
Sabe Jones 50278db1d6 feat(content): Mystery Items March 2019 2019-03-26 20:22:26 -05:00
Matteo Pagliazzi fe636b9bd2 Merge pull request #10819 from ianoxley/9796-keyboard-a11y
Add <button> and focus styles for keyboard users
2019-03-24 12:29:07 +01:00
Ian Oxley 7835fe1deb Fix outline issue in Firefox 2019-03-23 22:13:03 +00:00
Ian Oxley 8fb0d0899d Fix checkbox alignment for dailies 2019-03-23 22:12:43 +00:00
Matteo Pagliazzi abb8dc4dc1 Merge pull request #11078 from ChesterSng/11602-display-message-when-social-auth-acc-uses-password
Fixes #11062 Display information message when social authentication account uses password to login
2019-03-23 18:36:12 +01:00
Matteo Pagliazzi 910a76db68 Merge pull request #11064 from randi2kewl/todo-calendar-highlight-today
Added a highlight on today's date in To-Dos cal
2019-03-23 18:29:15 +01:00
Matteo Pagliazzi 2f792d51f8 Merge pull request #11069 from randi2kewl/11047-hall-search-case-insensitive
Fixes #11047 Hall search case insensitive
2019-03-23 18:22:53 +01:00
Matteo Pagliazzi 6cc925b535 Merge pull request #10988 from HabitRPG/sabrecat/platform-analytics-tweak
Set registered platform on analytics only once
2019-03-23 18:19:15 +01:00
Chester Sng 87d86ee632 Add test case for user that uses social authentication 2019-03-23 20:04:09 +08:00
Randi Miller b387d77128 Lint fixes 2019-03-22 16:18:58 -04:00
Randi Miller e644ae83fd Overrides for generateUser and test adjustment 2019-03-22 14:44:27 -04:00
Randi Miller ae21680a5f Add border-radius to highlighted tile 2019-03-22 14:23:04 -04:00
Randi Miller c1767eca1b Move datepicker css and color fixes 2019-03-22 14:17:36 -04:00
Chester Sng d20cd1bbf1 Remove unused string constant in front.js 2019-03-22 19:36:13 +08:00
Chester Sng 3e45f5af41 Add check for the existence of user's password before attempting to authenticate 2019-03-22 19:30:00 +08:00
Bonnie L 23cc2b9d21 catch promise rejection when user submits a message to group. fixes #10970 (#10978)
* catch promise rejection when user submits a message to group

* switch response exception handling to try/catch to avoid mixing aysnc/await with promises
2019-03-21 16:54:10 -05:00
JSn1nj4 58c4fcd506 Fix sellModal data caching (#11044)
* Several deps set to "optional" in lock file

This was done automatically when running `npm i` on Windows.

Node v10.15.2
NPM 6.4.1

* Begin working on issue #10687

Key files to look into:
- website/client/components/inventory/item.vue
- website/client/components/shops/market/sellModal.vue

File notes for me:

item.vue: provides wrapper for displaying item data.

sellModel.vue: for displaying items player intends to sell
- lines 10-21: check `item` computed property and load `item` component
- lines 151-153: ask how return line is evaluated to an `item`

The last one could be important to figuring out this caching issue.
Since the property is computed, it's possible that line is evaluating to
a truthy value that Vue is seeing as unchanged, even if the actual
`item` object is different each time.

* Pick up from sellModal.vue:155

This is where the item context seems to be set. The Vue dev tools
indicate that the `<item>` component is updating. It's only the `item`
reference inside of the `<sellModal>` component that isn't updating.

Issue #10687

* Remove (v-once) directive

This was preventing data referenced within nested elements from
updating.

Issue #10687

* Revert package-lock.json to "develop" version

This removes the "optional" settings that were automatically added by NPM to a handful of dependencies while working on PR #11044.

* Attempt to rerun tests

The most recent change shouldn't have caused tests to fail.
2019-03-21 16:52:00 -05:00
Alec Brickner 2878abc130 Center allocatable stat points (#11053) 2019-03-21 16:49:38 -05:00
Dmitry a8cb6e3409 Second empty head option was removed from edit avatar - hair - style (#11061) 2019-03-21 16:47:17 -05:00
Alys 2caa540006 allow moderators/staff to always see Report button for a flagged message (#11068) 2019-03-21 16:46:00 -05:00
Sabe Jones a2261e3591 4.89.0 2019-03-21 16:36:16 -05:00
Sabe Jones 90d498ff96 chore(sprites): compile 2019-03-21 16:36:01 -05:00
Sabe Jones 928327e02a feat(content): Magic Hatching Potions March 2019 2019-03-21 16:34:19 -05:00
Randi Miller f454700722 extending equipment modal hack to address #11015 (#11070)
* extending equipment modal hack to address #11015

* fix(modal): call hack only once, remove more dangling body props
2019-03-21 13:37:35 -05:00
Matteo Pagliazzi 83bce24e1f Merge branch 'develop' into 9796-keyboard-a11y 2019-03-21 16:05:18 +01:00
Sabe Jones e7979a99e6 Merge branch 'release' into develop 2019-03-19 19:53:54 -05:00
Sabe Jones 5c648af2ea 4.88.0 2019-03-19 19:53:20 -05:00
Sabe Jones 2ad4bee816 chore(sprites): compile 2019-03-19 19:53:11 -05:00
Sabe Jones e0291cf432 feat(event): Spring Fling 2019 2019-03-19 19:52:59 -05:00
Randi Miller bac9121153 Changes color scheme for datepicker fixes #11064 2019-03-19 15:44:06 -04:00
Sabe Jones d178928c45 fix(analytics): remove excess promise layer 2019-03-18 15:51:49 -05:00
Sabe Jones 9a6aa5f443 merge negue-ui-fixes into develop
Squashed commit of the following:

commit d0628da7557e718b4d144283949f6572718d9b45
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 15 19:34:39 2019 +0100

    fix quest-tooltip padding/sizes

commit c16bc0fe4521e01520628ddc84af54930b15e066
Merge: 24e3fe2a6 163f31688
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 15 18:58:51 2019 +0100

    Merge branch 'fix/quest-tooltip-cells' into negue-ui-fixes

commit 24e3fe2a6c8e384722d95f7edd9ce9e4ce16960c
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Mar 15 18:49:47 2019 +0100

    use item margin instead of container padding

commit 03ab975193b2007e24fcbb971fc7d4169bfb3ac7
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 14 21:41:43 2019 +0100

    fix input heights

commit 3aa18f1105a02655066e10a82cf53be9340a6bf1
Author: negue <eugen.bolz@gmail.com>
Date:   Thu Mar 14 20:58:22 2019 +0100

    revert margin-bottom on checklist

commit d8f533fda1d3833ab2f4aeb3bd8001d4a7881e8b
Merge: fbd01ab79 7d45dcfee
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu Mar 14 11:10:34 2019 -0500

    Merge branch 'fix/shops-ui' into negue-ui-fixes

commit fbd01ab79d5ea8144c191cd51a9c11216418493a
Merge: 65517d259 546e260e3
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu Mar 14 11:09:03 2019 -0500

    Merge branch 'fix/more-ui' into negue-ui-fixes

commit 65517d25947144f57b84fad84ce709ac7d008119
Merge: 5e935230a 2dcec78a4
Author: Sabe Jones <sabrecat@gmail.com>
Date:   Thu Mar 14 11:08:20 2019 -0500

    Merge branch 'fix/tasks-ui' into negue-ui-fixes

commit 546e260e36
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Mar 9 23:13:54 2019 +0100

    fix checkbox check mark

commit 46ea2010f8
Author: negue <eugen.bolz@gmail.com>
Date:   Sat Mar 9 22:48:20 2019 +0100

    remove bottom margin on a collapsed checklist

commit 7d45dcfee5
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Mar 6 22:45:09 2019 +0100

    fix star/empty colors - fix quest layout - countBadge z-index

commit f9b9e75c18
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 4 20:14:49 2019 +0100

    shops - timeTravelers: refactor filter logic

commit 6d3e9e0de0
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 4 20:06:02 2019 +0100

    shops-seasonal: refactor filter logic

commit aa2949e9d1
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 4 19:54:23 2019 +0100

    shops - quest: refactor filter logic + quest items margins

commit ad62b7a358
Author: negue <eugen.bolz@gmail.com>
Date:   Mon Mar 4 19:50:51 2019 +0100

    shop: equipment-cards background + market filter logic (as other pages)

commit 2dcec78a4a
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 21:02:10 2019 +0100

    remove space between notes and checklist

commit 31fab9b66d
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:45:59 2019 +0100

    remove margin of checklist items

commit 28b134a19b
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:33:43 2019 +0100

    show `Options` instead of  `Show More`

commit cafcfb6112
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:30:22 2019 +0100

    remove pointer on disabled task-controls

commit 7acbcc424b
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:25:36 2019 +0100

    remove margin of task-title markdown-p-tag

commit f667ab957b
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:25:16 2019 +0100

    40px height search + tags button

commit 2080ecb7e8
Author: negue <eugen.bolz@gmail.com>
Date:   Wed Feb 27 20:24:35 2019 +0100

    show grabbing cursor while dragging

commit 163f316889
Author: negue <eugen.bolz@gmail.com>
Date:   Fri Feb 15 23:26:40 2019 +0100

    replace the questInfo to use table-like behavior, expands to the content
2019-03-18 15:06:32 -05:00
Randi Miller e277a088ee Added some additional comments 2019-03-17 04:20:21 -04:00
Randi Miller e083df64e4 fixes #11047 Switches Hall query to use lowercase name 2019-03-17 04:00:50 -04:00
Sabe Jones dae37c17d6 Merge branch 'release' into develop 2019-03-15 10:37:22 -05:00
Sabe Jones 1d81916674 4.87.3 2019-03-15 10:36:45 -05:00
Sabe Jones 2a225c2376 chore(event): end Pi Day 2019-03-15 10:31:08 -05:00
Ian Oxley bd9d9d31c3 Update :focus outline for men icons
Make the .svg-icon focus style match its hover style.
2019-03-14 20:44:09 +00:00
Sabe Jones f1b5ce9c66 Merge branch 'release' into develop 2019-03-14 14:11:25 -05:00
Matteo Pagliazzi c08b25101b 4.87.2 2019-03-14 19:43:24 +01:00
Matteo Pagliazzi 9fd0e27c66 fix(stripe): fix buying gems 2019-03-14 19:43:10 +01:00
Matteo Pagliazzi 994082a1d8 payments success state: add note about auto renewal 2019-03-14 19:36:56 +01:00
Sabe Jones 0e6e7adb06 4.87.1 2019-03-14 12:26:03 -05:00
Sabe Jones 8486b9631f Merge branch 'develop' into release 2019-03-14 12:25:55 -05:00
Sabe Jones 3f04c8abf5 chore(email): next split test iteration 2019-03-14 12:21:46 -05:00
Sabe Jones 89e1c69728 fix(string): correct set membership for blue hairbow 2019-03-14 11:23:25 -05:00
Sabe Jones 5e935230a4 Merge branch 'release' into develop 2019-03-14 07:32:41 -05:00
Sabe Jones 9ad50be6ca fix(test): update food const 2019-03-14 07:32:32 -05:00
Sabe Jones 1ff3f3d4e7 Merge branch 'release' into develop 2019-03-14 07:05:35 -05:00
Sabe Jones 0b35aefdc9 4.87.0 2019-03-14 07:05:01 -05:00
Sabe Jones 0d374d817c chore(email): end split test 2019-03-14 07:02:45 -05:00
Sabe Jones 034058301d Merge branch 'sabrecat/pi-day' into release 2019-03-14 07:00:52 -05:00
Sabe Jones ae2d50c5b8 feat(pie): immediate pie for new users 2019-03-14 06:51:47 -05:00
Randi Miller fff16a86a5 Added a highlight on today's date in To-Dos cal 2019-03-14 03:40:03 -04:00
Matteo Pagliazzi c7309ae179 fix(amazon): disabled state for button, fix bug where checkout button would not appear 2019-03-13 19:19:30 +01:00
Matteo Pagliazzi ef42fba049 fix(paypal): button styles 2019-03-13 18:34:41 +01:00
Sabe Jones d75f926136 Merge branch 'release' into develop 2019-03-12 19:30:52 -05:00
Sabe Jones 78612a91dd 4.86.2 2019-03-12 19:30:09 -05:00
Sabe Jones 8bcd93075b chore(news): Bailey 2019-03-12 19:29:51 -05:00
Sabe Jones f318afb8cf Revert "replace the questInfo to use table-like behavior, expands to the content (#10995)"
This reverts commit 3ebd37f7cb.
2019-03-12 19:20:56 -05:00
Sabe Jones b954379f38 Revert "fixes Tasks UI (#11036)"
This reverts commit f548103f4c.
2019-03-12 19:20:40 -05:00
Sabe Jones e5c060a80b chore(sprites): compile 2019-03-12 17:10:50 -05:00
Sabe Jones 6668aae89b feat(event): Pi Day 2019-03-12 17:10:38 -05:00
Matteo Pagliazzi 9b62804a5c fix tavern/chat ui (#11056)
* add markdown-formatting link - hide textarea if guidelines not accepting - chat ui

* fix item-with-icon height/margins . public guild item member count
2019-03-11 18:32:07 +01:00
negue d21e29462c fix: shop ui (#11046)
* shop: equipment-cards background + market filter logic (as other pages)

* shops - quest: refactor filter logic + quest items margins

* shops-seasonal: refactor filter logic

* shops - timeTravelers: refactor filter logic

* fix star/empty colors - fix quest layout - countBadge z-index
2019-03-11 18:26:23 +01:00
Matteo Pagliazzi 6bccd2a866 New Payments Buttons (#11045)
* start implementing separate amazon button component

* wio

* switch amazon to new flow

* adjust amazon pay button size

* design buttons and add them to the settings page

* abstract css

* fixes and buy gems modal

* group plans css

* new buttons for gifts, fix padding in settings

* gift modal styles

* final style fixes
2019-03-11 18:23:47 +01:00
negue caea222330 fix item-with-icon height/margins . public guild item member count 2019-03-09 22:19:55 +01:00
negue 8ecbdc1448 add markdown-formatting link - hide textarea if guidelines not accepting - chat ui 2019-03-09 21:10:20 +01:00
Sabe Jones ee20b1eea8 4.86.1 2019-03-07 13:30:58 -06:00
Sabe Jones ff62c6eea0 Merge branch 'develop' into release 2019-03-07 13:30:49 -06:00
Melior 57cd4d44cd Translated using Weblate (German) (#11052)
Currently translated at 100.0% (206 of 206 strings)

Translation: Habitica/Settings
Translate-URL: https://translate.habitica.com/projects/habitica/settings/de/

Merge branch 'origin/develop' into Weblate.

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Merge branch 'origin/develop' into Weblate.

Translated using Weblate (Russian)

Currently translated at 100.0% (309 of 309 strings)

Translation: Habitica/Content
Translate-URL: https://translate.habitica.com/projects/habitica/content/ru/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 98.8% (412 of 417 strings)

Translation: Habitica/Backgrounds
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/pt_BR/

Translated using Weblate (Russian)

Currently translated at 100.0% (169 of 169 strings)

Translation: Habitica/Npc
Translate-URL: https://translate.habitica.com/projects/habitica/npc/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (153 of 153 strings)

Translation: Habitica/Limited
Translate-URL: https://translate.habitica.com/projects/habitica/limited/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (153 of 153 strings)

Translation: Habitica/Limited
Translate-URL: https://translate.habitica.com/projects/habitica/limited/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1753 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1752 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (153 of 153 strings)

Translation: Habitica/Limited
Translate-URL: https://translate.habitica.com/projects/habitica/limited/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1752 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (211 of 211 strings)

Translation: Habitica/Tasks
Translate-URL: https://translate.habitica.com/projects/habitica/tasks/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (36 of 36 strings)

Translation: Habitica/Loadingscreentips
Translate-URL: https://translate.habitica.com/projects/habitica/loadingscreentips/ru/

Translated using Weblate (Russian)

Currently translated at 99.7% (1752 of 1757 strings)

Translation: Habitica/Gear
Translate-URL: https://translate.habitica.com/projects/habitica/gear/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (309 of 309 strings)

Translation: Habitica/Content
Translate-URL: https://translate.habitica.com/projects/habitica/content/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (137 of 137 strings)

Translation: Habitica/Challenge
Translate-URL: https://translate.habitica.com/projects/habitica/challenge/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (417 of 417 strings)

Translation: Habitica/Backgrounds
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/ru/

Translated using Weblate (Russian)

Currently translated at 100.0% (417 of 417 strings)

Translation: Habitica/Backgrounds
Translate-URL: https://translate.habitica.com/projects/habitica/backgrounds/ru/

Translated using Weblate (German)

Currently translated at 100.0% (309 of 309 strings)

Translation: Habitica/Content
Translate-URL: https://translate.habitica.com/projects/habitica/content/de/
2019-03-07 13:30:19 -06:00
Sabe Jones e989503cfa Merge branch 'develop' into release 2019-03-07 13:28:34 -06:00
Sabe Jones 431cec7634 fix(strings): remove some trailing spaces 2019-03-07 13:28:05 -06:00
Matteo Pagliazzi 2a367ab3a7 Revert "New payments buttons and new Amazon checkout flow (#10940)"
This reverts commit 77f3bb53de.
2019-03-07 16:58:49 +01:00
Matteo Pagliazzi bc91dd81e9 Revert "fix(amazon): make sure to use up to date data"
This reverts commit 298a79b58d.
2019-03-07 16:58:38 +01:00
Sabe Jones 201085651b Merge branch 'release' into develop 2019-03-05 15:44:04 -06:00
negue 660928323e fix header design (#11013)
* statsbar-component for a closer tooltip

* fix scss scope, twice
2019-03-04 22:01:45 +01:00
Matteo Pagliazzi 298a79b58d fix(amazon): make sure to use up to date data 2019-03-04 22:00:40 +01:00
Matteo Pagliazzi 77f3bb53de New payments buttons and new Amazon checkout flow (#10940)
* start implementing separate amazon button component

* wio

* switch amazon to new flow
2019-03-04 21:51:17 +01:00
Alec Brickner 17d8a7b706 Fix mismatch between pet and star badge (#11041) 2019-03-03 17:48:51 +01:00
Alec Brickner 1d8a5b1952 Keep mystery items synced with server (#11039) 2019-03-03 17:39:42 +01:00
negue f548103f4c fixes Tasks UI (#11036)
* show grabbing cursor while dragging

* 40px height search + tags button

* remove margin of task-title markdown-p-tag

* remove pointer on disabled task-controls

* show `Options` instead of  `Show More`

* remove margin of checklist items

* remove space between notes and checklist
2019-03-03 17:28:58 +01:00
negue 2595ccb2b4 refactor filters to work like in guilds/challenges (#11023) 2019-03-03 17:24:59 +01:00
negue ceb4288b17 Footer Design / Instagram Link (#11022)
* re-add instagram icon+link

* fix donate button hover - smaller icons if not desktop

* lower margin on the small icons

* Update appFooter.vue

remove DevBlog link from footer
2019-03-03 17:22:55 +01:00
negue 3ebd37f7cb replace the questInfo to use table-like behavior, expands to the content (#10995) 2019-03-03 17:17:45 +01:00
Matteo Pagliazzi ff3df55639 Merge branch 'negue/flagpm' into develop 2019-03-03 17:12:19 +01:00
Matteo Pagliazzi 080c4b3e20 Merge branch 'develop' into negue/flagpm 2019-03-03 17:12:11 +01:00
Alec Brickner e939799800 Ensure profile page gets synced (#11032) 2019-03-03 17:05:38 +01:00
Sabe Jones f137342d88 fix(analytics): still more registeredThrough cleanup 2019-02-12 16:12:53 -06:00
Sabe Jones 94db493974 fix(analytics): don't also send prop along with event 2019-02-12 16:07:14 -06:00
Sabe Jones ee5c761680 fix(analytics): set reg platform only once 2019-02-12 16:04:14 -06:00
negue 0cbd6fb4d7 Merge branch 'develop' of https://github.com/HabitRPG/habitica into negue/flagpm
# Conflicts:
#	website/client/components/chat/chatCard.vue
#	website/client/components/header/menu.vue
2019-02-07 19:16:10 +01:00
negue 0ca3c1f94d fix POST-chat.test (author_name format) 2019-01-27 21:29:45 +01:00
negue 2f699e24d7 update test to use the correct author_name format 2019-01-27 19:05:00 +01:00
negue faa0611ab2 Merge branch 'develop' of https://github.com/HabitRPG/habitica into negue/flagpm 2019-01-27 18:14:51 +01:00
negue c66d2cb469 refactor properties - added another "inbox" check 2019-01-14 23:17:26 +01:00
negue 61606cb69d change to User ID - change mail var _DISPLAYNAME _DISPLAY_NAME 2019-01-04 21:04:41 +01:00
Ian Oxley 3d99a64e96 Fix outline around dropdown toggle menu in Firefox
When the menu is open and has the focus shift the outline to the
`.habitica-menu-dropdown-toggle` child element.
2018-12-18 15:58:16 +00:00
Ian Oxley 76f9204417 Update CSS to fix notification layout
Set `.row` inside a `.notification` to use `width: 100%`, and set margin
to zero.
2018-12-18 15:31:45 +00:00
negue 73ecdced01 remove the "delete" part of the flag notification 2018-12-07 00:13:24 +01:00
negue 1c17b415f0 refactor {group,inbox}-chatReporter variables 2018-12-06 23:55:18 +01:00
negue b912a83f22 refactor "formatUser" to show the correct user and displayname 2018-11-29 20:15:47 +01:00
negue fb3a9740bd add display name to the email variables 2018-11-29 20:00:05 +01:00
negue 817c943860 Merge remote-tracking branch 'origin/develop' into negue/flagpm 2018-11-29 19:02:01 +01:00
negue 0aba448c48 fix sentence 2018-11-29 19:01:26 +01:00
Ian Oxley 6b5173ecbf Replace button tag with ARIA button role
Add `role`, `aria-pressed`, `tabindex`, and keypress handlers, and
remove the `<button>` tag.

Add `isPressed` computed function. Use this to set the value of
`aria-pressed`.
2018-11-26 22:34:15 +00:00
Ian Oxley 53d8d2fc6a Fix :focus CSS for the dropdown menu
Add `:focus` style to the `.habitica-menu-dropdown` class, instead of
the `.habitica-menu-dropdown-toggle` class.
2018-11-26 22:31:57 +00:00
negue 52a7112591 some ui fixes / requested changes 2018-11-20 17:20:58 +01:00
Ian Oxley fd13771088 Set background on the dropdown toggle
Set the background to `$white` to stop Firefox falling back to the
default grey background for a button.
2018-11-19 19:40:41 +00:00
Ian Oxley c9d725ec20 Fix +ve / -ve habit control buttons
Align the icons centrally within the positive / negative controls.
2018-11-19 19:34:01 +00:00
negue 3203bffeaa refactor update the message to use .save - fix test 2018-11-18 22:37:09 +01:00
negue 3f47cdd9a2 merge fixes 2018-11-18 22:12:41 +01:00
negue 8b15d94ae1 Merge remote-tracking branch 'origin/develop' into negue/flagpm
# Conflicts:
#	website/client/components/chat/chatCard.vue
#	website/client/components/chat/chatMessages.vue
#	website/common/locales/en/messages.json
2018-11-18 22:04:33 +01:00
negue 8f2435c37c refactor Inbox-mongodb requests 2018-11-08 22:04:55 +01:00
Ian Oxley 302bc899d7 Update reward button and toggle menu
Add `<button>` tag to the 3 dots toggle menu, and the reward control.

Update the CSS to add focus styles, in addition to hover styles, for the
3 dots toggle menu.
2018-11-07 00:06:30 +00:00
Ian Oxley 8048cf9a97 Add <button> tag to shop items
Make the `.item` element a `<button>` so it can receive keyboard focus,
and be activated via the spacebar.
2018-11-06 23:24:34 +00:00
Ian Oxley 20548daccf Use <button> for habits +/- buttons
Use the `<button>` tag instead of a `<div>`. This makes the element
naturally focusable with the keyboard, and makes the HTML more semantic.

Update the CSS to align the icons in the centre of the `<button>`.
2018-11-06 22:55:51 +00:00
negue 2c250bfcd9 fix tests / lint 2018-10-14 15:28:00 +02:00
negue 75e3f15352 remove the v3 api method 2018-10-10 20:50:10 +02:00
negue 5670be26c7 review fixes 2018-10-10 20:46:43 +02:00
negue 9fc03cb91a cleanup 2018-10-08 19:08:14 +02:00
negue 7e80406181 fix flagging in the new inbox collection - move flag private message to api/v4 2018-10-02 21:23:29 +02:00
negue 60a6f6f2f6 fix merge issues 2018-09-30 15:37:14 +02:00
negue 92d68e5c6e Merge branch 'develop' of https://github.com/HabitRPG/habitica into negue/flagpm
# Conflicts:
#	website/client/components/chat/chatCard.vue
#	website/client/components/chat/chatMessages.vue
#	website/common/locales/en/messages.json
#	website/server/libs/slack.js
2018-09-22 19:18:08 +02:00
negue 6e7d8d93fe fix test import 2018-06-25 20:23:04 +02:00
negue bc861133e1 fix doc path 2018-06-25 18:48:43 +02:00
negue 31ef21f25c Merge branch 'develop' of https://github.com/HabitRPG/habitica into negue/flagpm
# Conflicts:
#	website/client/store/actions/chat.js
2018-06-25 18:47:47 +02:00
negue 97e1465899 fix ci - revert reporter to user var 2018-06-13 22:55:28 +02:00
negue 7cb0f5145d update margin / color 2018-06-11 22:53:43 +02:00
negue 5b6217a0bf pass userId for admin-calls 2018-06-11 22:39:07 +02:00
negue 09e4c88606 add tests + fix lint 2018-06-08 21:50:52 +02:00
negue 13bae96708 hide report button if already reported 2018-06-08 21:16:11 +02:00
negue 6241001eef remove unneeded try/catch 2018-06-08 21:03:26 +02:00
negue dc5722d0de report & mark message 2018-06-08 20:26:26 +02:00
negue e3b2443029 move reportFlagModal to menu.vue 2018-06-08 19:15:21 +02:00
negue ca5927fe73 sendInboxFlagNotification (for private message flag content) 2018-06-02 19:27:28 +02:00
negue 5a0eed7eae copy chatReporter - fix unknown apiMessages - add api for flagging pm 2018-06-02 18:18:00 +02:00
negue 532881e679 enable flagging private message - v-once for simple strings/icons - fix flag notification 2018-06-02 18:16:24 +02:00
negue 27d763a46c add slack debug calls (logger.info) 2018-06-02 18:14:53 +02:00
255 changed files with 16901 additions and 14988 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
const MIGRATION_NAME = 'mystery_items_201902';
const MYSTERY_ITEMS = ['eyewear_mystery_201902', 'shield_mystery_201902'];
const MIGRATION_NAME = 'mystery_items_201903';
const MYSTERY_ITEMS = ['armor_mystery_201903', 'head_mystery_201903'];
import { model as User } from '../../website/server/models/user';
import { model as UserNotification } from '../../website/server/models/userNotification';
+73
View File
@@ -0,0 +1,73 @@
/* eslint-disable no-console */
const MIGRATION_NAME = '20190314_pi_day';
import { v4 as uuid } from 'uuid';
import { model as User } from '../../website/server/models/user';
const progressCount = 1000;
let count = 0;
async function updateUser (user) {
count++;
const inc = {
'items.food.Pie_Skeleton': 1,
'items.food.Pie_Base': 1,
'items.food.Pie_CottonCandyBlue': 1,
'items.food.Pie_CottonCandyPink': 1,
'items.food.Pie_Shade': 1,
'items.food.Pie_White': 1,
'items.food.Pie_Golden': 1,
'items.food.Pie_Zombie': 1,
'items.food.Pie_Desert': 1,
'items.food.Pie_Red': 1,
};
const set = {};
set.migration = MIGRATION_NAME;
set['items.gear.owned.head_special_piDay'] = false;
set['items.gear.owned.shield_special_piDay'] = false;
const push = [
{type: 'marketGear', path: 'gear.flat.head_special_piDay', _id: uuid()},
{type: 'marketGear', path: 'gear.flat.shield_special_piDay', _id: uuid()},
];
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
return await User.update({_id: user._id}, {$inc: inc, $set: set, $push: {pinnedItems: {$each: push}}}).exec();
}
module.exports = async function processUsers () {
let query = {
migration: {$ne: MIGRATION_NAME},
'auth.timestamps.loggedin': {$gt: new Date('2019-02-15')},
};
const fields = {
_id: 1,
items: 1,
};
while (true) { // eslint-disable-line no-constant-condition
const users = await User // eslint-disable-line no-await-in-loop
.find(query)
.limit(250)
.sort({_id: 1})
.select(fields)
.lean()
.exec();
if (users.length === 0) {
console.warn('All appropriate users found and modified.');
console.warn(`\n${count} users processed\n`);
break;
} else {
query._id = {
$gt: users[users.length - 1],
};
}
await Promise.all(users.map(updateUser)); // eslint-disable-line no-await-in-loop
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "4.86.0",
"version": "4.90.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "4.86.0",
"version": "4.90.1",
"main": "./website/server/index.js",
"dependencies": {
"@google-cloud/trace-agent": "^3.5.2",
+3 -2
View File
@@ -32,6 +32,7 @@ describe('slack', () => {
},
message: {
id: 'chat-id',
username: 'author',
user: 'Author',
uuid: 'author-id',
text: 'some text',
@@ -50,11 +51,11 @@ describe('slack', () => {
expect(IncomingWebhook.prototype.send).to.be.calledOnce;
expect(IncomingWebhook.prototype.send).to.be.calledWith({
text: 'flagger (flagger-id; language: flagger-lang) flagged a message',
text: 'flagger (flagger-id; language: flagger-lang) flagged a group message',
attachments: [{
fallback: 'Flag Message',
color: 'danger',
author_name: `Author - author@example.com - author-id\n${timestamp}`,
author_name: `@author Author (author@example.com; author-id)\n${timestamp}`,
title: 'Flag in Some group - (private guild)',
title_link: undefined,
text: 'some text',
@@ -63,11 +63,11 @@ describe('POST /chat/:chatId/flag', () => {
/* eslint-disable camelcase */
expect(IncomingWebhook.prototype.send).to.be.calledWith({
text: `${user.profile.name} (${user.id}; language: en) flagged a message`,
text: `${user.profile.name} (${user.id}; language: en) flagged a group message`,
attachments: [{
fallback: 'Flag Message',
color: 'danger',
author_name: `${anotherUser.profile.name} - ${anotherUser.auth.local.email} - ${anotherUser._id}\n${timestamp}`,
author_name: `@${anotherUser.auth.local.username} ${anotherUser.profile.name} (${anotherUser.auth.local.email}; ${anotherUser._id})\n${timestamp}`,
title: 'Flag in Test Guild',
title_link: `${BASE_URL}/groups/guild/${group._id}`,
text: TEST_MESSAGE,
@@ -98,11 +98,11 @@ describe('POST /chat/:chatId/flag', () => {
/* eslint-disable camelcase */
expect(IncomingWebhook.prototype.send).to.be.calledWith({
text: `${newUser.profile.name} (${newUser.id}; language: en) flagged a message`,
text: `${newUser.profile.name} (${newUser.id}; language: en) flagged a group message`,
attachments: [{
fallback: 'Flag Message',
color: 'danger',
author_name: `${newUser.profile.name} - ${newUser.auth.local.email} - ${newUser._id}\n${timestamp}`,
author_name: `@${newUser.auth.local.username} ${newUser.profile.name} (${newUser.auth.local.email}; ${newUser._id})\n${timestamp}`,
title: 'Flag in Test Guild',
title_link: `${BASE_URL}/groups/guild/${group._id}`,
text: TEST_MESSAGE,
@@ -257,7 +257,7 @@ describe('POST /chat', () => {
attachments: [{
fallback: 'Slur Message',
color: 'danger',
author_name: `${user.profile.name} - ${user.auth.local.email} - ${user._id}`,
author_name: `@${user.auth.local.username} ${user.profile.name} (${user.auth.local.email}; ${user._id})`,
title: 'Slur in Test Guild',
title_link: `${BASE_URL}/groups/guild/${groupWithChat.id}`,
text: testSlurMessage,
@@ -310,7 +310,7 @@ describe('POST /chat', () => {
attachments: [{
fallback: 'Slur Message',
color: 'danger',
author_name: `${members[0].profile.name} - ${members[0].auth.local.email} - ${members[0]._id}`,
author_name: `@${members[0].auth.local.username} ${members[0].profile.name} (${members[0].auth.local.email}; ${members[0]._id})`,
title: 'Slur in Party - (private party)',
title_link: undefined,
text: testSlurMessage,
@@ -67,4 +67,10 @@ describe('GET /heroes/:heroId', () => {
expect(heroRes.auth.local).not.to.have.keys(['salt', 'hashed_password']);
expect(heroRes.profile).to.have.all.keys(['name']);
});
it('returns correct hero using search with difference case', async () => {
await generateUser({}, { username: 'TestUpperCaseName123' });
let heroRes = await user.get('/hall/heroes/TestuPPerCasEName123');
expect(heroRes.auth.local.username).to.equal('TestUpperCaseName123');
});
});
@@ -110,4 +110,22 @@ describe('POST /user/auth/local/login', () => {
let isValidPassword = await bcryptCompare(textPassword, user.auth.local.hashed_password);
expect(isValidPassword).to.equal(true);
});
it('user uses social authentication and has no password', async () => {
await user.unset({
'auth.local.hashed_password': 1,
});
await user.sync();
expect(user.auth.local.hashed_password).to.be.undefined;
await expect(api.post(endpoint, {
username: user.auth.local.username,
password: 'any-password',
})).to.eventually.be.rejected.and.eql({
code: 401,
error: 'NotAuthorized',
message: t('invalidLoginCredentialsLong'),
});
});
});
@@ -0,0 +1,74 @@
import {
generateUser,
translate as t,
} from '../../../helpers/api-integration/v4';
describe('POST /members/flag-private-message/:messageId', () => {
let userToSendMessage;
let messageToSend = 'Test Private Message';
beforeEach(async () => {
userToSendMessage = await generateUser();
});
it('Allows players to flag their own private message', async () => {
let receiver = await generateUser();
await userToSendMessage.post('/members/send-private-message', {
message: messageToSend,
toUserId: receiver._id,
});
let senderMessages = await userToSendMessage.get('/inbox/messages');
let sendersMessageInSendersInbox = _.find(senderMessages, (message) => {
return message.uuid === receiver._id && message.text === messageToSend;
});
expect(sendersMessageInSendersInbox).to.exist;
await expect(userToSendMessage.post(`/members/flag-private-message/${sendersMessageInSendersInbox.id}`)).to.eventually.be.ok;
});
it('Flags a private message', async () => {
let receiver = await generateUser();
await userToSendMessage.post('/members/send-private-message', {
message: messageToSend,
toUserId: receiver._id,
});
let receiversMessages = await receiver.get('/inbox/messages');
let sendersMessageInReceiversInbox = _.find(receiversMessages, (message) => {
return message.uuid === userToSendMessage._id && message.text === messageToSend;
});
expect(sendersMessageInReceiversInbox).to.exist;
await expect(receiver.post(`/members/flag-private-message/${sendersMessageInReceiversInbox.id}`)).to.eventually.be.ok;
});
it('Returns an error when user tries to flag a private message that is already flagged', async () => {
let receiver = await generateUser();
await userToSendMessage.post('/members/send-private-message', {
message: messageToSend,
toUserId: receiver._id,
});
let receiversMessages = await receiver.get('/inbox/messages');
let sendersMessageInReceiversInbox = _.find(receiversMessages, (message) => {
return message.uuid === userToSendMessage._id && message.text === messageToSend;
});
expect(sendersMessageInReceiversInbox).to.exist;
await expect(receiver.post(`/members/flag-private-message/${sendersMessageInReceiversInbox.id}`)).to.eventually.be.ok;
await expect(receiver.post(`/members/flag-private-message/${sendersMessageInReceiversInbox.id}`))
.to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: t('messageGroupChatFlagAlreadyReported'),
});
});
});
@@ -4,6 +4,7 @@ import { requester } from './requester';
import {
getDocument as getDocumentFromMongo,
updateDocument as updateDocumentInMongo,
unsetDocument as unsetDocumentInMongo,
} from '../mongo';
import {
assign,
@@ -29,6 +30,18 @@ class ApiObject {
return this;
}
async unset (options) {
if (isEmpty(options)) {
return;
}
await unsetDocumentInMongo(this._docType, this, options);
_updateLocalParameters((this, options));
return this;
}
async sync () {
let updatedDoc = await getDocumentFromMongo(this._docType, this);
@@ -13,10 +13,16 @@ import * as Tasks from '../../../../website/server/models/task';
// parameter, such as the number of wolf eggs the user has,
// , you can do so by passing in the full path as a string:
// { 'items.eggs.Wolf': 10 }
export async function generateUser (update = {}) {
let username = (Date.now() + generateUUID()).substring(0, 20);
let password = 'password';
let email = `${username}@example.com`;
//
// To manually set a username, email or password pass it in as
// an object for the second parameter. Only overrides need to be
// added. Items that don't exist will be autogenerated.
// Example: generateUser({}, { username: 'TestName' }) adds user
// with the 'TestName' username.
export async function generateUser (update = {}, overrides = {}) {
let username = overrides.username || (Date.now() + generateUUID()).substring(0, 20);
let password = overrides.password || 'password';
let email = overrides.email || `${username}@example.com`;
let user = await requester().post('/user/auth/local/register', {
username,
+13
View File
@@ -98,6 +98,19 @@ export async function updateDocument (collectionName, doc, update) {
});
}
// Unset a property in the database.
// Useful for testing.
export async function unsetDocument (collectionName, doc, update) {
let collection = mongoose.connection.db.collection(collectionName);
return new Promise((resolve) => {
collection.updateOne({ _id: doc._id }, { $unset: update }, (updateErr) => {
if (updateErr) throw new Error(`Error updating ${collectionName}: ${updateErr}`);
resolve();
});
});
}
export async function getDocument (collectionName, doc) {
let collection = mongoose.connection.db.collection(collectionName);
@@ -1,42 +1,72 @@
.promo_armoire_backgrounds_201903 {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px -220px;
background-position: -719px -767px;
width: 423px;
height: 147px;
}
.promo_beffymaroo_wondercon {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px 0px;
width: 718px;
height: 932px;
}
.promo_celestial_rainbow_potions {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px -933px;
width: 423px;
height: 147px;
}
.promo_classes_spring2019 {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -719px -604px;
width: 432px;
height: 162px;
}
.promo_egg_hunt {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -424px -933px;
width: 354px;
height: 147px;
}
.promo_mystery_201902 {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -424px -220px;
background-position: -1160px -196px;
width: 240px;
height: 147px;
}
.promo_mythical_marvels_bundle {
.promo_mystery_201903 {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px -368px;
width: 423px;
background-position: -779px -933px;
width: 351px;
height: 147px;
}
.promo_seasonalshop_spring {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -1160px -344px;
width: 162px;
height: 138px;
}
.promo_take_this {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -424px -368px;
background-position: -1160px -483px;
width: 96px;
height: 69px;
}
.promo_valentines_potions {
.scene_dailies {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px -516px;
width: 420px;
height: 147px;
background-position: -719px -327px;
width: 327px;
height: 276px;
}
.scene_achievement {
.scene_tavern {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: -397px 0px;
width: 339px;
height: 210px;
background-position: -719px 0px;
width: 440px;
height: 326px;
}
.scene_cooking {
.scene_todos {
background-image: url('~assets/images/sprites/spritesmith-largeSprites-0.png');
background-position: 0px 0px;
width: 396px;
height: 219px;
background-position: -1160px 0px;
width: 240px;
height: 195px;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 968 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 344 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

@@ -0,0 +1,26 @@
.vdp-datepicker .vdp-datepicker__calendar {
.cell:not(.blank):not(.disabled).day:hover {
border-radius: 2px;
border: 1px solid $purple-400;
}
.cell.selected,
.cell.selected.highlighted,
.cell.selected:hover {
color: $white;
background: $purple-300;
}
.cell.highlighted {
background: rgba($purple-400, 0.24);
color: $purple-200;
}
.cell.highlighted,
.cell.selected {
border-radius: 2px;
font-weight: bold;
}
}
+1 -1
View File
@@ -159,7 +159,7 @@ $bg-disabled-control: #34303a;
width: 18px;
height: 18px;
background-image: url(~client/assets/svg/for-css/checkbox-white.svg);
background-size: 75% 75%;
background-size: 13px 10px;
}
&:active~.custom-control-label::before {
+2
View File
@@ -36,3 +36,5 @@
@import './animals';
@import './iconalert';
@import './tiers';
@import './payments';
@import './datepicker.scss';
+44
View File
@@ -0,0 +1,44 @@
.payments-column {
display: flex;
flex-direction: column;
width: 296px;
justify-content: center;
&.payments-disabled {
opacity: 0.64;
.btn, .btn:hover, .btn:active {
box-shadow: none;
}
.payment-item > *{
cursor: default !important;
}
}
.payment-item {
margin-bottom: 12px;
display: flex;
&.payment-button {
display: flex;
justify-content: center;
align-items: center;
.credit-card-icon {
width: 21.3px;
height: 16px;
margin-right: 8.7px;
}
&.paypal-checkout {
background: #009cde;
img {
width: 157px;
height: 21px;
}
}
}
}
}
+5 -5
View File
@@ -2,8 +2,8 @@
// possible values are: normal, fall, habitoween, thanksgiving, winter, nye, birthday, valentines, spring, summer
// more to be added on future seasons
$npc_market_flavor: 'normal';
$npc_quests_flavor: 'normal';
$npc_seasonal_flavor: 'normal';
$npc_timetravelers_flavor: 'normal';
$npc_tavern_flavor: 'normal';
$npc_market_flavor: 'spring';
$npc_quests_flavor: 'spring';
$npc_seasonal_flavor: 'spring';
$npc_timetravelers_flavor: 'spring';
$npc_tavern_flavor: 'spring';
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="16" viewBox="0 0 22 16">
<path fill="#FFF" fill-rule="nonzero" d="M0 13.872V5.333h21.333v8.539c0 1.176-.747 2.128-1.67 2.128H1.67C.747 16 0 15.047 0 13.872zM19.664 0c.922 0 1.67.918 1.67 2.053v.614H0v-.614C0 .918.747 0 1.67 0h17.994z"/>
</svg>

After

Width:  |  Height:  |  Size: 307 B

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#E1E0E3" fill-rule="evenodd" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
<path class="star-empty" fill="#E1E0E3" fill-rule="evenodd" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
</svg>

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 232 B

@@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<path fill="#E1E0E3" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
<path fill="#FFB445" d="M8 0L5.333 5.333 0 8l5.333 2.667L8 16z"/>
<path class="star-empty" fill="#E1E0E3" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
<path class="star" fill="#FFB445" d="M8 0L5.333 5.333 0 8l5.333 2.667L8 16z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 352 B

@@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#FFB445" fill-rule="evenodd" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
<path class="star" fill="#FFB445" fill-rule="evenodd" d="M10.667 10.667L16 8l-5.333-2.667L8 0 5.333 5.333 0 8l5.333 2.667L8 16z"/>
</svg>

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 226 B

@@ -164,30 +164,30 @@ export default {
classGear (heroClass) {
if (heroClass === 'rogue') {
return {
armor: 'armor_rogue_5',
head: 'head_rogue_5',
shield: 'shield_rogue_6',
weapon: 'weapon_rogue_6',
armor: 'armor_special_spring2019Rogue',
head: 'head_special_spring2019Rogue',
shield: 'shield_special_spring2019Rogue',
weapon: 'weapon_special_spring2019Rogue',
};
} else if (heroClass === 'wizard') {
return {
armor: 'armor_wizard_5',
head: 'head_wizard_5',
weapon: 'weapon_wizard_6',
armor: 'armor_special_spring2019Mage',
head: 'head_special_spring2019Mage',
weapon: 'weapon_special_spring2019Mage',
};
} else if (heroClass === 'healer') {
return {
armor: 'armor_healer_5',
head: 'head_healer_5',
shield: 'shield_healer_5',
weapon: 'weapon_healer_6',
armor: 'armor_special_spring2019Healer',
head: 'head_special_spring2019Healer',
shield: 'shield_special_spring2019Healer',
weapon: 'weapon_special_spring2019Healer',
};
} else {
return {
armor: 'armor_warrior_5',
head: 'head_warrior_5',
shield: 'shield_warrior_5',
weapon: 'weapon_warrior_6',
armor: 'armor_special_spring2019Warrior',
head: 'head_special_spring2019Warrior',
shield: 'shield_special_spring2019Warrior',
weapon: 'weapon_special_spring2019Warrior',
};
}
},
+43 -15
View File
@@ -43,6 +43,8 @@
li(v-html='$t("communityForum")')
li
a(href='https://www.facebook.com/Habitica', target='_blank') {{ $t('communityFacebook') }}
li
a(href='https://www.instagram.com/habitica', target='_blank') {{ $t('communityInstagram') }}
li
a(href='https://www.reddit.com/r/habitrpg/', target='_blank') {{ $t('communityReddit') }}
.col-12.col-md-6
@@ -56,23 +58,22 @@
a(:href="getDataDisplayToolUrl", target='_blank') {{ $t('dataDisplayTool') }}
li
a(href='http://habitica.fandom.com/wiki/Guidance_for_Blacksmiths', target='_blank') {{ $t('guidanceForBlacksmiths') }}
li
a(href='http://devs.habitica.com/', target='_blank') {{ $t('devBlog') }}
.col-6.social
h3 {{ $t('footerSocial') }}
a.social-circle(href='https://twitter.com/habitica', target='_blank')
.social-icon.svg-icon(v-html='icons.twitter')
// TODO: Not ready yet. a.social-circle(href='https://www.instagram.com/habitica/', target='_blank')
.social-icon.svg-icon.instagram(v-html='icons.instagram')
a.social-circle(href='https://www.facebook.com/Habitica', target='_blank')
.social-icon.facebook.svg-icon(v-html='icons.facebook')
.icons
a.social-circle(href='https://twitter.com/habitica', target='_blank')
.social-icon.svg-icon(v-html='icons.twitter')
a.social-circle(href='https://www.instagram.com/habitica/', target='_blank')
.social-icon.svg-icon.instagram(v-html='icons.instagram')
a.social-circle(href='https://www.facebook.com/Habitica', target='_blank')
.social-icon.facebook.svg-icon(v-html='icons.facebook')
.row
.col-12.col-md-8 {{ $t('donateText3') }}
.col-12.col-md-4
button.btn.btn-contribute(@click="donate()", v-if="user")
button.btn.btn-contribute.btn-flat(@click="donate()", v-if="user")
.svg-icon.heart(v-html="icons.heart")
.text {{ $t('companyDonate') }}
.btn.btn-contribute(v-else)
.btn.btn-contribute.btn-flat(v-else)
a(href='http://habitica.fandom.com/wiki/Contributing_to_Habitica', target='_blank')
.svg-icon.heart(v-html="icons.heart")
.text {{ $t('companyContribute') }}
@@ -145,6 +146,22 @@
}
}
.icons {
display: flex;
justify-content: flex-end;
flex-shrink: 1;
}
// smaller than desktop
@media only screen and (max-width: 992px) {
.social-circle {
height: 32px !important;
width: 32px !important;
margin-left: 0.75em !important;
}
}
.social-circle {
width: 40px;
height: 40px;
@@ -152,17 +169,20 @@
background-color: #c3c0c7;
display: flex;
margin-left: 1em;
float: right;
&:first-child {
margin-left: 0;
}
&:hover {
background-color: #a5a1ac;
}
.social-icon {
color: #e1e0e3;
width: 16px;
margin: auto;
}
.instagram {
margin-top: .85em;
}
}
.logo {
@@ -185,6 +205,14 @@
box-shadow: none;
border-radius: 4px;
&:hover {
background: #a5a1ac;
.text {
color: white;
}
}
a {
display: flex;
}
+39 -12
View File
@@ -1,8 +1,8 @@
<template lang="pug">
div
.mentioned-icon(v-if='isUserMentioned')
.message-hidden(v-if='msg.flagCount === 1 && user.contributor.admin') Message flagged once, not hidden
.message-hidden(v-if='msg.flagCount > 1 && user.contributor.admin') Message hidden
.message-hidden(v-if='!inbox && msg.flagCount === 1 && user.contributor.admin') Message flagged once, not hidden
.message-hidden(v-if='!inbox && msg.flagCount > 1 && user.contributor.admin') Message hidden
.card-body
user-link(:userId="msg.uuid", :name="msg.user", :backer="msg.backer", :contributor="msg.contributor")
p.time
@@ -11,25 +11,28 @@ div
span(v-b-tooltip="", :title="msg.timestamp | date") {{ msg.timestamp | timeAgo }}&nbsp;
span(v-if="msg.client && user.contributor.level >= 4") ({{ msg.client }})
.text(v-html='atHighlight(parseMarkdown(msg.text))')
.reported(v-if="isMessageReported && (inbox === true)")
span(v-once) {{ $t('reportedMessage')}}
br
span(v-once) {{ $t('canDeleteNow') }}
hr
.d-flex(v-if='msg.id')
.action.d-flex.align-items-center(v-if='!inbox', @click='copyAsTodo(msg)')
.svg-icon(v-html="icons.copy")
div {{$t('copyAsTodo')}}
.action.d-flex.align-items-center(v-if='!inbox && user.flags.communityGuidelinesAccepted && msg.uuid !== "system"', @click='report(msg)')
.svg-icon(v-html="icons.report")
div {{$t('report')}}
// @TODO make flagging/reporting work in the inbox. NOTE: it must work even if the communityGuidelines are not accepted and it MUST work for messages that you have SENT as well as received. -- Alys
.action.d-flex.align-items-center(v-if='(inbox || (user.flags.communityGuidelinesAccepted && msg.uuid !== "system")) && (!isMessageReported || user.contributor.admin)', @click='report(msg)')
.svg-icon(v-html="icons.report", v-once)
div(v-once) {{$t('report')}}
.action.d-flex.align-items-center(v-if='msg.uuid === user._id || inbox || user.contributor.admin', @click='remove()')
.svg-icon(v-html="icons.delete")
| {{$t('delete')}}
.svg-icon(v-html="icons.delete", v-once)
div(v-once) {{$t('delete')}}
.ml-auto.d-flex(v-b-tooltip="{title: likeTooltip(msg.likes[user._id])}", v-if='!inbox')
.action.d-flex.align-items-center.mr-0(@click='like()', v-if='likeCount > 0', :class='{active: msg.likes[user._id]}')
.svg-icon(v-html="icons.liked", :title='$t("liked")')
| +{{ likeCount }}
.action.d-flex.align-items-center.mr-0(@click='like()', v-if='likeCount === 0', :class='{active: msg.likes[user._id]}')
.svg-icon(v-html="icons.like", :title='$t("like")')
span(v-if='!msg.likes[user._id]') {{ $t('like') }}
span(v-if='!msg.likes[user._id] && !inbox') {{ $t('like') }}
</template>
<style lang="scss">
@@ -111,6 +114,11 @@ div
color: $purple-400;
}
}
.reported {
margin-top: 18px;
color: $red-50;
}
</style>
<script>
@@ -132,8 +140,15 @@ import reportIcon from 'assets/svg/report.svg';
import {highlightUsers} from '../../libs/highlightUsers';
export default {
props: ['msg', 'inbox', 'groupId'],
components: {userLink},
props: {
msg: {},
inbox: {
type: Boolean,
default: false,
},
groupId: {},
},
data () {
return {
icons: Object.freeze({
@@ -143,6 +158,7 @@ export default {
delete: deleteIcon,
liked: likedIcon,
}),
reported: false,
};
},
filters: {
@@ -191,6 +207,9 @@ export default {
}
return likeCount;
},
isMessageReported () {
return this.msg.flags && this.msg.flags[this.user.id] || this.reported;
},
},
methods: {
async like () {
@@ -216,10 +235,18 @@ export default {
copyAsTodo (message) {
this.$root.$emit('habitica::copy-as-todo', message);
},
async report () {
report () {
this.$root.$on('habitica:report-result', data => {
if (data.ok) {
this.reported = true;
}
this.$root.$off('habitica:report-result');
});
this.$root.$emit('habitica::report-chat', {
message: this.msg,
groupId: this.groupId,
groupId: this.groupId || 'privateMessage',
});
},
async remove () {
@@ -3,7 +3,6 @@
.row
.col-12
copy-as-todo-modal(:group-type='groupType', :group-name='groupName', :group-id='groupId')
report-flag-modal
div(v-for="(msg, index) in messages", v-if='chat && canViewFlag(msg)', :class='{row: inbox}')
.d-flex(v-if='user._id !== msg.uuid', :class='{"flex-grow-1": inbox}')
avatar.avatar-left(
@@ -105,14 +104,21 @@ import findIndex from 'lodash/findIndex';
import Avatar from '../avatar';
import copyAsTodoModal from './copyAsTodoModal';
import reportFlagModal from './reportFlagModal';
import chatCard from './chatCard';
export default {
props: ['chat', 'groupType', 'groupId', 'groupName', 'inbox'],
props: {
chat: {},
inbox: {
type: Boolean,
default: false,
},
groupType: {},
groupId: {},
groupName: {},
},
components: {
copyAsTodoModal,
reportFlagModal,
chatCard,
Avatar,
},
@@ -106,14 +106,16 @@ export default {
this.$root.$emit('bv::hide::modal', 'report-flag');
},
async reportAbuse () {
this.notify('Thank you for reporting this violation. The moderators have been notified.');
this.text(this.$t(this.groupId === 'privateMessage' ? 'pmReported' : 'abuseReported'));
await this.$store.dispatch('chat:flag', {
let result = await this.$store.dispatch('chat:flag', {
groupId: this.groupId,
chatId: this.abuseObject.id,
comment: this.reportComment,
});
this.$root.$emit('habitica:report-result', result);
this.close();
},
async clearFlagCount () {
@@ -139,7 +139,6 @@ b-modal#avatar-modal(title="", :size='editing ? "lg" : "md"', :hide-header='true
span 5
button.btn.btn-secondary.purchase-all(@click='unlock(`hair.base.${baseHair4Keys.join(",hair.base.")}`)') {{ $t('purchaseAll') }}
.col-12.customize-options
.head_0.option(@click='set({"preferences.hair.base": 0})', :class="[{ active: user.preferences.hair.base === 0 }, 'hair_base_0_' + user.preferences.hair.color]")
.option(v-for='option in baseHair1',
:class='{active: user.preferences.hair.base === option}')
.base.sprite.customize-option(:class="`hair_base_${option}_${user.preferences.hair.color}`", @click='set({"preferences.hair.base": option})')
@@ -22,11 +22,11 @@
button.btn.btn-primary.btn-lg.btn-block(@click="createGroup()", :disabled="!newGroupIsReady") {{ $t('createGroupPlan') }}
.col-12(v-if='activePage === PAGES.PAY')
h2 {{ $t('choosePaymentMethod') }}
.payment-providers
.box.payment-button(@click='pay(PAYMENTS.STRIPE)')
.svg-icon.credit-card-icon(v-html="icons.creditCard")
.box.payment-button.amazon(@click='pay(PAYMENTS.AMAZON)')
.svg-icon.amazon-pay-icon(v-html="icons.amazonpay")
.payments-column
button.purchase.btn.btn-primary.payment-button.payment-item(@click='pay(PAYMENTS.STRIPE)')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
amazon-button.payment-item(:amazon-data="pay(PAYMENTS.AMAZON)")
</template>
<style lang="scss" scoped>
@@ -65,40 +65,29 @@
opacity: 0.7;
}
.amazon-pay-icon {
width: 150px;
}
.credit-card-icon {
width: 150px;
color: #4e4a57;
}
.btn-block {
margin-bottom: 1em;
}
.payment-button.amazon {
margin-bottom: 2em;
}
</style>
<script>
import * as Analytics from 'client/libs/analytics';
import { mapState } from 'client/libs/store';
import paymentsMixin from '../../mixins/payments';
import amazonButton from 'client/components/payments/amazonButton';
import amazonpay from 'assets/svg/amazonpay.svg';
import creditCard from 'assets/svg/credit-card.svg';
import creditCardIcon from 'assets/svg/credit-card-icon.svg';
export default {
mixins: [paymentsMixin],
components: {
amazonButton,
},
data () {
return {
amazonPayments: {},
icons: Object.freeze({
amazonpay,
creditCard,
creditCardIcon,
}),
PAGES: {
CREATE_GROUP: 'create-group',
@@ -159,7 +148,7 @@ export default {
this.showStripe(paymentData);
} else if (this.paymentMethod === this.PAYMENTS.AMAZON) {
paymentData.type = 'subscription';
this.amazonPaymentsInit(paymentData);
return paymentData;
}
},
},
+42 -12
View File
@@ -1,9 +1,10 @@
<template lang="pug">
.row.chat-row
.col-12
h3(v-once) {{ label }}
h3.float-left.label(:class="{accepted: communityGuidelinesAccepted }") {{ label }}
div.float-right(v-markdown='$t("markdownFormattingHelp")')
.row
.row(v-if="communityGuidelinesAccepted")
textarea(:placeholder='placeholder',
v-model='newMessage',
ref='user-entry',
@@ -22,14 +23,14 @@
:caretPosition = 'caretPosition',
:chat='group.chat')
community-guidelines
.row.chat-actions
.col-6.chat-receive-actions
button.btn.btn-secondary.float-left.fetch(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }}
button.btn.btn-secondary.float-left(v-once, @click='reverseChat()') {{ $t('reverseChat') }}
.col-6.chat-send-actions
button.btn.btn-secondary.send-chat.float-right(v-once, @click='sendMessage()') {{ $t('send') }}
community-guidelines
button.btn.btn-primary.send-chat.float-right(:disabled="!communityGuidelinesAccepted", @click='sendMessage()') {{ $t('send') }}
slot(
name="additionRow",
@@ -46,9 +47,14 @@
import autocomplete from '../chat/autoComplete';
import communityGuidelines from './communityGuidelines';
import chatMessage from '../chat/chatMessages';
import { mapState } from 'client/libs/store';
import markdownDirective from 'client/directives/markdown';
export default {
props: ['label', 'group', 'placeholder'],
directives: {
markdown: markdownDirective,
},
components: {
autocomplete,
communityGuidelines,
@@ -71,9 +77,13 @@
};
},
computed: {
...mapState({user: 'user.data'}),
currentLength () {
return this.newMessage.length;
},
communityGuidelinesAccepted () {
return this.user.flags.communityGuidelinesAccepted;
},
},
methods: {
// https://medium.com/@_jh3y/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a
@@ -114,12 +124,22 @@
async sendMessage () {
if (this.sending) return;
this.sending = true;
let response = await this.$store.dispatch('chat:postChat', {
group: this.group,
message: this.newMessage,
});
this.group.chat.unshift(response.message);
this.newMessage = '';
let response;
try {
response = await this.$store.dispatch('chat:postChat', {
group: this.group,
message: this.newMessage,
});
} catch (e) {
// catch exception to allow function to continue
}
if (response) {
this.group.chat.unshift(response.message);
this.newMessage = '';
}
this.sending = false;
// @TODO: I would like to not reload everytime we send. Why are we reloading?
@@ -196,6 +216,16 @@
.chat-row {
position: relative;
.label:not(.accepted) {
color: #a5a1ac;
}
.row {
margin-left: 0;
margin-right: 0;
clear: both;
}
textarea {
min-height: 150px;
width: 100%;
@@ -204,7 +234,7 @@
font-style: italic;
line-height: 1.43;
color: $gray-300;
padding: .5em;
padding: 10px 12px;
}
.user-entry {
@@ -11,17 +11,31 @@
.community-guidelines {
background-color: rgba(135, 129, 144, 0.84);
padding: 1em;
padding-left: 0;
padding-right: 0;
color: $white;
position: absolute;
top: 0;
height: 150px;
margin-top: 2.3em;
width: 100%;
// width: calc(100% - 24px);
border-radius: 4px;
align-items: center;
justify-content: center;
.col {
padding: 20px 24px;
}
a {
text-decoration: underline;
color: $white;
font-weight: bold;
}
button {
margin: 20px 12px;
padding-top: 5px;
padding-bottom: 5px;
}
.btn-follow-guidelines {
white-space: pre-line;
}
+6 -3
View File
@@ -21,12 +21,12 @@
.svg-icon.shield(v-html="icons.silverGuildBadgeIcon", v-if='group.memberCount > 100 && group.memberCount < 999')
.svg-icon.shield(v-html="icons.bronzeGuildBadgeIcon", v-if='group.memberCount < 100')
span.number {{ group.memberCount | abbrNum }}
div.member-list(v-once) {{ $t('memberList') }}
div.member-list.label(v-once) {{ $t('memberList') }}
.col-4(v-if='!isParty')
.item-with-icon(@click='showGroupGems()')
.svg-icon.gem(v-html="icons.gem")
span.number {{group.balance * 4}}
div(v-once) {{ $t('guildBank') }}
div.label(v-once) {{ $t('guildBank') }}
chat(
:label="$t('chat')",
:group="group",
@@ -100,6 +100,9 @@
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
padding: 1em;
text-align: center;
min-width: 80px;
max-width: 120px;
height: 76px;
.svg-icon.shield, .svg-icon.gem {
width: 28px;
@@ -115,7 +118,7 @@
font-weight: bold;
}
.member-list {
.label {
margin-top: .5em;
}
}
+18 -57
View File
@@ -48,14 +48,11 @@ div
.box.payment-providers
h3 Choose your payment method
.box.payment-button(@click='pay(PAYMENTS.STRIPE)')
div
.svg-icon.credit-card-icon(v-html="icons.group")
p.credit-card Credit Card
p Powered by Stripe
.box.payment-button(@click='pay(PAYMENTS.AMAZON)')
.svg-icon.amazon-pay-icon(v-html="icons.amazonpay")
.payments-column
button.purchase.btn.btn-primary.payment-button.payment-item(@click='pay(PAYMENTS.STRIPE)')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
amazon-button.payment-item(:amazon-data="pay(PAYMENTS.AMAZON)")
.container.col-6.offset-3.create-option(v-if='!upgradingGroup._id')
.row
h1.col-12.text-center.purple-header Create your Group today!
@@ -99,13 +96,13 @@ div
.form-group
button.btn.btn-primary.btn-lg.btn-block(@click="createGroup()", :disabled="!newGroupIsReady") {{ $t('createGroupPlan') }}
.col-12(v-if='activePage === PAGES.PAY')
.payment-providers
.text-center
h3 Choose your payment method
.box.payment-button(@click='pay(PAYMENTS.STRIPE)')
p Credit Card
p Powered by Stripe
.box.payment-button(@click='pay(PAYMENTS.AMAZON)')
| Amazon Pay
.payments-column.mx-auto
button.purchase.btn.btn-primary.payment-button.payment-item(@click='pay(PAYMENTS.STRIPE)')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
amazon-button.payment-item(:amazon-data="pay(PAYMENTS.AMAZON)")
</template>
<style lang="scss" scoped>
@@ -130,12 +127,6 @@ div
color: #fff;
}
.payment-button {
display: block;
margin: 0 auto;
margin-bottom: 1em;
}
.plus .svg-icon{
width: 24px;
}
@@ -143,26 +134,6 @@ div
.payment-providers {
width: 350px;
}
.credit-card {
font-size: 20px;
font-weight: bold;
margin-bottom: 0;
margin-top: .5em;
display: inline-block;
}
.credit-card-icon {
width: 25px;
display: inline-block;
margin-right: .5em;
}
.amazon-pay-icon {
width: 150px;
margin: 0 auto;
margin-top: .5em;
}
}
.header {
@@ -316,35 +287,25 @@ div
vertical-align: bottom;
}
}
.payment-button {
width: 200px;
height: 80px;
margin-bottom: .5em;
padding: .5em;
display: block;
}
.payment-button:hover {
cursor: pointer;
}
</style>
<script>
import paymentsMixin from '../../mixins/payments';
import { mapState } from 'client/libs/store';
import group from 'assets/svg/group.svg';
import amazonpay from 'assets/svg/amazonpay.svg';
import positiveIcon from 'assets/svg/positive.svg';
import creditCardIcon from 'assets/svg/credit-card-icon.svg';
import amazonButton from 'client/components/payments/amazonButton';
export default {
mixins: [paymentsMixin],
components: {
amazonButton,
},
data () {
return {
amazonPayments: {},
icons: Object.freeze({
group,
amazonpay,
creditCardIcon,
positiveIcon,
}),
PAGES: {
@@ -413,7 +374,7 @@ export default {
this.showStripe(paymentData);
} else if (this.paymentMethod === this.PAYMENTS.AMAZON) {
paymentData.type = 'subscription';
this.amazonPaymentsInit(paymentData);
return paymentData;
}
},
},
@@ -109,7 +109,7 @@ router-link.card-link(:to="{ name: 'guild', params: { groupId: guild._id } }")
.member-count {
position: relative;
top: -3.6em;
top: -3.7em;
font-size: 18px;
font-weight: bold;
line-height: 1.1;
@@ -3,6 +3,7 @@ div
inbox-modal
creator-intro
profileModal
report-flag-modal
send-gems-modal
b-navbar.topbar.navbar-inverse.static-top(toggleable="lg", type="dark", :class="navbarZIndexClass")
b-navbar-brand.brand
@@ -351,12 +352,15 @@ import profileModal from '../userMenu/profileModal';
import sendGemsModal from 'client/components/payments/sendGemsModal';
import userDropdown from './userDropdown';
import reportFlagModal from '../chat/reportFlagModal';
export default {
components: {
creatorIntro,
InboxModal,
notificationMenu,
profileModal,
reportFlagModal,
sendGemsModal,
userDropdown,
},
@@ -4,6 +4,7 @@
v-if="item != null",
:hide-header="true",
@change="onChange($event)"
@hide="fixDocBody()"
)
div.close
span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close", @click="hideDialog()")
@@ -187,8 +188,16 @@
},
hideDialog () {
this.$root.$emit('bv::hide::modal', 'equipgear-modal');
},
fixDocBody () {
document.body.classList.remove('modal-open');
document.body.setAttribute('data-modal-open-count', document.body.getAttribute('data-modal-open-count') - 1);
if (document.body.getAttribute('data-modal-open-count') <= 1) {
document.body.removeAttribute('data-modal-open-count');
} else {
document.body.setAttribute('data-modal-open-count', document.body.getAttribute('data-modal-open-count') - 1);
}
document.body.removeAttribute('data-padding-right');
document.body.style.removeProperty('padding-right');
},
memberOverrideAvatarGear (gear) {
return {
@@ -82,7 +82,7 @@
)
div(
v-for="group in itemsGroups",
v-if="viewOptions[group.key].selected",
v-if="!anyFilterSelected || viewOptions[group.key].selected",
:key="group.key",
:class='group.key',
)
@@ -383,10 +383,13 @@ export default {
items () {
return this.groupBy === 'type' ? this.gearItemsByType : this.gearItemsByClass;
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
itemsGroups () {
return map(this.groups, (label, group) => {
this.$set(this.viewOptions, group, {
selected: true,
selected: false,
open: false,
itemsInFirstPosition: [],
firstRender: true,
@@ -25,7 +25,7 @@
b-dropdown-item(@click="sortBy = 'AZ'", :active="sortBy === 'AZ'") {{ $t('AZ') }}
div(
v-for="group in groups",
v-if="group.selected",
v-if="!anyFilterSelected || group.selected",
:key="group.key",
)
h2.mb-3
@@ -225,7 +225,7 @@ const groups = [
return {
key: group,
quantity: 0,
selected: true,
selected: false,
classPrefix,
allowedItems,
};
@@ -340,6 +340,10 @@ export default {
return itemsByType;
},
anyFilterSelected () {
return this.groups.some(g => g.selected);
},
},
methods: {
userHasPet (potionKey, eggKey) {
@@ -465,8 +469,6 @@ export default {
let openedItem = result.data.data;
let text = this.content.gear.flat[openedItem.key].text();
this.drop(this.$t('messageDropMysteryItem', {dropText: text}), openedItem);
item.quantity--;
this.$forceUpdate();
} else {
this.$root.$emit('selectMembersModal::showItem', item);
}
@@ -69,7 +69,7 @@
span.badge.badge-pill.badge-default {{countOwnedAnimals(petGroups[0], 'pet')}}
div(v-for="(petGroup, index) in petGroups",
v-if="viewOptions[petGroup.key].selected",
v-if="!anyFilterSelected || viewOptions[petGroup.key].selected",
:key="petGroup.key")
h4(v-if="viewOptions[petGroup.key].animalCount !== 0") {{ petGroup.label }}
@@ -92,7 +92,11 @@
@click="petClicked(item)"
)
template(slot="itemBadge", slot-scope="context")
starBadge(:selected="item.key === currentPet", :show="isOwned('pet', item)", @click="selectPet(item)")
starBadge(
:selected="context.item.key === currentPet",
:show="isOwned('pet', context.item)",
@click="selectPet(context.item)"
)
.btn.btn-flat.btn-show-more(@click="setShowMore(petGroup.key)", v-if='petGroup.key !== "specialPets"')
| {{ $_openedItemRows_isToggled(petGroup.key) ? $t('showLess') : $t('showMore') }}
@@ -103,7 +107,7 @@
span.badge.badge-pill.badge-default {{countOwnedAnimals(mountGroups[0], 'mount')}}
div(v-for="mountGroup in mountGroups",
v-if="viewOptions[mountGroup.key].selected",
v-if="!anyFilterSelected || viewOptions[mountGroup.key].selected",
:key="mountGroup.key")
h4(v-if="viewOptions[mountGroup.key].animalCount != 0") {{ mountGroup.label }}
@@ -469,7 +473,7 @@
petGroups.map((petGroup) => {
this.$set(this.viewOptions, petGroup.key, {
selected: true,
selected: false,
animalCount: 0,
});
});
@@ -514,7 +518,7 @@
mountGroups.map((mountGroup) => {
this.$set(this.viewOptions, mountGroup.key, {
selected: true,
selected: false,
animalCount: 0,
});
});
@@ -538,6 +542,9 @@
},
];
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
methods: {
setShowMore (key) {
+27 -75
View File
@@ -23,21 +23,31 @@
span.mr-1(v-if="member.auth && member.auth.local && member.auth.local.username") @{{ member.auth.local.username }}
span.mr-1(v-if="member.auth && member.auth.local && member.auth.local.username")
span {{ characterLevel }}
.progress-container(v-b-tooltip.hover.bottom="$t('health')")
.svg-icon(v-html="icons.health")
.progress
.progress-bar.bg-health(:style="{width: `${percent(member.stats.hp, MAX_HEALTH)}%`}")
span.small-text {{member.stats.hp | statFloor}} / {{MAX_HEALTH}}
.progress-container(v-b-tooltip.hover.bottom="$t('experience')")
.svg-icon(v-html="icons.experience")
.progress
.progress-bar.bg-experience(:style="{width: `${percent(member.stats.exp, toNextLevel)}%`}")
span.small-text {{member.stats.exp | statFloor}} / {{toNextLevel}}
.progress-container(v-if="hasClass", v-b-tooltip.hover.bottom="$t('mana')")
.svg-icon(v-html="icons.mana")
.progress
.progress-bar.bg-mana(:style="{width: `${percent(member.stats.mp, maxMP)}%`}")
span.small-text {{member.stats.mp | statFloor}} / {{maxMP}}
stats-bar(
:icon="icons.health",
:value="member.stats.hp",
:maxValue="MAX_HEALTH",
:tooltip="$t('health')",
progressClass="bg-health",
:condensed="condensed"
)
stats-bar(
:icon="icons.experience",
:value="member.stats.exp",
:maxValue="toNextLevel",
:tooltip="$t('experience')",
progressClass="bg-experience",
:condensed="condensed"
)
stats-bar(
v-if="hasClass",
:icon="icons.mana",
:value="member.stats.mp",
:maxValue="maxMP",
:tooltip="$t('mana')",
progressClass="bg-mana",
:condensed="condensed"
)
</template>
<style lang="scss" scoped>
@@ -99,44 +109,6 @@
margin-bottom: .5em
}
.progress-container {
margin-left: 4px;
margin-bottom: .5em;
height: 24px;
}
.progress-container > span {
color: $header-color;
margin-left: 8px;
font-style: normal;
line-height: 1;
}
.progress-container > .svg-icon {
width: 24px;
height: 24px;
margin-right: 8px;
}
.progress-container > .progress {
min-width: 200px;
margin: 0px;
border-radius: 2px;
height: 12px;
background-color: $header-dark-background;
}
.progress-container > .progress > .progress-bar {
border-radius: 2px;
height: 12px;
min-width: 0px;
}
.progress-container .svg-icon, .progress-container .progress, .progress-container .small-text {
display: inline-block;
vertical-align: middle;
}
// Condensed version
.member-details.condensed.expanded {
background: $header-dark-background;
@@ -163,25 +135,6 @@
border-bottom-left-radius: 4px;
z-index: 9;
}
.progress-container > .svg-icon {
width: 19px;
height: 19px;
margin-top: -2px;
}
.progress-container > .progress {
width: 152px;
border-radius: 0px;
height: 10px;
margin-top: 2px;
background: $purple-100;
}
.progress-container > .progress > .progress-bar {
border-radius: 0px;
height: 10px;
}
}
</style>
@@ -190,6 +143,7 @@ import Avatar from './avatar';
import ClassBadge from './members/classBadge';
import { mapState } from 'client/libs/store';
import Profile from './userMenu/profile';
import StatsBar from './ui/statsbar';
import { toNextLevel } from '../../common/script/statHelpers';
import statsComputed from '../../common/script/libs/statsComputed';
@@ -205,9 +159,7 @@ export default {
Avatar,
Profile,
ClassBadge,
},
directives: {
// bTooltip,
StatsBar,
},
props: {
member: {
@@ -0,0 +1,114 @@
<template lang="pug">
.amazon-pay-button(:id="buttonId")
</template>
<script>
import axios from 'axios';
import { mapState } from 'client/libs/store';
import uuid from 'uuid';
import paymentsMixin from 'client/mixins/payments';
const AMAZON_PAYMENTS = process.env.AMAZON_PAYMENTS; // eslint-disable-line
export default {
mixins: [paymentsMixin],
data () {
return { // @TODO what needed here? can be moved to mixin?
amazonPayments: {
modal: null,
type: null,
gift: null,
loggedIn: false,
paymentSelected: false,
billingAgreementId: '',
recurringConsent: false,
orderReferenceId: null,
subscription: null,
coupon: null,
},
isAmazonSetup: false,
amazonButtonEnabled: false,
groupToCreate: null, // creating new group
group: null, // upgrading existing group
buttonId: null,
};
},
props: {
amazonData: Object,
amazonDisabled: {
type: Boolean,
default: false,
},
},
computed: {
...mapState({user: 'user.data'}),
...mapState(['isAmazonReady']),
amazonPaymentsCanCheckout () {
if (this.amazonPayments.type === 'single') {
return this.amazonPayments.paymentSelected === true;
} else if (this.amazonPayments.type === 'subscription') {
return this.amazonPayments.paymentSelected && this.amazonPayments.recurringConsent;
}
return false;
},
},
watch: {
amazonData () {
this.amazonPaymentsInit(this.amazonData);
},
},
beforeMount () {
this.buttonId = `AmazonPayButton-${uuid.v4()}`;
},
mounted () {
this.amazonPaymentsInit(this.amazonData);
if (this.isAmazonReady) return this.setupAmazon();
this.$store.watch(state => state.isAmazonReady, (isAmazonReady) => {
if (isAmazonReady) return this.setupAmazon();
});
},
methods: {
setupAmazon () {
if (this.isAmazonSetup) return false;
this.isAmazonSetup = true;
this.showButton();
},
showButton () {
window.OffAmazonPayments.Button( // eslint-disable-line new-cap
this.buttonId, // ID of the button
AMAZON_PAYMENTS.SELLER_ID,
{
type: 'PwA',
color: 'Gold',
size: 'large',
agreementType: 'BillingAgreement',
onSignIn: async (contract) => { // @TODO send to modal
if (this.amazonDisabled === true) return null;
// if (!this.checkGemAmount(this.amazonData)) return;
this.amazonPayments.billingAgreementId = contract.getAmazonBillingAgreementId();
this.$set(this.amazonPayments, 'loggedIn', true);
this.$root.$emit('habitica::pay-with-amazon', this.amazonPayments);
},
authorization: () => {
if (this.amazonDisabled === true) return null;
window.amazon.Login.authorize({
scope: 'payments:widget',
popup: true,
}, function amazonSuccess (response) {
if (response.error) return alert(response.error);
const url = '/amazon/verifyAccessToken';
axios.post(url, response).catch((e) => {
alert(e.message);
});
});
},
onError: this.amazonOnError, // @TODO port here
});
},
},
};
</script>
@@ -1,7 +1,6 @@
<template lang="pug">
b-modal#amazon-payment(title="Amazon", :hide-footer="true", size='md')
h2.text-center Continue with Amazon
#AmazonPayButton
#AmazonPayWallet(v-if="amazonPayments.loggedIn", style="width: 400px; height: 228px;")
template(v-if="amazonPayments.loggedIn && amazonPayments.type === 'subscription'")
br
@@ -19,7 +18,7 @@
margin-bottom: 12px;
}
#AmazonPayButton, #AmazonPayWallet, #AmazonPayRecurring {
#AmazonPayWallet, #AmazonPayRecurring {
margin: 0 auto;
}
@@ -54,7 +53,6 @@ export default {
subscription: null,
coupon: null,
},
OffAmazonPayments: {},
isAmazonSetup: false,
amazonButtonEnabled: false,
groupToCreate: null, // creating new group
@@ -74,12 +72,6 @@ export default {
},
},
mounted () {
if (this.isAmazonReady) return this.setupAmazon();
this.$store.watch(state => state.isAmazonReady, (isAmazonReady) => {
if (isAmazonReady) return this.setupAmazon();
});
this.$root.$on('habitica::pay-with-amazon', (amazonPaymentsData) => {
if (!amazonPaymentsData) return;
@@ -90,67 +82,30 @@ export default {
this.amazonPayments = Object.assign({}, amazonPayments, amazonPaymentsData);
this.$root.$emit('bv::show::modal', 'amazon-payment');
this.$nextTick(async () => {
if (this.amazonPayments.type === 'subscription') {
this.amazonInitWidgets();
} else {
let url = '/amazon/createOrderReferenceId';
let response = await axios.post(url, {
billingAgreementId: this.amazonPayments.billingAgreementId,
});
if (response.status <= 400) {
this.amazonPayments.orderReferenceId = response.data.data.orderReferenceId;
this.amazonInitWidgets();
} else {
alert(response.message);
}
}
});
});
},
destroyed () {
this.$root.$off('habitica::pay-with-amazon');
},
methods: {
setupAmazon () {
if (this.isAmazonSetup) return false;
this.isAmazonSetup = true;
this.OffAmazonPayments = window.OffAmazonPayments;
this.showButton();
},
showButton () {
// @TODO: prevent modal close form clicking outside
let amazonButton = this.OffAmazonPayments.Button( // eslint-disable-line
'AmazonPayButton',
AMAZON_PAYMENTS.SELLER_ID,
{
type: 'PwA',
color: 'Gold',
size: 'small',
agreementType: 'BillingAgreement',
onSignIn: async (contract) => {
this.amazonPayments.billingAgreementId = contract.getAmazonBillingAgreementId();
this.$set(this.amazonPayments, 'loggedIn', true);
if (this.amazonPayments.type === 'subscription') {
this.amazonInitWidgets();
} else {
let url = '/amazon/createOrderReferenceId';
let response = await axios.post(url, {
billingAgreementId: this.amazonPayments.billingAgreementId,
});
if (response.status <= 400) {
this.amazonPayments.orderReferenceId = response.data.data.orderReferenceId;
this.amazonInitWidgets();
return;
}
alert(response.message);
}
},
authorization: () => {
window.amazon.Login.authorize({
scope: 'payments:widget',
popup: true,
}, function amazonSuccess (response) {
if (response.error) return alert(response.error);
let url = '/amazon/verifyAccessToken';
axios.post(url, response)
.catch((e) => {
alert(e.message);
});
});
},
onError: this.amazonOnError,
});
},
amazonInitWidgets () {
let walletParams = {
sellerId: AMAZON_PAYMENTS.SELLER_ID, // @TODO: Import
@@ -167,15 +122,14 @@ export default {
walletParams.onReady = (billingAgreement) => {
this.amazonPayments.billingAgreementId = billingAgreement.getAmazonBillingAgreementId();
new this.OffAmazonPayments.Widgets.Consent({
new window.OffAmazonPayments.Widgets.Consent({
sellerId: AMAZON_PAYMENTS.SELLER_ID,
amazonBillingAgreementId: this.amazonPayments.billingAgreementId,
design: {
designMode: 'responsive',
},
onReady: (consent) => {
let getConsent = consent.getConsentStatus;
this.$set(this.amazonPayments, 'recurringConsent', getConsent ? Boolean(getConsent()) : false);
this.$set(this.amazonPayments, 'recurringConsent', consent.getConsentStatus ? Boolean(consent.getConsentStatus()) : false);
this.$set(this, 'amazonButtonEnabled', true);
},
onConsent: (consent) => {
@@ -189,7 +143,7 @@ export default {
walletParams.amazonOrderReferenceId = this.amazonPayments.orderReferenceId;
}
new this.OffAmazonPayments.Widgets.Wallet(walletParams).bind('AmazonPayWallet');
new window.OffAmazonPayments.Widgets.Wallet(walletParams).bind('AmazonPayWallet');
},
storePaymentStatusAndReload (url) {
let paymentType;
@@ -305,30 +259,6 @@ export default {
amazonOnPaymentSelect () {
this.$set(this.amazonPayments, 'paymentSelected', true);
},
amazonOnError (error) {
alert(error.getErrorMessage());
this.reset();
},
reset () {
// @TODO: Ensure we are using all of these
// some vars are set in the payments mixin. We should try to edit in one place
this.amazonPayments.modal = null;
this.amazonPayments.type = null;
this.amazonPayments.loggedIn = false;
// Gift
this.amazonPayments.gift = null;
this.amazonPayments.giftReceiver = null;
this.amazonPayments.billingAgreementId = null;
this.amazonPayments.orderReferenceId = null;
this.amazonPayments.paymentSelected = false;
this.amazonPayments.recurringConsent = false;
this.amazonPayments.subscription = null;
this.amazonPayments.coupon = null;
this.amazonPayments.groupToCreate = null;
this.amazonPayments.group = null;
},
},
};
</script>
@@ -44,16 +44,15 @@
button.btn.btn-primary(@click='gemAmount === 20 ? gemAmount = 0 : gemAmount = 20') {{gemAmount === 20 ? $t('selected') : '$5.00'}}
.row.text-center
h2.mx-auto.text-payment {{ $t('choosePaymentMethod') }}
.card-deck
.card.text-center.payment-method(@click='showStripe({})')
.card-body
.mx-auto(v-html='icons.creditCard', style='"height: 56px; width: 159px; margin-top: 1em;"')
.card.text-center.payment-method
a.card-body.paypal(@click="openPaypal(paypalCheckoutLink, 'gems')")
img(src='~assets/images/paypal.png')
.card.text-center.payment-method(@click="amazonPaymentsInit({type: 'single'})")
.card-body.amazon
img(src='~assets/images/amazon-payments.png')
.payments-column
button.purchase.btn.btn-primary.payment-button.payment-item(@click='showStripe({})')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
button.btn.payment-item.paypal-checkout.payment-button(@click="openPaypal(paypalCheckoutLink, 'gems')")
| &nbsp;
img(src='~assets/images/paypal-checkout.png', :alt="$t('paypal')")
| &nbsp;
amazon-button.payment-item(:amazon-data="{type: 'single'}")
.row.text-center
.svg-icon.mx-auto(v-html='icons.heart', style='"height: 24px; width: 24px;"')
.row.text-center.text-outtro
@@ -127,16 +126,16 @@
h2.mx-auto.text-payment(v-once) {{ $t('choosePaymentMethod') }}
.row.text-center
a.mx-auto(v-once) {{ $t('haveCouponCode') }}
.card-deck(v-if='subscriptionPlan')
.card.text-center.payment-method
.card-body(@click='showStripe({subscription: subscriptionPlan})')
.mx-auto(v-html='icons.creditCard', style='"height: 56px; width: 159px; margin-top: 1em;"')
.card.text-center.payment-method
a.card-body.paypal(@click="openPaypal(paypalSubscriptionLink, 'subscription')")
img(src='~assets/images/paypal.png')
.card.text-center.payment-method
.card-body.amazon(@click="amazonPaymentsInit({type: 'subscription', subscription: subscriptionPlan})")
img(src='~assets/images/amazon-payments.png')
.payments-column(v-if='subscriptionPlan')
button.purchase.btn.btn-primary.payment-button.payment-item(@click='showStripe({subscription: subscriptionPlan})')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
button.btn.payment-item.paypal-checkout.payment-button(@click="openPaypal(paypalSubscriptionLink, 'subscription')")
| &nbsp;
img(src='~assets/images/paypal-checkout.png', :alt="$t('paypal')")
| &nbsp;
amazon-button.payment-item(:amazon-data="{type: 'subscription', subscription: subscriptionPlan}")
.row.text-center
.svg-icon.mx-auto(v-html='icons.heart', style='"height: 24px; width: 24px;"')
.row.text-center.text-outtro
@@ -162,6 +161,11 @@
<style lang="scss" scoped>
@import '~client/assets/scss/colors.scss';
.payments-column {
margin: 0 auto;
}
a.mx-auto {
color: #2995cd;
}
@@ -174,10 +178,6 @@
font-size: 16px;
}
.amazon {
padding-top: 1.8em;
}
.benefits {
font-size: 14px;
}
@@ -194,19 +194,6 @@
justify-content: center;
}
.card {
margin: 1em;
border-radius: 2px;
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
}
.card.active {
border-color: #24cc8f;
button {
background-color: #24cc8f;
}
}
.divider {
width: 80%;
height: 1px;
@@ -272,18 +259,6 @@
cursor: pointer;
}
.payment-method {
background-color: #e1e0e3;
}
.payment-method:hover {
cursor: pointer;
}
.paypal {
padding-top: 1.3em;
}
.spacer {
height: 4em;
}
@@ -328,7 +303,6 @@
color: #4e4a57;
font-size: 24px;
margin: 1em;
opacity: 0.64;
}
</style>
@@ -339,7 +313,7 @@
import paymentsMixin from 'client/mixins/payments';
import checkIcon from 'assets/svg/check.svg';
import creditCard from 'assets/svg/credit-card.svg';
import creditCardIcon from 'assets/svg/credit-card-icon.svg';
import heart from 'assets/svg/health.svg';
import logo from 'assets/svg/habitica-logo.svg';
@@ -348,10 +322,13 @@
import fortyTwoGems from 'assets/svg/42-gems.svg';
import eightyFourGems from 'assets/svg/84-gems.svg';
import amazonButton from 'client/components/payments/amazonButton';
export default {
mixins: [paymentsMixin],
components: {
planGemLimits,
amazonButton,
},
computed: {
...mapState({user: 'user.data'}),
@@ -373,7 +350,7 @@
icons: Object.freeze({
logo,
check: checkIcon,
creditCard,
creditCardIcon,
fourGems,
heart,
twentyOneGems,
@@ -383,7 +360,6 @@
gemAmount: 0,
subscriptionPlan: '',
selectedPage: 'subscribe',
amazonPayments: {},
planGemLimits,
};
},
@@ -1,6 +1,6 @@
<template lang="pug">
b-modal#send-gems(:title="title", :hide-footer="true", size='lg', @hide='onHide()')
.modal-body(v-if='userReceivingGems')
b-modal#send-gems(:title="title", :hide-footer="true", size='md', @hide='onHide()')
div(v-if='userReceivingGems')
.panel.panel-default(
:class="gift.type === 'gems' ? 'panel-primary' : 'transparent'",
@click='gift.type = "gems"'
@@ -32,7 +32,7 @@ b-modal#send-gems(:title="title", :hide-footer="true", size='lg', @hide='onHide(
h3.panel-heading {{ $t('subscription') }}
.panel-body
.row
.col-md-4
.col-md-12
.form-group
.radio(v-for='block in subscriptionBlocks', v-if="block.target !== 'group' && block.canSubscribe === true")
label
@@ -48,11 +48,18 @@ b-modal#send-gems(:title="title", :hide-footer="true", size='lg', @hide='onHide(
@click="sendGift()",
:disabled="sendingInProgress"
) {{ $t("send") }}
template(v-else)
button.btn.btn-primary(@click='showStripe({gift, uuid: userReceivingGems._id, receiverName})') {{ $t('card') }}
button.btn.btn-warning(@click='openPaypalGift({gift: gift, giftedTo: userReceivingGems._id, receiverName})') PayPal
button.btn.btn-success(@click="amazonPaymentsInit({type: 'single', gift, giftedTo: userReceivingGems._id, receiverName})") Amazon Payments
button.btn.btn-secondary(@click='close()') {{$t('cancel')}}
.payments-column.mx-auto(v-else, :class="{'payments-disabled': !gift.subscription.key && gift.gems.amount < 1}")
button.purchase.btn.btn-primary.payment-button.payment-item(@click='showStripe({gift, uuid: userReceivingGems._id, receiverName})', :disabled="!gift.subscription.key && gift.gems.amount < 1")
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
button.btn.payment-item.paypal-checkout.payment-button(@click="openPaypalGift({gift: gift, giftedTo: userReceivingGems._id, receiverName})", :disabled="!gift.subscription.key && gift.gems.amount < 1")
| &nbsp;
img(src='~assets/images/paypal-checkout.png', :alt="$t('paypal')")
| &nbsp;
amazon-button.payment-item.mb-0(
:amazon-data="{type: 'single', gift, giftedTo: userReceivingGems._id, receiverName}",
:amazon-disabled="!gift.subscription.key && gift.gems.amount < 1",
)
</template>
<style lang="scss">
@@ -78,6 +85,12 @@ b-modal#send-gems(:title="title", :hide-footer="true", size='lg', @hide='onHide(
}
</style>
<style lang="scss" scoped>
input[type="radio"] {
margin-right: 4px;
}
</style>
<script>
import toArray from 'lodash/toArray';
import omitBy from 'lodash/omitBy';
@@ -86,12 +99,17 @@ import { mapState } from 'client/libs/store';
import planGemLimits from '../../../common/script/libs/planGemLimits';
import paymentsMixin from 'client/mixins/payments';
import notificationsMixin from 'client/mixins/notifications';
import amazonButton from 'client/components/payments/amazonButton';
import creditCardIcon from 'assets/svg/credit-card-icon.svg';
// @TODO: EMAILS.TECH_ASSISTANCE_EMAIL, load from config
const TECH_ASSISTANCE_EMAIL = 'admin@habitica.com';
export default {
mixins: [paymentsMixin, notificationsMixin],
components: {
amazonButton,
},
data () {
return {
planGemLimits,
@@ -110,6 +128,9 @@ export default {
},
sendingInProgress: false,
userReceivingGems: null,
icons: Object.freeze({
creditCardIcon,
}),
};
},
computed: {
@@ -33,6 +33,8 @@
span(v-html="$t(paymentData.newGroup ? 'groupPlanCreated' : 'groupPlanUpgraded', {groupName: paymentData.group.name})")
.details-block
span(v-html="$t('paymentSubBilling', {amount: groupPlanCost, months: paymentData.subscription.months})")
template(v-if="paymentData.paymentType === 'groupPlan' || paymentData.paymentType === 'subscription'")
span.small-text.auto-renew(v-once) {{ $t('paymentAutoRenew') }}
button.btn.btn-primary(@click='close()', v-once) {{$t('onwards')}}
</template>
@@ -116,6 +118,12 @@
}
}
}
.auto-renew {
margin-top: 16px;
color: $orange-10;
font-style: normal;
}
}
#payments-success-modal .modal-footer {
@@ -73,15 +73,15 @@
.subscribe-pay(v-if='!hasSubscription || hasCanceledSubscription')
h3 {{ $t('subscribeUsing') }}
.row.text-center
.col-md-4
button.purchase.btn.btn-primary(@click='showStripe({subscription:subscription.key, coupon:subscription.coupon})', :disabled='!subscription.key') {{ $t('card') }}
.col-md-4
a.purchase(@click="openPaypal(paypalPurchaseLink, 'subscription')", :disabled='!subscription.key')
img(src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png', :alt="$t('paypal')")
.col-md-4
a.btn.btn-secondary.purchase(@click="payWithAmazon()")
img(src='https://payments.amazon.com/gp/cba/button', :alt="$t('amazonPayments')")
.payments-column
button.purchase.btn.btn-primary.payment-button.payment-item(@click='showStripe({subscription:subscription.key, coupon:subscription.coupon})', :disabled='!subscription.key')
.svg-icon.credit-card-icon(v-html="icons.creditCardIcon")
| {{ $t('card') }}
button.btn.payment-item.paypal-checkout.payment-button(@click="openPaypal(paypalPurchaseLink, 'subscription')", :disabled='!subscription.key')
| &nbsp;
img(src='~assets/images/paypal-checkout.png', :alt="$t('paypal')")
| &nbsp;
amazon-button.payment-item(:amazon-data="{type: 'subscription', subscription: this.subscription.key, coupon: this.subscription.coupon}")
.row
.col-6
h2(v-once) {{ $t('giftSubscription') }}
@@ -92,7 +92,7 @@
h4(v-once) {{ $t('giftSubscriptionText4') }}
</template>
<style scoped>
<style scoped lang="scss">
.badge.badge-success {
color: #fff;
}
@@ -115,8 +115,14 @@ import planGemLimits from '../../../common/script/libs/planGemLimits';
import paymentsMixin from '../../mixins/payments';
import notificationsMixin from '../../mixins/notifications';
import amazonButton from 'client/components/payments/amazonButton';
import creditCardIcon from 'assets/svg/credit-card-icon.svg';
export default {
mixins: [paymentsMixin, notificationsMixin],
components: {
amazonButton,
},
data () {
return {
loading: false,
@@ -137,6 +143,9 @@ export default {
PAYPAL: 'Paypal',
GIFT: 'Gift',
},
icons: Object.freeze({
creditCardIcon,
}),
};
},
computed: {
@@ -240,13 +249,6 @@ export default {
},
},
methods: {
payWithAmazon () {
this.amazonPaymentsInit({
type: 'subscription',
subscription: this.subscription.key,
coupon: this.subscription.coupon,
});
},
async applyCoupon (coupon) {
const response = await axios.post(`/api/v4/coupons/validate/${coupon}`);
@@ -21,7 +21,7 @@ layout-section(:title="$t('equipment')")
span(slot="item", slot-scope="ctx")
span.text {{ $t(ctx.item.id) }}
itemRows(
itemRows.equipment-rows(
:items="sortedGearItems",
:itemWidth=94,
:itemMargin=24,
@@ -169,6 +169,10 @@ layout-section(:title="$t('equipment')")
};
</script>
<style scoped>
<style lang="scss" scoped>
.equipment-rows {
/deep/ .item.item-empty {
background: white;
}
}
</style>
@@ -21,7 +21,7 @@
h1.mb-4.page-header(v-once) {{ $t('market') }}
equipment-section(
v-if="viewOptions['equipment'].selected",
v-if="!anyFilterSelected || viewOptions['equipment'].selected",
:hidePinned="hidePinned",
:hideLocked="hideLocked",
:searchBy="searchTextThrottled"
@@ -39,17 +39,17 @@
span.text {{ $t(ctx.item.id) }}
div(
v-for="category in categories",
v-if="viewOptions[category.identifier].selected && category.identifier !== 'equipment'"
v-if="!anyFilterSelected || viewOptions[category.identifier].selected && category.identifier !== 'equipment'"
)
h4 {{ category.text }}
category-row(
:hidePinned="hidePinned",
:hideLocked="hideLocked",
:searchBy="searchTextThrottled",
:sortBy="selectedSortItemsBy.id",
:category="category"
)
keys-to-kennel(v-if='category.identifier === "special"')
category-row(
:hidePinned="hidePinned",
:hideLocked="hideLocked",
:searchBy="searchTextThrottled",
:sortBy="selectedSortItemsBy.id",
:category="category"
)
keys-to-kennel(v-if='category.identifier === "special"')
div.fill-height
inventoryDrawer(:showEggs="true", :showPotions="true")
@@ -290,13 +290,16 @@ export default {
categories.map((category) => {
if (!this.viewOptions[category.identifier]) {
this.$set(this.viewOptions, category.identifier, {
selected: true,
selected: false,
});
}
});
return categories;
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
methods: {
sellItem (itemScope) {
@@ -26,7 +26,7 @@
br
div(v-else)
div(v-once)
div
div.text {{ item.notes() }}
div
@@ -52,11 +52,6 @@
:popoverPosition="'top'",
@click="selectItem(item)"
)
template(slot="popoverContent", slot-scope="ctx")
div.questPopover
h4.popover-content-title {{ item.text }}
questInfo(:quest="item")
template(slot="itemBadge", slot-scope="ctx")
span.badge.badge-pill.badge-item.badge-svg(
:class="{'item-selected-badge': ctx.item.pinned, 'hide': !ctx.item.pinned}",
@@ -81,7 +76,7 @@
div(
v-for="category in categories",
v-if="viewOptions[category.identifier].selected"
v-if="!anyFilterSelected || viewOptions[category.identifier].selected"
)
h2.mb-3 {{ category.text }}
@@ -244,20 +239,22 @@
display: inline-block;
width: 33%;
margin-bottom: 24px;
vertical-align: top;
.items {
border-radius: 2px;
background-color: #edecee;
display: inline-block;
padding: 8px;
padding: 0;
margin-right: 12px;
}
.item-wrapper {
margin-bottom: 0;
}
.items > div:not(:last-of-type) {
margin-right: 16px;
.items > div {
margin: 8px;
}
}
@@ -415,7 +412,7 @@ export default {
if (this.shop.categories) {
this.shop.categories.map((category) => {
this.$set(this.viewOptions, category.identifier, {
selected: true,
selected: false,
});
});
@@ -424,6 +421,10 @@ export default {
return [];
}
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
methods: {
questItems (category, sortBy, searchBy, hideLocked, hidePinned) {
@@ -1,41 +1,60 @@
<template lang="pug">
.row(:class="{'small-version': smallVersion}")
dl
template(v-if="quest.collect")
dt(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('collect') + ':' }}
dd.col-8
.table-row(v-if="quest.collect")
dt {{ $t('collect') + ':' }}
dd
div(v-for="(collect, key) of quest.collect")
span {{ collect.count }} {{ getCollectText(collect) }}
template(v-if="quest.boss")
dt(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('bossHP') + ':' }}
dd.col-8 {{ quest.boss.hp }}
.table-row(v-if="quest.boss")
dt {{ $t('bossHP') + ':' }}
dd {{ quest.boss.hp }}
dt(:class="smallVersion ? 'col-3' : 'col-4'") {{ $t('difficulty') + ':' }}
dd.col-8
.svg-icon.inline(
v-for="star of stars()", v-html="icons[star]",
:class="smallVersion ? 'icon-12' : 'icon-16'",
)
.table-row
dt {{ $t('difficulty') + ':' }}
dd
.svg-icon.inline(
v-for="star of stars()", v-html="icons[star]",
:class="smallVersion ? 'icon-12' : 'icon-16'",
)
</template>
<style lang="scss" scoped>
@import '~client/assets/scss/colors.scss';
.row {
display: table;
color: #E1E0E3;
margin: 0;
}
.table-row {
display: table-row;
margin-bottom: 4px;
}
dd {
height: 24px;
padding-left: 1em;
padding-top: 3px;
padding-bottom: 3px;
}
dt, dd {
display: table-cell;
vertical-align: middle;
}
dt, dd, dd > * {
text-align: left;
}
dt {
font-size: 1.3em;
line-height: 1.2;
color: $gray-50;
}
.col-8 {
text-align: left;
}
.col-8:not(:last-child) {
margin-bottom: 4px;
}
.svg-icon {
margin-right: 4px;
}
@@ -58,6 +77,15 @@ dt {
white-space: nowrap;
}
}
// making sure the star-colors always correct
.star {
fill: #ffb445;
}
.star-empty {
fill: #686274;
}
</style>
<script>
@@ -437,7 +437,7 @@
_forEach(equipmentList, (value) => {
this.$set(this.viewOptions, value.key, {
selected: true,
selected: false,
});
});
@@ -446,6 +446,10 @@
return [];
}
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
methods: {
getClassName (classType) {
@@ -468,7 +472,7 @@
return false;
}
if (viewOptions[i.type] && !viewOptions[i.type].selected) {
if (this.anyFilterSelected && viewOptions[i.type] && !viewOptions[i.type].selected) {
return false;
}
@@ -48,7 +48,7 @@
div(
v-for="category in categories",
v-if="!closed && viewOptions[category.identifier].selected",
v-if="!anyFilterSelected || (!closed && viewOptions[category.identifier].selected)",
:class="category.identifier"
)
h2.mb-3 {{ category.text }}
@@ -329,12 +329,15 @@
normalGroups.map((category) => {
this.$set(this.viewOptions, category.identifier, {
selected: true,
selected: false,
});
});
return normalGroups;
},
anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected);
},
},
methods: {
travelersItems (category, sortBy, searchBy, hidePinned) {
+17 -4
View File
@@ -37,8 +37,9 @@
draggable.sortable-tasks(
ref="tasksList",
@update='taskSorted',
@start="isDragging(true)",
@end="isDragging(false)",
:options='{disabled: activeFilter.label === "scheduled", scrollSensitivity: 64}',
class="sortable-tasks"
)
task(
v-for="task in taskList",
@@ -49,12 +50,11 @@
:group='group',
)
template(v-if="hasRewardsList")
draggable(
draggable.reward-items(
ref="rewardsList",
@update="rewardSorted",
@start="rewardDragStart",
@end="rewardDragEnd",
class="reward-items",
)
shopItem(
v-for="reward in inAppRewards",
@@ -76,6 +76,9 @@
<style lang="scss" scoped>
@import '~client/assets/scss/colors.scss';
/deep/ .draggable-cursor {
cursor: grabbing;
}
.tasks-column {
min-height: 556px;
@@ -89,7 +92,6 @@
margin-top: 16px;
}
.reward-items {
@supports (display: grid) {
display: grid;
@@ -335,6 +337,7 @@ export default {
showPopovers: true,
selectedItemToBuy: {},
dragging: false,
};
},
created () {
@@ -521,9 +524,11 @@ export default {
rewardDragStart () {
// We need to stop popovers from interfering with our dragging
this.showPopovers = false;
this.isDragging(true);
},
rewardDragEnd () {
this.showPopovers = true;
this.isDragging(false);
},
quickAdd (ev) {
// Add a new line if Shift+Enter Pressed
@@ -678,6 +683,14 @@ export default {
this.error(e.message);
}
},
isDragging (dragging) {
this.dragging = dragging;
if (dragging) {
document.documentElement.classList.add('draggable-cursor');
} else {
document.documentElement.classList.remove('draggable-cursor');
}
},
},
};
</script>
+18 -7
View File
@@ -20,7 +20,7 @@
v-if="isUser && !isRunningYesterdailies",
:right="task.type === 'reward'",
ref="taskDropdown",
v-b-tooltip.hover.top="$t('showMore')"
v-b-tooltip.hover.top="$t('options')"
)
div(slot="dropdown-toggle", draggable=false)
.svg-icon.dropdown-icon(v-html="icons.menu")
@@ -46,7 +46,7 @@
v-markdown="task.notes",
:class="{'has-checklist': task.notes && hasChecklist}",
)
.checklist(v-if="canViewchecklist")
.checklist(v-if="canViewchecklist", :class="{isOpen: !task.collapseChecklist}")
.d-inline-flex
.collapse-checklist.d-flex.align-items-center.expand-toggle(
v-if="isUser",
@@ -141,6 +141,11 @@
min-width: 0px;
overflow-wrap: break-word;
// markdown p-tag, can't find without /deep/
/deep/ p {
margin-bottom: 0;
}
&.has-notes {
padding-bottom: 4px;
}
@@ -229,7 +234,7 @@
overflow-wrap: break-word;
&.has-checklist {
padding-bottom: 8px;
padding-bottom: 2px;
}
}
@@ -254,19 +259,25 @@
}
.checklist {
margin-bottom: 2px;
&.isOpen {
margin-bottom: 2px;
}
margin-top: -3px;
}
.collapse-checklist {
padding: 2px 6px;
margin-bottom: 9px;
border-radius: 1px;
background-color: $gray-600;
font-size: 10px;
line-height: 1.2;
text-align: center;
color: $gray-200;
margin-bottom: 9px;
&.open {
}
span {
margin: 0px 4px;
@@ -285,7 +296,7 @@
margin-bottom: -3px;
min-height: 0px;
width: 100%;
margin-left: 8px;
margin-left: 0;
padding-right: 20px;
overflow-wrap: break-word;
@@ -427,7 +438,7 @@
border-left: none;
}
.task-control, .reward-control {
.task-control:not(.task-disabled-habit-control-inner), .reward-control {
cursor: pointer;
}
@@ -88,7 +88,8 @@
:clearButtonText='$t("clear")',
:todayButton='!challengeAccessRequired',
:todayButtonText='$t("today")',
:disabled-picker='challengeAccessRequired'
:disabled-picker='challengeAccessRequired',
:highlighted='calendarHighlights'
)
.option(v-if="task.type === 'daily'")
.form-group
@@ -99,7 +100,8 @@
:clearButton="false",
:todayButton="!challengeAccessRequired",
:todayButtonText="$t('today')",
:disabled-picker="challengeAccessRequired"
:disabled-picker="challengeAccessRequired",
:highlighted='calendarHighlights'
)
.option(v-if="task.type === 'daily'")
.form-group
@@ -259,6 +261,10 @@
font-weight: bold;
}
.input-group > * {
height: 40px;
}
input, textarea {
border: none;
background: rgba(0, 0, 0, 0.24);
@@ -717,6 +723,7 @@ export default {
con: 'constitution',
per: 'perception',
},
calendarHighlights: { dates: [new Date()]},
};
},
mounted () {
+5 -1
View File
@@ -12,7 +12,7 @@
.col-12.col-md-4.offset-md-4
.d-flex
input.form-control.input-search(type="text", :placeholder="$t('search')", v-model="searchText")
button.btn.btn-secondary.dropdown-toggle.ml-2.d-flex.align-items-center(
button.btn.btn-secondary.dropdown-toggle.ml-2.d-flex.align-items-center.search-button(
type="button",
@click="toggleFilterPanel()",
:class="{active: selectedTags.length > 0}",
@@ -110,6 +110,10 @@
padding-top: 16px;
}
.input-search, .search-button {
height: 40px;
}
.tasks-navigation {
margin-bottom: 20px;
}
@@ -15,6 +15,7 @@ span.badge.badge-pill.badge-item.badge-count(
min-width: 24px;
height: 24px;
box-shadow: 0 1px 1px 0 rgba($black, 0.12);
z-index: 1;
}
</style>
+126
View File
@@ -0,0 +1,126 @@
<template lang="pug">
.progress-container(ref="container", :id="elementId", :class="{condensed}")
.svg-icon(v-html="icon")
.progress
.progress-bar(:class="progressClass", :style="{width: `${percent(value, maxValue)}%`}")
span.small-text {{value | statFloor}} / {{maxValue}}
b-tooltip.myClass(:target="() => $refs.container", :container="elementId", :title="tooltip", triggers="hover", placement="bottom")
</template>
<style lang="scss" scoped>
@import '~client/assets/scss/colors.scss';
.progress-container {
margin-left: 4px;
margin-bottom: .5em;
height: 24px;
/deep/ .bs-tooltip-bottom {
top: -16px !important
}
}
.progress-container > span {
color: $header-color;
margin-left: 8px;
font-style: normal;
line-height: 1;
}
.progress-container > .svg-icon {
width: 24px;
height: 24px;
margin-right: 8px;
}
.progress-container > .progress {
min-width: 200px;
margin: 0px;
border-radius: 1px;
height: 12px;
background-color: $header-dark-background;
}
.progress-container > .progress > .progress-bar {
border-radius: 1px;
height: 12px;
min-width: 0px;
}
.progress-container .svg-icon, .progress-container .progress, .progress-container .small-text {
display: inline-block;
vertical-align: middle;
}
.progress-container.condensed {
> .svg-icon {
width: 19px;
height: 19px;
margin-top: -2px;
}
> .progress {
width: 152px;
border-radius: 1px;
height: 10px;
margin-top: 2px;
background: $purple-100;
}
> .progress > .progress-bar {
border-radius: 1px;
height: 10px;
}
}
</style>
<script>
import percent from '../../../common/script/libs/percent';
export default {
props: {
icon: {
type: String,
},
value: {
type: Number,
},
maxValue: {
type: Number,
},
tooltip: {
type: String,
},
progressClass: {
type: String,
},
condensed: {
type: Boolean,
default: false,
},
},
data () {
return {
elementId: null,
};
},
filters: {
statFloor (value) {
if (value < 1 && value > 0) {
return Math.ceil(value * 10) / 10;
} else {
return Math.floor(value);
}
},
},
methods: {
percent,
click () {
this.$emit('click');
},
},
mounted () {
this.elementId = `container_${this._uid}`;
},
};
</script>
@@ -324,6 +324,7 @@
}
.progress-container > .progress {
border-radius: 1px;
background-color: $gray-500;
}
}
@@ -371,8 +372,10 @@
.progress {
height: 8px;
border-radius: 1px;
.progress-bar {
border-radius: 1px;
background-color: $green-10 !important;
}
}
@@ -495,6 +498,9 @@ export default {
async userId () {
this.loadUser();
},
userLoggedIn () {
this.loadUser();
},
},
methods: {
async loadUser () {
@@ -123,8 +123,8 @@
h3(v-if='userLevel100Plus', v-once, v-html="$t('noMoreAllocate')")
h3
| {{$t('statPoints')}}
.counter.badge(v-if='user.stats.points || userLevel100Plus')
| {{pointsRemaining}}&nbsp;
.counter.badge.badge-pill(v-if='user.stats.points || userLevel100Plus')
| {{pointsRemaining}}
.col-12.col-md-6
.float-right
toggle-switch(
@@ -409,9 +409,6 @@
color: #fff;
background-color: #ff944c;
box-shadow: 0 1px 1px 0 rgba(26, 24, 29, 0.12);
width: 24px;
height: 24px;
border-radius: 50%;
}
.box {
+23 -2
View File
@@ -223,7 +223,6 @@ export default {
return true;
},
amazonPaymentsInit (data) {
if (!this.checkGemAmount(data)) return;
if (data.type !== 'single' && data.type !== 'subscription') return;
if (data.gift) {
@@ -251,8 +250,30 @@ export default {
this.amazonPayments.gift = data.gift;
this.amazonPayments.type = data.type;
},
amazonOnError (error) {
alert(error.getErrorMessage());
this.reset();
},
reset () {
// @TODO: Ensure we are using all of these
// some vars are set in the payments mixin. We should try to edit in one place
this.amazonPayments.modal = null;
this.amazonPayments.type = null;
this.amazonPayments.loggedIn = false;
this.$root.$emit('habitica::pay-with-amazon', this.amazonPayments);
// Gift
this.amazonPayments.gift = null;
this.amazonPayments.giftReceiver = null;
this.amazonPayments.billingAgreementId = null;
this.amazonPayments.orderReferenceId = null;
this.amazonPayments.paymentSelected = false;
this.amazonPayments.recurringConsent = false;
this.amazonPayments.subscription = null;
this.amazonPayments.coupon = null;
this.amazonPayments.groupToCreate = null;
this.amazonPayments.group = null;
},
async cancelSubscription (config) {
if (config && config.group && !confirm(this.$t('confirmCancelGroupPlan'))) return;
+9 -1
View File
@@ -48,10 +48,18 @@ export async function like (store, payload) {
}
export async function flag (store, payload) {
const url = `/api/v4/groups/${payload.groupId}/chat/${payload.chatId}/flag`;
let url = '';
if (payload.groupId === 'privateMessage') {
url = `/api/v4/members/flag-private-message/${payload.chatId}`;
} else {
url = `/api/v4/groups/${payload.groupId}/chat/${payload.chatId}/flag`;
}
const response = await axios.post(url, {
comment: payload.comment,
});
return response.data.data;
}

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