From 6f259c41eb1f3ae8df3412573a98ba50aa386604 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Wed, 11 Oct 2023 16:41:16 -0500 Subject: [PATCH 1/4] feat: update default percentage to 0.18 and hide covid category to new users --- .../MonthlyGood/MonthlyGoodSetupPage.vue | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue index b43db585ba..5c06bbeda3 100644 --- a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue +++ b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue @@ -133,7 +133,7 @@ v-model="donationCheckbox" > - Monthly donation to Kiva (optional) + Help cover the cost of your loans (optional donation to Kiva)
@@ -376,6 +376,8 @@ const startDay = nextmonth => { return dayToStartMG.getDate(); }; +const defaultDonationPercentage = 0.18; + export default { name: 'MonthlyGoodSetupPage', props: { @@ -385,7 +387,7 @@ export default { }, initDonation: { type: Number, - default: 25 * 0.15, + default: 25 * defaultDonationPercentage, }, day: { type: Number, @@ -424,9 +426,9 @@ export default { mgAmount: 25, isDayInputShown: false, dayOfMonth: startDay(this.nextmonth), - donation: 25 * 0.15, + donation: 25 * defaultDonationPercentage, donationCheckbox: true, - donationOptionSelected: '15', + donationOptionSelected: '18', isDonationOptionsDirty: false, submitting: false, legacySubs: [], @@ -540,6 +542,15 @@ export default { // Sanitize and set initial form values. // Initial group from prop + const hasLoggedInResult = this.apollo.readQuery({ + query: hasEverLoggedInQuery + }); + if (!hasLoggedInResult?.hasEverLoggedIn) { + this.lendingCategories = this.lendingCategories.filter( + category => category.marketingName !== 'COVID-19' + ); + } + if (this.lendingCategories.find(category => category.value === this.category)) { this.selectedGroup = this.category; } @@ -555,7 +566,7 @@ export default { this.donationOptionSelected = 'other'; this.donation = this.initDonation; } else { - this.donation = this.amount * 0.15; + this.donation = this.amount * defaultDonationPercentage; } // Initial day from prop @@ -724,9 +735,9 @@ export default { monetaryValue: Math.round(amountToBasePercentageOn * 0.20 * 100) / 100 }, { - value: '15', - label: `${numeral(amountToBasePercentageOn * 0.15).format('$0,0.00')}`, - monetaryValue: Math.round(amountToBasePercentageOn * 0.15 * 100) / 100 + value: '18', + label: `${numeral(amountToBasePercentageOn * defaultDonationPercentage).format('$0,0.00')}`, + monetaryValue: Math.round(amountToBasePercentageOn * defaultDonationPercentage * 100) / 100 }, { From b2000350eba5cf3c3f53615838da1bba3a44583c Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Wed, 11 Oct 2023 18:29:27 -0500 Subject: [PATCH 2/4] fix: removing covid category in monthly good --- src/pages/MonthlyGood/MonthlyGoodSetupPage.vue | 9 --------- src/plugins/loan-group-categories.js | 10 +--------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue index 5c06bbeda3..0b4aa406bb 100644 --- a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue +++ b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue @@ -542,15 +542,6 @@ export default { // Sanitize and set initial form values. // Initial group from prop - const hasLoggedInResult = this.apollo.readQuery({ - query: hasEverLoggedInQuery - }); - if (!hasLoggedInResult?.hasEverLoggedIn) { - this.lendingCategories = this.lendingCategories.filter( - category => category.marketingName !== 'COVID-19' - ); - } - if (this.lendingCategories.find(category => category.value === this.category)) { this.selectedGroup = this.category; } diff --git a/src/plugins/loan-group-categories.js b/src/plugins/loan-group-categories.js index 4c2a9b74ab..bdb33b2930 100644 --- a/src/plugins/loan-group-categories.js +++ b/src/plugins/loan-group-categories.js @@ -58,15 +58,7 @@ export default { marketingName: 'US Borrowers', marketingOrder: 2, expLoansIds: [1084348, 2319451, 1079005] - }, - { - value: 'disaster_relief_covid', - label: 'COVID-19 Coronavirus', - shortName: 'the global COVID—19 response', - marketingName: 'COVID-19', - marketingOrder: 7, - expLoansIds: [2319451, 2320833, 2320176] - }, + } ], }; } From 77b61b42ff07402a06101e4f641eb9bd13b46eac Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Thu, 12 Oct 2023 10:49:18 -0500 Subject: [PATCH 3/4] fix: revert removing covid category and just filter it on monthly good page --- src/pages/MonthlyGood/MonthlyGoodSetupPage.vue | 2 ++ src/plugins/loan-group-categories.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue index 0b4aa406bb..b2c0d03dd3 100644 --- a/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue +++ b/src/pages/MonthlyGood/MonthlyGoodSetupPage.vue @@ -542,6 +542,8 @@ export default { // Sanitize and set initial form values. // Initial group from prop + // Removing covid-19 as a category option + this.lendingCategories = this.lendingCategories.filter(category => category.marketingName !== 'COVID-19'); if (this.lendingCategories.find(category => category.value === this.category)) { this.selectedGroup = this.category; } diff --git a/src/plugins/loan-group-categories.js b/src/plugins/loan-group-categories.js index bdb33b2930..8feacf0725 100644 --- a/src/plugins/loan-group-categories.js +++ b/src/plugins/loan-group-categories.js @@ -58,6 +58,14 @@ export default { marketingName: 'US Borrowers', marketingOrder: 2, expLoansIds: [1084348, 2319451, 1079005] + }, + { + value: 'disaster_relief_covid', + label: 'COVID-19 Coronavirus', + shortName: 'the global COVID—19 response', + marketingName: 'COVID-19', + marketingOrder: 7, + expLoansIds: [2319451, 2320833, 2320176] } ], }; From b483c4def4ea38301544b268da368d34eb70c392 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Thu, 12 Oct 2023 15:28:22 -0500 Subject: [PATCH 4/4] feat: filtering covid 19 category in settings subscription page --- src/components/Forms/MonthlyGoodUpdateForm.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Forms/MonthlyGoodUpdateForm.vue b/src/components/Forms/MonthlyGoodUpdateForm.vue index 3db8b8b350..c54a45d69e 100644 --- a/src/components/Forms/MonthlyGoodUpdateForm.vue +++ b/src/components/Forms/MonthlyGoodUpdateForm.vue @@ -273,6 +273,10 @@ export default { { label: 'Preserve existing settings', value: '', shortName: '' } ); } + // Removing Covid 19 category option if it is not active for the user + if (this.category?.marketingName !== 'COVID-19') { + this.lendingCategories = this.lendingCategories.filter(category => category.marketingName !== 'COVID-19'); + } /** After initial value is loaded, setup watch to make form dirty on value changes * and emit values on value changes. Setting this in mounted prevents the form * from being dirty on initial load