feat: campo "hasta" opcional en Tareas recurrentes
Vacio = se repite sin fin (comportamiento previo). Al completar un ciclo cuyo proximo vencimiento supera "hasta", la tarea se desactiva sola. Probado en dev con curl (3 ciclos seguidos, se desactiva justo al superar la fecha) y validacion de que "hasta" no puede ser anterior al proximo vencimiento. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,7 +84,7 @@ export default function ActivityDetailPanel({ activity, projectId, siblingActivi
|
||||
setPromoting(task);
|
||||
setPromoteForm({
|
||||
name: task.name, responsibleUserId: task.responsible_user_id || '',
|
||||
intervalUnit: 'months', intervalValue: 1, nextDueDate: task.due_date || '',
|
||||
intervalUnit: 'months', intervalValue: 1, nextDueDate: task.due_date || '', endDate: '',
|
||||
reminderDaysBefore: 7, reminderHour: 9,
|
||||
});
|
||||
}
|
||||
@@ -93,7 +93,7 @@ export default function ActivityDetailPanel({ activity, projectId, siblingActivi
|
||||
if (!promoteForm.nextDueDate) return;
|
||||
await runAction(async () => {
|
||||
await promoteTaskToRecurring(promoting.id, {
|
||||
...promoteForm, responsibleUserId: promoteForm.responsibleUserId || null,
|
||||
...promoteForm, responsibleUserId: promoteForm.responsibleUserId || null, endDate: promoteForm.endDate || null,
|
||||
});
|
||||
setPromoting(null);
|
||||
pushToast({ tone: 'success', message: t('common_saved') });
|
||||
@@ -253,7 +253,7 @@ export default function ActivityDetailPanel({ activity, projectId, siblingActivi
|
||||
title={t('recurring_task_promote_title')}
|
||||
onClose={() => setPromoting(null)}
|
||||
width={560}
|
||||
height={520}
|
||||
height={600}
|
||||
>
|
||||
{promoteForm && (
|
||||
<>
|
||||
@@ -269,6 +269,11 @@ export default function ActivityDetailPanel({ activity, projectId, siblingActivi
|
||||
<input className="input" type="date" value={promoteForm.nextDueDate} onChange={(e) => setPromoteForm((f) => ({ ...f, nextDueDate: e.target.value }))} />
|
||||
</Field>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<Field label={t('recurring_task_end_date')} hint={t('recurring_task_unlimited_hint')}>
|
||||
<input className="input" type="date" value={promoteForm.endDate} onChange={(e) => setPromoteForm((f) => ({ ...f, endDate: e.target.value }))} />
|
||||
</Field>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<Field label={t('recurring_task_every')}>
|
||||
<input className="input" type="number" min={1} value={promoteForm.intervalValue} onChange={(e) => setPromoteForm((f) => ({ ...f, intervalValue: Number(e.target.value) }))} />
|
||||
|
||||
Reference in New Issue
Block a user