From 352531e85e46e4d93906d42483f8b9f29f18cd11 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Tue, 7 Nov 2023 14:49:31 -0500 Subject: [PATCH 1/2] feat: increase edit donation amount from modal --- .../DonationNudge/DonationNudgeLightbox.vue | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue b/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue index 8c22413da1..6485c53934 100644 --- a/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue +++ b/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue @@ -97,6 +97,7 @@ import KvCharityNavigator from '@/components/Kv/KvCharityNavigator'; import { mdiInformation } from '@mdi/js'; import HeartIcon from '@/assets/icons/inline/heart-icon.svg'; import HowKivaUsesDonation from '@/components/Checkout/HowKivaUsesDonation'; +import { gql } from '@apollo/client'; import KvButton from '~/@kiva/kv-components/vue/KvButton'; import KvLightbox from '~/@kiva/kv-components/vue/KvLightbox'; import KvMaterialIcon from '~/@kiva/kv-components/vue/KvMaterialIcon'; @@ -108,9 +109,26 @@ export default { mdiInformation, zeroUpsellVisible: false, title: 'Loans change lives. Your donations make them possible.', + seasonalTipRateEnabled: false, }; }, - inject: ['cookieStore'], + inject: ['apollo', 'cookieStore'], + apollo: { + query: gql`query seasonalTipRateIncrease { + general { + seasonalTipRateEnabled: featureSetting(key: "seasonal_tip_rate.enabled") { + key + value + description + } + } + } + `, + preFetch: true, + result({ data }) { + this.seasonalTipRateEnabled = data?.general?.seasonalTipRateEnabled?.value === 'true' ?? false; + } + }, components: { KvButton, KvLightbox, @@ -154,12 +172,12 @@ export default { percentageRows() { return [ { - percentage: 15, + percentage: this.seasonalTipRateEnabled ? 18 : 15, appeal: `Cover the cost to facilitate ${this.loanCount > 1 ? 'these loans' : 'this loan'}`, appealIsHorizontallyPadded: false, }, { - percentage: 20, + percentage: this.seasonalTipRateEnabled ? 24 : 20, appeal: 'Reach more people around the world!', appealIsHorizontallyPadded: false, }, From 94c3468f1cd2a18645b27c281fb3ba28636e8516 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Tue, 7 Nov 2023 15:57:28 -0500 Subject: [PATCH 2/2] refactor: remove unused field and use util to get feature flag value --- .../Checkout/DonationNudge/DonationNudgeLightbox.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue b/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue index 6485c53934..8902715193 100644 --- a/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue +++ b/src/components/Checkout/DonationNudge/DonationNudgeLightbox.vue @@ -98,6 +98,7 @@ import { mdiInformation } from '@mdi/js'; import HeartIcon from '@/assets/icons/inline/heart-icon.svg'; import HowKivaUsesDonation from '@/components/Checkout/HowKivaUsesDonation'; import { gql } from '@apollo/client'; +import { readBoolSetting } from '@/util/settingsUtils'; import KvButton from '~/@kiva/kv-components/vue/KvButton'; import KvLightbox from '~/@kiva/kv-components/vue/KvLightbox'; import KvMaterialIcon from '~/@kiva/kv-components/vue/KvMaterialIcon'; @@ -119,14 +120,13 @@ export default { seasonalTipRateEnabled: featureSetting(key: "seasonal_tip_rate.enabled") { key value - description } } } `, preFetch: true, result({ data }) { - this.seasonalTipRateEnabled = data?.general?.seasonalTipRateEnabled?.value === 'true' ?? false; + this.seasonalTipRateEnabled = readBoolSetting(data, 'general.seasonalTipRateEnabled.value'); } }, components: {