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

Offen
#1,668 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 6 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
42/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, react, typescript

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
Go
Sterne
15.7k
Forks
1.4k
Ø Merge
9 T. 6 Std.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/answer

Alle Issues in apache/answer

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.