2
0

feat(wishlist): add wishlist feature for feature requests
Some checks failed
Build and Release / Lint (push) Failing after 5m36s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 2m37s
Build and Release / Create Release (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 3m39s

Implements comprehensive wishlist/feature request system for repositories. Includes categories with colors, voting system, importance ratings (1-5 stars), status tracking (open/planned/in-progress/completed/declined), threaded comments with reactions, and release linking. Adds v2 API endpoints for CRUD operations. Includes repository settings toggle, header tab, and full UI templates for list/view/create. Supports vote counts, importance averages, and comment reactions.
This commit is contained in:
2026-02-02 15:15:56 -05:00
parent 2ba1596b02
commit 36f5d77c9f
31 changed files with 3327 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ import (
asymkey_model "code.gitcaddy.com/server/v3/models/asymkey"
blog_model "code.gitcaddy.com/server/v3/models/blog"
wishlist_model "code.gitcaddy.com/server/v3/models/wishlist"
"code.gitcaddy.com/server/v3/models/db"
git_model "code.gitcaddy.com/server/v3/models/git"
issues_model "code.gitcaddy.com/server/v3/models/issues"
@@ -569,6 +570,16 @@ func RepoAssignment(ctx *Context) {
ctx.Data["BlogPostCount"] = blogCount
}
// Wishlist open count for repo header tab
if repo.WishlistEnabled {
wishlistCount, err := wishlist_model.CountOpenWishlistItems(ctx, repo.ID)
if err != nil {
ctx.ServerError("CountOpenWishlistItems", err)
return
}
ctx.Data["WishlistOpenCount"] = wishlistCount
}
ctx.Data["Title"] = repo.Owner.Name + "/" + repo.Name
ctx.Data["PageTitleCommon"] = repo.Name + " - " + setting.AppName
ctx.Data["Repository"] = repo

View File

@@ -0,0 +1,50 @@
// Copyright 2026 MarketAlly. All rights reserved.
// SPDX-License-Identifier: MIT
package forms
import (
"net/http"
"code.gitcaddy.com/server/v3/modules/web/middleware"
"code.gitcaddy.com/server/v3/services/context"
"gitea.com/go-chi/binding"
)
// WishlistItemForm is the form for creating wishlist items.
type WishlistItemForm struct {
Title string `binding:"Required;MaxSize(255)"`
Content string `binding:"Required"`
CategoryID int64
}
// Validate validates the fields.
func (f *WishlistItemForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// WishlistCommentForm is the form for adding comments.
type WishlistCommentForm struct {
Content string `binding:"Required"`
}
// Validate validates the fields.
func (f *WishlistCommentForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// WishlistCategoryForm is the form for managing categories.
type WishlistCategoryForm struct {
Name string `binding:"Required;MaxSize(100)"`
Color string `binding:"Required;MaxSize(7)"`
SortOrder int
}
// Validate validates the fields.
func (f *WishlistCategoryForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}