Skip to content

feat: merge tool for filières, associations and schools in admin#31

Merged
LukaMrt merged 6 commits into
masterfrom
develop
May 22, 2026
Merged

feat: merge tool for filières, associations and schools in admin#31
LukaMrt merged 6 commits into
masterfrom
develop

Conversation

@LukaMrt

@LukaMrt LukaMrt commented May 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ajout d'un MergeService avec des méthodes atomiques (transaction DBAL) pour fusionner des filières, associations et écoles
  • Ajout d'un MergeAdminController accessible depuis le menu admin ("Fusionner référentiels")
  • Interface avec 3 formulaires (filières, associations, écoles) permettant de choisir une source (supprimée) et une cible (conservée)
  • Tous les enregistrements liés (PersonFiliere, PersonAssociation) sont réassignés vers la cible, les champs annexes (dates, poste, diplôme) sont préservés

Test plan

  • Accéder à l'admin et cliquer sur "Fusionner référentiels" dans la section Outils
  • Fusionner deux filières et vérifier que les PersonFiliere sont bien réassignées
  • Fusionner deux associations et vérifier que les PersonAssociation sont bien réassignées
  • Fusionner deux écoles et vérifier que les PersonFiliere (school) sont bien réassignées
  • Vérifier que la source est supprimée après la fusion
  • Vérifier que sélectionner source = cible affiche un avertissement sans effectuer de fusion

🤖 Generated with Claude Code

LukaMrt and others added 3 commits May 22, 2026 17:55
- TreePage: shuffle persons order once on load, always default to grid view
- Directory toolbar: replace year pills with FilterCombobox (searchable, chips
  with overflow count) for promo, filière and école filters
- EditPersonPage: add CharacteristicsEditor to edit réseaux/services in-place,
  add LinksEditor for free-form links (title + URL)
- PersonPage: display free PersonLink items alongside characteristics in Liens section
- Backend: new PersonLink entity + migration, syncCharacteristics and syncLinks
  services, GET /api/characteristic-types endpoint
- Fixtures: PersonLinkFixture with sample free links for several persons

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an admin merge tool for reference data (filières/associations/écoles) and also introduces new “links” capabilities on person profiles plus extended directory filtering UI in the tree page.

Changes:

  • Backend: add MergeService + /admin/merge UI to merge reference entities and reassign related join rows.
  • Backend/Frontend: add “free-form links” (person_link) and editing/display support, plus characteristic types API.
  • Frontend: add new directory filters (promo/filière/école) and a new combobox-style filter UI; adjust CI workflow triggers.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
frontend/src/types/person.ts Adds links to Person and request types for links/characteristics
frontend/src/pages/tree/TreePage.tsx Adds shuffled ordering + filière/school filters wiring
frontend/src/pages/tree/toolbar/TagFilter.tsx New tag filter component
frontend/src/pages/tree/toolbar/FilterDropdown.tsx New dropdown filter component
frontend/src/pages/tree/toolbar/FilterCombobox.tsx New combobox filter component
frontend/src/pages/tree/toolbar/DirectoryToolbar.tsx Replaces year filter with combobox filters (promo/filière/école)
frontend/src/pages/person/PersonPage.tsx Displays free links in the “Liens” card
frontend/src/pages/person/EditPersonPage.tsx Adds editors for characteristics + free links
frontend/src/lib/persons.ts Extends filtering logic to filières + écoles
frontend/src/lib/api/characteristicTypes.ts Adds API client for characteristic types
frontend/src/hooks/usePersonFilter.ts Adds state/actions for new filters
backend/templates/admin/merge.html.twig Adds admin page template with merge forms
backend/src/Service/PersonService.php Maps links; adds sync methods for characteristics + links
backend/src/Service/MergeService.php Implements transactional merge operations via DQL updates
backend/src/Repository/Person/PersonLinkRepository.php Repository for PersonLink
backend/src/Repository/CharacteristicRepository.php Adds create() helper
backend/src/Fixture/PersonLinkFixture.php Seeds example person links
backend/src/Entity/Person/PersonLink.php New entity for free-form links
backend/src/Entity/Person/Person.php Adds links association + replace helpers
backend/src/Dto/Person/PersonResponseDto.php Adds links in response DTO
backend/src/Dto/Person/PersonRequestDto.php Adds characteristics + links in request DTO
backend/src/Dto/Person/PersonLinkRequestDto.php New request DTO with validation for links
backend/src/Dto/Person/PersonLinkDto.php New response DTO for links
backend/src/Dto/Person/CharacteristicRequestDto.php New request DTO for characteristic updates
backend/src/Controller/Api/PersonApiController.php Calls new sync methods on update
backend/src/Controller/Api/CharacteristicTypeApiController.php Exposes characteristic types list API
backend/src/Controller/Admin/MergeAdminController.php Admin controller for merge page + merge actions
backend/src/Controller/Admin/DashboardController.php Adds “Fusionner référentiels” menu link
backend/migrations/Version20260522120000.php Creates person_link table
backend/migrations/Version20260522154347.php Renames FK/index and changes FK semantics
.github/workflows/build.yml Adjusts branch triggers for workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/pages/tree/TreePage.tsx
Comment thread frontend/src/pages/tree/toolbar/FilterCombobox.tsx
Comment thread frontend/src/pages/tree/toolbar/TagFilter.tsx
Comment thread backend/src/Service/PersonService.php
Comment thread frontend/src/pages/person/EditPersonPage.tsx Outdated
Comment thread backend/migrations/Version20260522154347.php
Comment thread frontend/src/lib/persons.ts
Comment thread frontend/src/hooks/usePersonFilter.ts
Comment thread frontend/src/types/person.ts
Comment thread frontend/src/pages/person/EditPersonPage.tsx
LukaMrt and others added 3 commits May 22, 2026 18:26
- TreePage: shuffle only after full load (loadingMore=false) to avoid partial shuffle
- TagFilter: add type="button" to prevent accidental form submission
- EditPersonPage: remove dead code (usedTypeIds / void usedTypeIds)
- PersonService: syncCharacteristics now removes characteristics absent from payload
- MergeAdminController: catch \Throwable for unexpected DB errors
- DashboardController: split long line to satisfy PHPCS 120-char limit
- persons.test.ts / usePersonFilter.test.ts: update mocks to match new Person type and PersonFilter shape

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The FilterCombobox keeps the dropdown open after toggling an option,
so step 4 can click the option directly without needing to re-open it.
Removes the incorrect "Promo · N" locator that only appears in compact
mode (3+ selections).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LukaMrt
LukaMrt merged commit fa91cb1 into master May 22, 2026
14 checks passed
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.

2 participants