Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename project board -> column to make the UI less confusing #30170

Merged
merged 35 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4372908
Rename project board -> column to make the UI less confusion
lunny Mar 29, 2024
49fce5d
rename more board -> column
lunny Mar 30, 2024
506f2ac
Merge branch 'main' into lunny/rename_board_column
lunny Mar 30, 2024
ff6a72d
Fix bug
lunny Mar 30, 2024
ecdc683
Merge branch 'main' into lunny/rename_board_column
lunny Mar 30, 2024
311a82f
Rename boardview type -> template type
lunny Mar 30, 2024
f3554db
Rename boardtype -> templatetype on template and form
lunny Mar 31, 2024
a0406b1
Merge branch 'main' into lunny/rename_board_column
lunny Mar 31, 2024
37eb84a
remove unnecessary comment
lunny Mar 31, 2024
42bec44
Merge branch 'main' into lunny/rename_board_column
lunny Apr 3, 2024
98c3344
Merge branch 'main' into lunny/rename_board_column
silverwind Apr 5, 2024
0ad9355
Merge branch 'main' into lunny/rename_board_column
lunny Apr 15, 2024
d876464
more renames
lunny Apr 16, 2024
3d0fad8
Merge branch 'main' into lunny/rename_board_column
lunny Apr 16, 2024
6dcbe27
Merge branch 'lunny/rename_board_column' of github.com:lunny/gitea in…
lunny Apr 16, 2024
e5cab92
more renames
lunny Apr 17, 2024
c40e7fc
Merge branch 'main' into lunny/rename_board_column
lunny Apr 18, 2024
e6a7fd3
Fix comment of boards
lunny Apr 18, 2024
925dcf8
Update models/project/column.go
lunny Apr 18, 2024
78f7639
Update documentation about boards
lunny Apr 18, 2024
09f90d2
Merge branch 'main' into lunny/rename_board_column
lunny Apr 18, 2024
125a13b
Merge branch 'lunny/rename_board_column' of github.com:lunny/gitea in…
lunny Apr 18, 2024
ee38355
Merge branch 'main' into lunny/rename_board_column
lunny Apr 19, 2024
b0d4084
More renames
lunny Apr 19, 2024
0444955
color-project-board-bg -> color-project-column-bg
silverwind Apr 21, 2024
d065f6f
Merge branch 'main' into lunny/rename_board_column
lunny Apr 23, 2024
4cb15a7
Merge branch 'lunny/rename_board_column' of github.com:lunny/gitea in…
lunny Apr 23, 2024
7682adc
Merge branch 'main' into lunny/rename_board_column
lunny Apr 28, 2024
61e8ad5
Fix locale
lunny Apr 30, 2024
b284b95
Merge branch 'main' into lunny/rename_board_column
lunny Apr 30, 2024
9109a85
Merge branch 'lunny/rename_board_column' of github.com:lunny/gitea in…
lunny Apr 30, 2024
d9e5f56
Merge branch 'main' into lunny/rename_board_column
lunny May 11, 2024
96122c5
More renames
lunny May 11, 2024
7a80a55
Merge branch 'main' into lunny/rename_board_column
GiteaBot May 27, 2024
65818e9
Merge branch 'main' into lunny/rename_board_column
GiteaBot May 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/activities/statistic.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Statistic struct {
Mirror, Release, AuthSource, Webhook,
Milestone, Label, HookTask,
Team, UpdateTask, Project,
ProjectBoard, Attachment,
ProjectColumn, Attachment,
Branches, Tags, CommitStatus int64
IssueByLabel []IssueByLabelCount
IssueByRepository []IssueByRepositoryCount
Expand Down Expand Up @@ -115,6 +115,6 @@ func GetStatistic(ctx context.Context) (stats Statistic) {
stats.Counter.Team, _ = e.Count(new(organization.Team))
stats.Counter.Attachment, _ = e.Count(new(repo_model.Attachment))
stats.Counter.Project, _ = e.Count(new(project_model.Project))
stats.Counter.ProjectBoard, _ = e.Count(new(project_model.Board))
stats.Counter.ProjectColumn, _ = e.Count(new(project_model.Column))
return stats
}
28 changes: 14 additions & 14 deletions models/issues/issue_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,32 @@ func (issue *Issue) projectID(ctx context.Context) int64 {
return ip.ProjectID
}

// ProjectBoardID return project board id if issue was assigned to one
func (issue *Issue) ProjectBoardID(ctx context.Context) int64 {
// ProjectColumnID return project column id if issue was assigned to one
func (issue *Issue) ProjectColumnID(ctx context.Context) int64 {
var ip project_model.ProjectIssue
has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip)
if err != nil || !has {
return 0
}
return ip.ProjectBoardID
return ip.ProjectColumnID
}

// LoadIssuesFromBoard load issues assigned to this board
func LoadIssuesFromBoard(ctx context.Context, b *project_model.Board) (IssueList, error) {
// LoadIssuesFromColumn load issues assigned to this board
func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column) (IssueList, error) {
issueList, err := Issues(ctx, &IssuesOptions{
ProjectBoardID: b.ID,
ProjectID: b.ProjectID,
SortType: "project-column-sorting",
ProjectColumnID: b.ID,
ProjectID: b.ProjectID,
SortType: "project-column-sorting",
})
if err != nil {
return nil, err
}

if b.Default {
issues, err := Issues(ctx, &IssuesOptions{
ProjectBoardID: db.NoConditionID,
ProjectID: b.ProjectID,
SortType: "project-column-sorting",
ProjectColumnID: db.NoConditionID,
ProjectID: b.ProjectID,
SortType: "project-column-sorting",
})
if err != nil {
return nil, err
Expand All @@ -77,11 +77,11 @@ func LoadIssuesFromBoard(ctx context.Context, b *project_model.Board) (IssueList
return issueList, nil
}

// LoadIssuesFromBoardList load issues assigned to the boards
func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (map[int64]IssueList, error) {
// LoadIssuesFromColumnList load issues assigned to the boards
func LoadIssuesFromColumnList(ctx context.Context, bs project_model.ColumnList) (map[int64]IssueList, error) {
issuesMap := make(map[int64]IssueList, len(bs))
for i := range bs {
il, err := LoadIssuesFromBoard(ctx, bs[i])
il, err := LoadIssuesFromColumn(ctx, bs[i])
if err != nil {
return nil, err
}
Expand Down
14 changes: 7 additions & 7 deletions models/issues/issue_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type IssuesOptions struct { //nolint
SubscriberID int64
MilestoneIDs []int64
ProjectID int64
ProjectBoardID int64
ProjectColumnID int64
IsClosed optional.Option[bool]
IsPull optional.Option[bool]
LabelIDs []int64
Expand Down Expand Up @@ -169,12 +169,12 @@ func applyProjectCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Sessio
return sess
}

func applyProjectBoardCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Session {
// opts.ProjectBoardID == 0 means all project boards,
func applyProjectColumnCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Session {
// opts.ProjectColumnID == 0 means all project columns,
// do not need to apply any condition
if opts.ProjectBoardID > 0 {
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Eq{"project_board_id": opts.ProjectBoardID}))
} else if opts.ProjectBoardID == db.NoConditionID {
if opts.ProjectColumnID > 0 {
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Eq{"project_board_id": opts.ProjectColumnID}))
} else if opts.ProjectColumnID == db.NoConditionID {
sess.In("issue.id", builder.Select("issue_id").From("project_issue").Where(builder.Eq{"project_board_id": 0}))
}
return sess
Expand Down Expand Up @@ -246,7 +246,7 @@ func applyConditions(sess *xorm.Session, opts *IssuesOptions) *xorm.Session {

applyProjectCondition(sess, opts)

applyProjectBoardCondition(sess, opts)
applyProjectColumnCondition(sess, opts)

if opts.IsPull.Has() {
sess.And("issue.is_pull=?", opts.IsPull.Value())
Expand Down
24 changes: 12 additions & 12 deletions models/migrations/v1_22/v293_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ import (

func Test_CheckProjectColumnsConsistency(t *testing.T) {
// Prepare and load the testing database
x, deferable := base.PrepareTestEnv(t, 0, new(project.Project), new(project.Board))
x, deferable := base.PrepareTestEnv(t, 0, new(project.Project), new(project.Column))
defer deferable()
if x == nil || t.Failed() {
return
}

assert.NoError(t, CheckProjectColumnsConsistency(x))

// check if default board was added
var defaultBoard project.Board
has, err := x.Where("project_id=? AND `default` = ?", 1, true).Get(&defaultBoard)
// check if default column was added
var defaultColumn project.Column
has, err := x.Where("project_id=? AND `default` = ?", 1, true).Get(&defaultColumn)
assert.NoError(t, err)
assert.True(t, has)
assert.Equal(t, int64(1), defaultBoard.ProjectID)
assert.True(t, defaultBoard.Default)
assert.Equal(t, int64(1), defaultColumn.ProjectID)
assert.True(t, defaultColumn.Default)

// check if multiple defaults, previous were removed and last will be kept
expectDefaultBoard, err := project.GetBoard(db.DefaultContext, 2)
expectDefaultColumn, err := project.GetColumn(db.DefaultContext, 2)
assert.NoError(t, err)
assert.Equal(t, int64(2), expectDefaultBoard.ProjectID)
assert.False(t, expectDefaultBoard.Default)
assert.Equal(t, int64(2), expectDefaultColumn.ProjectID)
assert.False(t, expectDefaultColumn.Default)

expectNonDefaultBoard, err := project.GetBoard(db.DefaultContext, 3)
expectNonDefaultColumn, err := project.GetColumn(db.DefaultContext, 3)
assert.NoError(t, err)
assert.Equal(t, int64(2), expectNonDefaultBoard.ProjectID)
assert.True(t, expectNonDefaultBoard.Default)
assert.Equal(t, int64(2), expectNonDefaultColumn.ProjectID)
assert.True(t, expectNonDefaultColumn.Default)
}
Loading
Loading