Admin: allow editing badges and creating new badges from existing rules

未關閉
#1,668 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 6 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
42/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
go, react, typescript

研究方向

Read the existing Admin → Badges implementation and the backend badge data and rule handling described in the issue; inspect the related issue #1036 for the original scope. Map how badge fields and rule parameters reach the admin interface, then identify the decisions around custom text and existing users who meet new thresholds. Done means admins can edit badges and create badges from existing rules with parameters, with those decisions resolved.

由索引模型根據 Issue 內容生成。

描述

enhancement

Is your enhancement request related to a problem? Please describe

Admin → Badges currently only lets an admin activate or deactivate a badge.
But each badge is already stored as data in the badge table: name,
description, icon, level, single/multiple award, and a rule (handler) with
parameters (param, e.g. {"amount":"25"}).

So a community can't, for example:

  • Lower "Good Answer" from 25 to 15 votes for a small site
  • Change a badge's icon or level
  • Add an "Epic Answer" badge at 100 votes, even though the existing
    ReachAnswerVote rule already supports it

Today these changes require editing the database directly.

Describe the solution you'd like

Extend Admin → Badges so an admin can:

  1. Edit a badge's name, description, icon, level, and rule parameters
  2. Create a new badge by choosing one of the existing rules
    (ReachAnswerVote, ReachQuestionVote, ReachAnswerAcceptedAmount, ...)
    and setting its parameters

This doesn't need any new award rules. It only exposes what the backend
already stores.

Points that may need deciding:

  • Default badge names and descriptions are i18n keys
    (badge.default_badges.*). Custom badges would need plain text, or a way
    to add translations.
  • Badge rules only run on new events, so changing a threshold won't award
    the badge to users who already qualify.

Describe alternatives you've considered

Editing the badge table directly works, but is error-prone and outside
the supported interface.

Related: #1036 (original badges feature, where admin "Badge management"
shipped as activate/deactivate only).

主要語言
Go
星號
15.7k
分支
1.4k
平均合併
9 天 6 小時
30 天內合併 PR
8

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/answer 的其他 Issue

查看 apache/answer 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。