Add sponsorship requests form and admin system#3431
Conversation
|
Code Review — Sponsorship Request feature Bug: No date range validation in
Bug: Multiple components defined in
Bug: Untranslated user-visible strings in Several hardcoded English strings were added to the admin list view without translation wrappers, e.g.: <h2>Pending Tournament Prize Requests</h2>
// ...
<span>Organizer: {req.name} | Players: {req.expected_players} | ...</span>
// ...
<h2>Past Tournament Prize Requests</h2>Per project rules, all user-visible strings must go through |
|
Auth race condition in SponsorshipRequestAdmin.tsx: the useEffect reads user.is_superuser but user is not in the dependency array ([params.id]). If user data has not loaded when the component mounts, is_superuser is falsy and the component redirects immediately before the real auth state is confirmed. A superuser going directly to /sponsorship-requests/:id could be sent to / or see a perpetual loading screen. user or user.is_superuser should be added to the dependency array. Untranslated strings in PrizeBatchList.tsx: the section headings Pending Tournament Prize Requests and Past Tournament Prize Requests, inline labels Organizer, Players, Review, View, and the raw req.status value rendered as brackets around req.status are not wrapped in translation functions, violating the project rule that all user-visible strings must be translated. DURATION_OPTIONS labels cannot be translated in SponsorshipRequestTypes.ts: the label values such as 30 days and 60 days are plain strings defined at module load time. They cannot go through the translation system and are rendered directly in option elements in both SponsorshipRequest.tsx and EditModal.tsx. They need to be computed at render time to be translatable. Missing user feedback on submission failure in SponsorshipRequest.tsx: when the POST in handleSubmit fails, only console.error is called and the button is re-enabled with no message shown to the user. A toast in the catch block would be consistent with how other actions in this PR handle errors. |
Code Review: Sponsorship Request FeatureBug:
|
Code ReviewBugs and issues found: 1. CI tests disabled (Critical)Both 2. Missing
|
|
Untranslated user-visible strings Several strings added in this PR are not wrapped in translation functions, which is required per project conventions (all user-visible strings must use pgettext/_/etc. from @/lib/translate). In src/views/Prizes/PrizeBatchList.tsx, the new sponsorship request sections contain raw string literals: the headings 'Pending Tournament Prize Requests' and 'Past Tournament Prize Requests', the inline labels 'Organizer:' and 'Players:' in the list items, and the link text 'Review' and 'View' are all untranslated. In src/views/Prizes/SponsorshipRequestAdmin.tsx, the word 'to' between the start and end dates is also untranslated: These should be wrapped with _() or pgettext() (and interpolate() for the parameterized organizer/players strings). |
No description provided.