Skip to content
Snippets Groups Projects
Commit a8352e54 authored by Adam Procter's avatar Adam Procter
Browse files

added more pouchdb code

parent ba3bfedb
No related branches found
No related tags found
No related merge requests found
...@@ -42,10 +42,10 @@ import { getPalette } from '@/experimental/constants/color' ...@@ -42,10 +42,10 @@ import { getPalette } from '@/experimental/constants/color'
// import { generateConnectionHandles } from '@/utils/nodes' // import { generateConnectionHandles } from '@/utils/nodes'
// import { generateBezierCurve, makeBezier } from '@/utils/svg' // import { generateBezierCurve, makeBezier } from '@/utils/svg'
//import { generateConnectionHandles } from '@/utils/nodes' //import { generateConnectionHandles } from '@/utils/nodes'
import { generateBezierCurve } from '@/experimental/utils/svg' import { generateBezierCurve } from '@/experimental/utils/svg'
import { groupBy } from '@/experimental/utils/helpers' import { groupBy } from '@/experimental/utils/helpers'
import { mapState } from 'vuex'
const groupByFrom = groupBy('from') const groupByFrom = groupBy('from')
...@@ -102,6 +102,10 @@ export default { ...@@ -102,6 +102,10 @@ export default {
} }
}) })
}, },
...mapState({
connections: (state) => state.configConnections,
}),
}, },
methods: { methods: {
getCurve(connection) { getCurve(connection) {
...@@ -119,6 +123,19 @@ export default { ...@@ -119,6 +123,19 @@ export default {
findNode(id) { findNode(id) {
return [...this.nodes].find((pt) => pt.id === id) return [...this.nodes].find((pt) => pt.id === id)
}, },
// startConnect(connectid, fromNode, toNode, startx, starty, endx, endy, connected) {
// this.$store.dispatch('startConnect', {
// connectid,
// fromNode,
// toNode,
// startx,
// starty,
// endx,
// endy,
// connected,
// })
// },
}, },
} }
</script> </script>
......
...@@ -237,8 +237,8 @@ const store = new Vuex.Store({ ...@@ -237,8 +237,8 @@ const store = new Vuex.Store({
state.configConnections.push({ state.configConnections.push({
connectid: connectid, connectid: connectid,
startid: e.e, startid: e.fromNode,
endid: e.f, endid: e.toNode,
startx: e.startx, startx: e.startx,
starty: e.starty, starty: e.starty,
endx: e.endx, endx: e.endx,
...@@ -591,12 +591,12 @@ const store = new Vuex.Store({ ...@@ -591,12 +591,12 @@ const store = new Vuex.Store({
startConnect: ( startConnect: (
{ commit }, { commit },
{ connectid, e, f, startx, starty, endx, endy, connected } { connectid, fromNode, toNode, startx, starty, endx, endy, connected }
) => { ) => {
commit('MAKE_CONNECT', { commit('MAKE_CONNECT', {
connectid, connectid,
e, fromNode,
f, toNode,
startx, startx,
starty, starty,
endx, endx,
......
...@@ -65,6 +65,7 @@ export default { ...@@ -65,6 +65,7 @@ export default {
myNodes: (state) => state.myNodes, myNodes: (state) => state.myNodes,
otherNodes: (state) => state.otherNodes, otherNodes: (state) => state.otherNodes,
shortcutstate: (state) => state.shortcutstate, shortcutstate: (state) => state.shortcutstate,
connections: (state) => state.configConnections,
}), }),
...mapGetters({ ...mapGetters({
activeMode: 'ui/activeMode', activeMode: 'ui/activeMode',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment