aboutsummaryrefslogtreecommitdiffstats
path: root/models/project/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-08-09 09:29:02 +0800
committerGitHub <noreply@github.com>2024-08-09 01:29:02 +0000
commit791d7fc76aa41370860126e861cf14d98efe710e (patch)
tree066bde9247eaa6b91878c818901c378b65f5ecb1 /models/project/issue.go
parentaa1055fe16e2a11b4ab9503854be96e776231d93 (diff)
downloadgitea-791d7fc76aa41370860126e861cf14d98efe710e.tar.gz
gitea-791d7fc76aa41370860126e861cf14d98efe710e.zip
Add issue comment when moving issues from one column to another of the project (#29311)
Fix #27278 Replace #27816 This PR adds a meta-comment for an issue when dragging an issue from one column to another of a project. <img width="600" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/5fc1d954-430e-4db0-aaee-a00006fa91f5"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'models/project/issue.go')
-rw-r--r--models/project/issue.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/models/project/issue.go b/models/project/issue.go
index 3361b533b9..1c31b154ce 100644
--- a/models/project/issue.go
+++ b/models/project/issue.go
@@ -76,30 +76,6 @@ func (p *Project) NumOpenIssues(ctx context.Context) int {
return int(c)
}
-// MoveIssuesOnProjectColumn moves or keeps issues in a column and sorts them inside that column
-func MoveIssuesOnProjectColumn(ctx context.Context, column *Column, sortedIssueIDs map[int64]int64) error {
- return db.WithTx(ctx, func(ctx context.Context) error {
- sess := db.GetEngine(ctx)
- issueIDs := util.ValuesOfMap(sortedIssueIDs)
-
- count, err := sess.Table(new(ProjectIssue)).Where("project_id=?", column.ProjectID).In("issue_id", issueIDs).Count()
- if err != nil {
- return err
- }
- if int(count) != len(sortedIssueIDs) {
- return fmt.Errorf("all issues have to be added to a project first")
- }
-
- for sorting, issueID := range sortedIssueIDs {
- _, err = sess.Exec("UPDATE `project_issue` SET project_board_id=?, sorting=? WHERE issue_id=?", column.ID, sorting, issueID)
- if err != nil {
- return err
- }
- }
- return nil
- })
-}
-
func (c *Column) moveIssuesToAnotherColumn(ctx context.Context, newColumn *Column) error {
if c.ProjectID != newColumn.ProjectID {
return fmt.Errorf("columns have to be in the same project")