mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
rename more board -> column
This commit is contained in:
@@ -15,13 +15,13 @@ type (
|
||||
)
|
||||
|
||||
const (
|
||||
// BoardViewTypeNone is a project board type that has no predefined columns
|
||||
// BoardViewTypeNone is a project board view type that has no predefined columns
|
||||
BoardViewTypeNone BoardViewType = iota
|
||||
|
||||
// BoardViewTypeBasicKanban is a project board type that has basic predefined columns
|
||||
// BoardViewTypeBasicKanban is a project board view type that has basic predefined columns
|
||||
BoardViewTypeBasicKanban
|
||||
|
||||
// BoardViewTypeBugTriage is a project board type that has predefined columns suited to hunting down bugs
|
||||
// BoardViewTypeBugTriage is a project board view type that has predefined columns suited to hunting down bugs
|
||||
BoardViewTypeBugTriage
|
||||
)
|
||||
|
@@ -137,7 +137,7 @@ func NewColumn(ctx context.Context, column *Column) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteColumnByID removes all issues references to the project board.
|
||||
// DeleteColumnByID removes all issues references to the project column.
|
||||
func DeleteColumnByID(ctx context.Context, columnID int64) error {
|
||||
return db.WithTx(ctx, func(ctx context.Context) error {
|
||||
return deleteColumnByID(ctx, columnID)
|
||||
@@ -155,7 +155,7 @@ func deleteColumnByID(ctx context.Context, columnID int64) error {
|
||||
}
|
||||
|
||||
if column.Default {
|
||||
return fmt.Errorf("deleteBoardByID: cannot delete default board")
|
||||
return fmt.Errorf("deleteBoardByID: cannot delete default column")
|
||||
}
|
||||
|
||||
if err = column.removeIssues(ctx); err != nil {
|
||||
@@ -173,17 +173,17 @@ func deleteColumnByProjectID(ctx context.Context, projectID int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// GetColumn fetches the current board of a project
|
||||
// GetColumn fetches the current column of a project
|
||||
func GetColumn(ctx context.Context, columnID int64) (*Column, error) {
|
||||
board := new(Column)
|
||||
has, err := db.GetEngine(ctx).ID(columnID).Get(board)
|
||||
column := new(Column)
|
||||
has, err := db.GetEngine(ctx).ID(columnID).Get(column)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrProjectColumnNotExist{ColumnID: columnID}
|
||||
}
|
||||
|
||||
return board, nil
|
||||
return column, nil
|
||||
}
|
||||
|
||||
// UpdateColumn updates a project column
|
||||
|
@@ -76,7 +76,7 @@ func (p *Project) NumOpenIssues(ctx context.Context) int {
|
||||
}
|
||||
|
||||
// MoveIssuesOnProjectColumn moves or keeps issues in a column and sorts them inside that column
|
||||
func MoveIssuesOnProjectColumn(ctx context.Context, board *Column, sortedIssueIDs map[int64]int64) error {
|
||||
func MoveIssuesOnProjectColumn(ctx context.Context, column *Column, sortedIssueIDs map[int64]int64) error {
|
||||
return db.WithTx(ctx, func(ctx context.Context) error {
|
||||
sess := db.GetEngine(ctx)
|
||||
|
||||
@@ -84,7 +84,7 @@ func MoveIssuesOnProjectColumn(ctx context.Context, board *Column, sortedIssueID
|
||||
for _, issueID := range sortedIssueIDs {
|
||||
issueIDs = append(issueIDs, issueID)
|
||||
}
|
||||
count, err := sess.Table(new(ProjectIssue)).Where("project_id=?", board.ProjectID).In("issue_id", issueIDs).Count()
|
||||
count, err := sess.Table(new(ProjectIssue)).Where("project_id=?", column.ProjectID).In("issue_id", issueIDs).Count()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -93,7 +93,7 @@ func MoveIssuesOnProjectColumn(ctx context.Context, board *Column, sortedIssueID
|
||||
}
|
||||
|
||||
for sorting, issueID := range sortedIssueIDs {
|
||||
_, err = sess.Exec("UPDATE `project_issue` SET project_board_id=?, sorting=? WHERE issue_id=?", board.ID, sorting, issueID)
|
||||
_, err = sess.Exec("UPDATE `project_issue` SET project_board_id=?, sorting=? WHERE issue_id=?", column.ID, sorting, issueID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
// CardConfig is used to identify the type of board card that is being used
|
||||
// CardConfig is used to identify the type of column card that is being used
|
||||
CardConfig struct {
|
||||
CardType CardType
|
||||
Translation string
|
||||
@@ -32,7 +32,7 @@ type (
|
||||
)
|
||||
|
||||
const (
|
||||
// TypeIndividual is a type of project board that is owned by an individual
|
||||
// TypeIndividual is a type of project column that is owned by an individual
|
||||
TypeIndividual Type = iota + 1
|
||||
|
||||
// TypeRepository is a project that is tied to a repository
|
||||
@@ -62,12 +62,12 @@ func (err ErrProjectNotExist) Unwrap() error {
|
||||
return util.ErrNotExist
|
||||
}
|
||||
|
||||
// ErrProjectColumnNotExist represents a "ProjectBoardNotExist" kind of error.
|
||||
// ErrProjectColumnNotExist represents a "ErrProjectColumnNotExist" kind of error.
|
||||
type ErrProjectColumnNotExist struct {
|
||||
ColumnID int64
|
||||
}
|
||||
|
||||
// IsErrProjectColumnNotExist checks if an error is a ErrProjectBoardNotExist
|
||||
// IsErrProjectColumnNotExist checks if an error is a ErrProjectColumnNotExist
|
||||
func IsErrProjectColumnNotExist(err error) bool {
|
||||
_, ok := err.(ErrProjectColumnNotExist)
|
||||
return ok
|
||||
@@ -81,7 +81,7 @@ func (err ErrProjectColumnNotExist) Unwrap() error {
|
||||
return util.ErrNotExist
|
||||
}
|
||||
|
||||
// Project represents a project board
|
||||
// Project represents a project
|
||||
type Project struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Title string `xorm:"INDEX NOT NULL"`
|
||||
@@ -159,7 +159,7 @@ func init() {
|
||||
db.RegisterModel(new(Project))
|
||||
}
|
||||
|
||||
// GetCardConfig retrieves the types of configurations project board cards could have
|
||||
// GetCardConfig retrieves the types of configurations project column cards could have
|
||||
func GetCardConfig() []CardConfig {
|
||||
return []CardConfig{
|
||||
{CardTypeTextOnly, "repo.projects.card_type.text_only"},
|
||||
|
Reference in New Issue
Block a user