1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 13:37:20 +00:00
Files
gitea/models/project/board_view.go
2024-03-30 10:46:18 +08:00

46 lines
1.3 KiB
Go

// Copyright 2024 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package project
type (
// BoardViewType is used to represent a project column type
BoardViewType uint8
// BoardConfig is used to identify the type of board that is being created
BoardConfig struct {
BoardType BoardViewType
Translation string
}
)
const (
// BoardViewTypeNone is a project board view type that has no predefined columns
BoardViewTypeNone BoardViewType = iota
// BoardViewTypeBasicKanban is a project board view type that has basic predefined columns
BoardViewTypeBasicKanban
// BoardViewTypeBugTriage is a project board view type that has predefined columns suited to hunting down bugs
BoardViewTypeBugTriage
)
// GetBoardViewConfig retrieves the types of configurations project boards could have
func GetBoardViewConfig() []BoardConfig {
return []BoardConfig{
{BoardViewTypeNone, "repo.projects.type.none"},
{BoardViewTypeBasicKanban, "repo.projects.type.basic_kanban"},
{BoardViewTypeBugTriage, "repo.projects.type.bug_triage"},
}
}
// IsBoardViewTypeValid checks if the project board type is valid
func IsBoardViewTypeValid(p BoardViewType) bool {
switch p {
case BoardViewTypeNone, BoardViewTypeBasicKanban, BoardViewTypeBugTriage:
return true
default:
return false
}
}