Skip to content

Add Vote Rewards Settings tab to admin panel#47

Merged
AdaInTheLab merged 1 commit into
mainfrom
feature/vote-rewards-ui
Apr 30, 2026
Merged

Add Vote Rewards Settings tab to admin panel#47
AdaInTheLab merged 1 commit into
mainfrom
feature/vote-rewards-ui

Conversation

@AdaInTheLab
Copy link
Copy Markdown
Collaborator

Summary

Admin-panel UI for the VoteRewardsFeature backend that landed in #46. Now you can configure providers, set reward amounts, and watch grants come in without curling the REST endpoints.

  • Master enable toggle at the top of the tab
  • Per-provider config block for each registered adapter (today: 7daystodie-servers.com): enabled toggle, API key (password input), server ID, poll interval, reward type, points amount, broadcast template
  • Recent grants audit table at the bottom — most recent 50, with datetime, provider, player, steam id, reward type+value
  • VipGift and CdKey reward types are visible in the Select but their input fields are disabled with a "(not yet implemented)" hint so admins know choosing them today won't grant — backend throws `NotImplementedException` until the v1.5 dispatch wiring lands

Files

File What
`frontend/src/api/voterewards.ts` REST client (4 endpoints)
`frontend/src/types/index.ts` `VoteRewardsSettings`, `VoteProviderSettings`, `VoteGrant` + `ChatCommandSettings` extension
`frontend/src/views/SettingsView.vue` New tab + state + handlers (~190 LOC added)
`frontend/src/i18n/locales/en.ts` Canonical strings
`frontend/src/i18n/locales/{ja,ko,zh-CN,zh-TW}.ts` English placeholders with "translations TBD" markers

The non-English locale files just mirror the English strings for now — `vue-tsc`'s structural type-check requires the same shape across all locales, so translating later is a clean follow-up that doesn't block this work.

Test plan

  • Open Settings → Vote Rewards (admin only) — tab loads without errors
  • Master toggle saves and reloads correctly
  • 7daystodie-servers.com provider block renders with all fields
  • Enter an API key + Points reward + amount, save, refresh — values persist
  • Switch reward type to VIP Gift / CD Key — input field shows as disabled with hint
  • Audit log table renders empty initially with the empty-state message
  • After a grant lands (sweep or `/vote`), refreshing the tab shows the row in the audit table

🤖 Generated with Claude Code

UI surface for the VoteRewardsFeature backend that landed in #46:

- New "Vote Rewards" tab in SettingsView (admin-only, value="9")
- Master enable toggle + per-provider config block (enabled, API key,
  server ID, poll interval, reward type, points amount, broadcast template)
- Recent grants audit table at the bottom (datetime, provider, player,
  steam id, reward type+value)
- VipGift and CdKey reward types are present as Select options but their
  associated input fields are disabled with a "(not yet implemented)" hint
  so admins know choosing them won't grant — backend throws
  NotImplementedException for these until the v1.5 dispatch lands

Wired up:
- frontend/src/api/voterewards.ts — REST client
- VoteRewardsSettings, VoteProviderSettings, VoteGrant types
- ChatCommandSettings extended with voteEnabled / voteCooldownSeconds
  to match the C# settings POCO
- en.ts has the canonical strings; ja/ko/zh-CN/zh-TW carry English
  placeholders with a "translations TBD" comment so vue-tsc's structural
  check passes — native translations are a follow-up

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AdaInTheLab AdaInTheLab merged commit 15a3f99 into main Apr 30, 2026
2 checks passed
@AdaInTheLab AdaInTheLab deleted the feature/vote-rewards-ui branch April 30, 2026 15:10
@AdaInTheLab AdaInTheLab mentioned this pull request Apr 30, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant