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

オープン
#1,668 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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時間
マージ済み PR(30日)
8

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/answer のほかの issue

apache/answer の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。