5.10.0: Капсула прогрессии в списке задач
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m21s

This commit is contained in:
poignatov
2026-03-04 12:24:34 +03:00
parent 91d4a7337c
commit 81dc23b501
6 changed files with 114 additions and 24 deletions

View File

@@ -338,11 +338,12 @@ type Task struct {
RewardPolicy *string `json:"reward_policy,omitempty"` // "personal" или "general" для задач, связанных с желаниями
Position *int `json:"position,omitempty"` // Position for subtasks
// Дополнительные поля для списка задач (без omitempty чтобы всегда передавались)
ProjectNames []string `json:"project_names"`
GroupName *string `json:"group_name,omitempty"` // Название группы задачи
SubtasksCount int `json:"subtasks_count"`
HasProgression bool `json:"has_progression"`
AutoComplete bool `json:"auto_complete"`
ProjectNames []string `json:"project_names"`
GroupName *string `json:"group_name,omitempty"` // Название группы задачи
SubtasksCount int `json:"subtasks_count"`
HasProgression bool `json:"has_progression"`
AutoComplete bool `json:"auto_complete"`
DraftProgressionValue *float64 `json:"draft_progression_value,omitempty"`
}
type Reward struct {
@@ -7765,7 +7766,8 @@ func (a *App) getTasksHandler(w http.ResponseWriter, r *http.Request) {
WHERE st.parent_task_id = t.id AND st.deleted = FALSE),
ARRAY[]::text[]
) as subtask_project_names,
COALESCE(td.auto_complete, FALSE) as auto_complete
COALESCE(td.auto_complete, FALSE) as auto_complete,
td.progression_value as draft_progression_value
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
@@ -7805,6 +7807,7 @@ func (a *App) getTasksHandler(w http.ResponseWriter, r *http.Request) {
var projectNames pq.StringArray
var subtaskProjectNames pq.StringArray
var autoComplete bool
var draftProgressionValue sql.NullFloat64
err := rows.Scan(
&task.ID,
@@ -7823,6 +7826,7 @@ func (a *App) getTasksHandler(w http.ResponseWriter, r *http.Request) {
&projectNames,
&subtaskProjectNames,
&autoComplete,
&draftProgressionValue,
)
if err != nil {
log.Printf("Error scanning task: %v", err)
@@ -7863,6 +7867,9 @@ func (a *App) getTasksHandler(w http.ResponseWriter, r *http.Request) {
task.GroupName = &groupNameVal
}
task.AutoComplete = autoComplete
if draftProgressionValue.Valid {
task.DraftProgressionValue = &draftProgressionValue.Float64
}
// Объединяем проекты из основной задачи и подзадач
allProjects := make(map[string]bool)