mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-13 08:22:03 +00:00
fiche : aperçu du choix d'adoption en attente, titres de section en casse normale
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cde9c3d44d
commit
a36b287a32
3 files changed
+12
-1
No files matched your search
@@ -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}
|
||||
|
||||
@@ -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); }
|
||||
@@ -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é')
|
||||
|
||||
Reference in new issue
Block a user