Skip to content

Commit

Permalink
Kanban board suggestions (#2)
Browse files Browse the repository at this point in the history
* 6543 suggestions

* fix
  • Loading branch information
6543 authored Feb 8, 2020
1 parent 64430ed commit 338e8bb
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 28 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ globals:
hljs: false
SimpleMDE: false
u2fApi: false
hljs: false
Sortable: false
Vue: false

Expand Down
23 changes: 11 additions & 12 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ type Issue struct {
MilestoneID int64 `xorm:"INDEX"`
Milestone *Milestone `xorm:"-"`
ProjectID int64 `xorm:"INDEX"`
// If 0, then it has not been added to a specific board in the project
ProjectBoardID int64 `xorm:"INDEX"`
Project *Project `xorm:"-"`
Priority int
AssigneeID int64 `xorm:"-"`
Assignee *User `xorm:"-"`
IsClosed bool `xorm:"INDEX"`
IsRead bool `xorm:"-"`
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
PullRequest *PullRequest `xorm:"-"`
NumComments int
Ref string
ProjectBoardID int64 `xorm:"INDEX"` // If 0, then it has not been added to a specific board in the project
Project *Project `xorm:"-"`
Priority int
AssigneeID int64 `xorm:"-"`
Assignee *User `xorm:"-"`
IsClosed bool `xorm:"INDEX"`
IsRead bool `xorm:"-"`
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
PullRequest *PullRequest `xorm:"-"`
NumComments int
Ref string

DeadlineUnix timeutil.TimeStamp `xorm:"INDEX"`

Expand Down
2 changes: 1 addition & 1 deletion models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ var migrations = []Migration{
NewMigration("Add commit id and stale to reviews", addReviewCommitAndStale),
// v119 -> v120
NewMigration("Fix migrated repositories' git service type", fixMigratedRepositoryServiceType),
// v120 - v121
// v120 -> v121
NewMigration("Add owner_name on table repository", addOwnerNameOnRepository),
// v120 -> v121
NewMigration("add projects info to repository table", addProjectsInfo),
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v104.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
Expand Down Expand Up @@ -29,6 +30,5 @@ func removeLabelUneededCols(x *xorm.Engine) error {
if err := dropTableColumns(sess, "label", "is_selected"); err != nil {
return err
}

return sess.Commit()
}
1 change: 1 addition & 0 deletions models/migrations/v106.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v112.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package migrations

import (
"os"

"code.gitea.io/gitea/models"

"xorm.io/builder"
"xorm.io/xorm"
)
Expand Down
3 changes: 2 additions & 1 deletion models/migrations/v96.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ func deleteOrphanedAttachments(x *xorm.Engine) error {
return err
}

_, err := x.ID(attachment.ID).NoAutoCondition().Delete(attachment)
_, err := sess.ID(attachment.ID).NoAutoCondition().Delete(attachment)
return err
})

if err != nil {
return err
}
Expand Down
11 changes: 5 additions & 6 deletions modules/setting/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ var (
AccessControlAllowOrigin string
UseCompatSSHURI bool
DefaultCloseIssuesViaCommitsInAnyBranch bool

EnableKanbanBoard bool
ProjectBoardBasicKanbanType []string
ProjectBoardBugTriageType []string
EnablePushCreateUser bool
EnablePushCreateOrg bool
EnablePushCreateUser bool
EnablePushCreateOrg bool
EnableKanbanBoard bool
ProjectBoardBasicKanbanType []string
ProjectBoardBugTriageType []string

// Repository editor settings
Editor struct {
Expand Down
2 changes: 1 addition & 1 deletion routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ func getBranchData(ctx *context.Context, issue *models.Issue) {
ctx.Data["BaseBranch"] = pull.BaseBranch
ctx.Data["HeadBranch"] = pull.HeadBranch
ctx.Data["HeadUserName"] = pull.MustHeadUserName()
ctx.Data["RequireSimpleMDE"] = true
}
}

Expand Down Expand Up @@ -731,6 +730,7 @@ func ViewIssue(ctx *context.Context) {
ctx.Data["RequireHighlightJS"] = true
ctx.Data["RequireDropzone"] = true
ctx.Data["RequireTribute"] = true
ctx.Data["RequireSimpleMDE"] = true
ctx.Data["IsProjectsEnabled"] = setting.Repository.EnableKanbanBoard

renderAttachmentSettings(ctx)
Expand Down
7 changes: 3 additions & 4 deletions routers/user/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ func Profile(ctx *context.Context) {
case "projects":

ctx.Data["OpenProjects"], err = models.GetProjects(models.ProjectSearchOptions{
// RepoID: repo.ID,
Page: -1,
// IsClosed: uti,
Type: models.IndividualType,
Page: -1,
IsClosed: util.OptionalBoolFalse,
Type: models.IndividualType,
})
default:
repos, count, err = models.SearchRepository(&models.SearchRepoOptions{
Expand Down

0 comments on commit 338e8bb

Please sign in to comment.