Skip to content

Commit

Permalink
Kanban fix2 (go-gitea#4)
Browse files Browse the repository at this point in the history
* fix migrations

* update settings sample

* fix lint

* remove merge-conflict relict
  • Loading branch information
6543 authored Feb 9, 2020
1 parent 4cd0b75 commit 767a31e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
7 changes: 5 additions & 2 deletions custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ DISABLED_REPO_UNITS =
DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki
; Prefix archive files by placing them in a directory named after the repository
PREFIX_ARCHIVE_FILES = true
; Enable the kanban board feature system wide.
ENABLE_KANBAN_BOARD = true
; Default templates for kanban borards
PROJECT_BOARD_BASIC_KANBAN_TYPE = Todo, In progress, Done
PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High priority, Low priority, Closed

[repository.editor]
; List of file extensions for which lines should be wrapped in the CodeMirror editor
Expand Down Expand Up @@ -432,8 +437,6 @@ BOOST_WORKERS = 5
[admin]
; Disallow regular (non-admin) users from creating organizations.
DISABLE_REGULAR_ORG_CREATION = false
; Enable the kanban board feature system wide.
ENABLE_KANBAN_BOARD = true
; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
DEFAULT_EMAIL_NOTIFICATIONS = enabled

Expand Down
1 change: 1 addition & 0 deletions models/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ func (err ErrProjectNotExist) Error() string {
return fmt.Sprintf("projects does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
}

// ErrProjectBoardNotExist represents a "ProjectBoardNotExist" kind of error.
type ErrProjectBoardNotExist struct {
BoardID int64
RepoID int64
Expand Down
2 changes: 0 additions & 2 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1121,8 +1121,6 @@ type IssuesOptions struct {
MentionedID int64
MilestoneID int64
ProjectID int64
Page int
PageSize int
IsClosed util.OptionalBool
IsPull util.OptionalBool
LabelIDs []int64
Expand Down
14 changes: 7 additions & 7 deletions models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ var migrations = []Migration{
NewMigration("Fix migrated repositories' git service type", fixMigratedRepositoryServiceType),
// v120 -> v121
NewMigration("Add owner_name on table repository", addOwnerNameOnRepository),
// v120 -> v121
NewMigration("add is_restricted column for users table", addIsRestricted),
// v121 -> v122
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
NewMigration("add is_restricted column for users table", addIsRestricted),
// v122 -> v123
NewMigration("Add original informations for reactions", addReactionOriginals),
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
// v123 -> v124
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
NewMigration("Add original informations for reactions", addReactionOriginals),
// v124 -> v125
NewMigration("Add some columns on review for migration", addReviewMigrateInfo),
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
// v125 -> v126
NewMigration("Fix topic repository count", fixTopicRepositoryCount),
NewMigration("Add some columns on review for migration", addReviewMigrateInfo),
// v126 -> v127
NewMigration("Fix topic repository count", fixTopicRepositoryCount),
// v127 -> v128
NewMigration("add projects info to repository table", addProjectsInfo),
}

Expand Down
11 changes: 5 additions & 6 deletions models/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ type Project struct {
ClosedDateUnix timeutil.TimeStamp
}

// AfterLoad is invoked from XORM after setting the value of a field of
// this object.
// AfterLoad is invoked from XORM after setting the value of a field of this object.
func (p *Project) AfterLoad() {
p.NumOpenIssues = p.NumIssues - p.NumClosedIssues
}

// ProjectSearchOptions are options for GetProjects
type ProjectSearchOptions struct {
RepoID int64
Page int
Expand All @@ -134,8 +134,7 @@ type ProjectSearchOptions struct {
Type ProjectType
}

// GetProjects returns a list of all projects that have been created in the
// repository
// GetProjects returns a list of all projects that have been created in the repository
func GetProjects(opts ProjectSearchOptions) ([]*Project, error) {

projects := make([]*Project, 0, setting.UI.IssuePagingNum)
Expand Down Expand Up @@ -286,7 +285,7 @@ func countRepoClosedProjects(e Engine, repoID int64) (int64, error) {
Count(new(Project))
}

// ChangeProjectStatus togggles a project between opened and closed
// ChangeProjectStatus toggle a project between opened and closed
func ChangeProjectStatus(p *Project, isClosed bool) error {

repo, err := GetRepositoryByID(p.RepoID)
Expand Down Expand Up @@ -443,7 +442,7 @@ func changeProjectAssign(sess *xorm.Session, doer *User, issue *Issue, oldProjec
return updateIssueCols(sess, issue, "project_id")
}

// MoveIsssueAcrossProjectBoards move a card from one board to another
// MoveIssueAcrossProjectBoards move a card from one board to another
func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error {

sess := x.NewSession()
Expand Down
2 changes: 0 additions & 2 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
MentionedID: mentionedID,
MilestoneID: milestoneID,
ProjectID: projectID,
Page: pager.Paginater.Current(),
PageSize: setting.UI.IssuePagingNum,
IsClosed: util.OptionalBoolOf(isShowClosed),
IsPull: isPullOption,
LabelIDs: labelIDs,
Expand Down
1 change: 1 addition & 0 deletions routers/repo/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
projectTemplateKey = "ProjectTemplate"
)

// MustEnableProjects check if projects are enabled in settings
func MustEnableProjects(ctx *context.Context) {

if !setting.Repository.EnableKanbanBoard {
Expand Down

0 comments on commit 767a31e

Please sign in to comment.