feat(views): add bucket configuration mode
This commit is contained in:
parent
38457aaca5
commit
a9020e976d
@ -22,6 +22,11 @@ import (
|
|||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type projectViewBucketConfiguration20240313230538 struct {
|
||||||
|
Title string
|
||||||
|
Filter string
|
||||||
|
}
|
||||||
|
|
||||||
type projectView20240313230538 struct {
|
type projectView20240313230538 struct {
|
||||||
ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"view"`
|
ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"view"`
|
||||||
Title string `xorm:"varchar(255) not null" json:"title" valid:"runelength(1|250)"`
|
Title string `xorm:"varchar(255) not null" json:"title" valid:"runelength(1|250)"`
|
||||||
@ -29,6 +34,10 @@ type projectView20240313230538 struct {
|
|||||||
ViewKind int `xorm:"not null" json:"view_kind"`
|
ViewKind int `xorm:"not null" json:"view_kind"`
|
||||||
Filter string `xorm:"text null default null" query:"filter" json:"filter"`
|
Filter string `xorm:"text null default null" query:"filter" json:"filter"`
|
||||||
Position float64 `xorm:"double null" json:"position"`
|
Position float64 `xorm:"double null" json:"position"`
|
||||||
|
|
||||||
|
BucketConfigurationMode int `xorm:"default 0" json:"bucket_configuration_mode"`
|
||||||
|
BucketConfiguration []*projectViewBucketConfiguration20240313230538 `xorm:"json" json:"bucket_configuration"`
|
||||||
|
|
||||||
Updated time.Time `xorm:"updated not null" json:"updated"`
|
Updated time.Time `xorm:"updated not null" json:"updated"`
|
||||||
Created time.Time `xorm:"created not null" json:"created"`
|
Created time.Time `xorm:"created not null" json:"created"`
|
||||||
}
|
}
|
||||||
@ -77,6 +86,10 @@ func init() {
|
|||||||
Position: position,
|
Position: position,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if kind == 3 {
|
||||||
|
view.BucketConfigurationMode = 1
|
||||||
|
}
|
||||||
|
|
||||||
_, err := tx.Insert(view)
|
_, err := tx.Insert(view)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,19 @@ const (
|
|||||||
ProjectViewKindKanban
|
ProjectViewKindKanban
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type BucketConfigurationModeKind int
|
||||||
|
|
||||||
|
const (
|
||||||
|
BucketConfigurationModeNone BucketConfigurationModeKind = iota
|
||||||
|
BucketConfigurationModeManual
|
||||||
|
BucketConfigurationModeFilter
|
||||||
|
)
|
||||||
|
|
||||||
|
type ProjectViewBucketConfiguration struct {
|
||||||
|
Title string
|
||||||
|
Filter string
|
||||||
|
}
|
||||||
|
|
||||||
type ProjectView struct {
|
type ProjectView struct {
|
||||||
// The unique numeric id of this view
|
// The unique numeric id of this view
|
||||||
ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"view"`
|
ID int64 `xorm:"autoincr not null unique pk" json:"id" param:"view"`
|
||||||
@ -46,6 +59,11 @@ type ProjectView struct {
|
|||||||
// The position of this view in the list. The list of all views will be sorted by this parameter.
|
// The position of this view in the list. The list of all views will be sorted by this parameter.
|
||||||
Position float64 `xorm:"double null" json:"position"`
|
Position float64 `xorm:"double null" json:"position"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
|
// When the bucket configuration mode is not `manual`, this field holds the options of that configuration.
|
||||||
|
BucketConfiguration []*ProjectViewBucketConfiguration `xorm:"json" json:"bucket_configuration"`
|
||||||
|
|
||||||
// A timestamp when this view was updated. You cannot change this value.
|
// A timestamp when this view was updated. You cannot change this value.
|
||||||
Updated time.Time `xorm:"updated not null" json:"updated"`
|
Updated time.Time `xorm:"updated not null" json:"updated"`
|
||||||
// A timestamp when this reaction was created. You cannot change this value.
|
// A timestamp when this reaction was created. You cannot change this value.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user