@kiva/kv-components 3.56.1 → 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,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.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
|
+
|
|
6
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)
|
|
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.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": "
|
|
78
|
+
"gitHead": "6241a3deffa7ef7e581a09a1c371240884e5f269"
|
|
79
79
|
}
|
|
@@ -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,
|
package/vue/KvCommentsList.vue
CHANGED
|
@@ -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
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
};
|