From b61ad9d46acca5f76be59e05e63411872a8956c2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 11 Apr 2026 23:41:10 +0200 Subject: [PATCH] feat(reminders): add allowAbsolute prop to ReminderDetail Adds an allowAbsolute prop to ReminderDetail that hides the 'Date and time' option when set to false, and a lockRelativeTo prop on ReminderPeriod that hides the relativeTo select and forces the chosen value. ReminderDetail threads them together so that when absolute reminders are disallowed, the Custom form can only produce reminders that anchor to defaultRelativeTo. --- .../components/tasks/partials/ReminderDetail.vue | 13 ++++++++++++- .../components/tasks/partials/ReminderPeriod.vue | 14 ++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/tasks/partials/ReminderDetail.vue b/frontend/src/components/tasks/partials/ReminderDetail.vue index f9202c637..22d583f34 100644 --- a/frontend/src/components/tasks/partials/ReminderDetail.vue +++ b/frontend/src/components/tasks/partials/ReminderDetail.vue @@ -36,6 +36,7 @@ {{ $t('task.reminder.custom') }} (), { modelValue: () => new TaskReminderModel() as ITaskReminder, clearAfterUpdate: false, defaultRelativeTo: REMINDER_PERIOD_RELATIVE_TO_TYPES.DUEDATE, + allowAbsolute: true, }) const emit = defineEmits<{ @@ -118,13 +122,20 @@ const reminderDate = ref(null) const showFormSwitch = ref(null) const activeForm = computed(() => { - if (props.defaultRelativeTo === null) { + if (props.defaultRelativeTo === null && props.allowAbsolute) { return 'absolute' } return showFormSwitch.value }) +const lockedRelativeTo = computed(() => { + if (props.allowAbsolute) { + return null + } + return props.defaultRelativeTo +}) + const reminderText = computed(() => { if (reminder.value.relativeTo !== null) { return formatReminder(reminder.value) diff --git a/frontend/src/components/tasks/partials/ReminderPeriod.vue b/frontend/src/components/tasks/partials/ReminderPeriod.vue index 59d411acb..4048635d8 100644 --- a/frontend/src/components/tasks/partials/ReminderPeriod.vue +++ b/frontend/src/components/tasks/partials/ReminderPeriod.vue @@ -44,7 +44,10 @@ -
+