Skip to content

feat: add character detail page with public access (#59)#112

Merged
pierrick-fonquerne merged 2 commits intodevelopfrom
59-détails-dun-personnage
Feb 16, 2026

Hidden character warning

The head ref may contain hidden characters: "59-d\u00e9tails-dun-personnage"
Merged

feat: add character detail page with public access (#59)#112
pierrick-fonquerne merged 2 commits intodevelopfrom
59-détails-dun-personnage

Conversation

@pierrick-fonquerne
Copy link
Copy Markdown
Owner

Summary

  • Backend : endpoint GET /characters/{id} accessible sans authentification via [AllowAnonymous]. Le propriétaire voit tous ses personnages (tout statut), les anonymes/autres ne voient que les approuvés+partagés, sinon 404 (masque l'existence du personnage). Ajout de IsOwner au DTO pour éviter d'exposer le userId brut.
  • Frontend : page CharacterDetailPage à /characters/:id avec vue propriétaire (bouton Modifier, indicateur Partagé/Privé) et vue anonyme (lecture seule). Icônes de classe SVG extraites dans un utilitaire partagé (ClassIcons.tsx) réutilisé par ClassSelector et la page détail.
  • Tests : 8 tests unitaires backend (owner, anonyme, non-owner, partagé/privé), test d'intégration mis à jour (403→404), 18 tests frontend (affichage, accessibilité axe, erreurs).

Test plan

  • Vue propriétaire connecté : icône de classe, badge Approuvé, Partagé, boutons Modifier + Retour au tableau de bord
  • Vue anonyme sur personnage partagé : lecture seule, pas de bouton Modifier, juste Retour
  • Personnage inexistant (id=9999) : "Personnage introuvable." + Retour
  • Personnage draft en anonyme (id=1) : 404 masqué, "Personnage introuvable."
  • 236 tests backend passent (160 unitaires + 76 intégration)
  • 409 tests frontend passent, lint OK, type-check OK

Closes #59

Make GetById endpoint accessible without authentication via [AllowAnonymous].
Owner sees all their characters (any status), anonymous/other users see only
approved+shared, otherwise 404 (hides character existence for security).
Add IsOwner boolean to CharacterResponse DTO to avoid exposing raw userId.
Add CharacterDetailPage at /characters/:id with owner and anonymous views.
Owner sees edit button and shared indicator, anonymous sees read-only view.
Extract CLASS_ICONS into shared utility for reuse across ClassSelector and
detail page. Add getCharacterPublic service with conditional auth.
18 tests covering all scenarios including accessibility.
@pierrick-fonquerne pierrick-fonquerne linked an issue Feb 16, 2026 that may be closed by this pull request
7 tasks
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fantasyrealm-character-manager Ready Ready Preview, Comment Feb 16, 2026 3:57pm

@pierrick-fonquerne pierrick-fonquerne changed the base branch from main to develop February 16, 2026 15:58
@pierrick-fonquerne pierrick-fonquerne merged commit 044110a into develop Feb 16, 2026
6 of 7 checks passed
@pierrick-fonquerne pierrick-fonquerne deleted the 59-détails-dun-personnage branch February 16, 2026 15:59
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.

Détails d'un personnage

1 participant