diff --git a/README.md b/README.md index e31780a..6e885fe 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ Journaling has a long history; it helps people remember what happened, and the a This is borne of out of a personal desire I 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. -It is still a work-in-progress (WIP). It will eventually be hosted at , and will be available for public use. +It is still a work-in-progress (WIP), but is available for public preview at . diff --git a/src/api/src/db/request.js b/src/api/src/db/request.js index 7e810d5..6a4406f 100644 --- a/src/api/src/db/request.js +++ b/src/api/src/db/request.js @@ -68,6 +68,17 @@ export default function (pool) { }) }, + /** + * Get all answered requests with their text as of the "Answered" status + * @param {string} userId The Id of the user for whom requests should be retrieved + * @return All requests + */ + answered: async (userId) => + (await pool.query(`${currentRequestSql} + WHERE "userId" = $1 + AND "lastStatus" = 'Answered' + ORDER BY "asOf" DESC`)).rows, + /** * Get the "current" version of a request by its Id * @param {string} requestId The Id of the request to retrieve diff --git a/src/api/src/routes/request.js b/src/api/src/routes/request.js index bc9199e..8682ee6 100644 --- a/src/api/src/routes/request.js +++ b/src/api/src/routes/request.js @@ -45,7 +45,10 @@ export default function (checkJwt) { ctx.body = await db.request.oldest(ctx.state.user.sub) await next() }) - + .get('/answered', checkJwt, async (ctx, next) => { + ctx.body = await db.request.answered(ctx.state.user.sub) + await next() + }) return router } diff --git a/src/app/package.json b/src/app/package.json index db6ade4..a7e3d79 100644 --- a/src/app/package.json +++ b/src/app/package.json @@ -16,12 +16,14 @@ "dependencies": { "auth0-js": "^8.10.1", "axios": "^0.16.2", - "element-ui": "^1.4.4", + "bootstrap-vue": "^1.0.0-beta.9", "moment": "^2.18.1", "pug": "^2.0.0-rc.4", "vue": "^2.4.4", + "vue-awesome": "^2.3.3", "vue-progressbar": "^0.7.3", "vue-router": "^2.6.0", + "vue-toast": "^3.1.0", "vuex": "^2.4.0" }, "devDependencies": { diff --git a/src/app/src/App.vue b/src/app/src/App.vue index 1063316..48f2f9f 100644 --- a/src/app/src/App.vue +++ b/src/app/src/App.vue @@ -22,42 +22,17 @@ export default { diff --git a/src/app/src/components/common/DateFromNow.vue b/src/app/src/components/common/DateFromNow.vue index aaf5907..9b4b172 100644 --- a/src/app/src/components/common/DateFromNow.vue +++ b/src/app/src/components/common/DateFromNow.vue @@ -20,8 +20,11 @@ export default { } }, data () { + const dt = moment(this.value) return { - fromNow: moment(this.value).fromNow(), + dt, + fromNow: dt.fromNow(), + actual: dt.format('LLLL'), intervalId: null } }, @@ -34,12 +37,17 @@ export default { }, methods: { updateFromNow () { - let newFromNow = moment(this.value).fromNow() + let newFromNow = this.dt.fromNow() if (newFromNow !== this.fromNow) this.fromNow = newFromNow } }, render (createElement) { - return createElement(this.tag, this.fromNow) + return createElement(this.tag, { + domProps: { + title: this.actual, + innerText: this.fromNow + } + }) } } diff --git a/src/app/src/components/request/EditRequest.vue b/src/app/src/components/request/EditRequest.vue index b0f6533..530ac6c 100644 --- a/src/app/src/components/request/EditRequest.vue +++ b/src/app/src/components/request/EditRequest.vue @@ -1,18 +1,25 @@ - - diff --git a/src/app/src/components/user/LogOn.vue b/src/app/src/components/user/LogOn.vue index eea3b21..62fd1f3 100644 --- a/src/app/src/components/user/LogOn.vue +++ b/src/app/src/components/user/LogOn.vue @@ -7,14 +7,10 @@ article