diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-09-14 15:39:47 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-09-14 16:10:36 +0200 |
commit | c683f9135a3c98b446563856ece89f8b422ecc51 (patch) | |
tree | afefe3f49542d4afe39a2d7c6afb67178f4af7f9 /src | |
parent | b009d25e13ded79514de5818f2fb3496323ce08e (diff) |
Port to new Dashboard api
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'src')
-rw-r--r-- | src/dashboard.js | 8 | ||||
-rw-r--r-- | src/views/Dashboard.vue | 22 |
2 files changed, 19 insertions, 11 deletions
diff --git a/src/dashboard.js b/src/dashboard.js index 8c2720ef..d58ad980 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -14,18 +14,20 @@ import Vue from 'vue' import Dashboard from './views/Dashboard.vue' +// eslint-disable-next-line +__webpack_nonce__ = btoa(OC.requestToken); +// eslint-disable-next-line +__webpack_public_path__ = OC.linkTo('social', 'js/'); + Vue.prototype.t = t Vue.prototype.n = n Vue.prototype.OC = window.OC -Vue.prototype.OCA = window.OCA document.addEventListener('DOMContentLoaded', function() { - OCA.Dashboard.register('social_notifications', (el, { widget }) => { const View = Vue.extend(Dashboard) new View({ propsData: { title: widget.title } }).$mount(el) }) - }) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index ead86748..25a56c59 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -1,10 +1,10 @@ <template> - <DashboardWidget :items="items" + <NcDashboardWidget :items="items" :show-more-url="showMoreUrl" :show-more-text="title" :loading="state === 'loading'"> <template #empty-content> - <EmptyContent + <NcEmptyContent v-if="emptyContentMessage" :icon="emptyContentIcon"> <template #desc> @@ -15,24 +15,24 @@ </a> </div> </template> - </EmptyContent> + </NcEmptyContent> </template> - </DashboardWidget> + </NcDashboardWidget> </template> <script> import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' import { showError } from '@nextcloud/dialogs' -import { DashboardWidget } from '@nextcloud/vue-dashboard' -import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent' +import NcDashboardWidget from '@nextcloud/vue/dist/Components/NcDashboardWidget.js' +import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' export default { name: 'Dashboard', components: { - DashboardWidget, - EmptyContent + NcDashboardWidget, + NcEmptyContent }, props: { @@ -152,6 +152,9 @@ export default { if (n.subtype === 'Follow') { return t('social', '{account} is following you', { account: this.getActorName(n) }) } + if (n.subtype === 'Like') { + return t('social', '{account} liked your post', { account: this.getActorName(n) }) + } }, getAvatarUrl(n) { return undefined @@ -180,6 +183,9 @@ export default { if (n.subtype === 'Follow') { return this.getActorAccountName(n) } + if (n.subtype === 'Like') { + return this.getActorAccountName(n) + } return '' }, getNotificationTypeImage(n) { |