summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-07-04 10:53:56 -0100
committerGitHub <noreply@github.com>2019-07-04 10:53:56 -0100
commit5ec02bf5f27ea9e334e56c2842933a656bc009cf (patch)
tree00e75d9bfd32576e69b4a0dcf8d7a9776fdbc819 /src
parentca2fda3e5c62aa7ad7e4e4961cc7e92ec5e648c1 (diff)
parent106e70f39db2b2f92f0a45049811fe15fb0b3701 (diff)
Merge pull request #531 from nextcloud/feature/noid/notifications
new notification timeline
Diffstat (limited to 'src')
-rw-r--r--src/App.vue10
-rw-r--r--src/components/TimelineEntry.vue28
-rw-r--r--src/components/TimelineList.vue7
-rw-r--r--src/components/TimelinePost.vue (renamed from src/components/TimelineContent.vue)2
-rw-r--r--src/views/Timeline.vue4
5 files changed, 34 insertions, 17 deletions
diff --git a/src/App.vue b/src/App.vue
index c5633cf6..f70a58e6 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -136,6 +136,16 @@ export default {
icon: 'icon-comment',
text: t('social', 'Direct messages')
},
+ // {
+ // id: 'social-notifications',
+ // classes: [],
+ // router: {
+ // name: 'timeline',
+ // params: { type: 'notifications' }
+ // },
+ // icon: 'icon-comment',
+ // text: t('social', 'Notifications')
+ // },
{
id: 'social-account',
classes: [],
diff --git a/src/components/TimelineEntry.vue b/src/components/TimelineEntry.vue
index a88147a3..3257c656 100644
--- a/src/components/TimelineEntry.vue
+++ b/src/components/TimelineEntry.vue
@@ -1,5 +1,8 @@
<template>
- <div v-if="noDuplicateBoost" class="timeline-entry">
+ <div class="timeline-entry">
+ <div v-if="item.type === 'SocialAppNotification'">
+ {{ actionSummary }}
+ </div>
<div v-if="item.type === 'Announce'" class="boost">
<div class="container-icon-boost">
<span class="icon-boost" />
@@ -16,17 +19,20 @@
</a>
{{ boosted }}
</div>
- <timeline-content :item="entryContent" :parent-announce="isBoost" />
+ <timeline-post v-if="(item.type === 'Note' || item.type === 'Announce')" :item="entryContent" :parent-announce="isBoost" />
+ <user-entry v-if="item.type === 'SocialAppNotificationUser'" :key="user.id" :item="user" />
</div>
</template>
<script>
-import TimelineContent from './TimelineContent.vue'
+import TimelinePost from './TimelinePost'
+import UserEntry from './UserEntry'
export default {
name: 'TimelineEntry',
components: {
- TimelineContent
+ TimelinePost,
+ UserEntry
},
props: {
item: { type: Object, default: () => {} }
@@ -52,15 +58,13 @@ export default {
boosted() {
return t('social', 'boosted')
},
- noDuplicateBoost() {
- if (this.item.type === 'Announce') {
- for (var e in this.$store.state.timeline.timeline) {
- if (this.item.cache[this.item.object].object.id === e) {
- return false
- }
- }
+ actionSummary() {
+ let summary = this.item.summary
+ for (var key in this.item.details) {
+ let keyword = '{' + key + '}'
+ summary = summary.replace(keyword, JSON.stringify(this.item.details[key]))
}
- return true
+ return summary
}
},
methods: {
diff --git a/src/components/TimelineList.vue b/src/components/TimelineList.vue
index 9d405b16..b4c39e75 100644
--- a/src/components/TimelineList.vue
+++ b/src/components/TimelineList.vue
@@ -57,9 +57,9 @@
<script>
import InfiniteLoading from 'vue-infinite-loading'
-import TimelineEntry from './../components/TimelineEntry'
+import TimelineEntry from './TimelineEntry'
import CurrentUserMixin from './../mixins/currentUserMixin'
-import EmptyContent from './../components/EmptyContent'
+import EmptyContent from './EmptyContent'
export default {
name: 'Timeline',
@@ -69,6 +69,9 @@ export default {
EmptyContent
},
mixins: [CurrentUserMixin],
+ props: {
+ type: { type: String, default: () => 'home' }
+ },
data: function() {
return {
infoHidden: false,
diff --git a/src/components/TimelineContent.vue b/src/components/TimelinePost.vue
index a1796f0c..a3f4d753 100644
--- a/src/components/TimelineContent.vue
+++ b/src/components/TimelinePost.vue
@@ -58,7 +58,7 @@ pluginTag(linkify)
pluginMention(linkify)
export default {
- name: 'TimelineContent',
+ name: 'TimelinePost',
components: {
Avatar
},
diff --git a/src/views/Timeline.vue b/src/views/Timeline.vue
index 390b0adc..cf66c077 100644
--- a/src/views/Timeline.vue
+++ b/src/views/Timeline.vue
@@ -21,11 +21,11 @@
</div>
</div>
</transition>
- <composer />
+ <composer v-if="type !== 'notifications'" />
<h2 v-if="type === 'tags'">
#{{ this.$route.params.tag }}
</h2>
- <timeline-list />
+ <timeline-list :type="type" />
</div>
</template>