Skip to content

Commit b2d1765

Browse files
feat: remove huge amount flags (#591)
* fix: type passed to redirect handler * feat: huge amount flag removed to add it as a feature * fix: unit test fixed
1 parent e355473 commit b2d1765

File tree

9 files changed

+6
-36
lines changed

9 files changed

+6
-36
lines changed

@kiva/kv-components/src/utils/loanUtils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function buildPriceArray(amountLeft, minAmount) {
177177
* @param {boolean} isCompleteLoanActive Whether to include option that would complete loan
178178
* @param {number} minAmount The min amount to show in the dropdown
179179
* @param {boolean} enableFiveDollarsNotes Whether five dollar notes are enabled
180-
* @param {boolean} enableHugeAmount Whether huge loan amounts are enabled
181180
* @param {boolean} isVisitor Whether the current user is a visitor
182181
* @param {boolean} inPfp Whether the loan is in PFP
183182
* @returns {string[]} Price value array for the CTA dropdown
@@ -187,7 +186,6 @@ export function getDropdownPriceArray(
187186
isCompleteLoanActive = false,
188187
minAmount = 25,
189188
enableFiveDollarsNotes = false,
190-
enableHugeAmount = false,
191189
isVisitor = true,
192190
inPfp = false,
193191
) {
@@ -196,7 +194,7 @@ export function getDropdownPriceArray(
196194
? build5DollarsPriceArray(parsedAmountLeft).slice(0, 28)
197195
: buildPriceArray(parsedAmountLeft, minAmount).slice(0, 20);
198196

199-
if (enableHugeAmount && parsedAmountLeft > 500 && !isVisitor) {
197+
if (parsedAmountLeft > 500 && !isVisitor) {
200198
const hugePriceArray = buildHugePriceArray(parsedAmountLeft);
201199
priceArray = priceArray.concat(hugePriceArray);
202200
}

@kiva/kv-components/src/vue/KvClassicLoanCard.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@
220220
:user-balance="userBalance"
221221
:get-cookie="getCookie"
222222
:set-cookie="setCookie"
223-
:enable-huge-amount="enableHugeAmount"
224223
:is-visitor="isVisitor"
225224
:primary-button-text="primaryButtonText"
226225
:secondary-button-text="secondaryButtonText"
@@ -263,7 +262,6 @@
263262
:get-cookie="getCookie"
264263
:set-cookie="setCookie"
265264
:error-msg="errorMsg"
266-
:enable-huge-amount="enableHugeAmount"
267265
:is-visitor="isVisitor"
268266
@add-to-basket="$emit('add-to-basket', $event)"
269267
/>
@@ -453,10 +451,6 @@ export default {
453451
type: String,
454452
default: '',
455453
},
456-
enableHugeAmount: {
457-
type: Boolean,
458-
default: false,
459-
},
460454
primaryButtonText: {
461455
type: String,
462456
default: 'Lend',

@kiva/kv-components/src/vue/KvLendCta.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@
106106
>
107107
<div
108108
v-if="showPresetAmounts && !isAdding"
109-
class="tw-flex tw-gap-1 lg:tw-gap-2"
110-
:class="{'tw-flex-wrap md:tw-flex-nowrap': enableHugeAmount}"
109+
class="tw-flex tw-gap-1 lg:tw-gap-2 tw-flex-wrap md:tw-flex-nowrap"
111110
>
112111
<template v-if="!isLendAmountButton">
113112
<kv-ui-button
@@ -126,11 +125,10 @@
126125
v-if="showFilteredDropdown"
127126
:id="`LoanAmountDropdown_${loanId}`"
128127
v-model="selectedDropdownOption"
129-
class="tw-min-w-12 tw-rounded filtered-dropdown"
128+
class="tw-min-w-12 tw-rounded filtered-dropdown tw-w-full"
130129
:class="{
131130
'unselected-dropdown': !selectedDropdown,
132131
'selected-dropdown': selectedDropdown,
133-
'tw-w-full': enableHugeAmount
134132
}"
135133
aria-label="Lend amount"
136134
@update:modelValue="trackLendAmountSelection"
@@ -327,10 +325,6 @@ export default {
327325
type: Boolean,
328326
default: false,
329327
},
330-
enableHugeAmount: {
331-
type: Boolean,
332-
default: false,
333-
},
334328
isVisitor: {
335329
type: Boolean,
336330
default: true,
@@ -416,7 +410,6 @@ export default {
416410
this.isCompleteLoanActive,
417411
minAmount,
418412
this.enableFiveDollarsNotes,
419-
this.enableHugeAmount,
420413
this.isVisitor,
421414
);
422415
// Limit price options based on the maxAmount

@kiva/kv-components/src/vue/KvLoanActivities.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
:basket-items="basketItems"
6666
:route="route"
6767
:is-adding="isAdding"
68-
:enable-huge-amount="enableHugeAmount"
6968
:is-visitor="isVisitor"
7069
:enable-five-dollars-notes="enableFiveDollarsNotes"
7170
@add-to-basket="$emit('add-to-basket', $event)"
@@ -180,10 +179,6 @@ export default {
180179
type: Boolean,
181180
default: false,
182181
},
183-
enableHugeAmount: {
184-
type: Boolean,
185-
default: false,
186-
},
187182
isVisitor: {
188183
type: Boolean,
189184
default: true,

@kiva/kv-components/src/vue/KvWideLoanCard.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
:user-balance="userBalance"
216216
:get-cookie="getCookie"
217217
:set-cookie="setCookie"
218-
:enable-huge-amount="enableHugeAmount"
219218
:is-visitor="isVisitor"
220219
class="tw-mt-auto tw-self-end"
221220
:class="{'tw-flex-grow' : !sharesAvailable, 'tw-flex-shrink-0' : sharesAvailable}"
@@ -375,10 +374,6 @@ export default {
375374
type: Array,
376375
default: () => ([]),
377376
},
378-
enableHugeAmount: {
379-
type: Boolean,
380-
default: false,
381-
},
382377
},
383378
setup(props, { emit }) {
384379
const {

@kiva/kv-components/src/vue/stories/KvClassicLoanCard.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ export const HugeLentAmount = story({
387387
kvTrackFunction,
388388
photoPath,
389389
isVisitor: false,
390-
enableHugeAmount: true,
391390
});
392391

393392
export const SupportButton = story({

@kiva/kv-components/src/vue/stories/KvLendCta.stories.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export const HugeAmount = story({
8484
},
8585
unreservedAmount: '12850.00',
8686
kvTrackFunction,
87-
enableHugeAmount: true,
8887
isVisitor: false,
8988
});
9089

@@ -95,7 +94,6 @@ export const HugeAmountUnder1000 = story({
9594
},
9695
unreservedAmount: '850.00',
9796
kvTrackFunction,
98-
enableHugeAmount: true,
9997
isVisitor: false,
10098
});
10199

@@ -320,7 +318,6 @@ export const WithPresetOptionsHugeAmount = story({
320318
},
321319
unreservedAmount: '12850.00',
322320
kvTrackFunction,
323-
enableHugeAmount: true,
324321
isVisitor: false,
325322
showPresetAmounts: true,
326323
});

@kiva/kv-components/src/vue/stories/KvWideLoanCard.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,4 @@ export const HugeLentAmount = story({
292292
kvTrackFunction,
293293
photoPath,
294294
isVisitor: false,
295-
enableHugeAmount: true,
296295
});

@kiva/kv-components/tests/unit/specs/utils/loanUtils.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ describe('loanUtils', () => {
332332
});
333333

334334
it('should return huge dropdown values between 500 and 1000', () => {
335-
const result = getDropdownPriceArray('650.00', false, 25, false, true, false);
335+
const result = getDropdownPriceArray('650.00', false, 25, false, false);
336336

337337
expect(result).toEqual([
338338
'25',
@@ -361,7 +361,7 @@ describe('loanUtils', () => {
361361
});
362362

363363
it('should return huge dropdown values up to 10,000', () => {
364-
const result = getDropdownPriceArray('11000.00', false, 25, false, true, false);
364+
const result = getDropdownPriceArray('11000.00', false, 25, false, false);
365365

366366
expect(result).toEqual([
367367
'25',
@@ -402,7 +402,7 @@ describe('loanUtils', () => {
402402
});
403403

404404
it('should return not huge dropdown values for visitor', () => {
405-
const result = getDropdownPriceArray('650.00', false, 25, false, true, true);
405+
const result = getDropdownPriceArray('650.00', false, 25, false, true);
406406

407407
expect(result).toEqual([
408408
'25',

0 commit comments

Comments
 (0)