From 09a76aba30a80cdeea27cce3329a89bb1c59152d Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 6 Aug 2018 21:17:16 -0500 Subject: [PATCH] Snoozing is complete Also updated the doc links in preparation for transfer to the Bit Badger organization --- README.md | 4 +- docs/index.md | 8 ++- src/api/MyPrayerJournal.Api/Handlers.fs | 13 ++--- src/app/src/App.vue | 2 +- src/app/src/components/Navigation.vue | 11 +++- src/app/src/components/Snoozed.vue | 76 +++++++++++++++++++++++++ src/app/src/main.js | 1 + src/app/src/router/index.js | 6 ++ src/app/src/store/index.js | 1 + 9 files changed, 108 insertions(+), 14 deletions(-) create mode 100644 src/app/src/components/Snoozed.vue diff --git a/README.md b/README.md index 69b109e..1944415 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Journaling has a long history; it helps people remember what happened, and the act of writing helps people think about what happened and process it. A prayer journal is not a new concept; it helps you keep track of the requests for which you've prayed, you can use it to pray over things repeatedly, and you can write the result when the answer comes _(or it was "no")_. -myPrayerJournal was borne of out of a personal desire I (Daniel) had to have something that would help me with my prayer life. When it's time to pray, it's not really time to use an app, so the design goal here is to keep it simple and unobtrusive. It will also help eliminate some of the downsides to a paper prayer journal, like not remembering whether you've prayed for a request, or running out of room to write another update on one. +myPrayerJournal was borne of out of a personal desire [Daniel](https://github.com/danieljsummers) had to have something that would help him with his prayer life. When it's time to pray, it's not really time to use an app, so the design goal here is to keep it simple and unobtrusive. It will also help eliminate some of the downsides to a paper prayer journal, like not remembering whether you've prayed for a request, or running out of room to write another update on one. ## Futher Reading -The documentation for the site is at . +The documentation for the site is at . diff --git a/docs/index.md b/docs/index.md index 92c4e97..8dc436e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ Journaling has a long history; it helps people remember what happened, and the act of writing helps people think about what happened and process it. A prayer journal is not a new concept; it helps you keep track of the requests for which you've prayed, you can use it to pray over things repeatedly, and you can write the result when the answer comes _(or it was "no")_. -myPrayerJournal was borne of out of a personal desire I (Daniel) had to have something that would help me with my prayer life. When it's time to pray, it's not really time to use an app, so the design goal here is to keep it simple and unobtrusive. It will also help eliminate some of the downsides to a paper prayer journal, like not remembering whether you've prayed for a request, or running out of room to write another update on one. +myPrayerJournal was borne of out of a personal desire [Daniel](https://github.com/danieljsummers) had to have something that would help him with his prayer life. When it's time to pray, it's not really time to use an app, so the design goal here is to keep it simple and unobtrusive. It will also help eliminate some of the downsides to a paper prayer journal, like not remembering whether you've prayed for a request, or running out of room to write another update on one. ## Finding the Site @@ -38,12 +38,16 @@ The third button for each request has an icon that looks like a piece of paper w myPrayerJournal tracks all of the actions related to a request; the fourth button, with the magnifying glass icon, will show you the entire history, including the text as it changed, and all the times "Prayed" was recorded. +## Snoozing Requests + +There may be a time where a request does not need to appear. The fifth button, with the clock icon, allows you to snooze requests until the day you specify. Additionally, if you have any snoozed requests, a "Snoozed" menu item will appear next to the "Journal" one; this page allows you to see what requests are snoozed, and return them to your journal by canceling the snooze. + ## Answered Requests Next to "Journal" on the top navigation is the word "Answered." This page lists all answered requests, from most recent to least recent, along with the text of the request at the time it was marked as answered. It will also show you when it was marked answered. The button at the bottom of each request, with the magnifying glass and the words "Show Full Request", link to a page that shows that request's complete history and notes, along with a few statistics about that request. The history and notes are listed from most recent to least recent; if you want to read it chronologically, just press the "End" key on your keyboard and read it from the bottom up. ## Final Notes -- myPrayerJournal is currently in public beta. If you encounter errors, please [file an issue on GitHub](https://github.com/danieljsummers/myPrayerJournal/issues) with as much detail as possible. You can also browse the list of issues to see what has been done and what is still left to do. +- myPrayerJournal is currently in public beta. If you encounter errors, please [file an issue on GitHub](https://github.com/bit-badger/myPrayerJournal/issues) with as much detail as possible. You can also browse the list of issues to see what has been done and what is still left to do. - Prayer requests and their history are securely backed up nightly along with other Bit Badger Solutions data. - Prayer changes things - most of all, the one doing the praying. I pray that this tool enables you to deepen and strengthen your prayer life. diff --git a/src/api/MyPrayerJournal.Api/Handlers.fs b/src/api/MyPrayerJournal.Api/Handlers.fs index b16c167..cf41c4c 100644 --- a/src/api/MyPrayerJournal.Api/Handlers.fs +++ b/src/api/MyPrayerJournal.Api/Handlers.fs @@ -18,13 +18,12 @@ module Error = /// Handle 404s from the API, sending known URL paths to the Vue app so that they can be handled there let notFound : HttpHandler = fun next ctx -> - let vueApp () = htmlFile "wwwroot/index.html" next ctx - match true with - | _ when ctx.Request.Path.Value.StartsWith "/answered" -> vueApp () - | _ when ctx.Request.Path.Value.StartsWith "/journal" -> vueApp () - | _ when ctx.Request.Path.Value.StartsWith "/user" -> vueApp () - | _ when ctx.Request.Path.Value = "/" -> vueApp () - | _ -> (setStatusCode 404 >=> json ([ "error", "not found" ] |> dict)) next ctx + [ "/answered"; "/journal"; "/snoozed"; "/user" ] + |> List.filter ctx.Request.Path.Value.StartsWith + |> List.length + |> function + | 0 -> (setStatusCode 404 >=> json ([ "error", "not found" ] |> dict)) next ctx + | _ -> htmlFile "wwwroot/index.html" next ctx /// Handler helpers diff --git a/src/app/src/App.vue b/src/app/src/App.vue index f0086e9..92f0291 100644 --- a/src/app/src/App.vue +++ b/src/app/src/App.vue @@ -12,7 +12,7 @@ em: small. #[router-link(:to="{ name: 'PrivacyPolicy' }") Privacy Policy] • #[router-link(:to="{ name: 'TermsOfService' }") Terms of Service] • - #[a(href='https://github.com/danieljsummers/myprayerjournal') Developed] and hosted by + #[a(href='https://github.com/bit-badger/myprayerjournal') Developed] and hosted by #[a(href='https://bitbadger.solutions') Bit Badger Solutions] diff --git a/src/app/src/components/Navigation.vue b/src/app/src/components/Navigation.vue index 1ed93e6..31d5f4d 100644 --- a/src/app/src/components/Navigation.vue +++ b/src/app/src/components/Navigation.vue @@ -12,11 +12,13 @@ b-navbar(toggleable='sm' b-navbar-nav b-nav-item(v-if='isAuthenticated' to='/journal') Journal + b-nav-item(v-if='hasSnoozed' + to='/snoozed') Snoozed b-nav-item(v-if='isAuthenticated' to='/answered') Answered b-nav-item(v-if='isAuthenticated'): a(@click.stop='logOff()') Log Off b-nav-item(v-if='!isAuthenticated'): a(@click.stop='logOn()') Log On - b-nav-item(href='https://danieljsummers.github.io/myPrayerJournal/' + b-nav-item(href='https://bit-badger.github.io/myPrayerJournal/' target='_blank' @click.stop='') Docs @@ -35,7 +37,12 @@ export default { } }, computed: { - ...mapState([ 'isAuthenticated' ]) + hasSnoozed () { + return this.isAuthenticated && + Array.isArray(this.journal) && + this.journal.filter(req => req.snoozedUntil > Date.now()).length > 0 + }, + ...mapState([ 'journal', 'isAuthenticated' ]) }, methods: { logOn () { diff --git a/src/app/src/components/Snoozed.vue b/src/app/src/components/Snoozed.vue new file mode 100644 index 0000000..62fcfc1 --- /dev/null +++ b/src/app/src/components/Snoozed.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/app/src/main.js b/src/app/src/main.js index 7ebab9d..a2131e8 100644 --- a/src/app/src/main.js +++ b/src/app/src/main.js @@ -17,6 +17,7 @@ import 'vue-awesome/icons/file-text-o' import 'vue-awesome/icons/pencil' import 'vue-awesome/icons/plus' import 'vue-awesome/icons/search' +import 'vue-awesome/icons/times' import App from './App' import router from './router' diff --git a/src/app/src/router/index.js b/src/app/src/router/index.js index b4f66d7..1e75a2f 100644 --- a/src/app/src/router/index.js +++ b/src/app/src/router/index.js @@ -7,6 +7,7 @@ import Home from '@/components/Home' import Journal from '@/components/Journal' import LogOn from '@/components/user/LogOn' import PrivacyPolicy from '@/components/legal/PrivacyPolicy' +import Snoozed from '@/components/Snoozed' import TermsOfService from '@/components/legal/TermsOfService' Vue.use(Router) @@ -45,6 +46,11 @@ export default new Router({ name: 'TermsOfService', component: TermsOfService }, + { + path: '/snoozed', + name: 'Snoozed', + component: Snoozed + }, { path: '/user/log-on', name: 'LogOn', diff --git a/src/app/src/store/index.js b/src/app/src/store/index.js index 8eb0753..4f8c939 100644 --- a/src/app/src/store/index.js +++ b/src/app/src/store/index.js @@ -116,6 +116,7 @@ export default new Vuex.Store({ await api.snoozeRequest(requestId, until) const request = await api.getRequest(requestId) commit(mutations.REQUEST_UPDATED, request.data) + progress.finish() } catch (err) { logError(err) progress.fail()