Skip to content

Commit 767a31e

Browse files
authored
Kanban fix2 (go-gitea#4)
* fix migrations * update settings sample * fix lint * remove merge-conflict relict
1 parent 4cd0b75 commit 767a31e

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

custom/conf/app.ini.sample

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ DISABLED_REPO_UNITS =
5151
DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki
5252
; Prefix archive files by placing them in a directory named after the repository
5353
PREFIX_ARCHIVE_FILES = true
54+
; Enable the kanban board feature system wide.
55+
ENABLE_KANBAN_BOARD = true
56+
; Default templates for kanban borards
57+
PROJECT_BOARD_BASIC_KANBAN_TYPE = Todo, In progress, Done
58+
PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High priority, Low priority, Closed
5459

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

models/error.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,7 @@ func (err ErrProjectNotExist) Error() string {
15251525
return fmt.Sprintf("projects does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
15261526
}
15271527

1528+
// ErrProjectBoardNotExist represents a "ProjectBoardNotExist" kind of error.
15281529
type ErrProjectBoardNotExist struct {
15291530
BoardID int64
15301531
RepoID int64

models/issue.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,8 +1121,6 @@ type IssuesOptions struct {
11211121
MentionedID int64
11221122
MilestoneID int64
11231123
ProjectID int64
1124-
Page int
1125-
PageSize int
11261124
IsClosed util.OptionalBool
11271125
IsPull util.OptionalBool
11281126
LabelIDs []int64

models/migrations/migrations.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,19 @@ var migrations = []Migration{
174174
NewMigration("Fix migrated repositories' git service type", fixMigratedRepositoryServiceType),
175175
// v120 -> v121
176176
NewMigration("Add owner_name on table repository", addOwnerNameOnRepository),
177-
// v120 -> v121
178-
NewMigration("add is_restricted column for users table", addIsRestricted),
179177
// v121 -> v122
180-
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
178+
NewMigration("add is_restricted column for users table", addIsRestricted),
181179
// v122 -> v123
182-
NewMigration("Add original informations for reactions", addReactionOriginals),
180+
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
183181
// v123 -> v124
184-
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
182+
NewMigration("Add original informations for reactions", addReactionOriginals),
185183
// v124 -> v125
186-
NewMigration("Add some columns on review for migration", addReviewMigrateInfo),
184+
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
187185
// v125 -> v126
188-
NewMigration("Fix topic repository count", fixTopicRepositoryCount),
186+
NewMigration("Add some columns on review for migration", addReviewMigrateInfo),
189187
// v126 -> v127
188+
NewMigration("Fix topic repository count", fixTopicRepositoryCount),
189+
// v127 -> v128
190190
NewMigration("add projects info to repository table", addProjectsInfo),
191191
}
192192

models/projects.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ type Project struct {
120120
ClosedDateUnix timeutil.TimeStamp
121121
}
122122

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

128+
// ProjectSearchOptions are options for GetProjects
129129
type ProjectSearchOptions struct {
130130
RepoID int64
131131
Page int
@@ -134,8 +134,7 @@ type ProjectSearchOptions struct {
134134
Type ProjectType
135135
}
136136

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

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

289-
// ChangeProjectStatus togggles a project between opened and closed
288+
// ChangeProjectStatus toggle a project between opened and closed
290289
func ChangeProjectStatus(p *Project, isClosed bool) error {
291290

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

446-
// MoveIsssueAcrossProjectBoards move a card from one board to another
445+
// MoveIssueAcrossProjectBoards move a card from one board to another
447446
func MoveIssueAcrossProjectBoards(issue *Issue, board *ProjectBoard) error {
448447

449448
sess := x.NewSession()

routers/repo/issue.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
205205
MentionedID: mentionedID,
206206
MilestoneID: milestoneID,
207207
ProjectID: projectID,
208-
Page: pager.Paginater.Current(),
209-
PageSize: setting.UI.IssuePagingNum,
210208
IsClosed: util.OptionalBoolOf(isShowClosed),
211209
IsPull: isPullOption,
212210
LabelIDs: labelIDs,

routers/repo/projects.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
projectTemplateKey = "ProjectTemplate"
2727
)
2828

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

3132
if !setting.Repository.EnableKanbanBoard {

0 commit comments

Comments
 (0)