From ba22c18cd9c59f3bd53785378fcec4cba899aefd Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Tue, 26 Jul 2022 16:59:53 -0400 Subject: [PATCH 01/36] separating group plan creation modal out from groupPlan.vue --- .../groups/groupPlanCreationModal.vue | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 website/client/src/components/groups/groupPlanCreationModal.vue diff --git a/website/client/src/components/groups/groupPlanCreationModal.vue b/website/client/src/components/groups/groupPlanCreationModal.vue new file mode 100644 index 0000000000..2a71afd919 --- /dev/null +++ b/website/client/src/components/groups/groupPlanCreationModal.vue @@ -0,0 +1,230 @@ + + + + + From 8ecd152b411e9126b1c24b9da941e07d3b8508ba Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Wed, 27 Jul 2022 18:25:56 -0400 Subject: [PATCH 02/36] moved modal file from /groups into /group-plans --- .../group-plans/groupPlanCreationModal.vue | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 website/client/src/components/group-plans/groupPlanCreationModal.vue diff --git a/website/client/src/components/group-plans/groupPlanCreationModal.vue b/website/client/src/components/group-plans/groupPlanCreationModal.vue new file mode 100644 index 0000000000..2a71afd919 --- /dev/null +++ b/website/client/src/components/group-plans/groupPlanCreationModal.vue @@ -0,0 +1,230 @@ + + + + + From 9bee9d0a069f456609a641ef301a654a9b816501 Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Mon, 1 Aug 2022 17:11:15 -0400 Subject: [PATCH 03/36] working on editing code so the modal emits from group-plans instead of from within the file --- website/client/src/components/groups/groupPlan.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/client/src/components/groups/groupPlan.vue b/website/client/src/components/groups/groupPlan.vue index 6fc137a31f..4c54990d6b 100644 --- a/website/client/src/components/groups/groupPlan.vue +++ b/website/client/src/components/groups/groupPlan.vue @@ -495,6 +495,13 @@ export default { this.changePage(this.PAGES.CREATE_GROUP); this.$root.$emit('bv::show::modal', 'group-plan-modal'); }, + // launchModal () { + // this.$root.$on('group-plan-modal') { + // console.log('hello i am a modal'); + // this.activePage = page; + // this.$root.$emit('bv::show::modal', 'group-plan-modal'); + // }; + // }, changePage (page) { this.activePage = page; window.scrollTo(0, 0); From 999071a15c91dcf0c953c4380f9161c5c56f3303 Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Tue, 2 Aug 2022 16:05:41 -0400 Subject: [PATCH 04/36] still trying to get modal to work --- .../group-plans/groupPlanCreationModal.vue | 192 +++++++++--------- .../src/components/groups/groupPlan.vue | 111 +--------- 2 files changed, 97 insertions(+), 206 deletions(-) diff --git a/website/client/src/components/group-plans/groupPlanCreationModal.vue b/website/client/src/components/group-plans/groupPlanCreationModal.vue index 2a71afd919..c4694bcd2c 100644 --- a/website/client/src/components/group-plans/groupPlanCreationModal.vue +++ b/website/client/src/components/group-plans/groupPlanCreationModal.vue @@ -1,101 +1,100 @@ + diff --git a/website/client/src/components/group-plans/selectGroupTranslatedArray.vue b/website/client/src/components/group-plans/selectGroupTranslatedArray.vue new file mode 100644 index 0000000000..0b201f3d11 --- /dev/null +++ b/website/client/src/components/group-plans/selectGroupTranslatedArray.vue @@ -0,0 +1,86 @@ + + + + + + + diff --git a/website/client/src/components/groups/groupPlan.vue b/website/client/src/components/groups/groupPlan.vue index 83f4a5adf1..4bc9bb2209 100644 --- a/website/client/src/components/groups/groupPlan.vue +++ b/website/client/src/components/groups/groupPlan.vue @@ -1,7 +1,7 @@ + --> @@ -234,7 +234,7 @@ } .modal-content { width: 448px; - height: 436px; + max-height: 436px; border-radius: 8px; box-shadow: 0 14px 28px 0 rgba(26, 24, 29, 0.24), 0 10px 10px 0 rgba(26, 24, 29, 0.28); } @@ -277,6 +277,7 @@ export default { PAYMENTS: { AMAZON: 'amazon', STRIPE: 'stripe', + // OTHER: 'tempcode', // TEMP CODE }, paymentMethod: '', newGroup: { @@ -316,9 +317,11 @@ export default { }, pay (paymentMethod) { const subscriptionKey = 'group_monthly'; // @TODO: Get from content API? + const demographicsKey = this.newGroup.demographics; const paymentData = { subscription: subscriptionKey, coupon: null, + demographics: demographicsKey, }; if (this.upgradingGroup && this.upgradingGroup._id) { @@ -339,6 +342,11 @@ export default { this.redirectToStripe(paymentData); } + // TEMP CODE + if (this.paymentMethod === this.PAYMENTS.OTHER) { + console.log(paymentData); + } + return null; }, // need to figure out where/how to create the event in amplitude @@ -350,12 +358,13 @@ export default { this.sendingInProgress = false; }, // temporary function to go with temporary button - success () { - console.log(this.sendAnalytics()); - this.sendAnalytics(); - this.$root.$emit('bv::hide::modal', 'create-group'); - this.$root.$emit('bv::show::modal', 'payments-success-modal'); - }, + // success () { + // this.pay(this.PAYMENTS.OTHER); + // console.log(this.sendAnalytics()); + // this.sendAnalytics(); + // this.$root.$emit('bv::hide::modal', 'create-group'); + // this.$root.$emit('bv::show::modal', 'payments-success-modal'); + // }, }, }; diff --git a/website/client/src/components/payments/successModal.vue b/website/client/src/components/payments/successModal.vue index bc96b35f03..805013db51 100644 --- a/website/client/src/components/payments/successModal.vue +++ b/website/client/src/components/payments/successModal.vue @@ -105,8 +105,8 @@ ]" class="group-input" :placeholder="'groupUseDefault'" - :value="newGroup.demographics" - @select="newGroup.demographics = $event" + :value="upgradedGroup.demographics" + @select="upgradedGroup.demographics = $event" />
@@ -119,7 +119,7 @@
- + @@ -325,6 +324,14 @@ export default { isFromBalance () { return this.paymentData.paymentType === 'gift-gems-balance'; }, + upgradedGroup () { + const upgradedGroup = (this.paymentData.paymentType !== 'groupPlan' || this.paymentData.newGroup); + const demographicsKey = upgradedGroup.demographics; + const groupPlanUpgraded = { + demographics: demographicsKey, + }; + return groupPlanUpgraded.demographics; + }, }, mounted () { this.$root.$on('habitica:payment-success', data => { @@ -341,10 +348,12 @@ export default { }, methods: { submit () { + Analytics.track({ + name: this.groupPlanUpgraded.demographics, + }, + console.log(Analytics.track)); this.paymentData = {}; this.$root.$emit('bv::hide::modal', 'payments-success-modal'); - Analytics.track({ }, - console.log(Analytics.track)); }, onwards () { this.paymentData = {}; From e6f903fd2eaea84ae780ebb94dded90faa3d7435 Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Fri, 9 Sep 2022 15:37:08 -0400 Subject: [PATCH 25/36] update: more analytics work --- .../group-plans/groupPlanCreationModal.vue | 17 +++++++---- .../src/components/payments/successModal.vue | 23 ++++++++++---- website/client/src/libs/analytics.js | 30 +++++++++++++++++++ 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/website/client/src/components/group-plans/groupPlanCreationModal.vue b/website/client/src/components/group-plans/groupPlanCreationModal.vue index ffc4466cbe..7b5546c78d 100644 --- a/website/client/src/components/group-plans/groupPlanCreationModal.vue +++ b/website/client/src/components/group-plans/groupPlanCreationModal.vue @@ -251,7 +251,7 @@ import { mapState } from '@/libs/store'; import paymentsButtons from '@/components/payments/buttons/list'; import selectTranslatedArray from '@/components/tasks/modal-controls/selectTranslatedArray'; import lockableLabel from '@/components/tasks/modal-controls/lockableLabel'; -// import * as Analytics from '@/libs/analytics'; +import * as Analytics from '@/libs/analytics'; export default { components: { @@ -282,6 +282,7 @@ export default { challenges: false, }, demographics: null, + user: '', }, activePage: 'create-group', type: 'guild', @@ -305,10 +306,6 @@ export default { this.activePage = page; }, createGroup () { - // Analytics.track({ - // name: this.paymentData.demographics, - // }, - // console.log(this.paymentData.demographics)); this.changePage(this.PAGES.PAY); }, pay (paymentMethod) { @@ -320,6 +317,16 @@ export default { demographics: demographicsKey, }; + Analytics.track({ + hitType: 'event', + eventName: 'group plan create', + eventAction: 'group plan create', + eventCategory: 'behavior', + createGroupName: this.newGroup.name, + demographicsCreated: this.newGroup.demographics, + typeCreated: this.newGroup.type, + }); + if (this.upgradingGroup && this.upgradingGroup._id) { paymentData.groupId = this.upgradingGroup._id; paymentData.group = this.upgradingGroup; diff --git a/website/client/src/components/payments/successModal.vue b/website/client/src/components/payments/successModal.vue index 577c06d619..b708cd3b42 100644 --- a/website/client/src/components/payments/successModal.vue +++ b/website/client/src/components/payments/successModal.vue @@ -290,6 +290,7 @@