diff --git a/src/components/LoanCards/Buttons/MultipleAtcButton.vue b/src/components/LoanCards/Buttons/MultipleAtcButton.vue deleted file mode 100644 index 2f391211f7..0000000000 --- a/src/components/LoanCards/Buttons/MultipleAtcButton.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/src/components/LoanFinding/LendingCategorySection.vue b/src/components/LoanFinding/LendingCategorySection.vue index ecc9d91730..6385cbad89 100644 --- a/src/components/LoanFinding/LendingCategorySection.vue +++ b/src/components/LoanFinding/LendingCategorySection.vue @@ -11,20 +11,10 @@

{{ subtitle }}

- import _throttle from 'lodash/throttle'; import KvClassicLoanCardContainer from '@/components/LoanCards/KvClassicLoanCardContainer'; -import MultipleAtcButton from '@/components/LoanCards/Buttons/MultipleAtcButton'; import KvCarousel from '~/@kiva/kv-components/vue/KvCarousel'; import ViewMoreCard from './ViewMoreCard'; @@ -71,7 +59,6 @@ export default { components: { KvCarousel, KvClassicLoanCardContainer, - MultipleAtcButton, ViewMoreCard, }, props: { @@ -130,8 +117,6 @@ export default { }, data() { return { - isAddingMultiple: false, - hasMultipleBeenAdded: false, windowWidth: typeof window !== 'undefined' ? window.innerWidth : 1024, handleResize: _throttle(this.isWindowWidth, 200) }; @@ -155,24 +140,6 @@ export default { } return '336px'; }, - multipleAmount() { - let amount = 0; - for (let index = 0; index < this.totalLoans; index += 1) { - const loan = this.loans[index]; - const { unreservedAmount } = loan; - - if (this.enableFiveDollarsNotes) { - if (this.userBalance > 20) { - amount += unreservedAmount > 25 ? 25 : Number(unreservedAmount); - } else { - amount += unreservedAmount > 5 ? 5 : Number(unreservedAmount); - } - } else { - amount += unreservedAmount > 25 ? 25 : Number(unreservedAmount); - } - } - return amount; - }, totalLoans() { return this.loans.length; }, @@ -184,50 +151,6 @@ export default { addToBasket(payload) { this.$emit('add-to-basket', payload); }, - async addMultipleLoans() { - this.isAddingMultiple = true; - - const { multipleAmount } = this; - - for (let index = 0; index < this.totalLoans; index += 1) { - const { unreservedAmount } = this.loans[index]; - const key = this.loanCardKey(index); - - let amount = ''; - if (this.enableFiveDollarsNotes && this.userBalance <= 20) { - amount = Number(unreservedAmount) > 5 ? '5' : unreservedAmount; - } else { - amount = Number(unreservedAmount) > 25 ? '25' : unreservedAmount; - } - - // We occasionally get fully funded loans from dev FLSS - if (Number(amount) > 0) { - try { - // Ensure the reservations happen synchronously to prevent race conditions with the basket - // eslint-disable-next-line no-await-in-loop - await this.$refs[key][0].addToBasket(amount); - } catch { - // no-op - } - } - } - - this.$kvTrackEvent( - 'loan-card', - 'add-all-to-basket', - 'relending-lending-home-add-all', - this.userBalance, - multipleAmount - ); - - this.isAddingMultiple = false; - this.hasMultipleBeenAdded = true; - }, - checkout() { - this.$kvTrackEvent('loan-card', 'checkout', 'relending-lending-home-add-all'); - - this.$router.push({ path: '/checkout' }); - }, loanCardKey(index) { return `loan-card-${index}`; }, diff --git a/src/pages/LoanFinding/LoanFinding.vue b/src/pages/LoanFinding/LoanFinding.vue index b8c6aefd38..f8f8482474 100644 --- a/src/pages/LoanFinding/LoanFinding.vue +++ b/src/pages/LoanFinding/LoanFinding.vue @@ -17,14 +17,10 @@ :subtitle="firstRowSubtitle" :loans="firstRowLoans" :enable-five-dollars-notes="enableFiveDollarsNotes" - :enable-relending-exp="enableRelendingExp" :user-balance="userBalance" :per-step="perStepRecommendedRow" @add-to-basket="trackCategory($event, 'recommended')" - :class="{ - 'tw-pt-3 tw-pb-4 tw-bg-secondary' : enableRelendingExp, - 'tw-pt-3' : !isLoggedIn, - }" + :class="{ 'tw-pt-3' : !isLoggedIn }" /> @@ -35,7 +31,6 @@ :subtitle="almostFundedRowSubtitle" :loans="almostFundedLoans" :enable-five-dollars-notes="enableFiveDollarsNotes" - :enable-relending-exp="enableRelendingExp" :user-balance="userBalance" @add-to-basket="trackCategory($event, 'almost-funded')" class="tw-pt-3 tw-mb-2" @@ -49,7 +44,6 @@ :subtitle="fiveDollarsRowSubtitle" :loans="fiveDollarsRowLoans" :enable-five-dollars-notes="enableFiveDollarsNotes" - :enable-relending-exp="enableRelendingExp" :user-balance="userBalance" :five-dollars-selected="true" :title-icon="HandOrangeIcon" @@ -60,7 +54,6 @@
Recycle your balance and get these borrowers funded '; // eslint-disable-line max-len if (this.matchedLoansTotal > 0) { if (this.matchedLoansTotal < 3) return 'Help these borrowers cross the finish line'; return 'Matched lending'; @@ -216,13 +206,11 @@ export default { return spotlightData[this.spotlightIndex] ?? {}; }, firstRowTitle() { - if (this.enableRelendingExp) return `${this.firstName}, let's put your $${this.userBalanceString} to good use`; // eslint-disable-line max-len return this.isLoggedIn ? 'Recommended for you' : 'Make a difference today'; }, firstRowSubtitle() { - if (this.enableRelendingExp) return 'Loans we think you\'ll love based on your lending history'; return this.isLoggedIn ? 'Loans handpicked for you based on your lending history' : 'Support a featured borrower with a microloan.'; @@ -234,7 +222,7 @@ export default { return 'Lend as little as $5 to fund a new dream.'; }, showWelcomeMsg() { - return this.isLoggedIn && !this.enableRelendingExp && !this.showFiveDollarsBanner; + return this.isLoggedIn && !this.showFiveDollarsBanner; }, perStepRecommendedRow() { return !this.enableThreeLoansRecommended ? 2 : 3; @@ -380,15 +368,12 @@ export default { this.trackDisplayedLoans('recommended', 1, this.firstRowLoans); }, trackQuickFiltersDisplayedLoans({ data, pageOffset }) { - this.trackDisplayedLoans('quick-filters', this.enableRelendingExp ? 3 : 2, data, pageOffset); + this.trackDisplayedLoans('quick-filters', 2, data, pageOffset); }, trackSecondCarouselDisplayedLoans() { this.trackDisplayedLoans( - // eslint-disable-next-line no-nested-ternary - this.enableRelendingExp - ? 'recycle' - : (this.matchedLoansTotal < 3 ? 'ending-soon-almost-funded' : 'matched'), - this.enableRelendingExp ? 2 : 3, + this.matchedLoansTotal < 3 ? 'ending-soon-almost-funded' : 'matched', + 3, this.secondCategoryLoans, ); }, @@ -458,7 +443,7 @@ export default { ); this.enableAlmostFundedRow = almostFundedRowTestData.version === 'b'; - const recommendedArray = [ + this.firstRowLoans = [ ...cachedRecommendedLoans, { id: 0 }, { id: 0 }, { id: 0 }, { id: 0 }, @@ -466,32 +451,11 @@ export default { { id: 0 }, { id: 0 }, ]; - let relendingArray = [ - ...cachedRecommendedLoans, - ]; - - /* eslint-disable max-len */ - if (this.enableFiveDollarsNotes) { - if ((this.userBalance > 0 && this.userBalance < 10) || (this.userBalance > 20 && this.userBalance < 50)) relendingArray = relendingArray.slice(0, 2); - if ((this.userBalance > 10 && this.userBalance < 15) || (this.userBalance > 50 && this.userBalance < 75)) relendingArray = relendingArray.slice(0, 3); - - // check for $5 notes banner cookie - this.check5DollarsBannerCookie(); - } else { - if (this.userBalance > 0 && this.userBalance < 50) relendingArray = relendingArray.slice(0, 2); - if (this.userBalance > 50 && this.userBalance < 75) relendingArray = relendingArray.slice(0, 3); - } - /* eslint-enable max-len */ - - this.firstRowLoans = this.enableRelendingExp ? relendingArray : recommendedArray; + // check for $5 notes banner cookie + if (this.enableFiveDollarsNotes) this.check5DollarsBannerCookie(); }, mounted() { - if (!this.enableRelendingExp) { - this.getRecommendedLoans(); - } else { - this.trackFirstRowDisplayedLoans(); - } - + this.getRecommendedLoans(); this.getSecondCategoryData(); this.verifySpotlightIndex();