6.9.0: Задачи-закупки
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,17 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
return
|
||||
}
|
||||
|
||||
// Для задач-закупок открываем экран закупок
|
||||
const isPurchase = task.purchase_config_id != null
|
||||
if (isPurchase) {
|
||||
onNavigate?.('purchase', {
|
||||
purchaseConfigId: task.purchase_config_id,
|
||||
taskId: task.id,
|
||||
taskName: task.name
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Для обычных задач открываем диалог подтверждения
|
||||
setSelectedTaskForDetail(task.id)
|
||||
}
|
||||
@@ -408,7 +419,19 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
}
|
||||
|
||||
defaultDate.setHours(0, 0, 0, 0)
|
||||
setPostponeDate(formatDateToLocal(defaultDate))
|
||||
const plannedStr = formatDateToLocal(defaultDate)
|
||||
// Предвыбираем дату только если она не совпадает с текущей next_show_at (т.е. если чипс "По плану" будет показан)
|
||||
let nextShowStr = null
|
||||
if (task.next_show_at) {
|
||||
const d = new Date(task.next_show_at)
|
||||
d.setHours(0, 0, 0, 0)
|
||||
nextShowStr = formatDateToLocal(d)
|
||||
}
|
||||
if (plannedStr !== nextShowStr) {
|
||||
setPostponeDate(plannedStr)
|
||||
} else {
|
||||
setPostponeDate('')
|
||||
}
|
||||
}
|
||||
|
||||
const handlePostponeSubmit = async () => {
|
||||
@@ -791,7 +814,8 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
const hasProgression = task.has_progression || task.progression_base != null
|
||||
const hasSubtasks = task.subtasks_count > 0
|
||||
const isTest = task.config_id != null
|
||||
const showDetailOnCheckmark = !isTest
|
||||
const isPurchase = task.purchase_config_id != null
|
||||
const showDetailOnCheckmark = !isTest && !isPurchase
|
||||
const isWishlist = task.wishlist_id != null
|
||||
|
||||
// Проверяем бесконечную задачу: repetition_period = 0 И (repetition_date = 0 ИЛИ отсутствует)
|
||||
@@ -816,7 +840,7 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
<div
|
||||
className={`task-checkmark ${showDetailOnCheckmark ? 'task-checkmark-detail' : ''} ${task.auto_complete ? 'task-checkmark-auto-complete' : ''}`}
|
||||
onClick={(e) => handleCheckmarkClick(task, e)}
|
||||
title={isTest ? 'Запустить тест' : (showDetailOnCheckmark ? 'Открыть детали' : 'Выполнить задачу')}
|
||||
title={isTest ? 'Запустить тест' : (isPurchase ? 'Открыть закупки' : (showDetailOnCheckmark ? 'Открыть детали' : 'Выполнить задачу'))}
|
||||
>
|
||||
{isTest ? (
|
||||
<svg
|
||||
@@ -832,6 +856,20 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
|
||||
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
|
||||
</svg>
|
||||
) : isPurchase ? (
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M2 7h20l-2 13a2 2 0 0 1-2 1.5H6a2 2 0 0 1-2-1.5L2 7z"></path>
|
||||
<path d="M9 7V6a3 3 0 0 1 6 0v1"></path>
|
||||
</svg>
|
||||
) : isWishlist ? (
|
||||
<>
|
||||
<svg
|
||||
|
||||
Reference in New Issue
Block a user