@kiva/kv-components 3.89.1 → 3.90.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 +16 -0
- package/package.json +2 -2
- package/tests/unit/specs/components/KvClassicLoanCard.spec.js +0 -19
- package/vue/KvClassicLoanCard.vue +0 -6
- package/vue/KvLoanCallouts.vue +0 -34
- package/vue/KvLoanTag.vue +0 -4
- package/vue/KvWideLoanCard.vue +0 -1
- package/vue/stories/KvClassicLoanCard.stories.js +0 -9
- package/vue/stories/KvLoanCallouts.stories.js +0 -12
- package/vue/stories/KvLoanTag.stories.js +1 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.90.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.89.1...@kiva/kv-components@3.90.0) (2024-07-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* revert new loan card ([84ee01e](https://github.com/kiva/kv-ui-elements/commit/84ee01e11c23d45f41389c003acaba843b50d103))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* remove clickable tags exp ([afba87d](https://github.com/kiva/kv-ui-elements/commit/afba87dd24a9123607ccf6d8a83e81efab2a2a34))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.89.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.89.0...@kiva/kv-components@3.89.1) (2024-07-24)
|
|
7
23
|
|
|
8
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.90.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"optional": true
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "b1468cd0b28b722c0088ad4941c604d12cd60735"
|
|
86
86
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { render } from '@testing-library/vue';
|
|
2
|
-
import userEvent from '@testing-library/user-event';
|
|
3
2
|
import { axe } from 'jest-axe';
|
|
4
3
|
import KvClassicLoanCard from '../../../../vue/KvClassicLoanCard.vue';
|
|
5
4
|
|
|
@@ -199,22 +198,4 @@ describe('KvClassicLoanCard', () => {
|
|
|
199
198
|
expect(activityText).toBeDefined();
|
|
200
199
|
expect(activityBtn).toBeDefined();
|
|
201
200
|
});
|
|
202
|
-
|
|
203
|
-
it('should emit clicked tag data', async () => {
|
|
204
|
-
const { getByText, emitted } = render(KvClassicLoanCard,
|
|
205
|
-
{
|
|
206
|
-
props: {
|
|
207
|
-
loanId: loan.id,
|
|
208
|
-
loan,
|
|
209
|
-
kvTrackFunction,
|
|
210
|
-
photoPath,
|
|
211
|
-
enableClickableTags: true,
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
const tagSpan = getByText('Agriculture');
|
|
215
|
-
|
|
216
|
-
await userEvent.click(tagSpan);
|
|
217
|
-
|
|
218
|
-
expect(emitted()['jump-filter-page']).toEqual([[{ id: 1, label: 'Agriculture', type: 'sector' }]]);
|
|
219
|
-
});
|
|
220
201
|
});
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
<kv-loan-tag
|
|
98
98
|
v-if="showTags && !isLoading"
|
|
99
99
|
:loan="loan"
|
|
100
|
-
:kv-track-function="kvTrackFunction"
|
|
101
100
|
/>
|
|
102
101
|
</component>
|
|
103
102
|
|
|
@@ -151,7 +150,6 @@
|
|
|
151
150
|
<kv-loan-callouts
|
|
152
151
|
v-else
|
|
153
152
|
:callouts="loanCallouts"
|
|
154
|
-
:enable-clickable="enableClickableTags"
|
|
155
153
|
class="tw-mt-1.5"
|
|
156
154
|
:class="{ 'tw-px-1': largeCard }"
|
|
157
155
|
@click="$emit('jump-filter-page', $event)"
|
|
@@ -407,10 +405,6 @@ export default {
|
|
|
407
405
|
type: Boolean,
|
|
408
406
|
default: false,
|
|
409
407
|
},
|
|
410
|
-
enableClickableTags: {
|
|
411
|
-
type: Boolean,
|
|
412
|
-
default: false,
|
|
413
|
-
},
|
|
414
408
|
primaryButtonText: {
|
|
415
409
|
type: String,
|
|
416
410
|
default: 'Lend',
|
package/vue/KvLoanCallouts.vue
CHANGED
|
@@ -27,8 +27,6 @@
|
|
|
27
27
|
tw-mb-0.5
|
|
28
28
|
tw-text-small
|
|
29
29
|
"
|
|
30
|
-
:class="{ 'tw-cursor-pointer hover:tw-underline': isClickable(tag) }"
|
|
31
|
-
@click="clickCallout(tag)"
|
|
32
30
|
>
|
|
33
31
|
{{ tag.label }}
|
|
34
32
|
</span>
|
|
@@ -37,8 +35,6 @@
|
|
|
37
35
|
</template>
|
|
38
36
|
|
|
39
37
|
<script>
|
|
40
|
-
import { toRefs } from 'vue-demi';
|
|
41
|
-
|
|
42
38
|
export default {
|
|
43
39
|
name: 'KvLoanCallouts',
|
|
44
40
|
props: {
|
|
@@ -46,36 +42,6 @@ export default {
|
|
|
46
42
|
type: Array,
|
|
47
43
|
required: true,
|
|
48
44
|
},
|
|
49
|
-
enableClickable: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
emits: [
|
|
55
|
-
'click',
|
|
56
|
-
],
|
|
57
|
-
setup(props, { emit }) {
|
|
58
|
-
const {
|
|
59
|
-
enableClickable,
|
|
60
|
-
} = toRefs(props);
|
|
61
|
-
|
|
62
|
-
const isClickable = (tag) => {
|
|
63
|
-
const clickableTypes = ['sector', 'tag', 'attribute', 'activity'];
|
|
64
|
-
const isClickableType = clickableTypes.includes(tag.type);
|
|
65
|
-
|
|
66
|
-
return enableClickable.value && isClickableType && !!tag.id;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const clickCallout = (tag) => {
|
|
70
|
-
if (isClickable(tag)) {
|
|
71
|
-
emit('click', tag);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
isClickable,
|
|
77
|
-
clickCallout,
|
|
78
|
-
};
|
|
79
45
|
},
|
|
80
46
|
};
|
|
81
47
|
</script>
|
package/vue/KvLoanTag.vue
CHANGED
package/vue/KvWideLoanCard.vue
CHANGED
|
@@ -33,7 +33,6 @@ const story = (args) => {
|
|
|
33
33
|
:combined-activities="combinedActivities"
|
|
34
34
|
:showContributors="showContributors"
|
|
35
35
|
:enable-huge-amount="enableHugeAmount"
|
|
36
|
-
:enable-clickable-tags="enableClickableTags"
|
|
37
36
|
:primary-button-text="primaryButtonText"
|
|
38
37
|
:secondary-button-text="secondaryButtonText"
|
|
39
38
|
:secondary-button-handler="secondaryButtonHandler"
|
|
@@ -400,14 +399,6 @@ export const HugeLentAmount = story({
|
|
|
400
399
|
enableHugeAmount: true,
|
|
401
400
|
});
|
|
402
401
|
|
|
403
|
-
export const ClickableTags = story({
|
|
404
|
-
loanId: loan.id,
|
|
405
|
-
loan,
|
|
406
|
-
kvTrackFunction,
|
|
407
|
-
photoPath,
|
|
408
|
-
enableClickableTags: true,
|
|
409
|
-
});
|
|
410
|
-
|
|
411
402
|
export const SupportButton = story({
|
|
412
403
|
loanId: loan.id,
|
|
413
404
|
loan,
|
|
@@ -12,7 +12,6 @@ const story = (args) => {
|
|
|
12
12
|
template: `
|
|
13
13
|
<kv-loan-callouts
|
|
14
14
|
:callouts="callouts"
|
|
15
|
-
:enableClickable="enableClickable"
|
|
16
15
|
/>
|
|
17
16
|
`,
|
|
18
17
|
});
|
|
@@ -21,14 +20,3 @@ const story = (args) => {
|
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export const Default = story({ callouts: [{ label: 'callout 1' }, { label: 'callout 2' }, { label: 'callout 3' }] });
|
|
24
|
-
|
|
25
|
-
export const Clickable = story({
|
|
26
|
-
callouts: [
|
|
27
|
-
{ label: 'callout 1' },
|
|
28
|
-
{ id: 33, label: 'callout 2', type: 'sector' },
|
|
29
|
-
{ id: null, label: 'callout 3', type: 'tag' },
|
|
30
|
-
{ id: 12, label: 'callout 4', type: 'attribute' },
|
|
31
|
-
{ id: 9, label: 'callout 5', type: 'activity' },
|
|
32
|
-
],
|
|
33
|
-
enableClickable: true,
|
|
34
|
-
});
|
|
@@ -16,7 +16,6 @@ const story = (args) => {
|
|
|
16
16
|
template: `
|
|
17
17
|
<kv-loan-tag
|
|
18
18
|
:loan="loan"
|
|
19
|
-
:kv-track-function="kvTrackFunction"
|
|
20
19
|
/>
|
|
21
20
|
`,
|
|
22
21
|
});
|
|
@@ -30,9 +29,7 @@ tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
30
29
|
const nextWeek = new Date();
|
|
31
30
|
nextWeek.setDate(new Date().getDate() + 7);
|
|
32
31
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
export const EndingSoon = story({ loan: { plannedExpirationDate: tomorrow.toISOString() }, kvTrackFunction });
|
|
32
|
+
export const EndingSoon = story({ loan: { plannedExpirationDate: tomorrow.toISOString() } });
|
|
36
33
|
|
|
37
34
|
export const AlmostFunded = story({
|
|
38
35
|
loan: {
|
|
@@ -40,7 +37,6 @@ export const AlmostFunded = story({
|
|
|
40
37
|
plannedExpirationDate: nextWeek.toISOString(),
|
|
41
38
|
loanFundraisingInfo: { fundedAmount: 50, reservedAmount: 50 },
|
|
42
39
|
},
|
|
43
|
-
kvTrackFunction,
|
|
44
40
|
});
|
|
45
41
|
|
|
46
42
|
export const Matched = story({
|
|
@@ -51,7 +47,6 @@ export const Matched = story({
|
|
|
51
47
|
loanAmount: 199,
|
|
52
48
|
loanFundraisingInfo: { fundedAmount: 0, reservedAmount: 0 },
|
|
53
49
|
},
|
|
54
|
-
kvTrackFunction,
|
|
55
50
|
});
|
|
56
51
|
|
|
57
52
|
export const LseLoan = story({
|
|
@@ -63,5 +58,4 @@ export const LseLoan = story({
|
|
|
63
58
|
loanFundraisingInfo: { fundedAmount: 0, reservedAmount: 0 },
|
|
64
59
|
partnerName: 'N/A, direct to Novulis',
|
|
65
60
|
},
|
|
66
|
-
kvTrackFunction,
|
|
67
61
|
});
|