App changes: * Move to Vue Material for UI components * Convert request cards to true material design cards, separating the "pray" button from the others and improved highlighting of the current request * Centralize Auth0 integration in one place; modify the Vuex store to rely on it entirely, and add a Vue mixin to make it accessible by any component API changes: * Change backing data store to RavenDB * Evolve domain models (using F# discriminated unions, and JSON converters for storage) to make invalid states unrepresentable * Incorporate the FunctionalCuid library * Create a functional pipeline for app configuration instead of chaining `IWebHostBuilder` calls Bug fixes: * Set showAfter to 0 for immediately recurring requests (#26)
70 lines
1.6 KiB
Vue
70 lines
1.6 KiB
Vue
<template lang="pug">
|
|
md-dialog(:md-active.sync='snoozeVisible').mpj-skinny
|
|
md-dialog-title Snooze Prayer Request
|
|
md-content.mpj-dialog-content
|
|
span.mpj-text-muted Until
|
|
md-datepicker(v-model='form.snoozedUntil'
|
|
:md-disabled-dates='datesInPast'
|
|
md-immediately)
|
|
md-dialog-actions
|
|
md-button(:disabled='!isValid'
|
|
@click='snoozeRequest()').md-primary #[md-icon snooze] Snooze
|
|
md-button(@click='closeDialog()') #[md-icon undo] Cancel
|
|
</template>
|
|
|
|
<script>
|
|
'use strict'
|
|
|
|
import actions from '@/store/action-types'
|
|
|
|
export default {
|
|
name: 'snooze-request',
|
|
inject: [
|
|
'journalEvents',
|
|
'messages',
|
|
'progress'
|
|
],
|
|
props: {
|
|
events: { required: true }
|
|
},
|
|
data () {
|
|
return {
|
|
snoozeVisible: false,
|
|
datesInPast: date => date < new Date(),
|
|
form: {
|
|
requestId: '',
|
|
snoozedUntil: ''
|
|
}
|
|
}
|
|
},
|
|
created () {
|
|
this.journalEvents.$on('snooze', this.openDialog)
|
|
},
|
|
computed: {
|
|
isValid () {
|
|
return !isNaN(Date.parse(this.form.snoozedUntil))
|
|
}
|
|
},
|
|
methods: {
|
|
closeDialog () {
|
|
this.form.requestId = ''
|
|
this.form.snoozedUntil = ''
|
|
this.snoozeVisible = false
|
|
},
|
|
openDialog (requestId) {
|
|
this.form.requestId = requestId
|
|
this.snoozeVisible = true
|
|
},
|
|
async snoozeRequest () {
|
|
await this.$store.dispatch(actions.SNOOZE_REQUEST, {
|
|
progress: this.progress,
|
|
requestId: this.form.requestId,
|
|
until: Date.parse(this.form.snoozedUntil)
|
|
})
|
|
this.messages.$emit('info', `Request snoozed until ${this.form.snoozedUntil}`)
|
|
this.closeDialog()
|
|
}
|
|
}
|
|
}
|
|
</script>
|