diff --git a/.gitignore b/.gitignore index ca157720..e6a9dd7f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules public/bundle.* package-lock.json +plugins/*/* \ No newline at end of file diff --git a/README.md b/README.md index 506c6470..09fd8a4f 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,20 @@ npm run dev ## Data Storage -Blockstack.org is a "Decentralized computing network and app ecosystem" - basically, it offers a means to auth a user, and get/put files that are encrypted. This means Nomie works with flat files that require a network lookup. I've decided to create a "log book" for each month. Even heavy users will have a monthly book less than 100k, so that seemed reasonable. Plus doing it every day would require way too many network lookups when generating stats, and each year would be too big for and risky. +Open Nomie as of Jul 27, will support either local (with localforage) or cloud (with blockstack) -/v01/data/books/2019-01 +All storage is done based a key, value - so adding additional storage options in the future should be pretty easy. -- v01 - a way to make upgrading easier without affecting users existing data stores -- data - generic -- books - holder of books -- 2019-01 - json array of logs +Blockstack.org is a "Decentralized computing network and app ecosystem" - basically, it offers a means to auth a user, and get/put files that are encrypted. This means Nomie works with flat files that require a network lookup. I've decided to create a "log book" for each month. Even heavy users will have a monthly book less than 100k, so that seemed reasonable. Plus doing it every day would require way too many network lookups when generating stats, and each year would be too big for and risky. +/v01/data/books/2019-01 - array of logs /v01/data/trackers.json - trackers /v01/data/boards.json - users board configuration +## Component / Container Issues + +I don't like having a bunch of floating variables around, so like Vue, and Svete 2 - I tend to group data and methods together. But I flipped about half way through calling it data, to then calling it state. I'm not sure which will stick. + # Current Tracker Types **tick** Single Tap @@ -92,6 +94,10 @@ Tap to start, tap to stop. The timer is great for tracking durations. - **Keep cleaning, organizing and testing** - this project didn't start very clean, or ready for unit testing, this should be an on going objective. - **Use what's there** - Twitter bootstrap ([and all it's classes](https://getbootstrap.com/)) are available, reuse what already exists before writing new - especially css. +## Trademark License + +Nomie and the Blue Elephant are registered Trademarks of Happy Data, LLC. Indianapolis, IN. For a commercial use of the brand or logomark please contact support@happydata.org + ## MIT License Copyright 2019 Happy Data, LLC diff --git a/TODO.md b/TODO.md index d0e140f1..8445c5ac 100644 --- a/TODO.md +++ b/TODO.md @@ -1,30 +1,46 @@ # TODO -Generated Sun Jul 21 2019 9:12 pm +Generated Sun Jul 28 2019 12:00 pm - **src/store/user.js** + - TODO: Look at push notifications in the browser - TODO: Add 10 minute interval to check for day change - if change, fire a new user.ready - **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: figure out why duplicates happen on board saving - TODO: tried to make this a spread - but I keep breaking it. - **src/scss/main.scss** - TODO: Look at making prefers-color-scheme work properly - when enabled, only buttons change - **src/routes/stats.svelte** - TODO: Needs to be refactored and cleaned up +- **src/routes/settings.svelte** + - TODO: figure out how to handle a cancel in the interact prompt - **src/routes/history.svelte** + - TODO: Have it react when the ledger change, not a hard refresh + - TODO: refactor so it's clean and using the proper amount of Store vs local + - TODO: Look at making this refresh without doing the loading, it's pushing the page to the top and it's annoying - TODO: This is really sloppy - clean it up. + - TODO: Search Day Header isn't working reliably... Pulling it for now. - **src/routes/board-editor.svelte** - TODO: Make sorting work + - TODO: Fix Sorting on MObile --> - **src/modules/stats/stats.js** - TODO: Implement IgnoreZeros - **src/containers/tracker/input/keypad.svelte** - and one for the pin-lock container - TODO: merge these some day +- **src/containers/map/map.svelte** + - TODO: Look at making this curved dotted lines - and not just straight ones +- **src/containers/importer/importer.svelte** + - Modal will be hidden in settings TODO: make this not hacky --> +- **src/containers/board/tracker-button.svelte** + - TODO: Move this to components/tracker-button - **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: Add a media/photo type of thing that can be added to a log.. - TODO: Mobile is getting GMT Time, desktop is not - await LedgerStore.saveLog($ActiveLogStore); TODO: Make ledger task instead \ No newline at end of file diff --git a/config/global.js b/config/global.js index 138d7a3f..0ea509fa 100644 --- a/config/global.js +++ b/config/global.js @@ -1,4 +1,5 @@ export default { + storage_engine: 'local', // local or blockstack book_time_format: 'YYYY-MM', data_root: 'data/v01', book_root: 'data/v01/books', diff --git a/cypress.json b/cypress.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/cypress.json @@ -0,0 +1 @@ +{} diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 00000000..da18d935 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} \ No newline at end of file diff --git a/cypress/integration/app/app.js b/cypress/integration/app/app.js new file mode 100644 index 00000000..93694391 --- /dev/null +++ b/cypress/integration/app/app.js @@ -0,0 +1,52 @@ +/// + +context('App', () => { + beforeEach(() => { + cy.visit('http://localhost:5000'); + }); + + it('cy.hash() - get the current URL hash', () => { + // https://on.cypress.io/hash + cy.hash().should('be.empty'); + }); + it('next button', () => { + cy.wait(200); + + cy.get('.footer-buttons > .btn') + .contains('Next') + .click(); + + cy.wait(200); + + cy.get('.footer-buttons > .btn') + .contains('Next') + .click(); + + cy.wait(200); + + cy.get('.footer-buttons > .btn') + .contains('Next') + .click(); + + cy.wait(200); + + cy.get('.footer-buttons > .btn') + .contains('Next') + .click(); + + cy.wait(200); + + // select local storage + cy.get('.content > :nth-child(2)').click(); + + cy.wait(200); + + cy.get('.footer-buttons > .btn') + .contains('Next') + .click(); + + // cy.get('.footer-buttons > .btn') + // .contains('Login/Register') + // .click(); + }); +}); diff --git a/cypress/integration/modules/log.js b/cypress/integration/modules/log.js new file mode 100644 index 00000000..f6227df0 --- /dev/null +++ b/cypress/integration/modules/log.js @@ -0,0 +1,43 @@ +import Log from '../../../src/modules/nomie-log/nomie-log'; + +describe('modules/nomie-log', function() { + let log; + let stub = { + note: `I'm a note for #testing and I'm #good(344) and #good and kinda #bad sometimes #bad`, + }; + + it('log initializes', () => { + log = new Log(stub); + expect(log).to.be.instanceOf(Log); + expect(log.note).to.equal(stub.note); + }); + + it('log.toObject', () => { + log = new Log(stub); + expect(log.toObject()._id).to.be.a('string'); + }); + it('log.expanded', () => { + log = new Log(stub); + log.expanded(); + expect(log.trackers.testing.value).to.equal(1); + }); + it('log.hasTracker', () => { + log = new Log(stub); + log.expanded(); + expect(log.hasTracker('testing')).to.equal(true); + expect(log.hasTracker('nothing')).to.equal(false); + }); + it('log.trackersArray', () => { + log = new Log(stub); + log.expand(); + let trackers = log.trackersArray(); + expect(trackers.length).to.equal(3); + }); + it('log.addTag', () => { + log = new Log(stub); + log.expanded(); + log.addTag('cheese', 44); + expect(log.hasTracker('cheese')).to.equal(true); + expect(log.trackers.cheese.value).to.equal(44); + }); +}); diff --git a/cypress/integration/modules/stats.js b/cypress/integration/modules/stats.js new file mode 100644 index 00000000..9256dd10 --- /dev/null +++ b/cypress/integration/modules/stats.js @@ -0,0 +1,78 @@ +import Stats from '../../../src/modules/stats/stats'; +import NomieLog from '../../../src/modules/nomie-log/nomie-log'; +import Tracker from '../../../src/modules/tracker/tracker'; +import dayjs from 'dayjs'; + +// TODO: write tests for mean math trackers + +describe('modules/nomie-log', function() { + let rows = [ + new NomieLog({ + note: `I'm the #first #note and I'm #good(10)`, + }), + new NomieLog({ + note: `I'm the #middle #note and I'm #good(104) too`, + end: dayjs() + .subtract(1, 'day') + .toDate() + .getTime(), + }), + new NomieLog({ + note: `I'm the #last #note and I'm #bad and #good(1)`, + }), + new NomieLog({ + note: `I'm a thing`, + }), + ]; + + let stats = new Stats(rows, new Tracker({ tag: 'good' })); + + it('stats initializes', () => { + expect(stats).to.be.instanceOf(Stats); + }); + it('stats rows should expand', () => { + expect(stats.rows[0].trackers.first.value).to.equal(1); + }); + it('results.year.count', () => { + expect(stats.results.year.count).to.equal(3); + }); + it('results.month.count', () => { + expect(stats.results.month.count).to.equal(3); + }); + it('results.day.count', () => { + expect(stats.results.day.count).to.equal(2); + }); + it('getValueMap', () => { + let todayKey = dayjs().format('YYYY-MM-DD'); + let yesterdayKey = dayjs() + .subtract(1, 'day') + .format('YYYY-MM-DD'); + let valueMap = stats.getValueMap(rows); + expect(valueMap[todayKey]).to.be.instanceOf(Array); + expect(valueMap[todayKey]).to.include.members([10, 1]); + expect(valueMap[yesterdayKey]).to.include.members([104]); + }); + + it('getMinMaxFromValueMap()', () => { + let valueMap = stats.getValueMap(rows); + expect(stats.getMinMaxFromValueMap(valueMap).min.value).to.equal(11); + expect(stats.getMinMaxFromValueMap(valueMap).max.value).to.equal(104); + }); + + it('getRows - day', () => { + // number of days the tag shows up in the day + expect(stats.getRows('day').length).to.equal(2); + }); + + it('getRows - month', () => { + // number of days the tag shows up in the month + expect(stats.getRows('month').length).to.equal(3); + }); + + it('getChartData - month', () => { + // number of days the tag shows up in the month + expect(stats.toChartData('month').labels[0]).to.equal('01'); + // Check today's value + expect(stats.toChartData('month').points[new Date().getDate() - 1].y).to.equal(11); + }); +}); diff --git a/cypress/integration/modules/tracker.js b/cypress/integration/modules/tracker.js new file mode 100644 index 00000000..2f466027 --- /dev/null +++ b/cypress/integration/modules/tracker.js @@ -0,0 +1,44 @@ +import Tracker from '../../../src/modules/tracker/tracker'; + +describe('modules/tracker', function() { + let tracker; + let stub = { + tag: 'taggy_tag', + label: 'Tester', + uom: 'mile', + emoji: '๐Ÿฅช', + type: 'value', + color: '#555555', + default: 10, + math: 'mean', + }; + + it('tracker initializes', () => { + tracker = new Tracker(stub); + expect(tracker).to.be.instanceOf(Tracker); + expect(tracker.label).to.equal(stub.label); + expect(tracker.tag).to.equal(stub.tag); + expect(tracker.emoji).to.equal(stub.emoji); + expect(tracker.type).to.equal(stub.type); + expect(tracker.default).to.equal(stub.default); + expect(tracker.color).to.equal(stub.color); + expect(tracker.uom).to.equal(stub.uom); + expect(tracker.math).oneOf(['sum', 'mean']); + // expect(math.sum([1, 2])).to.equal(3); + }); + it('tracker.displayValue', () => { + tracker = new Tracker(stub); + expect(tracker.displayValue(100)).to.equal('100mi'); + // expect(math.sum([1, 2])).to.equal(3); + }); + it('tracker.displayTag', () => { + tracker = new Tracker(stub); + expect(tracker.displayTag()).to.equal('Taggy Tag'); + // expect(math.sum([1, 2])).to.equal(3); + }); + it('tracker.toTag', () => { + tracker = new Tracker(stub); + expect(tracker.toTag('Brandon Is Good !!!')).to.equal('brandon_is_good'); + // expect(math.sum([1, 2])).to.equal(3); + }); +}); diff --git a/cypress/integration/store/board.js b/cypress/integration/store/board.js new file mode 100644 index 00000000..899c4328 --- /dev/null +++ b/cypress/integration/store/board.js @@ -0,0 +1,9 @@ +import { BoardStore } from '../../../src/store/boards'; + +// TODO: Make more complete +describe('store/board', function() { + it('base data', () => { + expect(BoardStore.data().active).to.equal('all'); + expect(BoardStore.data().boards).to.be.instanceOf(Array); + }); +}); diff --git a/cypress/integration/utils/extract-trackers.js b/cypress/integration/utils/extract-trackers.js new file mode 100644 index 00000000..d1249289 --- /dev/null +++ b/cypress/integration/utils/extract-trackers.js @@ -0,0 +1,15 @@ +import extractor from '../../../src/utils/extract-trackers/extract-trackers'; + +describe('utils/extract-trackers', function() { + it('extract-tracker', () => { + let note = 'This is a #test of Nomies #extractor(4) and #cheese #cheese #cheese'; + let results = extractor(note); + + expect(results.test.tracker).to.equal('test'); + expect(results.test.value).to.equal(1); + expect(results.extractor.value).to.equal(4); + expect(results.cheese.value).to.equal(3); + + // expect(math.sum([1, 2])).to.equal(3); + }); +}); diff --git a/cypress/integration/utils/math.js b/cypress/integration/utils/math.js new file mode 100644 index 00000000..ce35a481 --- /dev/null +++ b/cypress/integration/utils/math.js @@ -0,0 +1,43 @@ +import math from '../../../src/utils/math/math'; + +describe('utils/math', function() { + it('math.sum', () => { + expect(math.sum([1, 2])).to.equal(3); + }); + it('math.average', () => { + expect(math.average([30, 344, 21, 23])).to.equal(104.5); + }); + it('math.round - default', () => { + expect(math.round(10.12345)).to.equal(10.12); + }); + it('math.round - 1000', () => { + expect(math.round(10.12345, 1000)).to.equal(10.123); + }); + it('math.round - 10', () => { + expect(math.round(10.12345, 10)).to.equal(10.1); + }); + it('math.max', () => { + expect(math.max([0, 12, 223, 332, 12, 345, 32.32, -324])).to.equal(345); + }); + it('math.min - negative', () => { + expect(math.min([0, 12, 223, 332, 12, 345, 32.32, -324, 443])).to.equal(-324); + }); + it('math.min - no negative', () => { + expect(math.min([1, 12, 223, 332, 12, 345, 32.32, 443])).to.equal(1); + }); + it('math.percentage', () => { + expect(math.percentage(100, 50)).to.equal(50); + }); + it('math.random', () => { + expect(math.random([10, 20, 30])).to.be.oneOf([10, 20, 30]); + }); + it('math.random_range', () => { + expect(math.random_range(0, 100)).to.be.within(0, 100); + }); + it('math.percentile', () => { + expect(math.percentile([0, 50, 100])).to.include.members([0, 50, 100]); + }); + it('math.trustfulNumber', () => { + expect(math.trustfulNumber(32 + 'abc', 0)).to.equal(0); + }); +}); diff --git a/cypress/integration/utils/regex.js b/cypress/integration/utils/regex.js new file mode 100644 index 00000000..df4a3e86 --- /dev/null +++ b/cypress/integration/utils/regex.js @@ -0,0 +1,10 @@ +import regexs from '../../../src/utils/regex'; + +describe('utils/regex', function() { + it('extract tags by regex', () => { + let note = 'This is a #test my #friend(44) # taco'; + let exp = new RegExp(regexs.tag, 'gi'); + + expect(note.match(exp)).to.include.members(['#test', '#friend(44)']); + }); +}); diff --git a/cypress/integration/utils/time.js b/cypress/integration/utils/time.js new file mode 100644 index 00000000..54c070f6 --- /dev/null +++ b/cypress/integration/utils/time.js @@ -0,0 +1,27 @@ +import time from '../../../src/utils/time/time'; + +describe('utils/time', function() { + it('padTime', () => { + expect(time.padTime(1)).to.equal('01'); + }); + it('secondsToTime', () => { + expect(time.secondsToTime(60 * 60)).to.equal('1:00:00'); + expect(time.secondsToTime(10 * 60 * 60)).to.equal('10:00:00'); + }); + it('msToSecond', () => { + expect(time.msToSecond(1000)).to.equal(1); + }); + it('timestringToSeconds', () => { + expect(time.timestringToSeconds('01:00:00')).to.equal(3600); + expect(time.timestringToSeconds('01:00:05')).to.equal(3605); + expect(time.timestringToSeconds('02:00:00')).to.equal(7200); + }); + it('unitsToSeconds', () => { + expect(time.unitsToSeconds(1, 0, 0)).to.equal(3600); + expect(time.unitsToSeconds(1, 0, 5)).to.equal(3605); + expect(time.unitsToSeconds(2, 0, 0)).to.equal(7200); + }); + it('getNumberedArray', () => { + expect(time.getNumberedArray(2)).to.include.members(['00', '01', '02']); + }); +}); diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js new file mode 100644 index 00000000..fd170fba --- /dev/null +++ b/cypress/plugins/index.js @@ -0,0 +1,17 @@ +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +module.exports = (on, config) => { + // `on` is used to hook into various events Cypress emits + // `config` is the resolved Cypress config +} diff --git a/cypress/support/commands.js b/cypress/support/commands.js new file mode 100644 index 00000000..c1f5a772 --- /dev/null +++ b/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add("login", (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This is will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/cypress/support/index.js b/cypress/support/index.js new file mode 100644 index 00000000..d68db96d --- /dev/null +++ b/cypress/support/index.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/package.json b/package.json index e8635c79..9cd49a06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-nomie", - "version": "4.0.57", + "version": "4.0.84", "homepage": "https://nomie.app", "bugs": { "url": "https://github.com/open-nomie/nomie/issues", @@ -18,19 +18,24 @@ "dev": "concurrently \"run-p start:dev autobuild\" \"npm run scss\"", "start": "sirv public --single", "start:dev": "sirv public --cors --single --dev", - "patch": "node build-tools/patch-version.js", + "patch_version": "node build-tools/patch-version.js", "test": "jest src/**/*.spec.js", "todo": "node build-tools/get-todo.js", - "commit-all": "npm run patch && npm run todo && git add . && git commit" + "patch": "npm run patch_version && npm run todo", + "cypress": "cypress open" }, "devDependencies": { + "@jukben/emoji-search": "^2.0.1", "@kazzkiq/svelte-preprocess-scss": "^0.1.3", "@sveltejs/gestures": "0.0.1", "bootstrap": "^4.3.1", "concurrently": "^4.1.1", + "cypress": "^3.4.0", + "emoji-search": "^1.0.0", "find-in-files": "^0.5.0", "git-release-notes": "^4.0.1", "jest": "^24.8.0", + "localforage": "^1.7.3", "mini-css-extract-plugin": "^0.7.0", "node-sass": "^4.12.0", "nomie-uom": "^1.0.2", @@ -62,4 +67,4 @@ "svelte-spinner": "^2.0.1" }, "license": "MIT" -} +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 56bee122..a68f5665 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ - Nomie Dap + Open Nomie @@ -11,7 +11,7 @@ - + + + diff --git a/src/components/board-tabs/board-tabs.svelte b/src/components/board-tabs/board-tabs.svelte index b113d757..1b2c4827 100644 --- a/src/components/board-tabs/board-tabs.svelte +++ b/src/components/board-tabs/board-tabs.svelte @@ -49,7 +49,9 @@
+
+ {#each boards as board} +
+
diff --git a/src/components/capture-log.svelte b/src/components/capture-log.svelte index 4037b401..bcf782c1 100644 --- a/src/components/capture-log.svelte +++ b/src/components/capture-log.svelte @@ -51,17 +51,18 @@ showDate: false }; + // TODO: Add a media/photo type of thing that can be added to a log.. + const methods = { advancedChanged() { if (state.date) { ActiveLogStore.update(l => { let now = new Date(); let gmtDate = new Date(state.date); + + console.log("Updating Log with date", { now, gmtDate }); // TODO: Mobile is getting GMT Time, desktop is not - // BUG - if (now.getTimezoneOffset() !== gmtDate.getTimezoneOffset()) { - alert("Timezone offset is not local"); - } + l.start = gmtDate.getTime(); l.end = gmtDate.getTime(); return l; @@ -72,7 +73,7 @@ state.show = !state.show; }, checkTextareaSize() { - let height = textarea.scrollHeight; + let height = (textarea || {}).scrollHeight || 100; textarea.style.height = (height > 300 ? 300 : height) + "px"; }, async logSave() { @@ -173,7 +174,7 @@ } } .save-button { - width: 30px; + padding: 0 10px; height: 30px; border-radius: 15px; display: flex; @@ -185,6 +186,7 @@ flex-shrink: 0; margin-bottom: 6px; border: none; + font-size: 0.9rem; color: #fff; svg { fill: #fff; @@ -244,9 +246,11 @@ bind:this={textarea} placeholder="What's Up?" on:keypress={methods.keyPress} /> - + {#if !saving} + + {:else} + + {/if} @@ -267,7 +271,7 @@ { methods.advancedChanged(); }} diff --git a/src/components/charts/bar-chart.svelte b/src/components/charts/bar-chart.svelte index 73244ade..e51b477a 100644 --- a/src/components/charts/bar-chart.svelte +++ b/src/components/charts/bar-chart.svelte @@ -44,7 +44,6 @@ p.y = value; return p; }); - console.log("Points!", { finalPoints, max, sum }); } } diff --git a/src/components/color-picker/color-picker.svelte b/src/components/color-picker/color-picker.svelte new file mode 100644 index 00000000..8602afa3 --- /dev/null +++ b/src/components/color-picker/color-picker.svelte @@ -0,0 +1,82 @@ + + + + +
+
+ {#each colors as color, index} +
+
diff --git a/src/components/day-time-grid/day-time-grid.svelte b/src/components/day-time-grid/day-time-grid.svelte new file mode 100644 index 00000000..1b0f8f74 --- /dev/null +++ b/src/components/day-time-grid/day-time-grid.svelte @@ -0,0 +1,112 @@ + + + + +
+ {#each days as day, index} +
+ + {#each day as hour, hi} +
+ {/each} +
+ {/each} +
diff --git a/src/components/list-item-log/list-item-log.svelte b/src/components/list-item-log/list-item-log.svelte index 6d7ac4f6..7764b21e 100644 --- a/src/components/list-item-log/list-item-log.svelte +++ b/src/components/list-item-log/list-item-log.svelte @@ -2,6 +2,10 @@ // Svelte import { createEventDispatcher } from "svelte"; + // Modules + import NomieLog from "../../modules/nomie-log/nomie-log"; + import Tracker from "../../modules/tracker/tracker"; + // components import NItem from "../list-item/list-item.svelte"; import NText from "../text/text.svelte"; @@ -18,25 +22,33 @@ export let trackers = {}; export let className = ""; export let focus = false; - + export let fullDate = false; // consts const dispatch = createEventDispatcher(); + + let displayLog; + + $: if (log) { + displayLog = new NomieLog(log); + } -{#if log} +{#if displayLog}
- {dayjs(log.end).format('h:mm a')} + + {dayjs(displayLog.end).format(fullDate ? 'ddd MMM D YYYY h:mm a' : 'h:mm a')} + - {#if log.lat} + {#if displayLog.lat} + +
+ {/if} +
+ {#if fileData && !version} + { + fileData = null; + }} /> + {:else if fileData} + + + + + + + +
+ {#if importing.trackers.running} + + {:else if importing.trackers.done} + Imported + + {:else} + + {/if} +
+
+ + +
+ {#if importing.boards.running} + + {:else if importing.boards.done} + Imported + + {:else} + + {/if} +
+
+ + +
+ {#if importing.records.running} +
+
+
+ {:else if importing.records.done} + Imported + + {:else} + + {/if} +
+ + {/if} +
+ + + +
+ {#if fileData && version && !importing.all.running && !importing.all.done} + + {:else if importing.all.running} + + {/if} +
+ + diff --git a/src/containers/interactions/interactions.svelte b/src/containers/interactions/interactions.svelte index a5e916d9..c5c3c961 100644 --- a/src/containers/interactions/interactions.svelte +++ b/src/containers/interactions/interactions.svelte @@ -1,12 +1,18 @@ -