From fc5f6a31ee86dd41636c5a6982aac766edf00df6 Mon Sep 17 00:00:00 2001 From: Michael Toth Date: Sun, 7 Apr 2019 05:30:23 -0700 Subject: [PATCH 1/5] Updates classlocked gear item description (#11108) --- website/common/locales/en/gear.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/common/locales/en/gear.json b/website/common/locales/en/gear.json index f6f88b64e2..e7317cfbdc 100644 --- a/website/common/locales/en/gear.json +++ b/website/common/locales/en/gear.json @@ -10,7 +10,7 @@ "gearNotOwned": "You do not own this item.", "noGearItemsOfType": "You don't own any of these.", "noGearItemsOfClass": "You already have all your class equipment! More will be released during the Grand Galas, near the solstices and equinoxes.", - "classLockedItem": "This item is only available to a specific class. Change your class under the User icon > Settings > Character Build!", + "classLockedItem": "This item is only available to a specific class. At level 10 or above, you can change your class under the User icon > Settings > Character Build!", "tierLockedItem": "This item is only available once you've purchased the previous items in sequence. Keep working your way up!", "sortByType": "Type", From 128bd4b9cd19c1dc5c30b16968d03607216d0608 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sun, 7 Apr 2019 15:57:11 +0200 Subject: [PATCH 2/5] fix(challenges): check if subscribed only when in group --- website/client/components/groups/membersModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/client/components/groups/membersModal.vue b/website/client/components/groups/membersModal.vue index 378e808a7f..e04933d62c 100644 --- a/website/client/components/groups/membersModal.vue +++ b/website/client/components/groups/membersModal.vue @@ -308,7 +308,7 @@ export default { return this.members.length < this.$store.state.memberModalOptions.memberCount; }, groupIsSubscribed () { - return this.group.purchased.active; + return this.group.purchased && this.group.purchased.active; }, group () { return this.$store.state.memberModalOptions.group; From a486ded6dddc3c46c4342eb2b35c23cf85cdd88f Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 9 Apr 2019 15:20:05 -0500 Subject: [PATCH 3/5] fix(tests): content coverage for wacky pots --- test/content/hatching-potions.test.js | 5 +++-- test/content/stable.test.js | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/test/content/hatching-potions.test.js b/test/content/hatching-potions.test.js index 72464137a9..918d88a67c 100644 --- a/test/content/hatching-potions.test.js +++ b/test/content/hatching-potions.test.js @@ -9,13 +9,14 @@ import hatchingPotions from '../../website/common/script/content/hatching-potion describe('hatchingPotions', () => { describe('all', () => { - it('is a combination of drop and premium potions', () => { + it('is a combination of drop, premium, and wacky potions', () => { let dropNumber = Object.keys(hatchingPotions.drops).length; let premiumNumber = Object.keys(hatchingPotions.premium).length; + let wackyNumber = Object.keys(hatchingPotions.wacky).length; let allNumber = Object.keys(hatchingPotions.all).length; expect(allNumber).to.be.greaterThan(0); - expect(allNumber).to.equal(dropNumber + premiumNumber); + expect(allNumber).to.equal(dropNumber + premiumNumber + wackyNumber); }); it('contains basic information about each potion', () => { diff --git a/test/content/stable.test.js b/test/content/stable.test.js index 5b0faaee37..34802c31fc 100644 --- a/test/content/stable.test.js +++ b/test/content/stable.test.js @@ -47,6 +47,18 @@ describe('stable', () => { }); }); + describe('wackyPets', () => { + it('contains a pet for each wacky potion * each drop egg', () => { + let numberOfWackyPotions = Object.keys(potions.wacky).length; + let numberOfDropEggs = Object.keys(eggs.drops).length; + let numberOfWackyPets = Object.keys(stable.wackyPets).length; + let expectedTotal = numberOfWackyPotions * numberOfDropEggs; + + expect(numberOfWackyPets).to.be.greaterThan(0); + expect(numberOfWackyPets).to.equal(expectedTotal); + }); + }); + describe('specialPets', () => { it('each value is a valid translation string', () => { each(stable.specialPets, (pet) => { @@ -107,10 +119,11 @@ describe('stable', () => { let questNumber = Object.keys(stable.questPets).length; let specialNumber = Object.keys(stable.specialPets).length; let premiumNumber = Object.keys(stable.premiumPets).length; + let wackyNumber = Object.keys(stable.wackyPets).length; let allNumber = Object.keys(stable.petInfo).length; expect(allNumber).to.be.greaterThan(0); - expect(allNumber).to.equal(dropNumber + questNumber + specialNumber + premiumNumber); + expect(allNumber).to.equal(dropNumber + questNumber + specialNumber + premiumNumber + wackyNumber); }); it('contains basic information about each pet', () => { From 4289becccc8663985736094e9fa2360d44733f0c Mon Sep 17 00:00:00 2001 From: negue Date: Wed, 10 Apr 2019 22:09:04 +0200 Subject: [PATCH 4/5] Performance: My Challenges (#11065) * use the same paging for "myChallenges" only loads 10 per call * challenges: show loading above the load-more button (instead at the top) * purple loading message and flat load-more button * remove comment * show loadMore button only when the request has 10 entries * challenge card ui --- website/client/assets/scss/categories.scss | 17 +- website/client/assets/svg/official.svg | 6 + .../components/challenges/challengeItem.vue | 186 ++++++++++++++---- .../components/challenges/findChallenges.vue | 27 ++- .../components/challenges/myChallenges.vue | 74 ++++++- website/client/components/userLink.vue | 4 - website/client/mixins/challengeUtilities.js | 41 ---- .../server/controllers/api-v3/challenges.js | 2 +- 8 files changed, 253 insertions(+), 104 deletions(-) create mode 100644 website/client/assets/svg/official.svg diff --git a/website/client/assets/scss/categories.scss b/website/client/assets/scss/categories.scss index 3108537157..5403a5e868 100644 --- a/website/client/assets/scss/categories.scss +++ b/website/client/assets/scss/categories.scss @@ -13,14 +13,19 @@ min-width: 100px; border-radius: 100px; background-color: $gray-600; - padding: .5em; + padding: 4px 12px; display: inline-block; - margin: .25em; - font-size: 12px; - font-weight: 500; - line-height: 1.33; + margin-right: 4px; + margin-top: 8px; text-align: center; - color: $gray-300; + + font-size: 12px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: 1.33; + letter-spacing: normal; + color: $gray-100; } .category-label-purple { diff --git a/website/client/assets/svg/official.svg b/website/client/assets/svg/official.svg new file mode 100644 index 0000000000..11dc5e1741 --- /dev/null +++ b/website/client/assets/svg/official.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/website/client/components/challenges/challengeItem.vue b/website/client/components/challenges/challengeItem.vue index 17b9428893..98f1e49d19 100644 --- a/website/client/components/challenges/challengeItem.vue +++ b/website/client/components/challenges/challengeItem.vue @@ -4,28 +4,26 @@ .number span.svg-icon(v-html="icons.gemIcon") span.value {{challenge.prize}} - .label {{ $t('challengePrize') }} + .label {{ $t('prize') }} .challenge-header router-link( :to="{ name: 'challenge', params: { challengeId: challenge._id } }" ) h3.challenge-title(v-markdown='challenge.name') - .owner(v-if="fullLayout") - .owner-item - strong {{ $t('createdBy') }}: - user-link.mx-1(:user="challenge.leader") - .owner-item(v-if="challenge.group && !isTavern(challenge.group)") - strong {{ $t(challenge.group.type) }}: - group-link.mx-1(:group="challenge.group") - .meta - .meta-item + .meta-info + .member-count .svg-icon.user-icon(v-html="icons.memberIcon") - span.mx-1 {{challenge.memberCount}} - // @TODO: add end date - .meta-item - .svg-icon(v-html="icons.calendarIcon") - strong.mx-1 {{ $t('endDate')}}: - span {{challenge.endDate}} + span.count-label {{challenge.memberCount}} + .divider + .official(v-if="isOfficial") + .svg-icon.user-icon(v-html="icons.officialIcon") + .owner(v-if="fullLayout") + .owner-item + strong {{ $t('createdBy') }}: + user-link.mx-1(:user="challenge.leader") + .owner-item(v-if="challenge.group && !isTavern(challenge.group)") + strong {{ $t(challenge.group.type) }}: + group-link.mx-1(:group="challenge.group") category-tags.challenge-categories( :categories="challenge.categories", :owner="isOwner", @@ -42,16 +40,23 @@ @@ -84,36 +89,90 @@ font-size: .9em; } + .official { + margin-right: 8px; + } + .challenge-prize { text-align: center; color: $gems-color; display: inline-block; float: right; - padding: 1em 1.5em; + padding: 18px 24px; margin-left: 1em; - background: #eefaf6; + background: #24cc8f19; border-bottom-left-radius: 4px; + width: 107px; + height: 80px; .svg-icon { - width: 32px; + width: 24px; + height: 24px; + object-fit: contain; + } + + .value { + margin-left: 8px; + font-size: 20px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.4; + letter-spacing: normal; + color: #1ca372; + } + + .label { + margin-top: 4px; + font-size: 12px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.33; + letter-spacing: normal; + text-align: center; + color: #1ca372; } } - .challenge-header, - .well-wrapper { - padding: 1em 1.5em; + .divider { + width: 1px; + height: 16px; + background-color: $gray-600; + margin-right: 12px; + margin-left: 12px; } .challenge-header { - padding-bottom: .5em; + padding: 16px 20px; } - .owner { - margin: 1em 0 .5em; + .well-wrapper { + padding: 16px 20px 20px; } - .meta, .owner { - display: flex; + .challenge-header { + padding-bottom: 0; + } + + .meta-info { + height: 24px; + margin-bottom: 8px; + } + + .count-label { + font-size: 14px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: 1.71; + letter-spacing: normal; + color: $gray-50; + margin-left: 4px; + } + + .meta-info, .owner, .member-count { + display: inline-flex; align-items: center; flex-wrap: wrap; } @@ -134,7 +193,7 @@ .challenge-categories { clear: right; display: flex; - padding: 0 1.5em 1em; + padding: 0 20px 16px; flex-wrap: wrap; } @@ -159,9 +218,16 @@ } .challenge-description { - color: $gray-200; - margin: 0 1.5em; + margin: 0 20px 0; word-break: break-word; + + font-size: 14px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: 1.71; + letter-spacing: normal; + color: $gray-50; } .well { @@ -170,22 +236,65 @@ justify-content: space-evenly; background-color: $gray-700; text-align: center; - padding: 1em; + padding: 16px; border-radius: .25em; > div { - color: $gray-200; + .value { + font-size: 20px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.4; + letter-spacing: normal; + color: $gray-50; + } + + .label { + font-size: 12px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.33; + letter-spacing: normal; + text-align: center; + color: $gray-100; + } .svg-icon { - color: $gray-300; + object-fit: contain; + color: $gray-100; } } > div.muted { - color: $gray-400; + .value { + opacity: 0.5; + font-size: 20px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.4; + letter-spacing: normal; + color: $gray-50; + } + + .label { + opacity: 0.5; + font-size: 12px; + font-weight: bold; + font-style: normal; + font-stretch: normal; + line-height: 1.33; + letter-spacing: normal; + text-align: center; + color: $gray-100; + } .svg-icon { - color: $gray-500; + object-fit: contain; + opacity: 0.5; + color: $gray-100; } } } @@ -208,6 +317,7 @@ import todoIcon from 'assets/svg/todo.svg'; import dailyIcon from 'assets/svg/daily.svg'; import rewardIcon from 'assets/svg/reward.svg'; + import officialIcon from 'assets/svg/official.svg'; export default { props: { @@ -232,6 +342,7 @@ gemIcon, memberIcon, calendarIcon, + officialIcon, }), }; }, @@ -243,6 +354,9 @@ isMember () { return this.user.challenges.indexOf(this.challenge._id) !== -1; }, + isOfficial () { + return this.challenge.official || this.challenge.categories.map(category => category.slug).includes('habitica_official'); + }, tasksData () { return [ { diff --git a/website/client/components/challenges/findChallenges.vue b/website/client/components/challenges/findChallenges.vue index 5b455aa5f4..bbd53e046e 100644 --- a/website/client/components/challenges/findChallenges.vue +++ b/website/client/components/challenges/findChallenges.vue @@ -6,7 +6,6 @@ .row.header-row .col-md-8.text-left h1(v-once) {{$t('findChallenges')}} - h2(v-if='loading') {{ $t('loading') }} .col-md-4 // @TODO: implement sorting span.dropdown-label {{ $t('sortBy') }} b-dropdown(:text="$t('sort')", right=true) @@ -24,8 +23,11 @@ challenge-item(:challenge='challenge') .row - .col-12.text-center(v-if='!loading && filteredChallenges.length > 0') - button.btn.btn-secondary(@click='loadMore()') {{ $t('loadMore') }} + h2.col-12.loading(v-if='loading') {{ $t('loading') }} + + .row + .col-12.text-center(v-if='showLoadMore && !loading && filteredChallenges.length > 0') + button.btn.btn-flat.btn-show-more(@click='loadMore()') {{ $t('loadMore') }} diff --git a/website/client/components/userLink.vue b/website/client/components/userLink.vue index a0fbc576d2..82fdb90f0c 100644 --- a/website/client/components/userLink.vue +++ b/website/client/components/userLink.vue @@ -11,10 +11,6 @@