Skip to content

Commit 9875110

Browse files
lunnysilverwindyp05327
authored
Rename project board -> column to make the UI less confusing (#30170)
This PR split the `Board` into two parts. One is the struct has been renamed to `Column` and the second we have a `Template Type`. But to make it easier to review, this PR will not change the database schemas, they are just renames. The database schema changes could be in future PRs. --------- Co-authored-by: silverwind <[email protected]> Co-authored-by: yp05327 <[email protected]>
1 parent 072b029 commit 9875110

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+725
-775
lines changed

docs/content/administration/config-cheat-sheet.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ and
828828

829829
## Project (`project`)
830830

831-
Default templates for project boards:
831+
Default templates for project board view:
832832

833833
- `PROJECT_BOARD_BASIC_KANBAN_TYPE`: **To Do, In Progress, Done**
834834
- `PROJECT_BOARD_BUG_TRIAGE_TYPE`: **Needs Triage, High Priority, Low Priority, Closed**

docs/content/index.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can try it out using [the online demo](https://try.gitea.io/).
3737

3838
- CI/CD: Gitea Actions supports CI/CD functionality, compatible with GitHub Actions. Users can write workflows in familiar YAML format and reuse a variety of existing Actions plugins. Actions plugins support downloading from any Git website.
3939

40-
- Project Management: Gitea tracks project requirements, features, and bugs through boards and issues. Issues support features like branches, tags, milestones, assignments, time tracking, due dates, dependencies, and more.
40+
- Project Management: Gitea tracks project requirements, features, and bugs through columns and issues. Issues support features like branches, tags, milestones, assignments, time tracking, due dates, dependencies, and more.
4141

4242
- Artifact Repository: Gitea supports over 20 different types of public or private software package management, including Cargo, Chef, Composer, Conan, Conda, Container, Helm, Maven, npm, NuGet, Pub, PyPI, RubyGems, Vagrant, and more.
4343

docs/content/installation/comparison.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ _Symbols used in table:_
104104
| Comment reactions |||||||||
105105
| Lock Discussion |||||||||
106106
| Batch issue handling |||||||||
107-
| Issue Boards (Kanban) | [/](https://github.com/go-gitea/gitea/issues/14710) ||||||||
107+
| Projects | [/](https://github.com/go-gitea/gitea/issues/14710) ||||||||
108108
| Create branch from issue | [](https://github.com/go-gitea/gitea/issues/20226) ||||||||
109109
| Convert comment to new issue |||||||||
110110
| Issue search |||||||||

docs/content/usage/permissions.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ With different permissions, people could do different things with these units.
4848
| Wiki | View wiki pages. Clone the wiki repository. | Create/Edit wiki pages, push | - |
4949
| ExternalWiki | Link to an external wiki | - | - |
5050
| ExternalTracker | Link to an external issue tracker | - | - |
51-
| Projects | View the boards | Change issues across boards | - |
51+
| Projects | View the columns of projects | Change issues across columns | - |
5252
| Packages | View the packages | Upload/Delete packages | - |
5353
| Actions | View the Actions logs | Approve / Cancel / Restart | - |
5454
| Settings | - | - | Manage the repository |

models/activities/statistic.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Statistic struct {
3030
Mirror, Release, AuthSource, Webhook,
3131
Milestone, Label, HookTask,
3232
Team, UpdateTask, Project,
33-
ProjectBoard, Attachment,
33+
ProjectColumn, Attachment,
3434
Branches, Tags, CommitStatus int64
3535
IssueByLabel []IssueByLabelCount
3636
IssueByRepository []IssueByRepositoryCount
@@ -115,6 +115,6 @@ func GetStatistic(ctx context.Context) (stats Statistic) {
115115
stats.Counter.Team, _ = e.Count(new(organization.Team))
116116
stats.Counter.Attachment, _ = e.Count(new(repo_model.Attachment))
117117
stats.Counter.Project, _ = e.Count(new(project_model.Project))
118-
stats.Counter.ProjectBoard, _ = e.Count(new(project_model.Board))
118+
stats.Counter.ProjectColumn, _ = e.Count(new(project_model.Column))
119119
return stats
120120
}

models/issues/comment.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ const (
100100
CommentTypeMergePull // 28 merge pull request
101101
CommentTypePullRequestPush // 29 push to PR head branch
102102

103-
CommentTypeProject // 30 Project changed
104-
CommentTypeProjectBoard // 31 Project board changed
103+
CommentTypeProject // 30 Project changed
104+
CommentTypeProjectColumn // 31 Project column changed
105105

106106
CommentTypeDismissReview // 32 Dismiss Review
107107

@@ -146,7 +146,7 @@ var commentStrings = []string{
146146
"merge_pull",
147147
"pull_push",
148148
"project",
149-
"project_board",
149+
"project_board", // FIXME: the name should be project_column
150150
"dismiss_review",
151151
"change_issue_ref",
152152
"pull_scheduled_merge",

models/issues/issue_project.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ func (issue *Issue) projectID(ctx context.Context) int64 {
3737
return ip.ProjectID
3838
}
3939

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

50-
// LoadIssuesFromBoard load issues assigned to this board
51-
func LoadIssuesFromBoard(ctx context.Context, b *project_model.Board) (IssueList, error) {
50+
// LoadIssuesFromColumn load issues assigned to this column
51+
func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column) (IssueList, error) {
5252
issueList, err := Issues(ctx, &IssuesOptions{
53-
ProjectBoardID: b.ID,
54-
ProjectID: b.ProjectID,
55-
SortType: "project-column-sorting",
53+
ProjectColumnID: b.ID,
54+
ProjectID: b.ProjectID,
55+
SortType: "project-column-sorting",
5656
})
5757
if err != nil {
5858
return nil, err
5959
}
6060

6161
if b.Default {
6262
issues, err := Issues(ctx, &IssuesOptions{
63-
ProjectBoardID: db.NoConditionID,
64-
ProjectID: b.ProjectID,
65-
SortType: "project-column-sorting",
63+
ProjectColumnID: db.NoConditionID,
64+
ProjectID: b.ProjectID,
65+
SortType: "project-column-sorting",
6666
})
6767
if err != nil {
6868
return nil, err
@@ -77,11 +77,11 @@ func LoadIssuesFromBoard(ctx context.Context, b *project_model.Board) (IssueList
7777
return issueList, nil
7878
}
7979

80-
// LoadIssuesFromBoardList load issues assigned to the boards
81-
func LoadIssuesFromBoardList(ctx context.Context, bs project_model.BoardList) (map[int64]IssueList, error) {
80+
// LoadIssuesFromColumnList load issues assigned to the columns
81+
func LoadIssuesFromColumnList(ctx context.Context, bs project_model.ColumnList) (map[int64]IssueList, error) {
8282
issuesMap := make(map[int64]IssueList, len(bs))
8383
for i := range bs {
84-
il, err := LoadIssuesFromBoard(ctx, bs[i])
84+
il, err := LoadIssuesFromColumn(ctx, bs[i])
8585
if err != nil {
8686
return nil, err
8787
}
@@ -110,7 +110,7 @@ func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_mo
110110
return util.NewPermissionDeniedErrorf("issue %d can't be accessed by project %d", issue.ID, newProject.ID)
111111
}
112112
if newColumnID == 0 {
113-
newDefaultColumn, err := newProject.GetDefaultBoard(ctx)
113+
newDefaultColumn, err := newProject.GetDefaultColumn(ctx)
114114
if err != nil {
115115
return err
116116
}
@@ -153,10 +153,10 @@ func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_mo
153153
}
154154
newSorting := util.Iif(res.IssueCount > 0, res.MaxSorting+1, 0)
155155
return db.Insert(ctx, &project_model.ProjectIssue{
156-
IssueID: issue.ID,
157-
ProjectID: newProjectID,
158-
ProjectBoardID: newColumnID,
159-
Sorting: newSorting,
156+
IssueID: issue.ID,
157+
ProjectID: newProjectID,
158+
ProjectColumnID: newColumnID,
159+
Sorting: newSorting,
160160
})
161161
})
162162
}

models/issues/issue_search.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type IssuesOptions struct { //nolint
3333
SubscriberID int64
3434
MilestoneIDs []int64
3535
ProjectID int64
36-
ProjectBoardID int64
36+
ProjectColumnID int64
3737
IsClosed optional.Option[bool]
3838
IsPull optional.Option[bool]
3939
LabelIDs []int64
@@ -169,12 +169,12 @@ func applyProjectCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Sessio
169169
return sess
170170
}
171171

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

247247
applyProjectCondition(sess, opts)
248248

249-
applyProjectBoardCondition(sess, opts)
249+
applyProjectColumnCondition(sess, opts)
250250

251251
if opts.IsPull.Has() {
252252
sess.And("issue.is_pull=?", opts.IsPull.Value())

models/migrations/v1_22/v293_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ import (
1515

1616
func Test_CheckProjectColumnsConsistency(t *testing.T) {
1717
// Prepare and load the testing database
18-
x, deferable := base.PrepareTestEnv(t, 0, new(project.Project), new(project.Board))
18+
x, deferable := base.PrepareTestEnv(t, 0, new(project.Project), new(project.Column))
1919
defer deferable()
2020
if x == nil || t.Failed() {
2121
return
2222
}
2323

2424
assert.NoError(t, CheckProjectColumnsConsistency(x))
2525

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

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

40-
expectNonDefaultBoard, err := project.GetBoard(db.DefaultContext, 3)
40+
expectNonDefaultColumn, err := project.GetColumn(db.DefaultContext, 3)
4141
assert.NoError(t, err)
42-
assert.Equal(t, int64(2), expectNonDefaultBoard.ProjectID)
43-
assert.True(t, expectNonDefaultBoard.Default)
42+
assert.Equal(t, int64(2), expectNonDefaultColumn.ProjectID)
43+
assert.True(t, expectNonDefaultColumn.Default)
4444
}

0 commit comments

Comments
 (0)