Merge branch 'develop' into increment-component

This commit is contained in:
CuriousMagpie
2023-01-25 14:35:39 -05:00
106 changed files with 9046 additions and 5790 deletions
@@ -50,7 +50,21 @@ export default {
challengeId: this.challengeId,
keep,
});
await this.$store.dispatch('tasks:fetchUserTasks', { forceLoad: true });
const userTasksByType = (await this.$store.dispatch('tasks:fetchUserTasks', { forceLoad: true })).data;
let tagInUse = false;
Object.keys(userTasksByType).forEach(taskType => {
userTasksByType[taskType].forEach(task => {
if (task.tags.indexOf(this.challengeId) > -1) {
tagInUse = true;
}
});
});
if (!tagInUse) {
await this.$store.dispatch(
'tags:deleteTag',
{ tagId: this.challengeId },
);
}
this.close();
},
close () {
@@ -121,7 +121,7 @@
v-if="editing"
class="menu-container col-2"
:class="{active: activeTopPage === 'backgrounds'}"
@click="changeTopPage('backgrounds', '2022')"
@click="changeTopPage('backgrounds', '2023')"
>
<div class="menu-item">
<div
@@ -1185,7 +1185,7 @@ export default {
},
],
bgSubMenuItems: ['2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014'].map(y => ({
bgSubMenuItems: ['2023', '2022', '2021', '2020', '2019', '2018', '2017', '2016', '2015', '2014'].map(y => ({
id: y,
label: y,
})),
@@ -1214,6 +1214,7 @@ export default {
2020: [],
2021: [],
2022: [],
2023: [],
};
// Hack to force update for now until we restructure the data
@@ -40,7 +40,7 @@
>{{ $t('editAvatar') }}</a>
<a
class="topbar-dropdown-item dropdown-item dropdown-separated"
@click="showAvatar('backgrounds', '2022')"
@click="showAvatar('backgrounds', '2023')"
>{{ $t('backgrounds') }}</a>
<a
class="topbar-dropdown-item dropdown-item"
@@ -83,6 +83,7 @@
}
h4 {
color: $gray-10;
font-size: 0.875rem;
font-weight: bold;
text-align: center;
@@ -93,7 +93,7 @@
<div class="subscribe-card mx-auto">
<div
v-if="hasSubscription && !hasCanceledSubscription"
class="d-flex flex-column align-items-center"
class="d-flex flex-column align-items-center pt-4"
>
<div class="round-container bg-green-10 d-flex align-items-center justify-content-center">
<div
@@ -107,7 +107,7 @@
</h2>
<div
v-if="hasGroupPlan"
class="mx-5 text-center"
class="mx-5 mb-4 text-center"
>
{{ $t('youHaveGroupPlan') }}
</div>
@@ -130,7 +130,7 @@
</div>
<button
class="btn btn-primary btn-update-card
d-flex justify-content-center align-items-center"
d-flex justify-content-center align-items-center mb-4"
@click="redirectToStripeEdit()"
>
<div
@@ -143,21 +143,61 @@
</div>
<div
v-else
class="svg-icon"
class="svg-icon mb-4"
:class="paymentMethodLogo.class"
v-html="paymentMethodLogo.icon"
>
</div>
<div
v-if="purchasedPlanExtraMonthsDetails.months > 0"
class="extra-months green-10 py-2 px-3 mt-4"
class="extra-months green-10 py-2 px-3 mb-4"
v-html="$t('purchasedPlanExtraMonths',
{months: purchasedPlanExtraMonthsDetails.months})"
>
</div>
</div>
<div
v-if="hasCanceledSubscription"
v-if="hasGiftSubscription"
class="d-flex flex-column align-items-center mt-4"
>
<div class="round-container bg-green-10 d-flex align-items-center justify-content-center">
<div
v-once
class="svg-icon svg-check"
v-html="icons.checkmarkIcon"
></div>
</div>
<h2 class="green-10 mx-auto mb-75">
{{ $t('youAreSubscribed') }}
</h2>
<div
class="mx-4 text-center mb-4 lh-71"
>
<span v-once>
{{ $t('haveNonRecurringSub') }}
</span>
<span
v-once
v-html="$t('subscriptionInactiveDate', {date: subscriptionEndDate})"
>
</span>
</div>
<h2 v-once>
{{ $t('switchToRecurring') }}
</h2>
<small
v-once
class="mx-4 mb-3 text-center"
>
{{ $t('continueGiftSubBenefits') }}
</small>
<subscription-options
:note="'subscriptionCreditConversion'"
class="w-100 mb-2"
/>
</div>
<div
v-else-if="hasCanceledSubscription"
class="d-flex flex-column align-items-center mt-4"
>
<div class="round-container bg-gray-300 d-flex align-items-center justify-content-center">
@@ -180,7 +220,7 @@
</div>
<div
v-if="hasSubscription"
class="bg-gray-700 py-3 mt-4 mb-3 text-center"
class="bg-gray-700 py-3 mb-3 text-center"
>
<div class="header-mini mb-3">
{{ $t('subscriptionStats') }}
@@ -322,6 +362,12 @@
max-width: 21rem;
}
small {
color: $gray-100;
font-size: 12px ;
line-height: 1.33;
}
strong {
font-size: 16px;
}
@@ -399,6 +445,10 @@
height: 49px;
}
.lh-71 {
line-height: 1.71;
}
.maroon-50 {
color: $maroon-50;
}
@@ -443,7 +493,6 @@
}
.subscribe-card {
padding-top: 2rem;
width: 28rem;
border-radius: 8px;
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
@@ -472,8 +521,7 @@
}
.svg-check {
width: 35.1px;
height: 28px;
width: 36px;
color: $white;
}
@@ -670,6 +718,9 @@ export default {
hasSubscription () {
return Boolean(this.user.purchased.plan.customerId);
},
hasGiftSubscription () {
return this.user.purchased.plan.customerId === 'Gift';
},
hasCanceledSubscription () {
return (
this.hasSubscription
@@ -1,6 +1,6 @@
<template>
<div id="subscription-form">
<b-form-group class="mb-4 w-100 h-100">
<b-form-group class="mb-3 w-100 h-100">
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
<b-form-radio
v-for="block in subscriptionBlocksOrdered"
@@ -32,6 +32,15 @@
</div>
</b-form-radio>
</b-form-group>
<div class="mx-4 mb-4 text-center">
<small
v-if="note"
v-once
class="font-italic"
>
{{ $t(note) }}
</small>
</div>
<!-- payment buttons first is for gift subs and the second is for renewing subs -->
<payments-buttons
v-if="userReceivingGift && userReceivingGift._id"
@@ -82,7 +91,10 @@
.subscription-bubble, .discount-bubble {
border-radius: 100px;
padding-left: 12px;
padding-right: 12px;
font-size: 12px;
line-height: 1.33;
}
.subscription-bubble {
@@ -100,8 +112,20 @@
<style lang="scss" scoped>
@import '~@/assets/scss/colors.scss';
small {
color: $gray-100;
display: inline-block;
font-size: 12px ;
font-weight: normal;
line-height: 1.33;
}
.subscribe-option {
border-bottom: 1px solid $gray-600;
background-color: $gray-700;
&:not(:last-of-type) {
border-bottom: 1px solid $gray-600;
}
}
</style>
@@ -121,6 +145,10 @@ export default {
paymentsMixin,
],
props: {
note: {
type: String,
default: null,
},
userReceivingGift: {
type: Object,
default () {},
@@ -154,13 +182,13 @@ export default {
subscriptionBubbles (subscription) {
switch (subscription) {
case 'basic_3mo':
return '<span class="subscription-bubble px-2 py-1 mr-1">Gem cap raised to 30</span><span class="subscription-bubble px-2 py-1">+1 Mystic Hourglass</span>';
return '<span class="subscription-bubble py-1 mr-1">Gem cap raised to 30</span><span class="subscription-bubble py-1">+1 Mystic Hourglass</span>';
case 'basic_6mo':
return '<span class="subscription-bubble px-2 py-1 mr-1">Gem cap raised to 35</span><span class="subscription-bubble px-2 py-1">+2 Mystic Hourglass</span>';
return '<span class="subscription-bubble py-1 mr-1">Gem cap raised to 35</span><span class="subscription-bubble py-1">+2 Mystic Hourglass</span>';
case 'basic_12mo':
return '<span class="discount-bubble px-2 py-1 mr-1">Save 20%</span><span class="subscription-bubble px-2 py-1 mr-1">Gem cap raised to 45</span><span class="subscription-bubble px-2 py-1">+4 Mystic Hourglass</span>';
return '<span class="discount-bubble py-1 mr-1">Save 20%</span><span class="subscription-bubble py-1 mr-1">Gem cap raised to 45</span><span class="subscription-bubble py-1">+4 Mystic Hourglass</span>';
default:
return '<span class="subscription-bubble px-2 py-1">Gem cap at 25</span>';
return '<span class="subscription-bubble py-1">Gem cap at 25</span>';
}
},
updateSubscriptionData (key) {
+41 -56
View File
@@ -5,40 +5,44 @@
>
<div class="row">
<div class="col-12 col-md-6 offset-md-3">
<h1 id="faq-heading">
<h1
v-once
id="faq-heading"
>
{{ $t('frequentlyAskedQuestions') }}
</h1>
<div
v-for="(heading, index) in headings"
v-for="(entry, index) in faq.questions"
:key="index"
class="faq-question"
>
<div
v-if="heading !== 'world-boss'"
<h2
v-once
v-b-toggle="entry.heading"
role="tab"
variant="info"
@click="handleClick($event)"
>
<h2
v-b-toggle="heading"
role="tab"
variant="info"
@click="handleClick($event)"
>
{{ $t(`faqQuestion${index}`) }}
</h2>
<b-collapse
:id="heading"
:visible="isVisible(heading)"
accordion="faq"
role="tabpanel"
>
<div
v-markdown="$t(`webFaqAnswer${index}`, replacements)"
class="card-body"
></div>
</b-collapse>
</div>
{{ entry.question }}
</h2>
<b-collapse
:id="entry.heading"
:visible="isVisible(entry.heading)"
accordion="faq"
role="tabpanel"
>
<div
v-once
v-markdown="entry.web"
class="card-body"
></div>
</b-collapse>
</div>
<hr>
<p v-markdown="$t('webFaqStillNeedHelp')"></p>
<p
v-once
v-markdown="stillNeedHelp"
></p>
</div>
</div>
</div>
@@ -46,7 +50,7 @@
<style lang='scss' scoped>
.card-body {
margin-bottom: 1em;
margin-bottom: 1em;
}
.faq-question h2 {
@@ -74,53 +78,34 @@
</style>
<script>
// @TODO: env.EMAILS.TECH_ASSISTANCE_EMAIL
import markdownDirective from '@/directives/markdown';
const TECH_ASSISTANCE_EMAIL = 'admin@habitica.com';
export default {
directives: {
markdown: markdownDirective,
},
data () {
const headings = [
'overview',
'set-up-tasks',
'sample-tasks',
'task-color',
'health',
'party-with-friends',
'pets-mounts',
'character-classes',
'blue-mana-bar',
'monsters-quests',
'gems',
'bugs-features',
'world-boss',
'group-plans',
];
const hash = window.location.hash.replace('#', '');
return {
headings,
replacements: {
techAssistanceEmail: TECH_ASSISTANCE_EMAIL,
wikiTechAssistanceEmail: `mailto:${TECH_ASSISTANCE_EMAIL}`,
},
visible: hash && headings.includes(hash) ? hash : null,
faq: {},
headings: [],
stillNeedHelp: '',
};
},
mounted () {
async mounted () {
this.$store.dispatch('common:setTitle', {
section: this.$t('help'),
subSection: this.$t('faq'),
});
this.faq = await this.$store.dispatch('faq:getFAQ');
for (const entry of this.faq.questions) {
this.headings.push(entry.heading);
}
this.stillNeedHelp = this.faq.stillNeedHelp.web;
},
methods: {
isVisible (heading) {
return this.visible && this.visible === heading;
const hash = window.location.hash.replace('#', '');
return hash && this.headings.includes(hash) && hash === heading;
},
handleClick (e) {
if (!e) return;
@@ -863,16 +863,13 @@ export default {
this.loadUser();
this.oldTitle = this.$store.state.title;
this.selectPage(this.startingPage);
this.$root.$on('habitica:restoreTitle', () => {
if (this.oldTitle) {
this.$store.dispatch('common:setTitle', {
fullTitle: this.oldTitle,
});
}
});
},
beforeDestroy () {
this.$root.$off('habitica:restoreTitle');
if (this.oldTitle) {
this.$store.dispatch('common:setTitle', {
fullTitle: this.oldTitle,
});
}
},
methods: {
async loadUser () {
@@ -5,7 +5,6 @@
:hide-footer="true"
:hide-header="true"
@hide="beforeHide"
@hidden="onHidden"
@shown="onShown()"
>
<profile
@@ -55,14 +54,11 @@ export default {
},
beforeHide () {
if (this.$route.path !== window.location.pathname) {
this.$root.$emit('habitica:restoreTitle');
}
},
onHidden () {
if (this.$route.path !== window.location.pathname) {
this.$router.go(-1);
this.$router.back();
}
},
},
};
</script>