Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629833
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
new file mode 100644
index 0000000000..ea26d95877
--- /dev/null
+++ b/src/components/conversation/conversation.js
@@ -0,0 +1,48 @@
+import { find, filter, sortBy, toInteger } from 'lodash'
+import Status from '../status/status.vue'
+import apiService from '../../services/api/api.service.js'
+
+const conversation = {
+ computed: {
+ status () {
+ const id = toInteger(this.$route.params.id)
+ const statuses = this.$store.state.statuses.allStatuses
+ const status = find(statuses, {id})
+
+ return status
+ },
+ conversation () {
+ if (!this.status) {
+ return false
+ }
+
+ const conversationId = this.status.statusnet_conversation_id
+ const statuses = this.$store.state.statuses.allStatuses
+ const conversation = filter(statuses, { statusnet_conversation_id: conversationId })
+ return sortBy(conversation, 'id')
+ }
+ },
+ components: {
+ Status
+ },
+ created () {
+ this.fetchConversation()
+ },
+ methods: {
+ fetchConversation () {
+ if (this.status) {
+ const conversationId = this.status.statusnet_conversation_id
+ apiService.fetchConversation({id: conversationId})
+ .then((statuses) => this.$store.dispatch('addNewStatuses', { statuses }))
+ .then(() => this.$store.commit('updateTimestamps'))
+ } else {
+ const id = this.$route.params.id
+ apiService.fetchStatus({id})
+ .then((status) => this.$store.dispatch('addNewStatuses', { statuses: [status] }))
+ .then(() => this.fetchConversation())
+ }
+ }
+ }
+}
+
+export default conversation
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
new file mode 100644
index 0000000000..60b3f0440f
--- /dev/null
+++ b/src/components/conversation/conversation.vue
@@ -0,0 +1,12 @@
+<template>
+ <div class="timeline panel panel-default">
+ <div class="panel-heading">Status</div>
+ <div class="panel-body">
+ <div class="timeline">
+ <status v-for="status in conversation" :key="status.id" v-bind:statusoid="status"></status>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script src="./conversation.js"></script>
diff --git a/src/main.js b/src/main.js
index de3b2af1cb..64d331f1f8 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,41 +1,43 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import App from './App.vue'
import PublicTimeline from './components/public_timeline/public_timeline.vue'
import PublicAndExternalTimeline from './components/public_and_external_timeline/public_and_external_timeline.vue'
import FriendsTimeline from './components/friends_timeline/friends_timeline.vue'
+import Conversation from './components/conversation/conversation.vue'
import statusesModule from './modules/statuses.js'
import usersModule from './modules/users.js'
Vue.use(Vuex)
Vue.use(VueRouter)
const store = new Vuex.Store({
modules: {
statuses: statusesModule,
users: usersModule
}
})
const routes = [
{ path: '/', redirect: '/main/all' },
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
- { path: '/main/friends', component: FriendsTimeline }
+ { path: '/main/friends', component: FriendsTimeline },
+ { name: 'conversation', path: '/notice/:id', component: Conversation }
]
const router = new VueRouter({
mode: 'history',
routes
})
/* eslint-disable no-new */
new Vue({
router,
store,
el: '#app',
template: '<App/>',
components: { App }
})
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 9, 6:13 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1724276
Default Alt Text
(3 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment