Skip to content

Commit

Permalink
feat: default sort option added to quick filters for almost funded ro…
Browse files Browse the repository at this point in the history
…w test (#5036)
  • Loading branch information
roger-in-kiva authored Oct 19, 2023
1 parent be6de27 commit 0231908
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/LoanFinding/QuickFiltersSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:targeted-loan-channel-url="targetedLoanChannelURL"
:with-categories="true"
:enable-qf-mobile="enableQfMobile"
default-sort="amountLeft"
:default-sort="defaultSort"
tracking-category="lending-home"
@update-filters="updateQuickFilters"
@reset-filters="resetFilters"
Expand Down Expand Up @@ -100,6 +100,10 @@ export default {
type: Boolean,
default: false
},
enableAlmostFundedRow: {
type: Boolean,
default: false
},
},
data() {
return {
Expand All @@ -110,7 +114,7 @@ export default {
loanSearchState: {
pageOffset: 0,
pageLimit: 6,
sortBy: 'amountLeft'
sortBy: this.enableAlmostFundedRow ? 'expiringSoon' : 'amountLeft'
},
// Default loans for loading animations
loans: new Array(6).fill({ id: 0 }),
Expand All @@ -134,6 +138,11 @@ export default {
showOverlay: false,
};
},
computed: {
defaultSort() {
return this.enableAlmostFundedRow ? 'expiringSoon' : 'amountLeft';
}
},
async mounted() {
this.allFacets = await fetchLoanFacets(this.apollo);
await this.fetchFilterData(this.flssLoanSearch);
Expand Down
1 change: 1 addition & 0 deletions src/pages/LoanFinding/LoanFinding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
:class="{ 'tw-order-last' : enableRelendingExp }"
:enable-five-dollars-notes="enableFiveDollarsNotes"
:enable-qf-mobile="enableQFMobileVersion"
:enable-almost-funded-row="enableAlmostFundedRow"
:user-balance="userBalance"
@add-to-basket="trackCategory($event, 'quick-filters')"
@data-loaded="trackQuickFiltersDisplayedLoans"
Expand Down

0 comments on commit 0231908

Please sign in to comment.