Skip to content

Commit

Permalink
Adding FAQ / Refactoring Config
Browse files Browse the repository at this point in the history
- Moving config to /config - and out of store
- Created FAQ route and config/faq
  • Loading branch information
brandoncorbin committed Jul 21, 2019
1 parent 081ee96 commit 7291fe2
Show file tree
Hide file tree
Showing 17 changed files with 144 additions and 22 deletions.
Empty file added RELEASENOTES.md
Empty file.
33 changes: 27 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
### TODOs
| Filename | line # | TODO
|:------|:------:|:------
| src/store/boards.js | 136 | tried to make this a spread - but I keep breaking it.
| src/store/ledger.js | 285 | this doesn't seem to be trigger a change in History.svetle
| src/store/ledger.js | 378 | Make this use listBooks() array to only look for books that exist
# TODO

Generated Sat Jul 20 2019 9:51 pm

- **src/store/ledger.js**
- TODO: this doesn't seem to be trigger a change in History.svetle
- TODO: Make this use listBooks() array to only look for books that exist
- **src/store/boards.js**
- TODO: tried to make this a spread - but I keep breaking it.
- **src/routes/stats.svelte**
- TODO: Needs to be refactored and cleaned up
- TODO: Implement IgnoreZeros
- **src/routes/settings.svelte**
- TODO: Make this a modal input - not a damn prompt
- **src/routes/history.svelte**
- TODO: This is really sloppy - clean it up.
- **src/routes/board-editor.svelte**
- TODO: Make sorting work
- **src/containers/tracker/input/keypad.svelte**
- and one for the pin-lock container - TODO: merge these some day
- **src/containers/board/board.svelte**
- TODO: fix user store to be a correct store
- TODO: Look at why this is needed... slop!
- TODO: Finish this starter pack add trackers, make them installable. -->
- **src/components/capture-log.svelte**
- TODO: Mobile is getting GMT Time, desktop is not
- await LedgerStore.saveLog($ActiveLogStore); TODO: Make ledger task instead
22 changes: 22 additions & 0 deletions build-tools/get-todo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const findInFiles = require('find-in-files');
const dayjs = require('dayjs');
const fs = require('fs');

let md = ['# TODO', '', `Generated ${dayjs().format('ddd MMM D YYYY h:mm a')}`, ''];

let stripComment = str => {
return str.replace(/(\/\/|\<\!\-\-|\*)/gi, '');
};

