@kiva/kv-components 3.30.0 → 3.31.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.31.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.30.0...@kiva/kv-components@3.31.0) (2023-07-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * 5 dollars pre select added to loan card components ([#274](https://github.com/kiva/kv-ui-elements/issues/274)) ([1f30146](https://github.com/kiva/kv-ui-elements/commit/1f30146f67ae079eb662cc02403ee9adcfe257ee))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.30.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.29.0...@kiva/kv-components@3.30.0) (2023-07-17)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.30.0",
3
+ "version": "3.31.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": "d54d59bf1bedf3e18841138aac0b4dc7f58679be"
78
+ "gitHead": "b66bca765d462556a4801b89dbf0f1a2dca99252"
79
79
  }
@@ -40,6 +40,7 @@ export function getLendCtaSelectedOption(
40
40
  campaign,
41
41
  unreservedAmount,
42
42
  userBalance,
43
+ fiveDollarsSelected,
43
44
  ) {
44
45
  // Don't enable the campaign changes when the user balance is undefined (user not logged in)
45
46
  if (enableFiveDollarsNotes && typeof userBalance !== 'undefined') {
@@ -78,6 +79,10 @@ export function getLendCtaSelectedOption(
78
79
  }
79
80
  }
80
81
 
82
+ if (enableFiveDollarsNotes && fiveDollarsSelected) {
83
+ return '5';
84
+ }
85
+
81
86
  // Handle when $5 notes isn't enabled
82
87
  if (isBetween25And50(unreservedAmount) || isLessThan25(unreservedAmount)) {
83
88
  return Number(unreservedAmount).toFixed();
@@ -201,6 +201,7 @@
201
201
  :is-loading="isLoading"
202
202
  :is-adding="isAdding"
203
203
  :enable-five-dollars-notes="enableFiveDollarsNotes"
204
+ :five-dollars-selected="fiveDollarsSelected"
204
205
  :kv-track-function="kvTrackFunction"
205
206
  :show-view-loan="showViewLoan"
206
207
  :custom-loan-details="customLoanDetails"
@@ -324,6 +325,10 @@ export default {
324
325
  type: Function,
325
326
  default: undefined,
326
327
  },
328
+ fiveDollarsSelected: {
329
+ type: Boolean,
330
+ default: false,
331
+ },
327
332
  },
328
333
  data() {
329
334
  return {
package/vue/KvLendCta.vue CHANGED
@@ -195,6 +195,10 @@ export default {
195
195
  type: Function,
196
196
  default: undefined,
197
197
  },
198
+ fiveDollarsSelected: {
199
+ type: Boolean,
200
+ default: false,
201
+ },
198
202
  },
199
203
  data() {
200
204
  return {
@@ -206,6 +210,7 @@ export default {
206
210
  this.route?.query?.utm_campaign,
207
211
  this.loan?.unreservedAmount,
208
212
  this.userBalance,
213
+ this.fiveDollarsSelected,
209
214
  ),
210
215
  };
211
216
  },
@@ -344,6 +349,7 @@ export default {
344
349
  this.route?.query?.utm_campaign,
345
350
  newValue,
346
351
  this.userBalance,
352
+ this.fiveDollarsSelected,
347
353
  );
348
354
  }
349
355
  },
@@ -19,6 +19,7 @@ const story = (args) => {
19
19
  :show-tags="showTags"
20
20
  :category-page-name="categoryPageName"
21
21
  :enable-five-dollars-notes="enableFiveDollarsNotes"
22
+ :five-dollars-selected="fiveDollarsSelected"
22
23
  :large-card="largeCard"
23
24
  :is-adding="isAdding"
24
25
  :is-visitor="isVisitor"
@@ -206,6 +207,15 @@ export const FiveDollarNotes = story({
206
207
  photoPath,
207
208
  });
208
209
 
210
+ export const FiveDollarsSelected = story({
211
+ loanId: loan.id,
212
+ loan,
213
+ enableFiveDollarsNotes: true,
214
+ fiveDollarsSelected: true,
215
+ kvTrackFunction,
216
+ photoPath,
217
+ });
218
+
209
219
  export const ViewLoan = story({
210
220
  loanId: loan.id,
211
221
  loan,
@@ -17,6 +17,7 @@ const story = (args) => {
17
17
  :is-loading="isLoading"
18
18
  :is-adding="isAdding"
19
19
  :enable-five-dollars-notes="enableFiveDollarsNotes"
20
+ :five-dollars-selected="fiveDollarsSelected"
20
21
  :kv-track-function="kvTrackFunction"
21
22
  :show-view-loan="showViewLoan"
22
23
  :custom-loan-details="customLoanDetails"
@@ -77,6 +78,17 @@ export const FiveDollar = story({
77
78
  kvTrackFunction,
78
79
  });
79
80
 
81
+ export const FiveDollarsSelected = story({
82
+ isLoading: false,
83
+ loan: {
84
+ id: 1,
85
+ unreservedAmount: '150.00',
86
+ },
87
+ enableFiveDollarsNotes: true,
88
+ fiveDollarsSelected: true,
89
+ kvTrackFunction,
90
+ });
91
+
80
92
  export const LessThan25 = story({
81
93
  isLoading: false,
82
94
  loan: {