Skip to content

Commit 1b52591

Browse files
st3inybackportbot-nextcloud[bot]
authored andcommitted
Fix empty content regressions in comments app
Signed-off-by: Richard Steinmetz <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent 62e5313 commit 1b52591

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

apps/comments/src/views/Comments.vue

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- @copyright Copyright (c) 2020 John Molakvoæ <[email protected]>
33
-
44
- @author John Molakvoæ <[email protected]>
5+
- @author Richard Steinmetz <[email protected]>
56
-
67
- @license GNU AGPL version 3 or any later version
78
-
@@ -31,8 +32,12 @@
3132
@new="onNewComment" />
3233

3334
<template v-if="!isFirstLoading">
34-
<NcEmptyContent v-if="!hasComments && done" icon="icon-comment">
35-
{{ t('comments', 'No comments yet, start the conversation!') }}
35+
<NcEmptyContent v-if="!hasComments && done"
36+
class="comments__empty"
37+
:title="t('comments', 'No comments yet, start the conversation!')">
38+
<template #icon>
39+
<MessageReplyTextIcon />
40+
</template>
3641
</NcEmptyContent>
3742

3843
<!-- Comments -->
@@ -55,14 +60,19 @@
5560
</div>
5661

5762
<!-- Error message -->
58-
<NcEmptyContent v-else-if="error" class="comments__error" icon="icon-error">
59-
{{ error }}
60-
<template #desc>
61-
<button icon="icon-history" @click="getComments">
62-
{{ t('comments', 'Retry') }}
63-
</button>
64-
</template>
65-
</NcEmptyContent>
63+
<template v-else-if="error">
64+
<NcEmptyContent class="comments__error" :title="error">
65+
<template #icon>
66+
<AlertCircleOutlineIcon />
67+
</template>
68+
</NcEmptyContent>
69+
<NcButton class="comments__retry" @click="getComments">
70+
<template #icon>
71+
<RefreshIcon />
72+
</template>
73+
{{ t('comments', 'Retry') }}
74+
</NcButton>
75+
</template>
6676
</template>
6777
</div>
6878
</template>
@@ -76,6 +86,10 @@ import VTooltip from 'v-tooltip'
7686
import Vue from 'vue'
7787
7888
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent'
89+
import NcButton from '@nextcloud/vue/dist/Components/NcButton'
90+
import RefreshIcon from 'vue-material-design-icons/Refresh'
91+
import MessageReplyTextIcon from 'vue-material-design-icons/MessageReplyText'
92+
import AlertCircleOutlineIcon from 'vue-material-design-icons/AlertCircleOutline'
7993
8094
import Comment from '../components/Comment'
8195
import getComments, { DEFAULT_LIMIT } from '../services/GetComments'
@@ -90,6 +104,10 @@ export default {
90104
// Avatar,
91105
Comment,
92106
NcEmptyContent,
107+
NcButton,
108+
RefreshIcon,
109+
MessageReplyTextIcon,
110+
AlertCircleOutlineIcon,
93111
},
94112
95113
data() {
@@ -276,8 +294,13 @@ export default {
276294
<style lang="scss" scoped>
277295
.comments {
278296
// Do not add emptycontent top margin
279-
&__error{
280-
margin-top: 0;
297+
&__empty,
298+
&__error {
299+
margin-top: 0 !important;
300+
}
301+
302+
&__retry {
303+
margin: 0 auto;
281304
}
282305
283306
&__info {

0 commit comments

Comments
 (0)