Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dashboard empty content #3479

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"svg-inline-loader": "^0.8.2",
"url-loader": "^4.1.0",
"vue-loader": "^15.9.3",
"vue-server-renderer": "^2.6.12",
"vue-server-renderer": "^2.6.11",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
Expand Down
35 changes: 16 additions & 19 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
</DashboardWidgetItem>
</template>
<template v-slot:empty-content>
<div class="empty-content">
<img class="empty-content__image" :src="emptyImage">
<p class="empty-content__text">
{{ t('mail', 'No messages found yet') }}
</p>
<a v-if="accounts.length === 0" :href="accountSetupUrl" class="button">{{ t('mail', 'Set up an account') }}</a>
</div>
<EmptyContent id="mail--empty-content" icon="icon-checkmark">
<template #desc>
{{ t('mail', 'No message found yet') }}
<div class="no-account">
<a v-if="accounts.length === 0" :href="accountSetupUrl" class="button">{{ t('mail', 'Set up an account') }}</a>
</div>
</template>
</EmptyContent>
</template>
</DashboardWidget>
</template>
Expand All @@ -55,6 +56,7 @@ import { generateUrl, imagePath } from '@nextcloud/router'
import { DashboardWidget, DashboardWidgetItem } from '@nextcloud/vue-dashboard'
import orderBy from 'lodash/fp/orderBy'
import prop from 'lodash/fp/prop'
import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent'
import Avatar from '../components/Avatar'
import { fetchEnvelopes } from '../service/MessageService'
Expand All @@ -70,6 +72,7 @@ export default {
Avatar,
DashboardWidget,
DashboardWidgetItem,
EmptyContent,
},
data() {
return {
Expand Down Expand Up @@ -130,19 +133,13 @@ export default {
}
</script>

<style lang="scss" scoped>
.empty-content {
<style lang="scss">
#mail--empty-content {
text-align: center;
margin-top: 50px;
}
.empty-content__image {
width: 80%;
margin: auto;
margin-bottom: 10px;
margin-top: 5vh;
}
.empty-content__text {
color: var(--color-text-maxcontrast);
text-align: center;
margin-bottom: 10px;
.no-account {
margin-top: 5vh;
margin-right: 5px;
}
</style>