diff --git a/CHANGELOG.md b/CHANGELOG.md index f69e641ed626f5f88c98a6bd16931951fa74c0a7..ef071c4cde349dbd154a09e48cb51d239d4bd3b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +# 0.1.45 + +_17th December 2020_ + +### Changed + +- Card view can now be sorted however this is not saved yet. + +### Fixed + +- You can now colour nodes in Collect and Card views +- initial node creation failed on new microcosm without switching views + # 0.1.44 _14th December 2020_ @@ -16,7 +29,7 @@ _14th December 2020_ _12th December 2020_ -## Fixed +### Fixed - Partial fix so that nodes will resize to fit content (after dragging into position) diff --git a/app/package.json b/app/package.json index 987a96f6dbdb95c325e9f5e81197b62e498f263f..1ecf70d6a706a681d8dd51a888d1f07dddd0721e 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "nodenogg.in", - "version": "0.1.44", + "version": "0.1.45", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/app/src/components/CardsLayer.vue b/app/src/components/CardsLayer.vue index c6602c2254b792af7994f3428e427cd5c4b43709..c228e75b9e4092259658f2889de0787ae09bd37c 100644 --- a/app/src/components/CardsLayer.vue +++ b/app/src/components/CardsLayer.vue @@ -8,67 +8,70 @@ @end="drag = false" @update="nodePositionIndex" > - <div v-for="(nodes, index) in $options.myArray" v-bind:key="index"> - <form - class="nodes cell" - :style="{ - backgroundColor: nodes.color, - }" - > - <template v-if="nodes.read_mode == false"> - <textarea - @focus="editTrue(true)" - @blur="editTrue(false)" - autofocus - v-model="nodes.node_text" - @input="editNode" - :id="nodes.node_id" - ref="nodetext" - placeholder="Type your thoughts and ideas here! (auto saved every keystroke)" - ></textarea> - </template> - <template v-else> - <p - :id="nodes.node_id" - :inner-html.prop="nodes.node_text | marked" - ></p> - </template> - <div class="btn-row"> - <SvgButton - buttonClass="nodes" - @click.prevent="deleteFlag(nodes.node_id), updateNodes()" - /> - <SvgButton2 - buttonClass="nodes" - @click.prevent=" - readFlag(nodes.node_id, nodes.read_mode), updateNodes() - " - /> - <v-swatches - v-model="color" - @input="chooseColor(color, nodes.node_id)" - :swatches="swatches" - :shapes="shapes" - show-border - show-fallback - fallback-input-type="color" - > - <SvgButton3 buttonClass="nodes" @click.prevent slot="trigger" /> - </v-swatches> - </div> + <div v-for="(value, index) in configPositions" v-bind:key="index"> + <div v-for="(nodes, index) in $options.myArray" v-bind:key="index"> + <form + class="nodes cell" + :style="{ + backgroundColor: nodes.color, + }" + v-if="nodes.node_id == value.node_id" + > + <template v-if="nodes.read_mode == false"> + <textarea + @focus="editTrue(true)" + @blur="editTrue(false)" + autofocus + v-model="nodes.node_text" + @input="editNode" + :id="nodes.node_id" + ref="nodetext" + placeholder="Type your thoughts and ideas here! (auto saved every keystroke)" + ></textarea> + </template> + <template v-else> + <p + :id="nodes.node_id" + :inner-html.prop="nodes.node_text | marked" + ></p> + </template> + <div class="btn-row"> + <SvgButton + buttonClass="nodes" + @click.prevent="deleteFlag(nodes.node_id), updateNodes()" + /> + <SvgButton2 + buttonClass="nodes" + @click.prevent=" + readFlag(nodes.node_id, nodes.read_mode), updateNodes() + " + /> + <v-swatches + v-model="color" + @input="chooseColor(color, nodes.node_id)" + :swatches="swatches" + :shapes="shapes" + show-border + show-fallback + fallback-input-type="color" + > + <SvgButton3 buttonClass="nodes" @click.prevent slot="trigger" /> + </v-swatches> + </div> - <div class="allemoji"> - <div - class="eachemoji" - v-for="(emojis, index) in configEmoji" - :key="index" - > - <template v-if="emojis.node_id == nodes.node_id">{{ - emojis.emoji_text - }}</template> + <div class="allemoji"> + <div + class="eachemoji" + v-for="(emojis, index) in configEmoji" + :key="index" + > + <template v-if="emojis.node_id == nodes.node_id">{{ + emojis.emoji_text + }}</template> + </div> </div> - </div> - </form> + </form> + </div> </div> <div @@ -171,7 +174,7 @@ import 'vue-swatches/dist/vue-swatches.css' var readmode var nodeid -var nodesort +//var nodesort var emojitext export default { @@ -184,7 +187,6 @@ export default { return { color: '#9bc2d8', shapes: 'circles', - // swatches: [{ color: '#F493A7', showBorder: true }], swatches: [ ['#EB5757', '#F2994A', '#F2C94C'], @@ -261,24 +263,26 @@ export default { methods: { nodePositionIndex() { - var i - var j - var dragger = document.getElementById('dragger') - - for (i = 0; i < dragger.childNodes.length; i++) { - var count = i - - for (j = 0; j < Object.keys(this.configPositions).length; j++) { - if ( - dragger.childNodes[i].firstChild[0].id == - this.configPositions[j].node_id - ) { - nodeid = this.configPositions[j].node_id - nodesort = count - this.$store.dispatch('sortNode', { nodeid, nodesort }) - } - } - } + // var i + // var j + // var dragger = document.getElementById('dragger') + // // console.log(dragger.childNodes.length) + // for (i = 0; i < dragger.childNodes.length; i++) { + // var count = i + // for (j = 0; j < Object.keys(this.configPositions).length; j++) { + // if (dragger.childNodes[i].firstChild != 'undefined') { + // if ( + // dragger.childNodes[i].firstChild[0].id == + // this.configPositions[j].node_id + // ) { + // nodeid = this.configPositions[j].node_id + // nodesort = count + // this.$store.dispatch('sortNode', { nodeid, nodesort }) + // } + // } + // // console.log(nodesort) + // } + // } }, chooseColor(color, nodeid) { this.$store.dispatch('colorNode', { nodeid, color }) diff --git a/app/src/components/Navigation.vue b/app/src/components/Navigation.vue index e14f17d7b5d25f2b42fe0143f50867f313aec6ed..971eada1d98b985af98d3e2171d88290dbabf915 100644 --- a/app/src/components/Navigation.vue +++ b/app/src/components/Navigation.vue @@ -1,8 +1,10 @@ <template> <nav class="navigation"> - <router-link v-for="route in routes" :key="route.name" :to="route.path">{{ - route.name - }}</router-link> + <router-link v-for="route in routes" :key="route.name" :to="route.path"> + <div v-if="route.path != '/nitpicky'"> + {{ route.name }} + </div></router-link + > </nav> </template> diff --git a/app/src/router/index.js b/app/src/router/index.js index d715684b206d916237f104df50553d7f6757f227..069ce11e292c7e6808f833316d99681546d9d2ed 100644 --- a/app/src/router/index.js +++ b/app/src/router/index.js @@ -7,6 +7,7 @@ import Discarded from '../views/Discarded.vue' import Leave from '../views/Leave.vue' import About from '../views/About.vue' import NotFound from '../views/NotFound.vue' +import NitPicky from '../views/NitPicky.vue' //import store from '../store' // import Oldhome from '../views/Oldhome' //import Test from '../views/Test' @@ -46,6 +47,11 @@ export const routes = [ name: 'About', component: About, }, + { + path: '/nitpicky', + name: 'NitPicky', + component: NitPicky, + }, { // catches 404 errors diff --git a/app/src/store/index.js b/app/src/store/index.js index f3adf1423b82f0c8951def1e6105e5324f0a24de..e1cc91630f5d940f69a7a119bf0d32a8628ec34e 100644 --- a/app/src/store/index.js +++ b/app/src/store/index.js @@ -69,6 +69,18 @@ const store = new Vuex.Store({ configEmoji: [ //{} ], + configRemote: [ + // { + // protocol: 'https://', + // couchusername: 'something', + // couchpassword: 'passcouch', + // couchurl: 'domain.com', + // }, + //{ https://, + // couchusername + // couchpassword + // couchURL} + ], }, mutations: { CREATE_MICROCOSM(state, doc) { @@ -82,16 +94,31 @@ const store = new Vuex.Store({ } else { microcosm = doc } + pouchdb = new PouchDB(microcosm) - remote = - process.env.VUE_APP_COUCH_HTTP + - '://' + - process.env.VUE_APP_COUCH_USER + - ':' + - process.env.VUE_APP_COUCH_PASS + - process.env.VUE_APP_COUCH_URL + - microcosm + - '/' + if (state.configRemote && state.configRemote.length > 0) { + remote = + state.configRemote[0].protocol + + state.configRemote[0].couchusername + + ':' + + state.configRemote[0].couchpassword + + '@' + + state.configRemote[0].couchurl + + '/' + + microcosm + + '/' + } else { + remote = + process.env.VUE_APP_COUCH_HTTP + + '://' + + process.env.VUE_APP_COUCH_USER + + ':' + + process.env.VUE_APP_COUCH_PASS + + process.env.VUE_APP_COUCH_URL + + microcosm + + '/' + } + store.dispatch('syncDB') }) }, @@ -387,14 +414,21 @@ const store = new Vuex.Store({ state.shortcutstate = e }, - // CONNECTION_STATE(state, e) { - // state.connectionstate = e - // }, + UPDATE_REMOTE(state, e) { + state.configRemote = [ + { + protocol: e.protocol, + couchusername: e.couchusername, + couchpassword: e.couchpassword, + couchurl: e.couchurl, + }, + ] + }, ADD_NODE(state) { var i + var zindex var totalNodes = [] - const reducer = (accumulator, currentValue) => accumulator + currentValue for (i = 0; i < Object.keys(state.allNodes).length; i++) { if ( state.allNodes[i].id != state.global_pos_name && @@ -406,8 +440,13 @@ const store = new Vuex.Store({ totalNodes.push(state.allNodes[i].doc.nodes.length) } } + const reducer = (accumulator, currentValue) => accumulator + currentValue + if (totalNodes && totalNodes.length > 0) { + zindex = totalNodes.reduce(reducer) + } else { + zindex = 1 + } - var zindex = totalNodes.reduce(reducer) var uniqueid = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15) @@ -858,6 +897,18 @@ const store = new Vuex.Store({ commit('COLOR_NODE', { nodeid, color }) }, + updateRemote: ( + { commit }, + { protocol, couchusername, couchpassword, couchurl } + ) => { + commit('UPDATE_REMOTE', { + protocol, + couchusername, + couchpassword, + couchurl, + }) + }, + makeConnect: ( { commit }, { fromnode, tonode, xposstart, yposstart, yposend, xposend } diff --git a/app/src/views/About.vue b/app/src/views/About.vue index dd6f338d8ad17b9559e50f865bf9da514df37f57..4c958dafd77a962ff1a9ae75eca0228f976937e8 100644 --- a/app/src/views/About.vue +++ b/app/src/views/About.vue @@ -7,9 +7,10 @@ concepts </p> <p> - Made by Adam Procter and Toby Milner-Gulland. + Made by Adam Procter. <em> - (+ many helpers (Mathew Parker, im looking at you) & + (+ many helpers (Toby Milner-Gulland & Mathew Parker, I'm looking at + you) & <a href="https://patreon.com/procterbot">supporters</a>) </em> </p> diff --git a/app/src/views/Cards.vue b/app/src/views/Cards.vue index 3f785de8753da869e1892608fb823604321eeb5e..74de959beade158c721dd477b1e5a3f73a6dee55 100644 --- a/app/src/views/Cards.vue +++ b/app/src/views/Cards.vue @@ -2,7 +2,7 @@ <div id="listwrapper"> <div v-if="clientset"> <h1 class="mobile">All nodes - card view</h1> - + <h2 class="danger">Positions not saved</h2> <CardsLayer @edit-true="(e) => editTrue(e)" :added="added" /> <!-- <OtherCardslayer /> --> @@ -137,6 +137,9 @@ export default { </script> <style lang="css" scoped> +.danger { + color: red; +} .mobile { margin-left: 1em; font-size: 1em; diff --git a/app/src/views/NitPicky.vue b/app/src/views/NitPicky.vue new file mode 100644 index 0000000000000000000000000000000000000000..ae544c35462ae4cc6aa74e83d2d7278daff82592 --- /dev/null +++ b/app/src/views/NitPicky.vue @@ -0,0 +1,84 @@ +<template> + <div> + <h1>Admin</h1> + <p>Access to some objects to test redirect of CouchDB and credentails</p> + + <div v-for="(value, index) in configRemote" v-bind:key="index"> + {{ value.protocol }}{{ value.couchusername }}:{{ value.couchpassword }}@{{ + value.couchurl + }} + </div> + <form> + <input + type="text" + v-model="protocol" + placeholder="https://" + autocorrect="off" + autocapitalize="none" + /> + <input + type="text" + v-model="couchusername" + placeholder="couch admin username" + autocorrect="off" + autocapitalize="none" + /> + <input + type="text" + v-model="couchpassword" + placeholder="couch admin password" + autocorrect="off" + autocapitalize="none" + /> + <input + type="text" + v-model="couchurl" + placeholder="youcouch.com" + autocorrect="off" + autocapitalize="none" + /> + + <button + @click.prevent=" + updateRemote(protocol, couchusername, couchpassword, couchurl) + " + > + Change Credentials + </button> + </form> + </div> +</template> + +<script> +import { mapState } from 'vuex' + +export default { + name: 'NitPicky', + + data: function () { + return { + protocol: '', + couchusername: '', + couchpassword: '', + couchurl: '', + } + }, + computed: mapState({ + configRemote: (state) => state.configRemote, + }), + + methods: { + updateRemote(protocol, couchusername, couchpassword, couchurl) { + // console.log(protocol, couchusername, couchpassword, couchurl) + this.$store.dispatch('updateRemote', { + protocol, + couchusername, + couchpassword, + couchurl, + }) + }, + }, +} +</script> + +<style lang="css" scoped></style>