diff --git a/client/web/compose/src/components/Namespaces/Reminders/Edit.vue b/client/web/compose/src/components/Namespaces/Reminders/Edit.vue index 40ed968d7..9d4d4b320 100644 --- a/client/web/compose/src/components/Namespaces/Reminders/Edit.vue +++ b/client/web/compose/src/components/Namespaces/Reminders/Edit.vue @@ -20,7 +20,7 @@ ({}), }, - myID: { - type: String, - required: true, - }, - users: { type: Array, required: true, @@ -151,38 +146,11 @@ export default { // Do this, so we don't edit the original object reminder: undefined, - assignees: [{ userID: this.myID }], + assignees: [{ userID: this.$auth.user.userID }], } }, computed: { - title: { - get () { - return (this.reminder.payload || {}).title - }, - set (v) { - this.updPayload('title', v) - }, - }, - - notes: { - get () { - return (this.reminder.payload || {}).notes - }, - set (v) { - this.updPayload('notes', v) - }, - }, - - remindAt: { - get () { - return (this.reminder.payload || {}).remindAt || null - }, - set (v) { - this.updPayload('remindAt', v) - }, - }, - recordViewer () { const { params } = this.reminder.payload.link || {} return params ? { name: 'page.record', params } : undefined @@ -201,14 +169,6 @@ export default { }, methods: { - // Helper to handle undefined fields - updPayload (f, v) { - if (!this.reminder.payload) { - this.$set(this.reminder, 'payload', {}) - } - this.$set(this.reminder.payload, f, v) - }, - searchUsers: _.debounce(function (query) { this.processingUsers = true @@ -220,7 +180,7 @@ export default { }, 300), getUserLabel ({ userID, email, name, username }) { - if (userID === this.myID) { + if (userID === this.$auth.user.userID) { return this.$t('reminder.edit.assigneePlaceholder') } diff --git a/client/web/compose/src/components/Namespaces/Reminders/List.vue b/client/web/compose/src/components/Namespaces/Reminders/List.vue index 4273b4a63..f2a8c8f02 100644 --- a/client/web/compose/src/components/Namespaces/Reminders/List.vue +++ b/client/web/compose/src/components/Namespaces/Reminders/List.vue @@ -66,8 +66,7 @@ > @@ -78,13 +77,12 @@ export default { onSave (r) { const endpoint = r.reminderID && r.reminderID !== NoID ? 'reminderUpdate' : 'reminderCreate' - this.$SystemAPI[endpoint](r).then(r => { - this.edit = undefined - this.fetchReminders() + this.$SystemAPI[endpoint](r).then(() => { + return this.fetchReminders() + }).then(() => { + this.onCancel() this.$Reminder.prefetch() }) - - this.onCancel() }, onCancel () { @@ -104,8 +102,8 @@ export default { }) }, - fetchReminders () { - this.$SystemAPI.reminderList({ + async fetchReminders () { + return this.$SystemAPI.reminderList({ assignedTo: this.$auth.user.userID, limit: 0, }).then(({ set: reminders = [] }) => { diff --git a/lib/vue/src/components/input/CInputDateTime/index.vue b/lib/vue/src/components/input/CInputDateTime/index.vue index ee120db99..bb05a55ab 100644 --- a/lib/vue/src/components/input/CInputDateTime/index.vue +++ b/lib/vue/src/components/input/CInputDateTime/index.vue @@ -54,7 +54,7 @@ import { getDate, setDate, getTime, setTime } from './lib/index.ts' export default { props: { value: { - type: String, + type: [String, Date], required: false, }, @@ -137,7 +137,7 @@ export default { background-color: white; } -@media (min-width: 992px) { +@media (min-width: 992px) { .c-input-date-time { min-width: 250px; }