Documentation ¶
Index ¶
- Variables
- func ChangeProjectStatus(p *Project, isClosed bool) error
- func ChangeProjectStatusByRepoIDAndID(repoID, projectID int64, isClosed bool) error
- func CountProjects(ctx context.Context, opts SearchOptions) (int64, error)
- func DeleteBoardByID(boardID int64) error
- func DeleteProjectByID(ctx context.Context, id int64) error
- func DeleteProjectByRepoID(ctx context.Context, repoID int64) error
- func GetSearchOrderByBySortType(sortType string) db.SearchOrderBy
- func IsBoardTypeValid(p BoardType) bool
- func IsCardTypeValid(p CardType) bool
- func IsErrProjectBoardNotExist(err error) bool
- func IsErrProjectNotExist(err error) bool
- func IsTypeValid(p Type) bool
- func MoveIssuesOnProjectBoard(board *Board, sortedIssueIDs map[int64]int64) error
- func NewBoard(board *Board) error
- func NewProject(p *Project) error
- func SetDefaultBoard(projectID, boardID int64) error
- func UpdateBoard(ctx context.Context, board *Board) error
- func UpdateBoardSorting(bs BoardList) error
- func UpdateProject(ctx context.Context, p *Project) error
- type Board
- type BoardConfig
- type BoardList
- type BoardType
- type CardConfig
- type CardType
- type ErrProjectBoardNotExist
- type ErrProjectNotExist
- type Project
- func (p *Project) GetBoards(ctx context.Context) (BoardList, error)
- func (p *Project) IconName() string
- func (p *Project) IsOrganizationProject() bool
- func (p *Project) IsRepositoryProject() bool
- func (p *Project) Link() string
- func (p *Project) LoadOwner(ctx context.Context) (err error)
- func (p *Project) LoadRepo(ctx context.Context) (err error)
- func (p *Project) NumClosedIssues() int
- func (p *Project) NumIssues() int
- func (p *Project) NumOpenIssues() int
- type ProjectIssue
- type SearchOptions
- type Type
Constants ¶
This section is empty.
Variables ¶
var BoardColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
BoardColorPattern is a regexp witch can validate BoardColor
Functions ¶
func ChangeProjectStatus ¶
ChangeProjectStatus toggle a project between opened and closed
func ChangeProjectStatusByRepoIDAndID ¶
ChangeProjectStatusByRepoIDAndID toggles a project between opened and closed
func CountProjects ¶ added in v1.19.0
func CountProjects(ctx context.Context, opts SearchOptions) (int64, error)
CountProjects counts projects
func DeleteBoardByID ¶
DeleteBoardByID removes all issues references to the project board.
func DeleteProjectByID ¶
DeleteProjectByID deletes a project from a repository. if it's not in a database transaction, it will start a new database transaction
func DeleteProjectByRepoID ¶ added in v1.17.4
func GetSearchOrderByBySortType ¶ added in v1.20.0
func GetSearchOrderByBySortType(sortType string) db.SearchOrderBy
func IsBoardTypeValid ¶
IsBoardTypeValid checks if the project board type is valid
func IsCardTypeValid ¶ added in v1.19.0
IsCardTypeValid checks if the project board card type is valid
func IsErrProjectBoardNotExist ¶
IsErrProjectBoardNotExist checks if an error is a ErrProjectBoardNotExist
func IsErrProjectNotExist ¶
IsErrProjectNotExist checks if an error is a ErrProjectNotExist
func MoveIssuesOnProjectBoard ¶
MoveIssuesOnProjectBoard moves or keeps issues in a column and sorts them inside that column
func SetDefaultBoard ¶
SetDefaultBoard represents a board for issues not assigned to one if boardID is 0 unset default
func UpdateBoard ¶
UpdateBoard updates a project board
func UpdateBoardSorting ¶
UpdateBoardSorting update project board sorting
Types ¶
type Board ¶
type Board struct { ID int64 `xorm:"pk autoincr"` Title string Default bool `xorm:"NOT NULL DEFAULT false"` // issues not assigned to a specific board will be assigned to this board Sorting int8 `xorm:"NOT NULL DEFAULT 0"` Color string `xorm:"VARCHAR(7)"` ProjectID int64 `xorm:"INDEX NOT NULL"` CreatorID int64 `xorm:"NOT NULL"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` }
Board is used to represent boards on a project
type BoardConfig ¶ added in v1.19.0
BoardConfig is used to identify the type of board that is being created
func GetBoardConfig ¶ added in v1.19.0
func GetBoardConfig() []BoardConfig
GetBoardConfig retrieves the types of configurations project boards could have
type BoardType ¶
type BoardType uint8
BoardType is used to represent a project board type
const ( // BoardTypeNone is a project board type that has no predefined columns BoardTypeNone BoardType = iota // BoardTypeBasicKanban is a project board type that has basic predefined columns BoardTypeBasicKanban // BoardTypeBugTriage is a project board type that has predefined columns suited to hunting down bugs BoardTypeBugTriage )
type CardConfig ¶ added in v1.19.0
CardConfig is used to identify the type of board card that is being used
func GetCardConfig ¶ added in v1.19.0
func GetCardConfig() []CardConfig
GetCardConfig retrieves the types of configurations project board cards could have
type CardType ¶ added in v1.19.0
type CardType uint8
CardType is used to represent a project board card type
type ErrProjectBoardNotExist ¶
type ErrProjectBoardNotExist struct {
BoardID int64
}
ErrProjectBoardNotExist represents a "ProjectBoardNotExist" kind of error.
func (ErrProjectBoardNotExist) Error ¶
func (err ErrProjectBoardNotExist) Error() string
func (ErrProjectBoardNotExist) Unwrap ¶ added in v1.17.4
func (err ErrProjectBoardNotExist) Unwrap() error
type ErrProjectNotExist ¶
ErrProjectNotExist represents a "ProjectNotExist" kind of error.
func (ErrProjectNotExist) Error ¶
func (err ErrProjectNotExist) Error() string
func (ErrProjectNotExist) Unwrap ¶ added in v1.17.4
func (err ErrProjectNotExist) Unwrap() error
type Project ¶
type Project struct { ID int64 `xorm:"pk autoincr"` Title string `xorm:"INDEX NOT NULL"` Description string `xorm:"TEXT"` OwnerID int64 `xorm:"INDEX"` Owner *user_model.User `xorm:"-"` RepoID int64 `xorm:"INDEX"` Repo *repo_model.Repository `xorm:"-"` CreatorID int64 `xorm:"NOT NULL"` IsClosed bool `xorm:"INDEX"` BoardType BoardType CardType CardType Type Type RenderedContent string `xorm:"-"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` ClosedDateUnix timeutil.TimeStamp }
Project represents a project board
func FindProjects ¶ added in v1.19.0
FindProjects returns a list of all projects that have been created in the repository
func GetProjectByID ¶
GetProjectByID returns the projects in a repository
func (*Project) GetBoards ¶ added in v1.20.0
GetBoards fetches all boards related to a project if no default board set, first board is a temporary "Uncategorized" board
func (*Project) IsOrganizationProject ¶ added in v1.19.0
func (*Project) IsRepositoryProject ¶ added in v1.20.0
func (*Project) NumClosedIssues ¶
NumClosedIssues return counter of closed issues assigned to a project
func (*Project) NumOpenIssues ¶
NumOpenIssues return counter of open issues assigned to a project
type ProjectIssue ¶
type ProjectIssue struct { ID int64 `xorm:"pk autoincr"` IssueID int64 `xorm:"INDEX"` ProjectID int64 `xorm:"INDEX"` // If 0, then it has not been added to a specific board in the project ProjectBoardID int64 `xorm:"INDEX"` // the sorting order on the board Sorting int64 `xorm:"NOT NULL DEFAULT 0"` }
ProjectIssue saves relation from issue to a project
type SearchOptions ¶
type SearchOptions struct { OwnerID int64 RepoID int64 Page int IsClosed util.OptionalBool OrderBy db.SearchOrderBy Type Type }
SearchOptions are options for GetProjects