From 90ced65fc5362737d58d75572d410c753b2bfe7c Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Sat, 27 Jun 2026 10:33:14 -0700 Subject: [PATCH] refactor: move include_subprojects to task collection filter --- .../tasks/partials/SingleTaskInProject.vue | 12 +++--- pkg/migration/20260302140100.go | 43 ------------------- pkg/models/project_view.go | 2 - pkg/models/task_collection.go | 2 +- 4 files changed, 7 insertions(+), 52 deletions(-) delete mode 100644 pkg/migration/20260302140100.go diff --git a/frontend/src/components/tasks/partials/SingleTaskInProject.vue b/frontend/src/components/tasks/partials/SingleTaskInProject.vue index b45426c57..a38625f9f 100644 --- a/frontend/src/components/tasks/partials/SingleTaskInProject.vue +++ b/frontend/src/components/tasks/partials/SingleTaskInProject.vue @@ -153,13 +153,13 @@ /> - {{ project.title }} + {{ project.title }} . - -package migration - -import ( - "src.techknowlogick.com/xormigrate" - "xorm.io/xorm" -) - -type projectViews20260302140100 struct { - IncludeSubprojects bool `xorm:"default false not null" json:"include_subprojects"` -} - -func (projectViews20260302140100) TableName() string { - return "project_views" -} - -func init() { - migrations = append(migrations, &xormigrate.Migration{ - ID: "20260302140100", - Description: "Add include_subprojects to project views", - Migrate: func(tx *xorm.Engine) error { - return tx.Sync(projectViews20260302140100{}) - }, - Rollback: func(tx *xorm.Engine) error { - return nil - }, - }) -} diff --git a/pkg/models/project_view.go b/pkg/models/project_view.go index dbb795f03..87874fd06 100644 --- a/pkg/models/project_view.go +++ b/pkg/models/project_view.go @@ -163,8 +163,6 @@ type ProjectView struct { Filter *TaskCollection `xorm:"json null default null" query:"filter" json:"filter" doc:"The filter query used to match tasks shown in this view. See https://vikunja.io/docs/filters."` // The position of this view in the list. The list of all views will be sorted by this position. Position float64 `xorm:"double null" json:"position" doc:"The position of this view in the list. The list of all views will be sorted by this position."` - // If enabled, this view also includes tasks from all descendant subprojects. - IncludeSubprojects bool `xorm:"default false not null" json:"include_subprojects"` // The bucket configuration mode. Can be `none`, `manual` or `filter`. `manual` allows to move tasks between buckets as you normally would. `filter` creates buckets based on a filter for each bucket. BucketConfigurationMode BucketConfigurationModeKind `xorm:"default 0" json:"bucket_configuration_mode" swaggertype:"string" enums:"none,manual,filter" doc:"The bucket configuration mode. One of none, manual or filter. manual lets you move tasks between buckets; filter creates a bucket per filter."` diff --git a/pkg/models/task_collection.go b/pkg/models/task_collection.go index 37b22288c..f01aea79f 100644 --- a/pkg/models/task_collection.go +++ b/pkg/models/task_collection.go @@ -32,7 +32,7 @@ type TaskCollection struct { ProjectID int64 `param:"project" json:"-"` ProjectViewID int64 `param:"view" json:"-"` // If set to true, tasks from all descendant subprojects will also be returned. - IncludeSubprojects bool `query:"include_subprojects" json:"-"` + IncludeSubprojects bool `json:"include_subprojects" query:"include_subprojects"` Search string `query:"s" json:"s" doc:"A search term to match tasks by their title."`