diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 4cceb8f..9d61c99 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1821,6 +1821,10 @@ function App() { } }, [auth.userAuth.token, tree.canEditCurrentTree, tree.treeContext.accessToken, tree.treeContext.treeId, refreshTreeAndKeepSelection, isDemoMode, makeLocalId]) // eslint-disable-line react-hooks/exhaustive-deps + // Choix en attente d'un contributeur (brouillon), affiché sur la fiche avant l'envoi + const [pendingParentage, setPendingParentage] = useState({}) + useEffect(() => { if (!editMode.isActive) setPendingParentage({}) }, [editMode.isActive]) // eslint-disable-line react-hooks/exhaustive-deps + // Lien avec ses parents : naissance ou adoption, pour tous les liens parent de la personne const handleSetParentage = useCallback(async (childPersonId, parentageType) => { const childLinks = filiations.filter((candidate) => String(candidate.childId) === String(childPersonId)) @@ -1837,6 +1841,7 @@ function App() { const draft = editMode.restoreDraft() const parentageChanges = { ...(draft.parentageChanges || {}), [String(childPersonId)]: parentageType } editMode.updateDraft({ parentageChanges }) + setPendingParentage((prev) => ({ ...prev, [String(childPersonId)]: parentageType })) setRelationFeedback({ loading: false, success: t('Modification ajoutée à la contribution'), error: '' }) return } @@ -3090,6 +3095,7 @@ function App() { onAddRelation={handleAddRelation} onRemoveRelation={handleRemoveRelation} onSetParentage={handleSetParentage} + pendingParentage={pendingParentage[String(tree.selectedPerson.id)] ?? null} relationActionLoading={relationFeedback.loading} relationActionSuccess={relationFeedback.success} relationActionError={relationFeedback.error} diff --git a/frontend/src/components/PersonCard.css b/frontend/src/components/PersonCard.css index 2e72518..aff0ddf 100644 --- a/frontend/src/components/PersonCard.css +++ b/frontend/src/components/PersonCard.css @@ -269,3 +269,6 @@ .pc-parentage { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pz-line-soft); } .pc-seg { width: 100%; } .pc-seg .pz-tab { flex: 1; } + +/* Titres de section de l'onglet Infos et Liens : casse normale, Newsreader 15 px, comme la maquette (.sec) */ +.pc-infos .pz-eyebrow { text-transform: none; letter-spacing: 0; font: 400 15px/1.3 var(--pz-serif); color: var(--pz-ink); } diff --git a/frontend/src/components/PersonCard.jsx b/frontend/src/components/PersonCard.jsx index 75e6073..70f2ee8 100644 --- a/frontend/src/components/PersonCard.jsx +++ b/frontend/src/components/PersonCard.jsx @@ -59,6 +59,7 @@ const PersonCard = ({ onAddRelation, onRemoveRelation, onSetParentage, + pendingParentage = null, relationActionLoading = false, relationActionSuccess = '', relationActionError = '', @@ -353,7 +354,8 @@ const PersonCard = ({ && f.parentageType === 'adoption' && (String(f.parentId) === String(parentId) || (f.unionId && personUnions.some((u) => String(u.id) === String(f.unionId)))) )) - const parentsAdopted = filiations.some((f) => String(f.childId) === String(person.id) && f.parentageType === 'adoption') + // Un contributeur voit son choix en attente avant l'envoi ; sinon le lien enregistré + const parentsAdopted = pendingParentage ? pendingParentage === 'adoption' : filiations.some((f) => String(f.childId) === String(person.id) && f.parentageType === 'adoption') const adoptedChildLabel = (child) => { if (!parentageAdopted(child.id, person.id)) return null return child.sex === 'female' ? t('adoptée') : t('adopté')