@kiva/kv-components 3.43.0 → 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.44.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.43.0...@kiva/kv-components@3.44.0) (2023-09-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* increase impact visibility for lse loans ([#298](https://github.com/kiva/kv-ui-elements/issues/298)) ([f9dc1e4](https://github.com/kiva/kv-ui-elements/commit/f9dc1e47f25a68f8e3bd745abfc2338b376bd848))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.43.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.42.0...@kiva/kv-components@3.43.0) (2023-09-15)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"optional": true
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "de7cefc4bfbacb12fbabf0c4b201319acaba37d3"
|
|
79
79
|
}
|
|
@@ -231,6 +231,8 @@ import KvLoanTag from './KvLoanTag.vue';
|
|
|
231
231
|
import KvMaterialIcon from './KvMaterialIcon.vue';
|
|
232
232
|
import KvLoadingPlaceholder from './KvLoadingPlaceholder.vue';
|
|
233
233
|
|
|
234
|
+
const LSE_LOAN_KEY = 'N/A';
|
|
235
|
+
|
|
234
236
|
export default {
|
|
235
237
|
name: 'KvClassicLoanCard',
|
|
236
238
|
components: {
|
|
@@ -438,14 +440,25 @@ export default {
|
|
|
438
440
|
singleParents: !!tags.filter((t) => t.toUpperCase() === 'SINGLE PARENT').length,
|
|
439
441
|
};
|
|
440
442
|
|
|
443
|
+
const isLseLoan = this.loan?.partnerName?.toUpperCase().includes(LSE_LOAN_KEY);
|
|
444
|
+
|
|
441
445
|
// P1 Category
|
|
442
446
|
// Exp limited to: Eco-friendly, Refugees and IDPs, Single Parents
|
|
447
|
+
// Tag as first option for LSE loans
|
|
448
|
+
if (isLseLoan && tags.length) {
|
|
449
|
+
const position = Math.floor(Math.random() * tags.length);
|
|
450
|
+
const tag = tags[position];
|
|
451
|
+
callouts.push(tag);
|
|
452
|
+
}
|
|
453
|
+
|
|
443
454
|
if (!this.categoryPageName) {
|
|
444
|
-
if (categories.ecoFriendly
|
|
455
|
+
if (categories.ecoFriendly
|
|
456
|
+
&& !callouts.filter((c) => c.toUpperCase() === categories.ecoFriendly.toUpperCase()).length) {
|
|
445
457
|
callouts.push('Eco-friendly');
|
|
446
458
|
} else if (categories.refugeesIdps) {
|
|
447
459
|
callouts.push('Refugees and IDPs');
|
|
448
|
-
} else if (categories.singleParents
|
|
460
|
+
} else if (categories.singleParents
|
|
461
|
+
&& !callouts.filter((c) => c.toUpperCase() === categories.singleParents.toUpperCase()).length) {
|
|
449
462
|
callouts.push('Single Parent');
|
|
450
463
|
}
|
|
451
464
|
}
|
|
@@ -482,6 +495,8 @@ export default {
|
|
|
482
495
|
}
|
|
483
496
|
}
|
|
484
497
|
|
|
498
|
+
// Only show one callout for LSE loans
|
|
499
|
+
if (isLseLoan && callouts.length > 1) return [callouts.shift()];
|
|
485
500
|
return callouts;
|
|
486
501
|
},
|
|
487
502
|
},
|
package/vue/KvLoanTag.vue
CHANGED
|
@@ -17,6 +17,8 @@ import { differenceInDays, parseISO } from 'date-fns';
|
|
|
17
17
|
import numeral from 'numeral';
|
|
18
18
|
import KvCountdownTimer from './KvCountdownTimer.vue';
|
|
19
19
|
|
|
20
|
+
const LSE_LOAN_KEY = 'N/A';
|
|
21
|
+
|
|
20
22
|
export default {
|
|
21
23
|
name: 'KvLoanTag',
|
|
22
24
|
components: {
|
|
@@ -55,6 +57,10 @@ export default {
|
|
|
55
57
|
return null;
|
|
56
58
|
},
|
|
57
59
|
tagText() {
|
|
60
|
+
const partnerName = this.loan?.partnerName ?? '';
|
|
61
|
+
if (partnerName.toUpperCase().includes(LSE_LOAN_KEY)) {
|
|
62
|
+
return 'High community impact';
|
|
63
|
+
}
|
|
58
64
|
switch (this.variation) {
|
|
59
65
|
case 'almost-funded': return 'Almost funded';
|
|
60
66
|
case 'matched-loan': return `${this.matchRatio + 1}x matching by ${this.loan?.matchingText}`;
|
|
@@ -182,6 +182,29 @@ export const LongCallouts = story({
|
|
|
182
182
|
photoPath,
|
|
183
183
|
});
|
|
184
184
|
|
|
185
|
+
export const LseLoan = story({
|
|
186
|
+
loanId: loan.id,
|
|
187
|
+
loan: {
|
|
188
|
+
...loan,
|
|
189
|
+
loanFundraisingInfo: {
|
|
190
|
+
fundedAmount: '950.00',
|
|
191
|
+
isExpiringSoon: false,
|
|
192
|
+
reservedAmount: '0.00',
|
|
193
|
+
},
|
|
194
|
+
partnerName: 'N/A, direct to Novulis',
|
|
195
|
+
tags: [
|
|
196
|
+
'user_favorite',
|
|
197
|
+
'#Woman-Owned Business',
|
|
198
|
+
'#Animals',
|
|
199
|
+
'#Repeat Borrower',
|
|
200
|
+
'#Supporting Family',
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
kvTrackFunction,
|
|
204
|
+
photoPath,
|
|
205
|
+
showTags: true,
|
|
206
|
+
});
|
|
207
|
+
|
|
185
208
|
export const Bookmarked = story({
|
|
186
209
|
loanId: loan.id,
|
|
187
210
|
loan,
|
|
@@ -53,3 +53,15 @@ export const Matched = story({
|
|
|
53
53
|
},
|
|
54
54
|
kvTrackFunction,
|
|
55
55
|
});
|
|
56
|
+
|
|
57
|
+
export const LseLoan = story({
|
|
58
|
+
loan: {
|
|
59
|
+
matchingText: 'Ebay',
|
|
60
|
+
matchRatio: 1,
|
|
61
|
+
plannedExpirationDate: nextWeek.toISOString(),
|
|
62
|
+
loanAmount: 199,
|
|
63
|
+
loanFundraisingInfo: { fundedAmount: 0, reservedAmount: 0 },
|
|
64
|
+
partnerName: 'N/A, direct to Novulis',
|
|
65
|
+
},
|
|
66
|
+
kvTrackFunction,
|
|
67
|
+
});
|