From 8b15bc76e60ef484330e6753752d673c05a7d0a4 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 5 Sep 2018 10:19:02 +0200 Subject: [PATCH] Add server data to room entries --- client/src/components/UserWidget.vue | 4 ++-- client/src/components/rooms/RoomEntry.vue | 19 ++++++++++++++++++- client/src/pages/room.vue | 7 ++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/client/src/components/UserWidget.vue b/client/src/components/UserWidget.vue index 20a35268..82b4f3c9 100644 --- a/client/src/components/UserWidget.vue +++ b/client/src/components/UserWidget.vue @@ -2,14 +2,14 @@
- {{name}} + {{firstName}} {{lastName}} {{date}}
diff --git a/client/src/components/rooms/RoomEntry.vue b/client/src/components/rooms/RoomEntry.vue index f95e846b..a440156f 100644 --- a/client/src/components/rooms/RoomEntry.vue +++ b/client/src/components/rooms/RoomEntry.vue @@ -17,11 +17,28 @@ import UserWidget from '@/components/UserWidget.vue'; export default { - props: ['title', 'teaser', 'image', 'author'], + props: ['title', 'author', 'contents'], components: { UserWidget + }, + + computed: { + image() { + if (this.contents) { + let found = this.contents.find(c => c.type === 'image_url'); + return found ? found.value.url : ''; + } + return ''; + }, + teaser() { + // if (this.contents && this.contents.length) { + // if (this.contents[0].type === 'link') + // } + return ''; + } } + } diff --git a/client/src/pages/room.vue b/client/src/pages/room.vue index ef556617..a940adab 100644 --- a/client/src/pages/room.vue +++ b/client/src/pages/room.vue @@ -12,7 +12,7 @@
- +
@@ -42,7 +42,6 @@ created() { this.$store.dispatch('hideFilter'); - // this.$store.dispatch('setSpecialContainerClass', 'red'); }, data() { @@ -139,9 +138,7 @@ manual: true, result({data, loading, networkStatus}) { if (!loading) { - this.room = this.$getRidOfEdges(data).room - this.roomAppearance = this.room.appearance - this.roomEntries = this.room.roomEntries + this.room = Object.assign({}, this.$getRidOfEdges(data).room); } } }