From 4665a054089cc3886815a055181be1ef168fe92f Mon Sep 17 00:00:00 2001 From: Adam Procter <adamprocter@researchnot.es> Date: Fri, 10 Apr 2020 17:10:35 +0100 Subject: [PATCH] added other list view currently doesnt hide nodes (spatial view) also not sure I am doing the loops in the best way possible as I am treating this component maybe too much like the richer nodes --- app/src/components/ListLayer.vue | 3 +-- app/src/components/OtherListlayer.vue | 39 +++++++++++++++++++++++++++ app/src/views/Home.vue | 9 +++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 app/src/components/OtherListlayer.vue diff --git a/app/src/components/ListLayer.vue b/app/src/components/ListLayer.vue index 7b6509a..8dc4ef4 100644 --- a/app/src/components/ListLayer.vue +++ b/app/src/components/ListLayer.vue @@ -22,8 +22,7 @@ export default { }, computed: mapState({ - myNodes: state => state.myNodes, - otherNodes: state => state.otherNodes + myNodes: state => state.myNodes }), filters: { diff --git a/app/src/components/OtherListlayer.vue b/app/src/components/OtherListlayer.vue new file mode 100644 index 0000000..76e2f3d --- /dev/null +++ b/app/src/components/OtherListlayer.vue @@ -0,0 +1,39 @@ +<template> + <div class="otherlist"> + <ul v-for="value in otherNodes" v-bind:key="value.node_id"> + <li + class="dataeach" + v-if="nodeid == value.node_id" + :inner-html.prop="value.node_text | marked" + >{{ nodeid }}</li> + </ul> + </div> +</template> + +<script> +import { mapState } from 'vuex' +import marked from 'marked' + +export default { + name: 'OtherListlayer', + props: { + nodeid: String, + nodetext: String + }, + + computed: mapState({ + otherNodes: state => state.otherNodes + }), + + filters: { + // need to write a reverse data filter I suspect here so new data is at the top of list + marked: marked + } +} +</script> + +<style lang="css" scoped> +li { + margin-bottom: -15px; +} +</style> \ No newline at end of file diff --git a/app/src/views/Home.vue b/app/src/views/Home.vue index 2578261..c7c7a6c 100644 --- a/app/src/views/Home.vue +++ b/app/src/views/Home.vue @@ -22,6 +22,13 @@ v-bind:nodeid="value.node_id" v-bind:nodetext="value.node_text" /> + + <OtherListlayer + v-for="value in otherNodes" + v-bind:key="value.node_id" + v-bind:nodeid="value.node_id" + v-bind:nodetext="value.node_text" + /> </div> <ControlsLayer @listView="listView()" /> </div> @@ -35,6 +42,7 @@ import OnBoard from '@/components/OnBoard.vue' import NodesLayer from '@/components/NodesLayer.vue' import OtherNodeslayer from '@/components/OtherNodeslayer.vue' import ListLayer from '@/components/ListLayer.vue' +import OtherListlayer from '@/components/OtherListlayer.vue' import ControlsLayer from '@/components/ControlsLayer.vue' import { mapState } from 'vuex' @@ -75,6 +83,7 @@ export default { NodesLayer, OtherNodeslayer, ListLayer, + OtherListlayer, ControlsLayer }, computed: mapState({ -- GitLab