From 5ec4f1b047d798b7038ec73db86476e70d2b1888 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 4 Feb 2017 13:52:26 +0100 Subject: [PATCH] Extract conversation and create conversation page. --- .../conversation-page/conversation-page.js | 19 +++++++++++++++++++ .../conversation-page/conversation-page.vue | 5 +++++ src/components/conversation/conversation.js | 14 ++++++-------- src/components/conversation/conversation.vue | 9 +++++++-- src/main.js | 4 ++-- 5 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 src/components/conversation-page/conversation-page.js create mode 100644 src/components/conversation-page/conversation-page.vue diff --git a/src/components/conversation-page/conversation-page.js b/src/components/conversation-page/conversation-page.js new file mode 100644 index 00000000..beffa5bb --- /dev/null +++ b/src/components/conversation-page/conversation-page.js @@ -0,0 +1,19 @@ +import Conversation from '../conversation/conversation.vue' +import { find, toInteger } from 'lodash' + +const conversationPage = { + components: { + Conversation + }, + computed: { + statusoid () { + const id = toInteger(this.$route.params.id) + const statuses = this.$store.state.statuses.allStatuses + const status = find(statuses, {id}) + + return status + } + } +} + +export default conversationPage diff --git a/src/components/conversation-page/conversation-page.vue b/src/components/conversation-page/conversation-page.vue new file mode 100644 index 00000000..b03eea28 --- /dev/null +++ b/src/components/conversation-page/conversation-page.vue @@ -0,0 +1,5 @@ + + + diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 5d4f5d04..ecc76e71 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { find, filter, sortBy, toInteger } from 'lodash' +import { filter, sortBy } from 'lodash' import { statusType } from '../../modules/statuses.js' import Status from '../status/status.vue' @@ -8,14 +8,12 @@ const sortAndFilterConversation = (conversation) => { } const conversation = { + props: [ + 'statusoid', + 'collapsable' + ], computed: { - status () { - const id = toInteger(this.$route.params.id) - const statuses = this.$store.state.statuses.allStatuses - const status = find(statuses, {id}) - - return status - }, + status () { return this.statusoid }, conversation () { if (!this.status) { return false diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 00d3e062..9675e69f 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -1,9 +1,14 @@