mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	feat: Add sorting by exclusive labels (issue priority) (#33206)
Fix #2616 This PR adds a new sort option for exclusive labels. For exclusive labels, a new property is exposed called "order", while in the UI options are populated automatically in the `Sort` column (see screenshot below) for each exclusive label scope. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -87,6 +87,7 @@ type Label struct {
 | 
			
		||||
	OrgID           int64 `xorm:"INDEX"`
 | 
			
		||||
	Name            string
 | 
			
		||||
	Exclusive       bool
 | 
			
		||||
	ExclusiveOrder  int `xorm:"DEFAULT 0"` // 0 means no exclusive order
 | 
			
		||||
	Description     string
 | 
			
		||||
	Color           string `xorm:"VARCHAR(7)"`
 | 
			
		||||
	NumIssues       int
 | 
			
		||||
@@ -236,7 +237,7 @@ func UpdateLabel(ctx context.Context, l *Label) error {
 | 
			
		||||
	}
 | 
			
		||||
	l.Color = color
 | 
			
		||||
 | 
			
		||||
	return updateLabelCols(ctx, l, "name", "description", "color", "exclusive", "archived_unix")
 | 
			
		||||
	return updateLabelCols(ctx, l, "name", "description", "color", "exclusive", "exclusive_order", "archived_unix")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DeleteLabel delete a label
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user