Trying to create a new timeline for showing a single post's context (replies and partens)

using Maxence's new endpoints (eg: 'apps/social/local/v1/post/replies?id=').

It doesn't work yet though.

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
feature/noid/sql-rewrite-0929
Cyrille Bollu 2019-09-12 17:30:01 +02:00 zatwierdzone przez Maxence Lange
rodzic 686f193c99
commit de841d1826
3 zmienionych plików z 10 dodań i 17 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
<template>
<div class="timeline-entry" @click="showModal">
<div class="timeline-entry" @click.prevent="getSinglePostTimeline">
<div v-if="item.type === 'SocialAppNotification'">
{{ actionSummary }}
</div>
@ -26,20 +26,15 @@
v-else
:item="entryContent"
:parent-announce="isBoost" />
<modal v-if="modal" size="full" @close="closeModal">
<div class="modal_content">Hello world!</div>
</modal>
</div>
</template>
<script>
import Modal from 'nextcloud-vue/dist/Components/Modal'
import TimelinePost from './TimelinePost.vue'
export default {
name: 'TimelineEntry',
components: {
Modal,
TimelinePost
},
props: {
@ -47,7 +42,6 @@ export default {
},
data() {
return {
modal: false
}
},
computed: {
@ -67,6 +61,9 @@ export default {
boosted() {
return t('social', 'boosted')
},
getSinglePostTimeline() {
this.$store.dispatch('changeTimelineType', { type: 'post', params: {id: this.item.id} })
},
actionSummary() {
let summary = this.item.summary
@ -100,16 +97,6 @@ export default {
}
},
methods: {
showModal(event) {
// Do not show the timeline entry's modal if we click on a link, an attachment's miniature, or the post's author name
if (event.target.tagName === 'A' || event.target.tagName === 'IMG' || event.target.className.indexOf('post-author') !== -1) {
return
}
this.modal = true
},
closeModal() {
this.modal = false
},
userDisplayName(actorInfo) {
return actorInfo.name !== '' ? actorInfo.name : actorInfo.preferredUsername
}

Wyświetl plik

@ -54,6 +54,10 @@ export default new Router({
{
path: 'tags/:tag',
name: 'tags'
},
{
path: 'post',
name: 'post'
}
]
},

Wyświetl plik

@ -189,6 +189,8 @@ const actions = {
url = OC.generateUrl(`apps/social/api/v1/account/${state.account}/stream?limit=25&since=` + sinceTimestamp)
} else if (state.type === 'tags') {
url = OC.generateUrl(`apps/social/api/v1/stream/tag/${state.params.tag}?limit=25&since=` + sinceTimestamp)
} else if (state.type === 'post') {
url = OC.generateUrl(`apps/social/local/v1/post/replies?id=${state.params.id}&limit=5&since=0`)
} else {
url = OC.generateUrl(`apps/social/api/v1/stream/${state.type}?limit=25&since=` + sinceTimestamp)
}