@kiva/kv-components 3.75.0 → 3.75.2

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,28 @@
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.75.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.75.1...@kiva/kv-components@3.75.2) (2024-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * category callouts were missing props to make them clickable ([6d7918b](https://github.com/kiva/kv-ui-elements/commit/6d7918bda0ddb8bff1dc38fa985409503c2d2616))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.75.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.75.0...@kiva/kv-components@3.75.1) (2024-04-26)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * activity removed from clickable tags ([#394](https://github.com/kiva/kv-ui-elements/issues/394)) ([e59496a](https://github.com/kiva/kv-ui-elements/commit/e59496afceb9b7964078452c57dd401cb6b2dab4))
23
+
24
+
25
+
26
+
27
+
6
28
  # [3.75.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.74.1...@kiva/kv-components@3.75.0) (2024-04-26)
7
29
 
8
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.75.0",
3
+ "version": "3.75.2",
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": "478101c653870979f75a18e4ea2cb355e21c28ac"
78
+ "gitHead": "489d7831ed1eb950eb559003530e4fed7e0e5d98"
79
79
  }
@@ -211,10 +211,10 @@ describe('KvClassicLoanCard', () => {
211
211
  enableClickableTags: true,
212
212
  },
213
213
  });
214
- const tagSpan = getByText('Dairy');
214
+ const tagSpan = getByText('Agriculture');
215
215
 
216
216
  await userEvent.click(tagSpan);
217
217
 
218
- expect(emitted()['jump-filter-page']).toEqual([[{ id: 61, label: 'Dairy', type: 'activity' }]]);
218
+ expect(emitted()['jump-filter-page']).toEqual([[{ id: 1, label: 'Agriculture', type: 'sector' }]]);
219
219
  });
220
220
  });
package/utils/loanCard.js CHANGED
@@ -11,7 +11,7 @@ const SUSTAINABLE_AG_KEY = 'SUSTAINABLE AG';
11
11
  const SINGLE_PARENT_KEY = 'SINGLE PARENT';
12
12
  const REFUGEE_KEY = 'REFUGEES/DISPLACED';
13
13
 
14
- const findCalloutData = (tags, tagName) => tags?.find((t) => t.name.toUpperCase() === tagName.toUpperCase()) ?? {};
14
+ const findCalloutData = (tags, tagName) => tags?.find((t) => t.name.replace('#', '').toUpperCase() === tagName.toUpperCase()) ?? {}; // eslint-disable-line max-len
15
15
 
16
16
  export function loanCardComputedProperties(props) {
17
17
  const {
@@ -101,12 +101,12 @@ export function loanCardComputedProperties(props) {
101
101
  if (categories.ecoFriendly
102
102
  // eslint-disable-next-line max-len
103
103
  && !callouts.find((c) => c.label.toUpperCase() === ECO_FRIENDLY_KEY || c.label.toUpperCase() === SUSTAINABLE_AG_KEY)) {
104
- callouts.push({ label: 'Eco-friendly' });
104
+ callouts.push({ label: 'Eco-friendly', type: 'tag', id: 9 });
105
105
  } else if (categories.refugeesIdps) {
106
- callouts.push({ label: 'Refugees and IDPs' });
106
+ callouts.push({ label: 'Refugees and IDPs', type: 'attribute', id: 28 });
107
107
  } else if (categories.singleParents
108
108
  && !callouts.find((c) => c.label.toUpperCase() === SINGLE_PARENT_KEY)) {
109
- callouts.push({ label: 'Single Parent' });
109
+ callouts.push({ label: 'Single Parent', type: 'tag', id: 17 });
110
110
  }
111
111
  }
112
112
 
@@ -142,7 +142,7 @@ export function loanCardComputedProperties(props) {
142
142
  const id = themeData?.id ?? null;
143
143
  if (!callouts.filter((c) => c.label.toUpperCase() === theme.toUpperCase()).length
144
144
  && theme.toUpperCase() !== categoryPageName.value?.toUpperCase()) {
145
- callouts.push({ label: theme, type: 'theme', id });
145
+ callouts.push({ label: theme, type: 'attribute', id });
146
146
  }
147
147
  }
148
148
 
@@ -60,7 +60,7 @@ export default {
60
60
  } = toRefs(props);
61
61
 
62
62
  const isClickable = (tag) => {
63
- const clickableTypes = ['activity', 'sector', 'tag', 'theme'];
63
+ const clickableTypes = ['sector', 'tag', 'attribute'];
64
64
  const isClickableType = clickableTypes.includes(tag.type);
65
65
 
66
66
  return enableClickable.value && isClickableType && !!tag.id;
@@ -24,11 +24,10 @@ export const Default = story({ callouts: [{ label: 'callout 1' }, { label: 'call
24
24
 
25
25
  export const Clickable = story({
26
26
  callouts: [
27
- { id: 1, label: 'callout 1', type: 'activity' },
28
27
  { label: 'callout 2' },
29
28
  { id: 33, label: 'callout 3', type: 'sector' },
30
29
  { id: null, label: 'callout 4', type: 'tag' },
31
- { id: 12, label: 'callout 5', type: 'theme' },
30
+ { id: 12, label: 'callout 5', type: 'attribute' },
32
31
  ],
33
32
  enableClickable: true,
34
33
  });