Immich : publier l'origine du portrait dans le graphe, pas l'identifiant

- avatarFromImmich (fichier préfixé « immich- ») remplace immichPersonId
  côté front : le panneau ne propose le retrait que si le portrait vient
  d'Immich, et le bouton de la fiche retrouve son libellé distinctif
- helper isImmichAvatarPath partagé entre le payload du graphe et la route
  unassign, qui testaient le préfixe chacun de son côté
- tests : origine du portrait dans le payload (vrai/faux/null)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mistral Vibe committed 2026-10-13 17:47:37 +02:00
1 parent 8d36a08b11
commit 310f2fb597
10 files changed
+50 -12

No files matched your search

+1
View File
@@ -115,6 +115,7 @@ function mapRemotePersonToLocal(person, current = null) {
profession: person?.profession || null,
nationality: person?.nationality || null,
photo: current?.photo || null,
avatarFromImmich: person?.avatarFromImmich ?? false,
}
}
+5
View File
@@ -15,6 +15,7 @@ describe('loadGraphData avatar mapping', () => {
deathDate: null,
notes: null,
avatarUrlPath: '/trees/t-1/persons/p-1/avatar',
avatarFromImmich: true,
},
{
id: 'p-2',
@@ -24,6 +25,7 @@ describe('loadGraphData avatar mapping', () => {
deathDate: null,
notes: null,
avatarUrlPath: null,
avatarFromImmich: false,
},
],
unions: [],
@@ -48,6 +50,9 @@ describe('loadGraphData avatar mapping', () => {
expect(getPersonById('p-1')?.photo).toBe('/api/trees/t-1/persons/p-1/avatar?token=abc')
expect(getPersonById('p-2')?.photo).toBeNull()
expect(getPersonMedias('p-2')[0]?.source).toBe('Album familial')
// Origine du portrait portée par la personne (faux quand il ne vient pas d'Immich)
expect(getPersonById('p-1')?.avatarFromImmich).toBe(true)
expect(getPersonById('p-2')?.avatarFromImmich).toBe(false)
})
})