Merge branch 'release' into develop

This commit is contained in:
Sabe Jones
2021-08-30 16:26:28 -05:00
46 changed files with 78 additions and 777 deletions
@@ -1,250 +0,0 @@
<template>
<b-modal
id="drop-cap-reached"
size="md"
:hide-header="true"
:hide-footer="hasSubscription"
>
<div class="text-center">
<div
class="modal-close"
@click="close()"
>
<div
v-once
class="svg-icon"
v-html="icons.close"
></div>
</div>
<h1
v-once
class="header purple"
>
{{ $t('dropCapReached') }}
</h1>
<div class="max-items-wrapper d-flex align-items-center justify-content-center">
<div
class="svg-icon sparkles sparkles-rotate"
v-html="icons.sparkles"
></div>
<div class="max-items-module d-flex align-items-center justify-content-center flex-column">
<h1 class="max-items">
{{ maxItems }}
</h1>
<span
v-once
class="items-text"
>{{ $t('items') }}</span>
</div>
<div
class="svg-icon sparkles"
v-html="icons.sparkles"
></div>
</div>
<p
v-once
class="mb-4"
>
{{ $t('dropCapExplanation') }}
</p>
<a
v-once
class="standard-link d-block mb-3"
@click="toWiki()"
>
{{ $t('dropCapLearnMore') }}
</a>
</div>
<div
slot="modal-footer"
class="footer"
>
<span
v-once
class="purple d-block font-weight-bold mb-3 mt-3"
>
{{ $t('lookingForMoreItems') }}
</span>
<img
class="swords mb-3"
srcset="
~@/assets/images/swords.png,
~@/assets/images/swords@2x.png 2x,
~@/assets/images/swords@3x.png 3x"
src="~@/assets/images/swords.png"
>
<p
v-once
class="subs-benefits mb-3"
>
{{ $t('dropCapSubs') }}
</p>
<button
v-once
class="btn btn-primary"
@click="toLearnMore()"
>
{{ $t('learnMore') }}
</button>
</div>
</b-modal>
</template>
<style lang="scss">
@import '~@/assets/scss/colors.scss';
#drop-cap-reached {
.modal-body {
padding: 0 1.5rem;
}
.modal-footer {
background: $gray-700;
border-top: none;
padding: 0 1.5rem 2rem 1.5rem;
}
.modal-dialog {
width: 20.625rem;
font-size: 0.875rem;
line-height: 1.71;
text-align: center;
}
}
</style>
<style lang="scss" scoped>
@import '~@/assets/scss/colors.scss';
.modal-close {
position: absolute;
width: 18px;
height: 18px;
padding: 4px;
right: 16px;
top: 16px;
cursor: pointer;
.svg-icon {
width: 12px;
height: 12px;
}
}
.subs-benefits {
font-size: 0.75rem;
line-height: 1.33;
font-style: normal;
}
.purple {
color: $purple-300;
}
.header {
font-size: 1.25rem;
line-height: 1.4;
text-align: center;
margin-top: 2rem;
}
.sparkles {
width: 2.5rem;
height: 4rem;
&.sparkles-rotate {
transform: rotate(180deg);
}
}
.max-items-wrapper {
margin: 17px auto;
}
.max-items-module {
background: white;
border-radius: 92px;
border: 8px solid $purple-400;
width: 92px;
height: 92px;
margin-left: 17px;
margin-right: 17px;
.items-text {
font-size: 0.75rem;
line-height: 1.33;
color: $gray-100;
}
}
.max-items {
font-size: 2rem;
line-height: 1.25;
color: $purple-300;
margin: 0;
}
.swords {
width: 7rem;
height: 3rem;
}
</style>
<script>
import closeIcon from '@/assets/svg/close.svg';
import sparkles from '@/assets/svg/star-group.svg';
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
export default {
data () {
return {
icons: Object.freeze({
close: closeIcon,
sparkles,
}),
maxItems: null,
};
},
computed: {
...mapState({ user: 'user.data' }),
hasSubscription () {
return Boolean(this.user.purchased.plan.customerId);
},
},
mounted () {
this.$root.$on('habitica:drop-cap-reached', notification => {
this.maxItems = notification.data.items;
this.$root.$emit('bv::show::modal', 'drop-cap-reached');
});
},
beforeDestroy () {
this.$root.$off('habitica:drop-cap-reached');
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'drop-cap-reached');
},
toWiki () {
window.open('https://habitica.fandom.com/wiki/Drops', '_blank');
Analytics.track({
hitType: 'event',
eventCategory: 'drop-cap-reached',
eventAction: 'click',
eventLabel: 'Drop Cap Reached > Modal > Wiki',
});
},
toLearnMore () {
Analytics.track({
hitType: 'event',
eventCategory: 'drop-cap-reached',
eventAction: 'click',
eventLabel: 'Drop Cap Reached > Modal > Subscriptions',
});
this.close();
this.$router.push('/user/settings/subscription');
},
},
};
</script>
@@ -466,7 +466,6 @@ footer {
import axios from 'axios';
import moment from 'moment';
import { mapState } from '@/libs/store';
import * as Analytics from '@/libs/analytics';
import gryphon from '@/assets/svg/gryphon.svg';
import twitter from '@/assets/svg/twitter.svg';
import facebook from '@/assets/svg/facebook.svg';
@@ -580,12 +579,6 @@ export default {
this.$root.$emit('bv::show::modal', 'modify-inventory');
},
donate () {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Gems > Donate',
});
this.$root.$emit('bv::show::modal', 'buy-gems', { alreadyTracked: true });
},
},
@@ -133,7 +133,6 @@
</style>
<script>
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
import paymentsMixin from '../../mixins/payments';
import paymentsButtons from '@/components/payments/buttons/list';
@@ -174,12 +173,6 @@ export default {
},
methods: {
changePage (page) {
Analytics.track({
hitType: 'event',
eventCategory: 'group-plans-static',
eventAction: 'view',
eventLabel: page,
});
this.activePage = page;
window.scrollTo(0, 0);
},
@@ -4,7 +4,6 @@
title="Empty"
size="lg"
hide-footer="hide-footer"
@shown="shown()"
>
<div
slot="modal-header"
@@ -342,7 +341,6 @@
</style>
<script>
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
import upIcon from '@/assets/svg/up.svg';
@@ -368,14 +366,6 @@ export default {
...mapState({ user: 'user.data' }),
},
methods: {
shown () {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'viewed-group-plan-overview',
});
},
toggle (question) {
this.expandedQuestions[question] = !this.expandedQuestions[question];
},
@@ -725,7 +725,6 @@ body.modal-open #habitica-menu {
<script>
import { mapState, mapGetters } from '@/libs/store';
import * as Analytics from '@/libs/analytics';
import { goToModForm } from '@/libs/modform';
import gemIcon from '@/assets/svg/gem.svg';
@@ -804,13 +803,6 @@ export default {
this.$root.$emit('bv::show::modal', 'create-party-modal');
},
showBuyGemsModal () {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Gems > Toolbar',
});
this.$root.$emit('bv::show::modal', 'buy-gems', { alreadyTracked: true });
},
dropdownDesktop (hover) {
@@ -1,43 +0,0 @@
<template>
<base-notification
:can-remove="canRemove"
:has-icon="false"
:notification="notification"
:read-after-click="true"
@click="action"
>
<div
slot="content"
class="notification-bold-blue"
>
{{ $t('dropCapReached') }}
</div>
</base-notification>
</template>
<script>
import BaseNotification from './base';
import * as Analytics from '@/libs/analytics';
export default {
components: {
BaseNotification,
},
props: {
notification: { type: Object, required: true },
canRemove: { type: Boolean, required: true },
},
methods: {
action () {
this.$root.$emit('habitica:drop-cap-reached', this.notification);
Analytics.track({
hitType: 'event',
eventCategory: 'drop-cap-reached',
eventAction: 'click',
eventLabel: 'Drop Cap Reached > Notification Click',
});
},
},
};
</script>
@@ -146,7 +146,6 @@ import ACHIEVEMENT_MIND_OVER_MATTER from './notifications/mindOverMatter';
import ONBOARDING_COMPLETE from './notifications/onboardingComplete';
import GIFT_ONE_GET_ONE from './notifications/g1g1';
import OnboardingGuide from './onboardingGuide';
import DROP_CAP_REACHED from './notifications/dropCapReached';
export default {
components: {
@@ -176,7 +175,6 @@ export default {
OnboardingGuide,
ONBOARDING_COMPLETE,
GIFT_ONE_GET_ONE,
DROP_CAP_REACHED,
},
data () {
return {
@@ -202,7 +200,7 @@ export default {
'GROUP_TASK_CLAIMED', 'NEW_MYSTERY_ITEMS', 'CARD_RECEIVED',
'NEW_INBOX_MESSAGE', 'NEW_CHAT_MESSAGE', 'UNALLOCATED_STATS_POINTS',
'ACHIEVEMENT_JUST_ADD_WATER', 'ACHIEVEMENT_LOST_MASTERCLASSER', 'ACHIEVEMENT_MIND_OVER_MATTER',
'VERIFY_USERNAME', 'ONBOARDING_COMPLETE', 'DROP_CAP_REACHED',
'VERIFY_USERNAME', 'ONBOARDING_COMPLETE',
],
};
},
@@ -139,7 +139,6 @@
<script>
import { mapState } from '@/libs/store';
import * as Analytics from '@/libs/analytics';
import userIcon from '@/assets/svg/user.svg';
import MenuDropdown from '../ui/customMenuDropdown';
import MessageCount from './messageCount';
@@ -178,13 +177,6 @@ export default {
this.$router.push({ name: startingPage });
},
toLearnMore () {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'User Dropdown > Subscriptions',
});
this.$router.push({ name: 'subscription' });
},
logout () {
@@ -35,7 +35,6 @@
<mind-over-matter />
<onboarding-complete />
<first-drops />
<drop-cap-reached-modal />
</div>
</template>
@@ -118,6 +117,7 @@ import { mapState } from '@/libs/store';
import { MAX_LEVEL_HARD_CAP } from '@/../../common/script/constants';
import notifications from '@/mixins/notifications';
import guide from '@/mixins/guide';
import { CONSTANTS, setLocalSetting } from '@/libs/userlocalManager';
import yesterdailyModal from './tasks/yesterdailyModal';
import newStuff from './news/modal';
@@ -147,7 +147,6 @@ import loginIncentives from './achievements/login-incentives';
import onboardingComplete from './achievements/onboardingComplete';
import verifyUsername from './settings/verifyUsername';
import firstDrops from './achievements/firstDrops';
import DropCapReachedModal from '@/components/achievements/dropCapReached';
const NOTIFICATIONS = {
CHALLENGE_JOINED_ACHIEVEMENT: {
@@ -459,7 +458,6 @@ export default {
justAddWater,
onboardingComplete,
firstDrops,
DropCapReachedModal,
},
mixins: [notifications, guide],
data () {
@@ -811,6 +809,10 @@ export default {
// Run Cron
await axios.post('/api/v4/cron');
// Reset daily analytics actions
setLocalSetting(CONSTANTS.keyConstants.TASKS_SCORED_COUNT, 0);
setLocalSetting(CONSTANTS.keyConstants.TASKS_CREATED_COUNT, 0);
// Sync
await Promise.all([
this.$store.dispatch('user:fetch', { forceLoad: true }),
@@ -56,7 +56,6 @@
<script>
import axios from 'axios';
import pick from 'lodash/pick';
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
import { CONSTANTS, setLocalSetting } from '@/libs/userlocalManager';
import paymentsMixin from '@/mixins/payments';
@@ -261,13 +260,6 @@ export default {
if (newGroup && newGroup._id) {
// Handle new user signup
if (!this.$store.state.isUserLoggedIn) {
Analytics.track({
hitType: 'event',
eventCategory: 'group-plans-static',
eventAction: 'view',
eventLabel: 'paid-with-amazon',
});
this.storePaymentStatusAndReload(`${habiticaUrl}/group-plans/${newGroup._id}/task-information?showGroupOverview=true`);
return;
}
@@ -363,7 +363,6 @@
<script>
import moment from 'moment';
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
import markdown from '@/directives/markdown';
import paymentsMixin from '@/mixins/payments';
@@ -449,22 +448,11 @@ export default {
async mounted () {
await this.$store.dispatch('worldState:getWorldState');
this.$root.$on('bv::show::modal', (modalId, data = {}) => {
this.$root.$on('bv::show::modal', modalId => {
if (modalId === 'buy-gems') {
// We force reloading the world state every time the modal is reopened
// To make sure the promo status is always up to date
this.$store.dispatch('worldState:getWorldState', { forceLoad: true });
// Track opening of gems modal unless it's been already tracked
// For example the gems button in the menu already tracks the event by itself
if (data.alreadyTracked !== true) {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Gems > Wallet',
});
}
}
});
},
@@ -246,7 +246,6 @@
</style>
<script>
import * as Analytics from '@/libs/analytics';
import { setup as setupPayments } from '@/libs/payments';
import amazonPaymentsModal from '@/components/payments/amazonModal';
import AuthForm from '../auth/authForm.vue';
@@ -280,24 +279,10 @@ export default {
},
methods: {
goToNewGroupPage () {
Analytics.track({
hitType: 'event',
eventCategory: 'group-plans-static',
eventAction: 'view',
eventLabel: 'view-auth-form',
});
this.$root.$emit('bv::show::modal', 'group-plan');
},
authenticate () {
this.modalPage = 'purchaseGroup';
Analytics.track({
hitType: 'event',
eventCategory: 'group-plans-static',
eventAction: 'view',
eventLabel: 'create-group',
});
},
},
};
@@ -262,7 +262,6 @@
<script>
import logo from '@/assets/svg/logo.svg';
import purpleLogo from '@/assets/svg/purple-logo.svg';
import * as Analytics from '@/libs/analytics';
export default {
data () {
@@ -286,13 +285,6 @@ export default {
}
// @TODO duplicate of code in home.vue
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Play',
});
this.$router.push('/register');
},
scrollToMobileApp () {
@@ -816,7 +816,6 @@ import kickstarter from '@/assets/images/home/kickstarter.svg';
import lifehacker from '@/assets/images/home/lifehacker.svg';
import makeuseof from '@/assets/images/home/make-use-of.svg';
import thenewyorktimes from '@/assets/images/home/the-new-york-times.svg';
import * as Analytics from '@/libs/analytics';
import { MINIMUM_PASSWORD_LENGTH } from '@/../../common/script/constants';
export default {
@@ -944,12 +943,6 @@ export default {
window.location.href = this.$route.query.redirectTo || '/';
},
playButtonClick () {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Play',
});
this.$router.push('/register');
},
// @TODO: Abstract hello in to action or lib