diff --git a/geneit_app/src/App.tsx b/geneit_app/src/App.tsx index 2fdad99..8994ab5 100644 --- a/geneit_app/src/App.tsx +++ b/geneit_app/src/App.tsx @@ -67,33 +67,42 @@ export function App(): React.ReactElement { }> } /> - } /> - } - /> - } /> - } - /> + + } /> + } + /> + } + /> + } + /> - } /> - } - /> - } /> - } - /> + } /> + } + /> + } + /> + } + /> - } /> - } - /> + } /> + } + /> + } /> + } /> } /> diff --git a/geneit_app/src/api/FamilyApi.ts b/geneit_app/src/api/FamilyApi.ts index e830f54..763dc7e 100644 --- a/geneit_app/src/api/FamilyApi.ts +++ b/geneit_app/src/api/FamilyApi.ts @@ -60,7 +60,8 @@ export class Family implements FamilyAPI { */ memberURL(member: Member, edit?: boolean): string { return ( - `/family/${this.family_id}/member/${member.id}` + (edit ? "/edit" : "") + `/family/${this.family_id}/genealogy/member/${member.id}` + + (edit ? "/edit" : "") ); } @@ -68,7 +69,7 @@ export class Family implements FamilyAPI { * Get family tree URL for member */ familyTreeURL(member: Member | number): string { - return `/family/${this.family_id}/tree/${ + return `/family/${this.family_id}/genealogy/tree/${ typeof member === "number" ? member : member.id }`; } @@ -78,7 +79,8 @@ export class Family implements FamilyAPI { */ coupleURL(member: Couple, edit?: boolean): string { return ( - `/family/${this.family_id}/couple/${member.id}` + (edit ? "/edit" : "") + `/family/${this.family_id}/genealogy/couple/${member.id}` + + (edit ? "/edit" : "") ); } } diff --git a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx index 3de9873..7693feb 100644 --- a/geneit_app/src/routes/family/FamilyCoupleRoute.tsx +++ b/geneit_app/src/routes/family/FamilyCoupleRoute.tsx @@ -62,7 +62,7 @@ export function FamilyCreateCoupleRoute(): React.ReactElement { const cancel = () => { setShouldQuit(true); - n(family.family.URL("couples")); + n(family.family.URL("genealogy/couples")); }; return ( @@ -115,7 +115,7 @@ export function FamilyCoupleRoute(): React.ReactElement { await CoupleApi.Delete(couple!); snackbar("La fiche du couple a été supprimée avec succès !"); - n(family.family.URL("couples")); + n(family.family.URL("genealogy/couples")); await family.reloadCouplesList(); } catch (e) { @@ -486,7 +486,7 @@ export function CouplePage(p: {
diff --git a/geneit_app/src/routes/family/FamilyMemberRoute.tsx b/geneit_app/src/routes/family/FamilyMemberRoute.tsx index c394f53..7e5509e 100644 --- a/geneit_app/src/routes/family/FamilyMemberRoute.tsx +++ b/geneit_app/src/routes/family/FamilyMemberRoute.tsx @@ -63,7 +63,7 @@ export function FamilyCreateMemberRoute(): React.ReactElement { await family.reloadMembersList(); setShouldQuit(true); - n(family.family.URL(`member/${r.id}`)); + n(family.family.URL(`genealogy/member/${r.id}`)); snackbar(`La fiche pour ${r.fullName} a été créée avec succès !`); } catch (e) { console.error(e); @@ -73,7 +73,7 @@ export function FamilyCreateMemberRoute(): React.ReactElement { const cancel = () => { setShouldQuit(true); - n(family.family.URL("members")); + n(family.family.URL("genealogy/members")); }; const member = Member.New(family.family.family_id); @@ -130,7 +130,7 @@ export function FamilyMemberRoute(): React.ReactElement { await MemberApi.Delete(member!); snackbar("La fiche de membre a été supprimée avec succès !"); - n(family.family.URL("members")); + n(family.family.URL("genealogy/members")); await family.reloadMembersList(); } catch (e) { @@ -155,9 +155,7 @@ export function FamilyMemberRoute(): React.ReactElement { editing={false} onrequestOpenTree={() => n(family.family.familyTreeURL(member!))} onRequestDelete={deleteMember} - onRequestEdit={() => - n(family.family.URL(`member/${member!.id}/edit`)) - } + onRequestEdit={() => n(family.family.memberURL(member!, true))} onForceReload={forceReload} /> )} @@ -199,7 +197,7 @@ export function FamilyEditMemberRoute(): React.ReactElement { await family.reloadMembersList(); setShouldQuit(true); - n(family.family.URL(`member/${member!.id}`)); + n(family.family.memberURL(member!)); } catch (e) { console.error(e); alert("Échec de la mise à jour des informations du membre !"); @@ -682,10 +680,7 @@ export function MemberPage(p: { <>Aucun enfant ) : ( p.children.map((c) => ( - + )) @@ -694,7 +689,7 @@ export function MemberPage(p: {
Aucun frère ou sœur ) : ( p.siblings.map((c) => ( - + )) @@ -727,7 +719,7 @@ export function MemberPage(p: {
diff --git a/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx b/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx index faa24b6..5949f6b 100644 --- a/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx +++ b/geneit_app/src/routes/family/FamilyMemberTreeRoute.tsx @@ -87,7 +87,7 @@ export function FamilyMemberTreeRoute(): React.ReactElement { dense member={member} secondary={ - + diff --git a/geneit_app/src/routes/family/FamilyMembersListRoute.tsx b/geneit_app/src/routes/family/FamilyMembersListRoute.tsx index 66a5af4..db7a48a 100644 --- a/geneit_app/src/routes/family/FamilyMembersListRoute.tsx +++ b/geneit_app/src/routes/family/FamilyMembersListRoute.tsx @@ -60,7 +60,7 @@ export function FamilyMembersListRoute(): React.ReactElement { }} > - + diff --git a/geneit_app/src/routes/family/FamilySettingsRoute.tsx b/geneit_app/src/routes/family/FamilySettingsRoute.tsx index 5c1cc14..bfc4186 100644 --- a/geneit_app/src/routes/family/FamilySettingsRoute.tsx +++ b/geneit_app/src/routes/family/FamilySettingsRoute.tsx @@ -14,9 +14,9 @@ import { } from "@mui/material"; import React from "react"; import { useNavigate } from "react-router-dom"; -import { DataApi } from "../../api/genealogy/DataApi"; import { FamilyApi } from "../../api/FamilyApi"; import { ServerApi } from "../../api/ServerApi"; +import { DataApi } from "../../api/genealogy/DataApi"; import { useAlert } from "../../hooks/context_providers/AlertDialogProvider"; import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider"; import { useLoadingMessage } from "../../hooks/context_providers/LoadingMessageProvider"; @@ -55,7 +55,7 @@ export function FamilySettingsRoute(): React.ReactElement { return ( <> - + {family.family.enable_genealogy && }