findInFiles.find('TODO:', './src').then(res => {
let fileNames = Object.keys(res);
fileNames.forEach(name => {
let file = name;
let node = res[file];
md.push(`- **${file}**`);
node.line.forEach(line => {
md.push(` - ${stripComment(line).trim()}`);
});
});
fs.writeFileSync('./TODO.md', md.join(`\n`), 'UTF-8');
});
35 changes: 35 additions & 0 deletions config/faq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export default [
{
question: 'What should I track?',
answer: `That's really up to you. But, you can't go wrong tracking your
mood a couple times a day, and each time you drink water. From there, you'll start to see what
else you might want to track and understand.`,
},
{
question: 'When should I track?',
answer: `That's really up to you too, but the key is to keep it balanced,
track a few times throug out the day maybe?`,
},
{
question: `Where's my data stored?`,
answer: `Unless you've setup your own custom hosting with Blockstack,
your data is stored encrypted in Blockstack's instance of GaiaHub.
The only person able to decrypt your data is you.`,
},
{
question: `Can I host my own data?`,
answer: `Yes! If you're technical search form "DigitalOcean GaiaHub" and follow the instructions.
This will direct you to Blockstack where you'll set your own GaiaHub storage`,
},
{
question: `Can I auto import thing into this version of Nomie?`,
answer: `Yes, using a custom URL parameter. If you add /?note=Hi to the end of this
url - it will automatically create a note. Apps like Tasker (Android) and
Shortcuts in iOS can open web browsers. So you url encode a note with the
data you need. For example: #water(34)`,
},
{
question: `Why create Nomie?`,
answer: `Because I (@brandoncorbin) need it.`,
},
];
File renamed without changes.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@
"build": "node build-tools/bust-cache.js && rollup -c",
"autobuild": "rollup -c -w",
"scss": "node-sass ./src/scss/main.scss --output=./public --watch=./src/scss/**/*.scss --include-path",
"watch:scss": "nodemon -e scss -x \"npm run scss\"",
"dev": "concurrently \"run-p start:dev autobuild\" \"npm run scss\"",
"dev-original": "run-p start:dev autobuild",
"start": "sirv public --single",
"start:dev": "sirv public --cors --single --dev",
"patch": "node build-tools/patch-version.js",
"test:unit": "jest src/**/*.spec.js",
"todo": "leasot -x --reporter markdown 'src/**/*.js' > TODO.md",
"commit": "npm run patch && npm run todo && git add TODO.md && git add package.json && git commit"
"test": "jest src/**/*.spec.js",
"todo": "node build-tools/get-todo.js",
"commit-all": "npm run patch && npm run todo && git add . && git commit"
},
"devDependencies": {
"@kazzkiq/svelte-preprocess-scss": "^0.1.3",
"@sveltejs/gestures": "0.0.1",
"bootstrap": "^4.3.1",
"concurrently": "^4.1.1",
"find-in-files": "^0.5.0",
"git-release-notes": "^4.0.1",
"jest": "^24.8.0",
"leasot": "^8.0.0",
"mini-css-extract-plugin": "^0.7.0",
"node-sass": "^4.12.0",
"nomie-uom": "^1.0.2",
Expand Down
2 changes: 2 additions & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import SettingsRoute from "./routes/settings.svelte";
import StatsRoute from "./routes/stats.svelte";
import BoardEditorRoute from "./routes/board-editor.svelte";
import FAQRoute from "./routes/faq.svelte";
// Stores
import { UserStore } from "./store/user"; // user auth and state
Expand Down Expand Up @@ -83,6 +84,7 @@
<Route path="/settings" component={SettingsRoute} />
<Route path="/stats/:id" component={StatsRoute} />
<Route path="/board/:id" component={BoardEditorRoute} />
<Route path="/faq" component={FAQRoute} />
</div>
</Router>
{:else}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/layout/tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</Link>
<Link to="/settings">
<Icon name="menu" />
<label>Settings</label>
<label>More</label>
</Link>
</div>
</nav>
2 changes: 1 addition & 1 deletion src/containers/tracker/editor/editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import TrackerTypes from "../../../modules/tracker-types/tracker-types";
// Stores
import config from "../../../store/config";
import config from "../../../../config/global";
import { UserStore } from "../../../store/user";
import { Interact } from "../../../store/interact";
import { TrackerStore } from "../../../store/trackers";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/export/export.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Modules
import Storage from '../storage/storage';
// stores
import config from '../../store/config';
import config from '../../../config/global';
import { LedgerStore } from '../../store/ledger';

//vendors
Expand Down
33 changes: 33 additions & 0 deletions src/routes/faq.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script>
//Vendors
import { navigate, Router, Route } from "svelte-routing";
// Modules
import Tracker from "../modules/tracker/tracker";
// Components
import NText from "../components/text/text.svelte";
import NItem from "../components/list-item/list-item.svelte";
// containers
import NPage from "../containers/layout/page.svelte";
// config
import faq from "../../config/faq";
</script>

<NPage className="stats" withBack={true}>

<div slot="header" class="n-row">
<h1>Frequent Questions</h1>
<div class="filler" />
</div>

<div class="container">
<div class="n-list">
{#each faq as q, index}
<div class="n-pop my-2 py-2">
<NItem title={q.question} description={q.answer} />
</div>
{/each}
</div>
</div>

</NPage>
9 changes: 8 additions & 1 deletion src/routes/settings.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script>
//Vendors
import { navigate } from "svelte-routing";
// Components
import NItem from "../components/list-item/list-item.svelte";
import NText from "../components/text/text.svelte";
Expand All @@ -21,7 +24,7 @@
import { TrackerStore } from "../store/trackers";
import { BoardStore } from "../store/boards";
// Config
import config from "../store/config";
import config from "../../config/global";
// consts
const Export = new Exporter();
Expand Down Expand Up @@ -49,6 +52,9 @@
bookAge(date) {
return dayjs(`${date}-01`).fromNow();
},
faq() {
navigate("/faq");
},
export() {
Export.onChange(change => {
console.log("change", change);
Expand Down Expand Up @@ -133,6 +139,7 @@

<NToolbar pinTop>
<h2>Settings</h2>
<button on:click={methods.faq} class="btn btn-clear text-primary">FAQ</button>
</NToolbar>
{#if $UserStore.meta}
<div class="page page-settings with-header">
Expand Down
2 changes: 0 additions & 2 deletions src/store/active-log.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { writable } from 'svelte/store';
import config from '../store/config';
import dayjs from 'dayjs';
import NomieLog from '../modules/nomie-log/nomie-log';
import Logger from '../utils/log/log';

Expand Down
2 changes: 1 addition & 1 deletion src/store/boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { writable } from 'svelte/store';
import Storage from '../modules/storage/storage';

// Stores
import config from '../store/config';
import config from '../../config/global';

// Utils
import md5 from 'md5';
Expand Down
4 changes: 3 additions & 1 deletion src/store/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import Logger from '../utils/log/log';
import dayjs from 'dayjs';
import { writable } from 'svelte/store';

// Config
import config from '../../config/global';

// Stores
import config from '../store/config';
import { UserStore } from './user';
import locate from '../modules/locate/locate';
import { Interact } from './interact';
Expand Down
5 changes: 4 additions & 1 deletion src/store/trackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import Storage from '../modules/storage/storage';
import Tracker from '../modules/tracker/tracker';
import StarterPack from '../modules/packs/default-trackers';

// Config
import config from '../../config/global';

// Stores
import config from '../store/config';
import { Interact } from '../store/interact';
import { BoardStore } from '../store/boards';

// Utils
import Logger from '../utils/log/log';

Expand Down
2 changes: 1 addition & 1 deletion src/store/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Storage from '../modules/storage/storage';
import { TrackerStore } from './trackers';
import { BoardStore } from './boards';

import config from './config';
import config from '../../config/global';

const console = new Logger('🤠 userStore');

Expand Down

0 comments on commit 7291fe2

Please sign in to comment.