From d42535f36e0937154a55df01b26ba4e154ebccaa Mon Sep 17 00:00:00 2001 From: poignatov Date: Sun, 15 Mar 2026 17:41:46 +0300 Subject: [PATCH] =?UTF-8?q?6.17.0:=20=D0=A1=D1=87=D1=91=D1=82=D1=87=D0=B8?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=D0=B4=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=20?= =?UTF-8?q?=D1=81=20=D1=83=D1=87=D1=91=D1=82=D0=BE=D0=BC=20=D0=B4=D1=80?= =?UTF-8?q?=D0=B0=D1=84=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- play-life-backend/main.go | 10 +++++++++- play-life-web/package.json | 2 +- play-life-web/src/components/TaskForm.jsx | 2 +- play-life-web/src/components/TaskList.jsx | 6 +++++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 62d3df0..1980a78 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.16.5 +6.17.0 diff --git a/play-life-backend/main.go b/play-life-backend/main.go index 672d7fb..6eab73f 100644 --- a/play-life-backend/main.go +++ b/play-life-backend/main.go @@ -353,6 +353,7 @@ type Task struct { HasProgression bool `json:"has_progression"` AutoComplete bool `json:"auto_complete"` DraftProgressionValue *float64 `json:"draft_progression_value,omitempty"` + DraftSubtasksCount *int `json:"draft_subtasks_count,omitempty"` } type Reward struct { @@ -8492,7 +8493,8 @@ func (a *App) fetchTasksForUser(userID int) ([]Task, error) { ARRAY[]::text[] ) as subtask_project_names, COALESCE(td.auto_complete, FALSE) as auto_complete, - td.progression_value as draft_progression_value + td.progression_value as draft_progression_value, + CASE WHEN td.id IS NOT NULL THEN (SELECT COUNT(*) FROM task_draft_subtasks tds WHERE tds.task_draft_id = td.id) ELSE NULL END as draft_subtasks_count FROM tasks t LEFT JOIN task_drafts td ON td.task_id = t.id AND td.user_id = $1 WHERE t.user_id = $1 AND t.parent_task_id IS NULL AND t.deleted = FALSE @@ -8533,6 +8535,7 @@ func (a *App) fetchTasksForUser(userID int) ([]Task, error) { var subtaskProjectNames pq.StringArray var autoComplete bool var draftProgressionValue sql.NullFloat64 + var draftSubtasksCount sql.NullInt64 err := rows.Scan( &task.ID, @@ -8553,6 +8556,7 @@ func (a *App) fetchTasksForUser(userID int) ([]Task, error) { &subtaskProjectNames, &autoComplete, &draftProgressionValue, + &draftSubtasksCount, ) if err != nil { log.Printf("Error scanning task: %v", err) @@ -8600,6 +8604,10 @@ func (a *App) fetchTasksForUser(userID int) ([]Task, error) { if draftProgressionValue.Valid { task.DraftProgressionValue = &draftProgressionValue.Float64 } + if draftSubtasksCount.Valid { + count := int(draftSubtasksCount.Int64) + task.DraftSubtasksCount = &count + } // Объединяем проекты из основной задачи и подзадач allProjects := make(map[string]bool) diff --git a/play-life-web/package.json b/play-life-web/package.json index 155188b..5e2f552 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "6.16.5", + "version": "6.17.0", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/TaskForm.jsx b/play-life-web/src/components/TaskForm.jsx index ef6ff87..11bcd25 100644 --- a/play-life-web/src/components/TaskForm.jsx +++ b/play-life-web/src/components/TaskForm.jsx @@ -391,7 +391,7 @@ function TaskForm({ onNavigate, taskId, wishlistId, returnTo, returnWishlistId } if (data.task.reward_policy) { setRewardPolicy(data.task.reward_policy) } else { - setRewardPolicy('personal') // Значение по умолчанию + setRewardPolicy('general') // Значение по умолчанию } } else { setCurrentWishlistId(null) diff --git a/play-life-web/src/components/TaskList.jsx b/play-life-web/src/components/TaskList.jsx index 0a86b4a..909b338 100644 --- a/play-life-web/src/components/TaskList.jsx +++ b/play-life-web/src/components/TaskList.jsx @@ -924,7 +924,11 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
{task.name} {hasSubtasks && ( - (+{task.subtasks_count}) + + {task.draft_subtasks_count != null + ? `(${task.draft_subtasks_count}/${task.subtasks_count})` + : `(${task.subtasks_count})`} + )} {!isOneTime && !isInfinite && !isWishlist && (