@kiva/kv-components 3.56.0 → 3.57.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,33 @@
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.57.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.56.1...@kiva/kv-components@3.57.0) (2024-03-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * test failed because of whitespaces in value ([4591e93](https://github.com/kiva/kv-ui-elements/commit/4591e932a9c785f97019f47a8d7899142b2c1204))
12
+
13
+
14
+ ### Features
15
+
16
+ * show number of likes ([c088fae](https://github.com/kiva/kv-ui-elements/commit/c088fae443da391871ef1783e64712d306b84007))
17
+
18
+
19
+
20
+
21
+
22
+ ## [3.56.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.56.0...@kiva/kv-components@3.56.1) (2024-03-01)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * remove country from voting card ([fee3dcb](https://github.com/kiva/kv-ui-elements/commit/fee3dcb7af0fd103dedca70c14448cfab91c66eb))
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.56.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.55.2...@kiva/kv-components@3.56.0) (2024-03-01)
7
34
 
8
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.56.0",
3
+ "version": "3.57.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": "2850cb1cba0104d44adfeee72211deadfbd29a14"
78
+ "gitHead": "6241a3deffa7ef7e581a09a1c371240884e5f269"
79
79
  }
@@ -141,7 +141,10 @@ const comments = {
141
141
  },
142
142
  ],
143
143
  },
144
- children_counts: {},
144
+ children_counts: {
145
+ comment: 1,
146
+ like: 1,
147
+ },
145
148
  },
146
149
  {
147
150
  created_at: '2024-02-01T20:11:23.931133Z',
@@ -26,11 +26,13 @@ describe('KvCommentsListItem', () => {
26
26
  });
27
27
 
28
28
  it('should handle like button click', async () => {
29
- const { getAllByRole, emitted } = renderComment({ comment });
29
+ const { getAllByRole, emitted, getByTestId } = renderComment({ comment });
30
30
  const likeButton = getAllByRole('button', { name: 'Like' })[0];
31
+ const likeCount = getByTestId('like-count');
31
32
 
32
33
  await userEvent.click(likeButton);
33
34
 
35
+ expect(likeCount).toHaveTextContent(1);
34
36
  expect(emitted()[ADD_REACTION_EVENT]).toEqual([[{
35
37
  id: comment.id,
36
38
  isChild: true,
@@ -10,7 +10,7 @@
10
10
  :user-display-name="userDisplayName"
11
11
  :user-public-id="userPublicId"
12
12
  :is-liked="comment.is_liked"
13
- class="tw-mb-2"
13
+ class="tw-mb-2 tw-not-prose"
14
14
  @add-reaction="handleReaction"
15
15
  />
16
16
  </div>
@@ -31,11 +31,19 @@
31
31
  v-if="nestLevel < 3"
32
32
  class="tw-flex tw-items-center tw-gap-x-2"
33
33
  >
34
- <kv-comments-heart-button
35
- :is-small="true"
36
- :is-liked="isLiked"
37
- @click="addReaction(LIKE_COMMENT_EVENT, $event)"
38
- />
34
+ <div class="tw-flex tw-items-center tw-gap-0.5">
35
+ <kv-comments-heart-button
36
+ :is-small="true"
37
+ :is-liked="isLiked"
38
+ @click="addReaction(LIKE_COMMENT_EVENT, $event)"
39
+ />
40
+ <p
41
+ v-if="numberOfLikes"
42
+ data-testid="like-count"
43
+ >
44
+ {{ numberOfLikes }}
45
+ </p>
46
+ </div>
39
47
  <kv-comments-reply-button
40
48
  @click="replyClick"
41
49
  />
@@ -178,6 +186,8 @@ export default {
178
186
 
179
187
  const hideInput = () => { showInput.value = false; };
180
188
 
189
+ const numberOfLikes = computed(() => comment?.value?.children_counts?.like ?? 0);
190
+
181
191
  return {
182
192
  hideInput,
183
193
  showInput,
@@ -192,6 +202,7 @@ export default {
192
202
  authorName,
193
203
  childComments,
194
204
  isLiked,
205
+ numberOfLikes,
195
206
  };
196
207
  },
197
208
  };
@@ -32,7 +32,7 @@
32
32
  :icon="mapMarkerIcon"
33
33
  />
34
34
  <div>
35
- {{ borrowerName }}, {{ country }}
35
+ {{ borrowerName }}
36
36
  </div>
37
37
  </div>
38
38
  </div>
@@ -83,10 +83,6 @@ export default {
83
83
  type: String,
84
84
  default: '',
85
85
  },
86
- country: {
87
- type: String,
88
- default: '',
89
- },
90
86
  category: {
91
87
  type: String,
92
88
  default: '',
@@ -26,7 +26,6 @@ const Template = (args) => ({
26
26
  export const Default = Template.bind({});
27
27
  Default.args = {
28
28
  borrowerName: 'Jacqueline',
29
- country: 'Rwanda',
30
29
  category: 'Women-owned retail businesses',
31
30
  percentage: 45,
32
31
  showVoteButton: true,