First cut of answered requests
- changed import to only bring in church rather than the entire lodash package - changed webpack config to exclude moment's locale - set the bearer token on load if the user is authenticated
This commit is contained in:
@@ -1,18 +1,30 @@
|
||||
<template lang="pug">
|
||||
article
|
||||
page-title(title='Answered Requests')
|
||||
p(v-if='!loaded') Loading answered requests...
|
||||
div(v-if='loaded')
|
||||
p(v-for='req in requests')
|
||||
b-btn(@click='showFull(req.requestId)' size='sm' variant='outline-secondary')
|
||||
icon(name='search')
|
||||
| View Full Request
|
||||
| {{ req.text }}
|
||||
full-request(:events='eventBus')
|
||||
</template>
|
||||
|
||||
<script>
|
||||
'use static'
|
||||
|
||||
import Vue from 'vue'
|
||||
|
||||
import FullRequest from './request/FullRequest'
|
||||
|
||||
import api from '@/api'
|
||||
|
||||
export default {
|
||||
name: 'answered',
|
||||
data () {
|
||||
return {
|
||||
eventBus: new Vue(),
|
||||
requests: [],
|
||||
loaded: false
|
||||
}
|
||||
@@ -25,14 +37,24 @@ export default {
|
||||
this.$Progress.finish()
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
this.$message({
|
||||
message: 'Error loading requests; check console for details',
|
||||
type: 'error'
|
||||
})
|
||||
this.toast.showToast('Error loading requests; check console for details', { theme: 'danger' })
|
||||
this.$Progress.fail()
|
||||
} finally {
|
||||
this.loaded = true
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
FullRequest
|
||||
},
|
||||
computed: {
|
||||
toast () {
|
||||
return this.$parent.$refs.toast
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showFull (requestId) {
|
||||
this.eventBus.$emit('full', requestId)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -21,7 +21,7 @@ article
|
||||
|
||||
import Vue from 'vue'
|
||||
import { mapState } from 'vuex'
|
||||
import _ from 'lodash'
|
||||
import chunk from 'lodash/chunk'
|
||||
|
||||
import EditRequest from './request/EditRequest'
|
||||
import FullRequest from './request/FullRequest'
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
return `${this.user.given_name}'s Prayer Journal`
|
||||
},
|
||||
journalCardRows () {
|
||||
return _.chunk(this.journal, 3)
|
||||
return chunk(this.journal, 3)
|
||||
},
|
||||
toast () {
|
||||
return this.$parent.$refs.toast
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template lang="pug">
|
||||
b-navbar(toggleable='sm' type='dark' variant='info' fixed='top')
|
||||
b-navbar(toggleable='sm' type='dark' variant='primary' fixed='top')
|
||||
b-nav-toggle(target='nav_collapse')
|
||||
b-navbar-brand(to='/')
|
||||
span(style='font-weight:100;') my
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template lang="pug">
|
||||
span
|
||||
b-btn(@click='openDialog()' title='Show History' size='sm' variant='outline-secondary'): icon(name='search')
|
||||
b-modal(title='Prayer Request History'
|
||||
v-model='historyVisible'
|
||||
size='lg'
|
||||
|
||||
Reference in New Issue
Block a user