From faf47efaca4c04fe526e4a3a7349b5136296f351 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 4 Dec 2025 18:19:40 +0200 Subject: [PATCH] Fix bump issues (#651) * Add event for defer * Fix recurrence form * fixup! Fix recurrence form * Refresh projects on banner change --- backend/models/task_event.js | 2 + backend/routes/tasks/utils/logging.js | 15 ++ .../components/Project/ProjectDetails.tsx | 14 ++ .../Task/TaskForm/TaskRecurrenceSection.tsx | 141 +++++++++++------- frontend/components/Task/TaskTimeline.tsx | 8 + frontend/entities/TaskEvent.ts | 1 + frontend/utils/taskEventService.ts | 1 + public/locales/ar/translation.json | 8 + public/locales/bg/translation.json | 8 + public/locales/da/translation.json | 8 + public/locales/de/translation.json | 8 + public/locales/el/translation.json | 8 + public/locales/en/translation.json | 2 + public/locales/es/translation.json | 8 + public/locales/fi/translation.json | 8 + public/locales/fr/translation.json | 8 + public/locales/id/translation.json | 8 + public/locales/it/translation.json | 8 + public/locales/jp/translation.json | 8 + public/locales/ko/translation.json | 8 + public/locales/nl/translation.json | 8 + public/locales/no/translation.json | 8 + public/locales/pl/translation.json | 8 + public/locales/pt/translation.json | 8 + public/locales/ro/translation.json | 8 + public/locales/ru/translation.json | 8 + public/locales/sl/translation.json | 8 + public/locales/sv/translation.json | 8 + public/locales/tr/translation.json | 8 + public/locales/ua/translation.json | 8 + public/locales/vi/translation.json | 8 + public/locales/zh/translation.json | 8 + 32 files changed, 326 insertions(+), 50 deletions(-) diff --git a/backend/models/task_event.js b/backend/models/task_event.js index 55c25d1..10b79db 100644 --- a/backend/models/task_event.js +++ b/backend/models/task_event.js @@ -35,6 +35,7 @@ module.exports = (sequelize) => { 'status_changed', 'priority_changed', 'due_date_changed', + 'defer_until_changed', 'project_changed', 'project_id_changed', 'name_changed', @@ -95,6 +96,7 @@ module.exports = (sequelize) => { 'status', 'priority', 'due_date', + 'defer_until', 'project_id', 'name', 'description', diff --git a/backend/routes/tasks/utils/logging.js b/backend/routes/tasks/utils/logging.js index e056355..3e724c8 100644 --- a/backend/routes/tasks/utils/logging.js +++ b/backend/routes/tasks/utils/logging.js @@ -10,6 +10,7 @@ function captureOldValues(task) { status: task.status, priority: task.priority, due_date: task.due_date, + defer_until: task.defer_until, project_id: task.project_id, note: task.note, today: task.today, @@ -70,6 +71,20 @@ async function logTaskChanges(task, oldValues, reqBody, tagsData, userId) { } } + if (reqBody.defer_until !== undefined) { + const oldDeferStr = oldValues.defer_until + ? oldValues.defer_until.toISOString() + : null; + const newDeferStr = reqBody.defer_until || null; + + if (oldDeferStr !== newDeferStr) { + changes.defer_until = { + oldValue: oldValues.defer_until, + newValue: reqBody.defer_until, + }; + } + } + if (Object.keys(changes).length > 0) { await logTaskUpdate(task.id, userId, changes, { source: 'web' }); } diff --git a/frontend/components/Project/ProjectDetails.tsx b/frontend/components/Project/ProjectDetails.tsx index e80a62d..699f735 100644 --- a/frontend/components/Project/ProjectDetails.tsx +++ b/frontend/components/Project/ProjectDetails.tsx @@ -456,6 +456,13 @@ const ProjectDetails: React.FC = () => { area: savedProject.area || prev?.area, Area: (savedProject as any).Area || (prev as any)?.Area, })); + + const currentProjects = projectsStore.projects; + const updatedProjects = currentProjects.map((p) => + p.id === savedProject.id ? savedProject : p + ); + projectsStore.setProjects(updatedProjects); + closeModal(); }; @@ -477,6 +484,13 @@ const ProjectDetails: React.FC = () => { Area: (updatedProject as any).Area || (prev as any)?.Area, })); + // Update the global projects store + const currentProjects = projectsStore.projects; + const updatedProjects = currentProjects.map((p) => + p.id === updatedProject.id ? { ...p, image_url: imageUrl } : p + ); + projectsStore.setProjects(updatedProjects); + showSuccessToast( t('success.bannerUpdated', 'Banner updated successfully!') ); diff --git a/frontend/components/Task/TaskForm/TaskRecurrenceSection.tsx b/frontend/components/Task/TaskForm/TaskRecurrenceSection.tsx index 8d10e45..03ddb03 100644 --- a/frontend/components/Task/TaskForm/TaskRecurrenceSection.tsx +++ b/frontend/components/Task/TaskForm/TaskRecurrenceSection.tsx @@ -190,22 +190,17 @@ const TaskRecurrenceSection: React.FC = ({ - - (customOnChange || onChange)( - 'recurrence_month_day', - e.target.value ? parseInt(e.target.value) : null - ) + + (customOnChange || onChange)('recurrence_month_day', value) } + min={1} + max={31} placeholder={t( 'recurrence.monthDayPlaceholder', - 'Leave empty for current day' + 'Select day of month' )} - className="block w-full border border-gray-300 dark:border-gray-900 rounded-md focus:outline-none shadow-sm px-2 py-2 text-sm bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100" disabled={isDisabled} /> @@ -419,7 +414,9 @@ const TaskRecurrenceSection: React.FC = ({ {/* Main recurrence settings in one row */} -
+