Refactor routes storage
This commit is contained in:
parent
1daca27ba0
commit
f686d3fcbf
@ -16,26 +16,26 @@ import { NewAccountRoute } from "./routes/auth/NewAccountRoute";
|
|||||||
import { OIDCCbRoute } from "./routes/auth/OIDCCbRoute";
|
import { OIDCCbRoute } from "./routes/auth/OIDCCbRoute";
|
||||||
import { PasswordForgottenRoute } from "./routes/auth/PasswordForgottenRoute";
|
import { PasswordForgottenRoute } from "./routes/auth/PasswordForgottenRoute";
|
||||||
import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute";
|
import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute";
|
||||||
import { FamilyHomeRoute } from "./routes/family/FamilyHomeRoute";
|
import { FamilyHomeRoute } from "./routes/family/genealogy/FamilyHomeRoute";
|
||||||
import {
|
import {
|
||||||
FamilyCreateMemberRoute,
|
FamilyCreateMemberRoute,
|
||||||
FamilyEditMemberRoute,
|
FamilyEditMemberRoute,
|
||||||
FamilyMemberRoute,
|
FamilyMemberRoute,
|
||||||
} from "./routes/family/FamilyMemberRoute";
|
} from "./routes/family/genealogy/FamilyMemberRoute";
|
||||||
import { FamilySettingsRoute } from "./routes/family/FamilySettingsRoute";
|
import { FamilySettingsRoute } from "./routes/family/FamilySettingsRoute";
|
||||||
import { FamilyUsersListRoute } from "./routes/family/FamilyUsersListRoute";
|
import { FamilyUsersListRoute } from "./routes/family/FamilyUsersListRoute";
|
||||||
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
|
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
|
||||||
import { BaseFamilyRoute } from "./widgets/BaseFamilyRoute";
|
import { BaseFamilyRoute } from "./widgets/BaseFamilyRoute";
|
||||||
import { BaseLoginPage } from "./widgets/BaseLoginpage";
|
import { BaseLoginPage } from "./widgets/BaseLoginpage";
|
||||||
import { FamilyMembersListRoute } from "./routes/family/FamilyMembersListRoute";
|
import { FamilyMembersListRoute } from "./routes/family/genealogy/FamilyMembersListRoute";
|
||||||
import {
|
import {
|
||||||
FamilyCoupleRoute,
|
FamilyCoupleRoute,
|
||||||
FamilyCreateCoupleRoute,
|
FamilyCreateCoupleRoute,
|
||||||
FamilyEditCoupleRoute,
|
FamilyEditCoupleRoute,
|
||||||
} from "./routes/family/FamilyCoupleRoute";
|
} from "./routes/family/genealogy/FamilyCoupleRoute";
|
||||||
import { FamilyCouplesListRoute } from "./routes/family/FamilyCouplesListRoute";
|
import { FamilyCouplesListRoute } from "./routes/family/genealogy/FamilyCouplesListRoute";
|
||||||
import { FamilyTreeRoute } from "./routes/family/FamilyTreeRoute";
|
import { FamilyTreeRoute } from "./routes/family/genealogy/FamilyTreeRoute";
|
||||||
import { FamilyMemberTreeRoute } from "./routes/family/FamilyMemberTreeRoute";
|
import { FamilyMemberTreeRoute } from "./routes/family/genealogy/FamilyMemberTreeRoute";
|
||||||
import { GenealogyHomeRoute } from "./routes/family/genealogy/GenealogyHomeRoute";
|
import { GenealogyHomeRoute } from "./routes/family/genealogy/GenealogyHomeRoute";
|
||||||
|
|
||||||
interface AuthContext {
|
interface AuthContext {
|
||||||
|
@ -6,26 +6,26 @@ import SaveIcon from "@mui/icons-material/Save";
|
|||||||
import { Button, Grid, Stack } from "@mui/material";
|
import { Button, Grid, Stack } from "@mui/material";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { Couple, CoupleApi } from "../../api/genealogy/CoupleApi";
|
import { Couple, CoupleApi } from "../../../api/genealogy/CoupleApi";
|
||||||
import { Member } from "../../api/genealogy/MemberApi";
|
import { Member } from "../../../api/genealogy/MemberApi";
|
||||||
import { ServerApi } from "../../api/ServerApi";
|
import { ServerApi } from "../../../api/ServerApi";
|
||||||
import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
|
import { useAlert } from "../../../hooks/context_providers/AlertDialogProvider";
|
||||||
import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider";
|
import { useConfirm } from "../../../hooks/context_providers/ConfirmDialogProvider";
|
||||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
import { useSnackbar } from "../../../hooks/context_providers/SnackbarProvider";
|
||||||
import { AsyncWidget } from "../../widgets/AsyncWidget";
|
import { AsyncWidget } from "../../../widgets/AsyncWidget";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { ConfirmLeaveWithoutSaveDialog } from "../../widgets/ConfirmLeaveWithoutSaveDialog";
|
import { ConfirmLeaveWithoutSaveDialog } from "../../../widgets/ConfirmLeaveWithoutSaveDialog";
|
||||||
import { CouplePhoto } from "../../widgets/CouplePhoto";
|
import { CouplePhoto } from "../../../widgets/CouplePhoto";
|
||||||
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
|
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
|
||||||
import { MemberItem } from "../../widgets/MemberItem";
|
import { MemberItem } from "../../../widgets/MemberItem";
|
||||||
import { PropertiesBox } from "../../widgets/PropertiesBox";
|
import { PropertiesBox } from "../../../widgets/PropertiesBox";
|
||||||
import { RouterLink } from "../../widgets/RouterLink";
|
import { RouterLink } from "../../../widgets/RouterLink";
|
||||||
import { DateInput } from "../../widgets/forms/DateInput";
|
import { DateInput } from "../../../widgets/forms/DateInput";
|
||||||
import { MemberInput } from "../../widgets/forms/MemberInput";
|
import { MemberInput } from "../../../widgets/forms/MemberInput";
|
||||||
import { PropSelect } from "../../widgets/forms/PropSelect";
|
import { PropSelect } from "../../../widgets/forms/PropSelect";
|
||||||
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
|
import { UploadPhotoButton } from "../../../widgets/forms/UploadPhotoButton";
|
||||||
import { useQuery } from "../../hooks/useQuery";
|
import { useQuery } from "../../../hooks/useQuery";
|
||||||
import { useLoadingMessage } from "../../hooks/context_providers/LoadingMessageProvider";
|
import { useLoadingMessage } from "../../../hooks/context_providers/LoadingMessageProvider";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new couple route
|
* Create a new couple route
|
@ -6,17 +6,17 @@ import { Button, TextField, Tooltip } from "@mui/material";
|
|||||||
import { DataGrid, GridActionsCellItem, GridColDef } from "@mui/x-data-grid";
|
import { DataGrid, GridActionsCellItem, GridColDef } from "@mui/x-data-grid";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { Couple, CoupleApi } from "../../api/genealogy/CoupleApi";
|
import { Couple, CoupleApi } from "../../../api/genealogy/CoupleApi";
|
||||||
import { dateTimestamp, fmtDate } from "../../api/genealogy/MemberApi";
|
import { dateTimestamp, fmtDate } from "../../../api/genealogy/MemberApi";
|
||||||
import { ServerApi } from "../../api/ServerApi";
|
import { ServerApi } from "../../../api/ServerApi";
|
||||||
import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
|
import { useAlert } from "../../../hooks/context_providers/AlertDialogProvider";
|
||||||
import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider";
|
import { useConfirm } from "../../../hooks/context_providers/ConfirmDialogProvider";
|
||||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
import { useSnackbar } from "../../../hooks/context_providers/SnackbarProvider";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { CouplePhoto } from "../../widgets/CouplePhoto";
|
import { CouplePhoto } from "../../../widgets/CouplePhoto";
|
||||||
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
|
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
|
||||||
import { MemberPhoto } from "../../widgets/MemberPhoto";
|
import { MemberPhoto } from "../../../widgets/MemberPhoto";
|
||||||
import { RouterLink } from "../../widgets/RouterLink";
|
import { RouterLink } from "../../../widgets/RouterLink";
|
||||||
|
|
||||||
export function FamilyCouplesListRoute(): React.ReactElement {
|
export function FamilyCouplesListRoute(): React.ReactElement {
|
||||||
const alert = useAlert();
|
const alert = useAlert();
|
@ -1,5 +1,5 @@
|
|||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
|
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
|
||||||
|
|
||||||
export function FamilyHomeRoute(): React.ReactElement {
|
export function FamilyHomeRoute(): React.ReactElement {
|
||||||
return (
|
return (
|
@ -14,32 +14,32 @@ import {
|
|||||||
import * as EmailValidator from "email-validator";
|
import * as EmailValidator from "email-validator";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { Couple } from "../../api/genealogy/CoupleApi";
|
import { Couple } from "../../../api/genealogy/CoupleApi";
|
||||||
import { Member, MemberApi, fmtDate } from "../../api/genealogy/MemberApi";
|
import { Member, MemberApi, fmtDate } from "../../../api/genealogy/MemberApi";
|
||||||
import { ServerApi } from "../../api/ServerApi";
|
import { ServerApi } from "../../../api/ServerApi";
|
||||||
import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
|
import { useAlert } from "../../../hooks/context_providers/AlertDialogProvider";
|
||||||
import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider";
|
import { useConfirm } from "../../../hooks/context_providers/ConfirmDialogProvider";
|
||||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
import { useSnackbar } from "../../../hooks/context_providers/SnackbarProvider";
|
||||||
import { AsyncWidget } from "../../widgets/AsyncWidget";
|
import { AsyncWidget } from "../../../widgets/AsyncWidget";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { ConfirmLeaveWithoutSaveDialog } from "../../widgets/ConfirmLeaveWithoutSaveDialog";
|
import { ConfirmLeaveWithoutSaveDialog } from "../../../widgets/ConfirmLeaveWithoutSaveDialog";
|
||||||
import { CouplePhoto } from "../../widgets/CouplePhoto";
|
import { CouplePhoto } from "../../../widgets/CouplePhoto";
|
||||||
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
|
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
|
||||||
import { MemberItem } from "../../widgets/MemberItem";
|
import { MemberItem } from "../../../widgets/MemberItem";
|
||||||
import { MemberPhoto } from "../../widgets/MemberPhoto";
|
import { MemberPhoto } from "../../../widgets/MemberPhoto";
|
||||||
import { PropertiesBox } from "../../widgets/PropertiesBox";
|
import { PropertiesBox } from "../../../widgets/PropertiesBox";
|
||||||
import { RouterLink } from "../../widgets/RouterLink";
|
import { RouterLink } from "../../../widgets/RouterLink";
|
||||||
import { DateInput } from "../../widgets/forms/DateInput";
|
import { DateInput } from "../../../widgets/forms/DateInput";
|
||||||
import { MemberInput } from "../../widgets/forms/MemberInput";
|
import { MemberInput } from "../../../widgets/forms/MemberInput";
|
||||||
import { PropCheckbox } from "../../widgets/forms/PropCheckbox";
|
import { PropCheckbox } from "../../../widgets/forms/PropCheckbox";
|
||||||
import { PropEdit } from "../../widgets/forms/PropEdit";
|
import { PropEdit } from "../../../widgets/forms/PropEdit";
|
||||||
import { PropSelect } from "../../widgets/forms/PropSelect";
|
import { PropSelect } from "../../../widgets/forms/PropSelect";
|
||||||
import { SexSelection } from "../../widgets/forms/SexSelection";
|
import { SexSelection } from "../../../widgets/forms/SexSelection";
|
||||||
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
|
import { UploadPhotoButton } from "../../../widgets/forms/UploadPhotoButton";
|
||||||
import { useQuery } from "../../hooks/useQuery";
|
import { useQuery } from "../../../hooks/useQuery";
|
||||||
import { mdiFamilyTree } from "@mdi/js";
|
import { mdiFamilyTree } from "@mdi/js";
|
||||||
import Icon from "@mdi/react";
|
import Icon from "@mdi/react";
|
||||||
import { useLoadingMessage } from "../../hooks/context_providers/LoadingMessageProvider";
|
import { useLoadingMessage } from "../../../hooks/context_providers/LoadingMessageProvider";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new member route
|
* Create a new member route
|
@ -21,12 +21,12 @@ import {
|
|||||||
buildAscendingTree,
|
buildAscendingTree,
|
||||||
buildDescendingTree,
|
buildDescendingTree,
|
||||||
treeHeight,
|
treeHeight,
|
||||||
} from "../../utils/family_tree";
|
} from "../../../utils/family_tree";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { BasicFamilyTree } from "../../widgets/BasicFamilyTree";
|
import { BasicFamilyTree } from "../../../widgets/BasicFamilyTree";
|
||||||
import { MemberItem } from "../../widgets/MemberItem";
|
import { MemberItem } from "../../../widgets/MemberItem";
|
||||||
import { RouterLink } from "../../widgets/RouterLink";
|
import { RouterLink } from "../../../widgets/RouterLink";
|
||||||
import { SimpleFamilyTree } from "../../widgets/simple_family_tree/SimpleFamilyTree";
|
import { SimpleFamilyTree } from "../../../widgets/simple_family_tree/SimpleFamilyTree";
|
||||||
|
|
||||||
enum CurrTab {
|
enum CurrTab {
|
||||||
BasicTree,
|
BasicTree,
|
@ -13,14 +13,14 @@ import {
|
|||||||
MemberApi,
|
MemberApi,
|
||||||
dateTimestamp,
|
dateTimestamp,
|
||||||
fmtDate,
|
fmtDate,
|
||||||
} from "../../api/genealogy/MemberApi";
|
} from "../../../api/genealogy/MemberApi";
|
||||||
import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
|
import { useAlert } from "../../../hooks/context_providers/AlertDialogProvider";
|
||||||
import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider";
|
import { useConfirm } from "../../../hooks/context_providers/ConfirmDialogProvider";
|
||||||
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
|
import { useSnackbar } from "../../../hooks/context_providers/SnackbarProvider";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { FamilyPageTitle } from "../../widgets/FamilyPageTitle";
|
import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle";
|
||||||
import { MemberPhoto } from "../../widgets/MemberPhoto";
|
import { MemberPhoto } from "../../../widgets/MemberPhoto";
|
||||||
import { RouterLink } from "../../widgets/RouterLink";
|
import { RouterLink } from "../../../widgets/RouterLink";
|
||||||
|
|
||||||
export function FamilyMembersListRoute(): React.ReactElement {
|
export function FamilyMembersListRoute(): React.ReactElement {
|
||||||
const alert = useAlert();
|
const alert = useAlert();
|
@ -1,6 +1,6 @@
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useFamily } from "../../widgets/BaseFamilyRoute";
|
import { useFamily } from "../../../widgets/BaseFamilyRoute";
|
||||||
import { MemberInput } from "../../widgets/forms/MemberInput";
|
import { MemberInput } from "../../../widgets/forms/MemberInput";
|
||||||
|
|
||||||
export function FamilyTreeRoute(): React.ReactElement {
|
export function FamilyTreeRoute(): React.ReactElement {
|
||||||
const n = useNavigate();
|
const n = useNavigate();
|
Loading…
Reference in New Issue
Block a user