Commit 65b13777 authored by Adam Procter's avatar Adam Procter

start to tidy up store stuff

parent 299a52c0
Pipeline #195 failed with stages
in 1 minute and 25 seconds
This diff is collapsed.
......@@ -4,7 +4,7 @@
<nav>
<ul>
<li> <router-link to="/selectscreen" v-if="isLoggedIn" @click.native="logout()">Sign Out</router-link></li>
<li> <router-link to="/home">Home</router-link></li>
<li> <router-link to="/home" v-if="isLoggedIn" >Home</router-link></li>
<li> <router-link to="/about">About</router-link></li>
</ul>
......@@ -15,24 +15,21 @@
<script>
// helper to access data from vuex
import { mapActions, mapGetters } from 'vuex'
export default {
name: 'welcome',
methods: {
logout() {
this.$store.dispatch('logout');
},
...mapActions(["logout"])
},
}
},
computed: {
isLoggedIn() {
return this.$store.getters.isLoggedIn;
},
...mapGetters(["isLoggedIn"])
}
}
}
}
......
......@@ -22,8 +22,8 @@ export default {
components: {
styledviewer: styledviewer
},
data:{
},
// data:{
// },
methods: {
...mapGetters([
'allObjects'
......@@ -67,6 +67,7 @@ export default {
knowledgeObj.rect(60, 40).attr({
fill: colours[Math.floor(Math.random() * colours.length)]
//.svg('<g id="doc" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect id="Rectangle-2" fill="#000000" x="3" y="0" width="115" height="171"></rect><rect id="Rectangle" stroke="#FFFFFF" stroke-width="7" x="3.5" y="3.5" width="113" height="164"></rect><path d="M23.5,40.5 L95,40.5" id="Line-3" stroke="#979797" stroke-width="4" stroke-linecap="square"></path><path d="M24.5,54.25 L96,54.25" id="Line-3-Copy" stroke="#979797" stroke-width="4" stroke-linecap="square"></path><path d="M24.5,69.25 L96,69.25" id="Line-3-Copy-2" stroke="#979797" stroke-width="4" stroke-linecap="square"></path><path d="M24.5,86.25 L70,86.25" id="Line-3-Copy-3" stroke="#979797" stroke-width="4" stroke-linecap="square"></path></g>')
})
} else if (element.type == "slidedeck"){
knowledgeObj.circle(30, 30).attr({
......@@ -75,10 +76,10 @@ export default {
}
var type = knowledgeObj.text(element.type)
var owner = knowledgeObj.text(element.owner)
var title = knowledgeObj.text(element.title)
console.log(knowledgeObj)
owner.move(0,40)
//console.log(knowledgeObj)
title.move(0,40)
// rect_1.connectable({
// container: links,
......
......@@ -59,9 +59,9 @@ export default new Vuex.Store({
// console.log("OPEN DB ERROR", error);
// });
// },
// addKnowledgeObject({ commit }, payload) {
// commit('ADD_KNOWLEDGE_OBJECT', payload)
// },
addKnowledgeObject({ commit }, payload) {
commit('ADD_KNOWLEDGE_OBJECT', payload)
},
login({ commit }, payload) {
commit(LOGIN, payload);
......
......@@ -11,7 +11,7 @@
<option value="plaintxt">Plain Text</option>
</select>
<input v-model="owner" placeholder="Owner" />
<input v-model="title" placeholder="Title" />
<textarea v-model="metadata.mdtxt" type="text" placeholder="Enter text here" rows="10"></textarea>
<button type="submit"><font-awesome-icon icon="save" size="2x"/></button>
......@@ -39,11 +39,10 @@ name: 'editor',
return {
type:'',
author:'',
owner:'',
title:'',
connections:[],
metadata:{},
xpos:0,
ypos:0
}
},
......@@ -59,11 +58,11 @@ name: 'editor',
_id:uniqueid,
type:this.type,
author:localStorage.getItem("token"),
owner:this.owner,
// need to change owner in DB
title:this.title,
connections:this.connections,
metadata:this.metadata,
xpos:this.xpos,
ypos:this.ypos
})
this.syncData()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment