From e2aaadb2311b1b12da6f9e486f4e9ac5304d9ae7 Mon Sep 17 00:00:00 2001 From: Casey Dyer Date: Tue, 29 Oct 2024 14:50:00 -0700 Subject: [PATCH 1/3] fix: badge closed event wasn't required and closed event gets called twice by lightbox --- src/components/MyKiva/BadgeModal.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/MyKiva/BadgeModal.vue b/src/components/MyKiva/BadgeModal.vue index 11cf985ad4..389e48a7f1 100644 --- a/src/components/MyKiva/BadgeModal.vue +++ b/src/components/MyKiva/BadgeModal.vue @@ -13,19 +13,13 @@ diff --git a/src/pages/Portfolio/MyKiva/MyKivaPage.vue b/src/pages/Portfolio/MyKiva/MyKivaPage.vue index e8baf59807..01255f0162 100644 --- a/src/pages/Portfolio/MyKiva/MyKivaPage.vue +++ b/src/pages/Portfolio/MyKiva/MyKivaPage.vue @@ -88,7 +88,7 @@ > My impact journeys - + @@ -163,15 +163,25 @@ const handleShowNavigation = () => { $kvTrackEvent('SecondaryNav top level', 'click', 'MyKiva-Settings-icon'); }; -const handleBadgeClicked = badge => { +const handleBadgeSectionClicked = badge => { state.value = STATE_JOURNEY; selectedBadgeData.value = badge; showBadgeModal.value = true; }; -const handleBadgeLevelClicked = clickedTier => { +const handleBadgeJourneyLevelClicked = payload => { + const { challengeName, tier: clickedTier } = payload; + tier.value = clickedTier; state.value = clickedTier?.completedDate ? STATE_EARNED : STATE_IN_PROGRESS; + + $kvTrackEvent( + 'portfolio', + 'click', + state.value === STATE_EARNED ? 'Already earned badge modal' : 'Earn a badge - within badge journey map modal', + challengeName, + clickedTier.level, + ); }; const handleBadgeModalClosed = () => { From 9d50c46eac9a57c1d76ce540616515121ca60773 Mon Sep 17 00:00:00 2001 From: Casey Dyer Date: Tue, 29 Oct 2024 16:14:57 -0700 Subject: [PATCH 3/3] fix: resolve minor issues with earned modal --- src/components/MyKiva/BadgeCompleted.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MyKiva/BadgeCompleted.vue b/src/components/MyKiva/BadgeCompleted.vue index 8ae63e6d5f..4aafe1cb36 100644 --- a/src/components/MyKiva/BadgeCompleted.vue +++ b/src/components/MyKiva/BadgeCompleted.vue @@ -99,7 +99,7 @@ const { getTierBadgeDataByLevel } = useBadgeData(); const badgeData = computed(() => getTierBadgeDataByLevel(badge.value, tier.value?.level)); const isPublic = computed(() => lender.value?.public && lender.value?.publicName); -const shareUrl = computed(() => (isPublic.value ? `/lender/${lender.value?.publicId}` : 'https://www.kiva.org')); +const shareUrl = computed(() => (isPublic.value ? `/lender/${lender.value?.publicId}` : '')); // eslint-disable-next-line max-len const shareMessage = "It's not everyday you change a life! Thank you, from all of us at Kiva and the millions of lives changed around the world."; @@ -150,7 +150,7 @@ onMounted(() => {