From d0337e679b2f7d28ba44042219c216e21e99e28d Mon Sep 17 00:00:00 2001 From: hatim dinia Date: Thu, 31 Oct 2024 09:57:17 +0100 Subject: [PATCH] refactor(ui-imports): migrate to absolute imports from src directory --- installer | 2 +- .../Settings/utils.ts => common/contants.ts} | 9 ++-- webapp/src/components/App/Api.tsx | 2 +- .../src/components/App/Data/DataListing.tsx | 2 +- .../src/components/App/Data/DataPropsView.tsx | 6 +-- .../App/Data/DatasetCreationDialog.tsx | 10 ++-- .../src/components/App/Data/MatrixDialog.tsx | 8 ++-- webapp/src/components/App/Data/index.tsx | 20 ++++---- webapp/src/components/App/Data/utils.tsx | 4 +- .../components/App/Settings/Groups/Header.tsx | 8 ++-- .../Groups/dialog/CreateGroupDialog.tsx | 8 ++-- .../dialog/GroupFormDialog/GroupForm.tsx | 18 +++---- .../Groups/dialog/GroupFormDialog/index.tsx | 4 +- .../Groups/dialog/UpdateGroupDialog.tsx | 8 ++-- .../components/App/Settings/Groups/index.tsx | 20 ++++---- .../App/Settings/Maintenance/index.tsx | 8 ++-- .../components/App/Settings/Tokens/Header.tsx | 4 +- .../Tokens/dialog/CreateTokenDialog.tsx | 15 ++---- .../dialog/TokenFormDialog/TokenForm.tsx | 17 +++---- .../Tokens/dialog/TokenFormDialog/index.tsx | 2 +- .../Tokens/dialog/TokenInfoDialog.tsx | 12 ++--- .../components/App/Settings/Tokens/index.tsx | 23 ++++----- .../components/App/Settings/Users/Header.tsx | 4 +- .../Users/dialog/CreateUserDialog.tsx | 8 ++-- .../Users/dialog/UpdateUserDialog.tsx | 12 ++--- .../Users/dialog/UserFormDialog/UserForm.tsx | 17 +++---- .../Users/dialog/UserFormDialog/index.tsx | 6 +-- .../components/App/Settings/Users/index.tsx | 16 +++---- webapp/src/components/App/Settings/index.tsx | 11 ++--- .../CommandListItem/CommandMatrixViewer.tsx | 2 +- .../CommandListItem/index.tsx | 8 ++-- .../CommandListItem/style.ts | 2 +- .../DraggableCommands/CommandListView.tsx | 2 +- .../Commands/Edition/commandTypes.ts | 2 +- .../Singlestudy/Commands/Edition/index.tsx | 18 +++---- .../App/Singlestudy/Commands/Edition/utils.ts | 2 +- .../InformationView/CreateVariantDialog.tsx | 16 +++---- .../LauncherHistory/JobStepper.tsx | 22 ++++----- .../InformationView/LauncherHistory/index.tsx | 13 ++--- .../Notes/NodeEditorModal/index.tsx | 4 +- .../HomeView/InformationView/Notes/index.tsx | 16 +++---- .../HomeView/InformationView/Notes/utils.ts | 2 +- .../HomeView/InformationView/index.tsx | 8 ++-- .../HomeView/StudyTreeView/index.tsx | 2 +- .../HomeView/StudyTreeView/utils.ts | 6 +-- .../App/Singlestudy/HomeView/index.tsx | 2 +- .../App/Singlestudy/NavHeader/Actions.tsx | 12 ++--- .../App/Singlestudy/NavHeader/Details.tsx | 6 +-- .../App/Singlestudy/NavHeader/index.tsx | 28 +++++------ .../App/Singlestudy/PropertiesDialog.tsx | 28 +++++------ .../App/Singlestudy/UpgradeDialog.tsx | 16 +++---- .../Configuration/AdequacyPatch/Fields.tsx | 12 ++--- .../Configuration/AdequacyPatch/index.tsx | 14 +++--- .../Configuration/AdequacyPatch/utils.ts | 4 +- .../AdvancedParameters/Fields.tsx | 10 ++-- .../AdvancedParameters/index.tsx | 10 ++-- .../Configuration/AdvancedParameters/utils.ts | 4 +- .../explore/Configuration/General/Fields.tsx | 14 +++--- .../dialogs/ScenarioBuilderDialog/Table.tsx | 12 ++--- .../dialogs/ScenarioBuilderDialog/index.tsx | 8 ++-- .../dialogs/ScenarioBuilderDialog/utils.ts | 4 +- .../ScenarioBuilderDialog/withAreas.tsx | 6 +-- .../dialogs/ScenarioPlaylistDialog/index.tsx | 17 +++---- .../dialogs/ScenarioPlaylistDialog/utils.ts | 4 +- .../dialogs/ThematicTrimmingDialog/index.tsx | 19 ++++---- .../dialogs/ThematicTrimmingDialog/utils.ts | 2 +- .../explore/Configuration/General/index.tsx | 6 +-- .../explore/Configuration/General/utils.ts | 4 +- .../Configuration/Optimization/Fields.tsx | 10 ++-- .../Configuration/Optimization/index.tsx | 10 ++-- .../Configuration/Optimization/utils.ts | 4 +- .../TimeSeriesManagement/Fields.tsx | 10 ++-- .../TimeSeriesManagement/index.tsx | 8 ++-- .../TimeSeriesManagement/utils.ts | 4 +- .../explore/Configuration/index.tsx | 12 ++--- .../Singlestudy/explore/Debug/Data/Folder.tsx | 32 ++++++------- .../Singlestudy/explore/Debug/Data/Image.tsx | 4 +- .../Singlestudy/explore/Debug/Data/Json.tsx | 16 +++---- .../Singlestudy/explore/Debug/Data/Matrix.tsx | 4 +- .../Singlestudy/explore/Debug/Data/Text.tsx | 14 +++--- .../Singlestudy/explore/Debug/Data/index.tsx | 7 ++- .../Singlestudy/explore/Debug/DebugContext.ts | 2 +- .../explore/Debug/Tree/FileTreeItem.tsx | 6 +-- .../Singlestudy/explore/Debug/Tree/index.tsx | 4 +- .../App/Singlestudy/explore/Debug/index.tsx | 10 ++-- .../App/Singlestudy/explore/Debug/utils.ts | 2 +- .../Modelization/Areas/AreaPropsView.tsx | 10 ++-- .../explore/Modelization/Areas/AreasTab.tsx | 6 +-- .../Hydro/Allocation/AllocationField.tsx | 4 +- .../Areas/Hydro/Allocation/Fields.tsx | 12 ++--- .../Areas/Hydro/Allocation/index.tsx | 12 ++--- .../Areas/Hydro/Allocation/utils.ts | 6 +-- .../Hydro/Correlation/CorrelationField.tsx | 8 ++-- .../Areas/Hydro/Correlation/Fields.tsx | 15 +++--- .../Areas/Hydro/Correlation/index.tsx | 12 ++--- .../Areas/Hydro/Correlation/utils.ts | 6 +-- .../Modelization/Areas/Hydro/HydroMatrix.tsx | 6 +-- .../Areas/Hydro/HydroMatrixDialog.tsx | 9 ++-- .../Areas/Hydro/InflowStructure/index.tsx | 12 ++--- .../Areas/Hydro/InflowStructure/utils.ts | 4 +- .../Areas/Hydro/ManagementOptions/Fields.tsx | 10 ++-- .../Areas/Hydro/ManagementOptions/index.tsx | 10 ++-- .../Areas/Hydro/ManagementOptions/utils.ts | 4 +- .../Areas/Hydro/SplitHydroMatrix.tsx | 2 +- .../Areas/Hydro/hooks/useAreasOptions.ts | 8 ++-- .../Modelization/Areas/Hydro/index.tsx | 6 +-- .../explore/Modelization/Areas/Hydro/utils.ts | 4 +- .../explore/Modelization/Areas/Load.tsx | 6 +-- .../explore/Modelization/Areas/MiscGen.tsx | 6 +-- .../Modelization/Areas/Properties/Fields.tsx | 12 ++--- .../Modelization/Areas/Properties/index.tsx | 10 ++-- .../Modelization/Areas/Properties/utils.ts | 4 +- .../Modelization/Areas/Renewables/Fields.tsx | 12 ++--- .../Modelization/Areas/Renewables/Form.tsx | 18 +++---- .../Modelization/Areas/Renewables/Matrix.tsx | 4 +- .../Modelization/Areas/Renewables/index.tsx | 16 +++---- .../Modelization/Areas/Renewables/utils.ts | 12 ++--- .../explore/Modelization/Areas/Reserve.tsx | 6 +-- .../explore/Modelization/Areas/Solar.tsx | 6 +-- .../Modelization/Areas/Storages/Fields.tsx | 14 +++--- .../Modelization/Areas/Storages/Form.tsx | 16 +++---- .../Modelization/Areas/Storages/Matrix.tsx | 10 ++-- .../Modelization/Areas/Storages/index.tsx | 14 +++--- .../Modelization/Areas/Storages/utils.ts | 6 +-- .../Modelization/Areas/Thermal/Fields.tsx | 14 +++--- .../Modelization/Areas/Thermal/Form.tsx | 18 +++---- .../Modelization/Areas/Thermal/Matrix.tsx | 4 +- .../Modelization/Areas/Thermal/index.tsx | 16 +++---- .../Modelization/Areas/Thermal/utils.ts | 12 ++--- .../explore/Modelization/Areas/Wind.tsx | 6 +-- .../Areas/common/clustersUtils.ts | 4 +- .../explore/Modelization/Areas/index.tsx | 23 ++++----- .../BindingConstraints/AddDialog.tsx | 29 ++++++------ .../BindingConstPropsView.tsx | 5 +- .../AddConstraintTermForm/OptionsList.tsx | 6 +-- .../AddConstraintTermForm/index.tsx | 12 ++--- .../AddConstraintTermDialog/index.tsx | 20 ++++---- .../BindingConstView/BindingConstForm.tsx | 19 ++++---- .../BindingConstView/ConstraintFields.tsx | 12 ++--- .../ConstraintTerm/OptionsList.tsx | 6 +-- .../BindingConstView/ConstraintTerm/index.tsx | 8 ++-- .../BindingConstView/Matrix.tsx | 8 ++-- .../BindingConstView/index.tsx | 30 ++++++------ .../Modelization/BindingConstraints/index.tsx | 25 +++++----- .../Modelization/Links/LinkPropsView.tsx | 8 ++-- .../Modelization/Links/LinkView/LinkForm.tsx | 20 ++++---- .../Links/LinkView/LinkMatrixView.tsx | 6 +-- .../Modelization/Links/LinkView/index.tsx | 8 ++-- .../Modelization/Links/LinkView/utils.ts | 4 +- .../explore/Modelization/Links/index.tsx | 18 +++---- .../Modelization/Map/Areas/AreaConfig.tsx | 8 ++-- .../Modelization/Map/Areas/AreaLink.tsx | 9 ++-- .../Modelization/Map/Areas/AreaLinks.tsx | 13 ++--- .../Map/Areas/DeleteAreaDialog.tsx | 15 +++--- .../explore/Modelization/Map/Areas/index.tsx | 21 ++++----- .../Modelization/Map/CreateAreaDialog.tsx | 12 ++--- .../Districts/CreateDistrictDialog.tsx | 20 ++++---- .../Districts/UpdateDistrictDialog.tsx | 24 +++++----- .../Map/MapConfig/Districts/index.tsx | 17 +++---- .../MapConfig/Layers/CreateLayerDialog.tsx | 18 +++---- .../MapConfig/Layers/UpdateLayerDialog.tsx | 22 ++++----- .../Map/MapConfig/Layers/index.tsx | 17 +++---- .../explore/Modelization/Map/MapGraph.tsx | 22 ++++----- .../explore/Modelization/Map/MapHeader.tsx | 16 ++----- .../explore/Modelization/Map/Node.tsx | 2 +- .../explore/Modelization/Map/index.tsx | 24 ++++------ .../explore/Modelization/Map/style.ts | 2 +- .../explore/Modelization/Map/utils.ts | 4 +- .../explore/Modelization/index.tsx | 14 ++---- .../explore/Results/ResultDetails/index.tsx | 47 ++++++++----------- .../explore/Results/ResultDetails/utils.ts | 2 +- .../App/Singlestudy/explore/Results/index.tsx | 22 ++++----- .../App/Singlestudy/explore/TabWrapper.tsx | 4 +- .../dialogs/CreateTemplateTableDialog.tsx | 4 +- .../dialogs/TableTemplateFormDialog.tsx | 14 +++--- .../dialogs/UpdateTemplateTableDialog.tsx | 4 +- .../explore/TableModeList/index.tsx | 18 ++++--- .../explore/TableModeList/utils.ts | 4 +- .../Xpansion/Candidates/CandidateForm.tsx | 12 ++--- .../Candidates/CreateCandidateDialog.tsx | 16 +++---- .../Xpansion/Candidates/XpansionPropsView.tsx | 8 ++-- .../explore/Xpansion/Candidates/index.tsx | 25 +++++----- .../explore/Xpansion/Capacities.tsx | 2 +- .../explore/Xpansion/Constraints.tsx | 2 +- .../Singlestudy/explore/Xpansion/FileList.tsx | 12 ++--- .../Xpansion/Settings/SettingsForm.tsx | 12 ++--- .../explore/Xpansion/Settings/index.tsx | 16 +++---- .../Singlestudy/explore/Xpansion/Weights.tsx | 2 +- .../Singlestudy/explore/Xpansion/index.tsx | 12 ++--- .../explore/common/ListElement.tsx | 4 +- .../explore/common/OutputFilters.tsx | 6 +-- .../src/components/App/Singlestudy/index.tsx | 22 ++++----- .../App/Studies/CreateStudyDialog.tsx | 26 +++++----- .../Filter/MultipleLinkElement/index.tsx | 6 +-- .../Filter/SingleLinkElement/index.tsx | 2 +- .../ExportModal/ExportFilter/Filter/index.tsx | 8 +--- .../ExportModal/ExportFilter/index.tsx | 6 +-- .../App/Studies/ExportModal/index.tsx | 14 +++--- .../components/App/Studies/FilterDrawer.tsx | 16 +++---- .../components/App/Studies/HeaderBottom.tsx | 14 +++--- .../components/App/Studies/HeaderTopRight.tsx | 6 +-- .../components/App/Studies/LauncherDialog.tsx | 28 +++++------ .../App/Studies/MoveStudyDialog.tsx | 12 ++--- .../components/App/Studies/RefreshButton.tsx | 4 +- webapp/src/components/App/Studies/SideNav.tsx | 6 +-- .../App/Studies/StudiesList/StudyCardCell.tsx | 4 +- .../App/Studies/StudiesList/index.tsx | 25 +++++----- .../src/components/App/Studies/StudyCard.tsx | 20 ++++---- .../src/components/App/Studies/StudyTree.tsx | 12 ++--- webapp/src/components/App/Studies/index.tsx | 12 ++--- webapp/src/components/App/Studies/utils.ts | 2 +- .../src/components/App/Tasks/JobTableView.tsx | 10 ++-- .../components/App/Tasks/LaunchJobLogView.tsx | 8 ++-- .../App/Tasks/NotificationBadge.tsx | 14 +++--- webapp/src/components/App/Tasks/index.tsx | 34 +++++++------- webapp/src/components/App/index.tsx | 8 ++-- webapp/src/components/common/DownloadLink.tsx | 8 ++-- .../common/EditableMatrix/MatrixGraphView.tsx | 2 +- .../common/EditableMatrix/index.tsx | 2 +- .../components/common/EditableMatrix/utils.ts | 2 +- webapp/src/components/common/Fieldset.tsx | 2 +- webapp/src/components/common/FileTable.tsx | 2 +- webapp/src/components/common/Form/index.tsx | 10 ++-- .../components/common/Form/useFormApiPlus.ts | 2 +- .../components/common/Form/useFormUndoRedo.ts | 2 +- .../common/GroupedDataTable/CreateDialog.tsx | 8 ++-- .../GroupedDataTable/DuplicateDialog.tsx | 6 +-- .../common/GroupedDataTable/index.tsx | 14 +++--- webapp/src/components/common/Handsontable.tsx | 2 +- .../components/common/JSONEditor/index.tsx | 8 ++-- .../src/components/common/JSONEditor/utils.ts | 2 +- webapp/src/components/common/LogModal.tsx | 6 +-- webapp/src/components/common/Matrix/index.tsx | 13 ++--- .../src/components/common/PropertiesView.tsx | 2 +- webapp/src/components/common/SelectMulti.tsx | 4 +- webapp/src/components/common/SelectSingle.tsx | 4 +- .../src/components/common/SplitView/index.tsx | 2 +- .../src/components/common/TableForm/Table.tsx | 8 ++-- .../src/components/common/TableForm/index.tsx | 8 ++-- webapp/src/components/common/TableMode.tsx | 11 ++--- .../components/common/TreeItemEnhanced.tsx | 2 +- .../common/buttons/DownloadButton.tsx | 6 +-- .../common/buttons/DownloadMatrixButton.tsx | 6 +-- .../common/buttons/UploadFileButton.tsx | 8 ++-- .../components/common/dialogs/BasicDialog.tsx | 2 +- .../common/dialogs/DataViewerDialog/index.tsx | 12 ++--- .../common/dialogs/DigestDialog.tsx | 12 ++--- .../common/dialogs/ImportDialog.tsx | 6 +-- .../common/fieldEditors/BooleanFE.tsx | 2 +- .../common/fieldEditors/CheckBoxFE.tsx | 2 +- .../common/fieldEditors/CheckboxesTagsFE.tsx | 2 +- .../fieldEditors/ColorPickerFE/index.tsx | 6 +-- .../common/fieldEditors/ListFE/index.tsx | 6 +-- .../common/fieldEditors/NumberFE.tsx | 2 +- .../common/fieldEditors/PasswordFE.tsx | 2 +- .../common/fieldEditors/SelectFE.tsx | 2 +- .../common/fieldEditors/StringFE.tsx | 2 +- .../common/fieldEditors/SwitchFE.tsx | 2 +- .../components/common/loaders/AppLoader.tsx | 4 +- .../common/loaders/GlobalPageLoadingError.tsx | 2 +- .../common/utils/UsePromiseCond.tsx | 2 +- .../src/components/common/utils/constants.ts | 2 +- .../src/components/wrappers/LoginWrapper.tsx | 18 +++---- .../MaintenanceWrapper/MessageInfoDialog.tsx | 14 +++--- .../wrappers/MaintenanceWrapper/index.tsx | 14 +++--- .../components/wrappers/MenuWrapper/index.tsx | 24 +++++----- .../components/wrappers/MenuWrapper/styles.ts | 2 +- webapp/src/hoc/reactHookFormSupport.tsx | 8 ++-- webapp/src/hooks/useEnqueueErrorSnackbar.tsx | 2 +- webapp/src/hooks/usePromise.ts | 2 +- webapp/src/redux/ducks/auth.ts | 10 ++-- webapp/src/redux/ducks/groups.ts | 4 +- webapp/src/redux/ducks/studies.ts | 4 +- webapp/src/redux/ducks/studyMaps.ts | 8 ++-- webapp/src/redux/ducks/studySyntheses.ts | 4 +- webapp/src/redux/ducks/users.ts | 4 +- webapp/src/redux/hooks/useStudyMaps.ts | 6 +-- webapp/src/redux/hooks/useStudySynthesis.ts | 6 +-- .../middlewares/localStorageMiddleware.ts | 8 ++-- webapp/src/redux/selectors.ts | 8 ++-- webapp/src/redux/utils.ts | 6 +-- webapp/src/services/api/auth.ts | 2 +- webapp/src/services/api/client.ts | 4 +- webapp/src/services/api/matrix.ts | 4 +- .../studies/config/thematicTrimming/index.ts | 4 +- .../studies/config/thematicTrimming/types.ts | 2 +- webapp/src/services/api/studies/raw/index.ts | 2 +- webapp/src/services/api/studies/raw/types.ts | 2 +- .../services/api/studies/tableMode/index.ts | 4 +- .../services/api/studies/tableMode/types.ts | 2 +- webapp/src/services/api/study.ts | 4 +- webapp/src/services/api/studydata.ts | 6 +-- webapp/src/services/api/tasks.ts | 2 +- webapp/src/services/api/user.ts | 2 +- webapp/src/services/api/variant.ts | 2 +- webapp/src/services/api/xpansion.ts | 4 +- webapp/src/services/utils/index.ts | 2 +- webapp/src/services/utils/localStorage.ts | 11 ++--- webapp/src/services/webSockets.ts | 12 ++--- webapp/src/utils/i18nUtils.ts | 2 +- webapp/src/utils/studiesUtils.ts | 4 +- webapp/tsconfig.json | 2 +- 302 files changed, 1321 insertions(+), 1468 deletions(-) rename webapp/src/{components/App/Settings/utils.ts => common/contants.ts} (78%) diff --git a/installer b/installer index 118c9c5d85..eda9075b77 160000 --- a/installer +++ b/installer @@ -1 +1 @@ -Subproject commit 118c9c5d85a0b7b0d47e6b899c7c4ed15caaa7bd +Subproject commit eda9075b7798827a5679f4aeca6fc27f8e520159 diff --git a/webapp/src/components/App/Settings/utils.ts b/webapp/src/common/contants.ts similarity index 78% rename from webapp/src/components/App/Settings/utils.ts rename to webapp/src/common/contants.ts index b074304987..7c850b4dfd 100644 --- a/webapp/src/components/App/Settings/utils.ts +++ b/webapp/src/common/contants.ts @@ -12,12 +12,11 @@ * This file is part of the Antares project. */ -import * as RA from "ramda-adjunct"; -import { RoleType } from "../../../common/types"; +import { RoleType } from "./types"; +export const APP_NAME = "antares-web"; export const RESERVED_USER_NAMES = ["admin"]; export const RESERVED_GROUP_NAMES = ["admin"]; - export const ROLE_TYPE_KEYS = Object.values(RoleType).filter( - RA.isString, -) as Array; + (value): value is keyof typeof RoleType => typeof value === "string", +); diff --git a/webapp/src/components/App/Api.tsx b/webapp/src/components/App/Api.tsx index 837b80e729..8cc4c8ca7c 100644 --- a/webapp/src/components/App/Api.tsx +++ b/webapp/src/components/App/Api.tsx @@ -15,7 +15,7 @@ import { Box } from "@mui/material"; import SwaggerUI from "swagger-ui-react"; import "swagger-ui-react/swagger-ui.css"; -import { getConfig } from "../../services/config"; +import { getConfig } from "@/services/config"; function Api() { return ( diff --git a/webapp/src/components/App/Data/DataListing.tsx b/webapp/src/components/App/Data/DataListing.tsx index 30968f4f30..fd256317da 100644 --- a/webapp/src/components/App/Data/DataListing.tsx +++ b/webapp/src/components/App/Data/DataListing.tsx @@ -17,7 +17,7 @@ import { Typography, Box, styled } from "@mui/material"; import AutoSizer from "react-virtualized-auto-sizer"; import { FixedSizeList, areEqual, ListChildComponentProps } from "react-window"; import ArrowRightIcon from "@mui/icons-material/ArrowRight"; -import { MatrixDataSetDTO } from "../../../common/types"; +import { MatrixDataSetDTO } from "@/common/types"; const ROW_ITEM_SIZE = 45; const BUTTONS_SIZE = 40; diff --git a/webapp/src/components/App/Data/DataPropsView.tsx b/webapp/src/components/App/Data/DataPropsView.tsx index c4b5215cf5..35479c79d8 100644 --- a/webapp/src/components/App/Data/DataPropsView.tsx +++ b/webapp/src/components/App/Data/DataPropsView.tsx @@ -13,10 +13,10 @@ */ import { useState } from "react"; -import { MatrixDataSetDTO, MatrixInfoDTO } from "../../../common/types"; -import PropertiesView from "../../common/PropertiesView"; +import { MatrixDataSetDTO, MatrixInfoDTO } from "@/common/types"; import DataListing from "./DataListing"; import { StyledListingBox } from "./styles"; +import PropertiesView from "@/components/common/PropertiesView"; interface PropTypes { dataset: MatrixDataSetDTO[]; @@ -39,7 +39,7 @@ function DataPropsView(props: PropTypes) { ); }; - const onChange = async (currentName: string) => { + const onChange = (currentName: string) => { if (currentName !== "") { const f = filter(currentName); setFilteredDatas(f); diff --git a/webapp/src/components/App/Data/DatasetCreationDialog.tsx b/webapp/src/components/App/Data/DatasetCreationDialog.tsx index 90764a1977..94579be701 100644 --- a/webapp/src/components/App/Data/DatasetCreationDialog.tsx +++ b/webapp/src/components/App/Data/DatasetCreationDialog.tsx @@ -26,13 +26,13 @@ import { useSnackbar } from "notistack"; import { useTranslation } from "react-i18next"; import axios, { AxiosError } from "axios"; import HelpIcon from "@mui/icons-material/Help"; -import { getGroups } from "../../../services/api/user"; -import { GroupDTO, MatrixDataSetDTO } from "../../../common/types"; +import { getGroups } from "@/services/api/user"; +import { GroupDTO, MatrixDataSetDTO } from "@/common/types"; import { saveMatrix } from "./utils"; -import useEnqueueErrorSnackbar from "../../../hooks/useEnqueueErrorSnackbar"; -import SimpleLoader from "../../common/loaders/SimpleLoader"; -import BasicDialog from "../../common/dialogs/BasicDialog"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import { BoxParamHeader, BoxParam, ParamTitle } from "./styles"; +import BasicDialog from "@/components/common/dialogs/BasicDialog"; +import SimpleLoader from "@/components/common/loaders/SimpleLoader"; interface PropTypes { open: boolean; diff --git a/webapp/src/components/App/Data/MatrixDialog.tsx b/webapp/src/components/App/Data/MatrixDialog.tsx index c02bf8a6c1..74683d9435 100644 --- a/webapp/src/components/App/Data/MatrixDialog.tsx +++ b/webapp/src/components/App/Data/MatrixDialog.tsx @@ -15,10 +15,10 @@ import { useState, useEffect } from "react"; import { AxiosError } from "axios"; import { useTranslation } from "react-i18next"; -import { MatrixInfoDTO, MatrixType } from "../../../common/types"; -import { getMatrix } from "../../../services/api/matrix"; -import useEnqueueErrorSnackbar from "../../../hooks/useEnqueueErrorSnackbar"; -import DataViewerDialog from "../../common/dialogs/DataViewerDialog"; +import { MatrixInfoDTO, MatrixType } from "@/common/types"; +import { getMatrix } from "@/services/api/matrix"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import DataViewerDialog from "@/components/common/dialogs/DataViewerDialog"; interface PropTypes { matrixInfo: MatrixInfoDTO; diff --git a/webapp/src/components/App/Data/index.tsx b/webapp/src/components/App/Data/index.tsx index 9055a3e2b4..0cf3b954eb 100644 --- a/webapp/src/components/App/Data/index.tsx +++ b/webapp/src/components/App/Data/index.tsx @@ -27,18 +27,18 @@ import { exportMatrixDataset, getMatrixList, getExportMatrixUrl, -} from "../../../services/api/matrix"; -import { MatrixInfoDTO, MatrixDataSetDTO } from "../../../common/types"; +} from "@/services/api/matrix"; +import { MatrixInfoDTO, MatrixDataSetDTO } from "@/common/types"; import DatasetCreationDialog from "./DatasetCreationDialog"; -import ConfirmationDialog from "../../common/dialogs/ConfirmationDialog"; -import RootPage from "../../common/page/RootPage"; import MatrixDialog from "./MatrixDialog"; -import useEnqueueErrorSnackbar from "../../../hooks/useEnqueueErrorSnackbar"; -import SimpleLoader from "../../common/loaders/SimpleLoader"; -import FileTable from "../../common/FileTable"; -import { getAuthUser } from "../../../redux/selectors"; -import useAppSelector from "../../../redux/hooks/useAppSelector"; -import SplitView from "../../common/SplitView"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { getAuthUser } from "@/redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; +import FileTable from "@/components/common/FileTable"; +import SimpleLoader from "@/components/common/loaders/SimpleLoader"; +import RootPage from "@/components/common/page/RootPage"; +import SplitView from "@/components/common/SplitView"; function Data() { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Data/utils.tsx b/webapp/src/components/App/Data/utils.tsx index a05c03a790..de886a29ac 100644 --- a/webapp/src/components/App/Data/utils.tsx +++ b/webapp/src/components/App/Data/utils.tsx @@ -17,12 +17,12 @@ import { MatrixDataSetDTO, MatrixDataSetUpdateDTO, MatrixInfoDTO, -} from "../../../common/types"; +} from "@/common/types"; import { createMatrixByImportation, updateDataSet, createDataSet, -} from "../../../services/api/matrix"; +} from "@/services/api/matrix"; const updateMatrix = async ( data: MatrixDataSetDTO, diff --git a/webapp/src/components/App/Settings/Groups/Header.tsx b/webapp/src/components/App/Settings/Groups/Header.tsx index f73f783ef9..54e31eab85 100644 --- a/webapp/src/components/App/Settings/Groups/Header.tsx +++ b/webapp/src/components/App/Settings/Groups/Header.tsx @@ -16,11 +16,11 @@ import { Box, Button } from "@mui/material"; import GroupAddIcon from "@mui/icons-material/GroupAdd"; import { useTranslation } from "react-i18next"; import { useState } from "react"; -import { GroupDetailsDTO } from "../../../../common/types"; +import { GroupDetailsDTO } from "@/common/types"; import CreateGroupDialog from "./dialog/CreateGroupDialog"; -import { isAuthUserAdmin } from "../../../../redux/selectors"; -import useAppSelector from "../../../../redux/hooks/useAppSelector"; -import SearchFE from "../../../common/fieldEditors/SearchFE"; +import { isAuthUserAdmin } from "@/redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import SearchFE from "@/components/common/fieldEditors/SearchFE"; interface Props { setSearchValue: (v: string) => void; diff --git a/webapp/src/components/App/Settings/Groups/dialog/CreateGroupDialog.tsx b/webapp/src/components/App/Settings/Groups/dialog/CreateGroupDialog.tsx index 3b3abd1485..ca68f3a900 100644 --- a/webapp/src/components/App/Settings/Groups/dialog/CreateGroupDialog.tsx +++ b/webapp/src/components/App/Settings/Groups/dialog/CreateGroupDialog.tsx @@ -21,11 +21,11 @@ import { GroupDTO, RoleDetailsDTO, UserDTO, -} from "../../../../../common/types"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; -import { createGroup, createRole } from "../../../../../services/api/user"; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +} from "@/common/types"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { createGroup, createRole } from "@/services/api/user"; import GroupFormDialog, { GroupFormDialogProps } from "./GroupFormDialog"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; type InheritPropsToOmit = "title" | "titleIcon" | "onSubmit" | "onCancel"; diff --git a/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/GroupForm.tsx b/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/GroupForm.tsx index 87e47d9db2..fe9bcbfdf4 100644 --- a/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/GroupForm.tsx +++ b/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/GroupForm.tsx @@ -37,19 +37,19 @@ import { Controller, useFieldArray } from "react-hook-form"; import { v4 as uuidv4 } from "uuid"; import DeleteIcon from "@mui/icons-material/Delete"; import GroupIcon from "@mui/icons-material/Group"; +import { RoleType, UserDTO } from "@/common/types"; +import { roleToString, sortByName } from "@/services/utils"; +import usePromise from "@/hooks/usePromise"; +import { getGroups, getUsers } from "@/services/api/user"; +import { getAuthUser } from "@/redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { validateString } from "@/utils/validation/string"; +import { UseFormReturnPlus } from "@/components/common/Form/types"; import { RESERVED_GROUP_NAMES, RESERVED_USER_NAMES, ROLE_TYPE_KEYS, -} from "../../../utils"; -import { RoleType, UserDTO } from "../../../../../../common/types"; -import { roleToString, sortByName } from "../../../../../../services/utils"; -import usePromise from "../../../../../../hooks/usePromise"; -import { getGroups, getUsers } from "../../../../../../services/api/user"; -import { getAuthUser } from "../../../../../../redux/selectors"; -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import { UseFormReturnPlus } from "../../../../../common/Form/types"; -import { validateString } from "@/utils/validation/string"; +} from "@/common/contants"; function GroupForm(props: UseFormReturnPlus) { const { diff --git a/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/index.tsx b/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/index.tsx index ef29ca1722..32d2468144 100644 --- a/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/index.tsx +++ b/webapp/src/components/App/Settings/Groups/dialog/GroupFormDialog/index.tsx @@ -14,8 +14,8 @@ import FormDialog, { FormDialogProps, -} from "../../../../../common/dialogs/FormDialog"; -import { RoleType, UserDTO } from "../../../../../../common/types"; +} from "@/components/common/dialogs/FormDialog"; +import { RoleType, UserDTO } from "@/common/types"; import GroupForm from "./GroupForm"; export interface GroupFormDialogProps diff --git a/webapp/src/components/App/Settings/Groups/dialog/UpdateGroupDialog.tsx b/webapp/src/components/App/Settings/Groups/dialog/UpdateGroupDialog.tsx index 42e4541ed9..a3a95a0688 100644 --- a/webapp/src/components/App/Settings/Groups/dialog/UpdateGroupDialog.tsx +++ b/webapp/src/components/App/Settings/Groups/dialog/UpdateGroupDialog.tsx @@ -18,17 +18,17 @@ import { useTranslation } from "react-i18next"; import { usePromise as usePromiseWrapper } from "react-use"; import { useSnackbar } from "notistack"; import * as R from "ramda"; -import { GroupDetailsDTO } from "../../../../../common/types"; +import { GroupDetailsDTO } from "@/common/types"; import { createRole, deleteUserRole, getRolesForGroup, updateGroup, -} from "../../../../../services/api/user"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; +} from "@/services/api/user"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import GroupFormDialog, { GroupFormDialogProps } from "./GroupFormDialog"; import { GroupEdit } from ".."; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; type InheritPropsToOmit = | "title" diff --git a/webapp/src/components/App/Settings/Groups/index.tsx b/webapp/src/components/App/Settings/Groups/index.tsx index b92e62ffe8..063286e1d1 100644 --- a/webapp/src/components/App/Settings/Groups/index.tsx +++ b/webapp/src/components/App/Settings/Groups/index.tsx @@ -34,18 +34,18 @@ import EditIcon from "@mui/icons-material/Edit"; import * as R from "ramda"; import GroupIcon from "@mui/icons-material/Group"; import { useSnackbar } from "notistack"; -import { GroupDetailsDTO } from "../../../../common/types"; -import usePromiseWithSnackbarError from "../../../../hooks/usePromiseWithSnackbarError"; -import { deleteGroup, getGroups } from "../../../../services/api/user"; -import { sortByName } from "../../../../services/utils"; -import ConfirmationDialog from "../../../common/dialogs/ConfirmationDialog"; -import useEnqueueErrorSnackbar from "../../../../hooks/useEnqueueErrorSnackbar"; -import { RESERVED_GROUP_NAMES } from "../utils"; +import { GroupDetailsDTO } from "@/common/types"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import { deleteGroup, getGroups } from "@/services/api/user"; +import { sortByName } from "@/services/utils"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import Header from "./Header"; import UpdateGroupDialog from "./dialog/UpdateGroupDialog"; -import { getAuthUser } from "../../../../redux/selectors"; -import useAppSelector from "../../../../redux/hooks/useAppSelector"; -import { isSearchMatching } from "../../../../utils/stringUtils"; +import { getAuthUser } from "@/redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { isSearchMatching } from "@/utils/stringUtils"; +import { RESERVED_GROUP_NAMES } from "@/common/contants"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; enum GroupActionKind { ADD = "ADD", diff --git a/webapp/src/components/App/Settings/Maintenance/index.tsx b/webapp/src/components/App/Settings/Maintenance/index.tsx index 624006a4e6..877df2228c 100644 --- a/webapp/src/components/App/Settings/Maintenance/index.tsx +++ b/webapp/src/components/App/Settings/Maintenance/index.tsx @@ -27,15 +27,15 @@ import { useState } from "react"; import { Controller, FieldValues, useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { useUpdateEffect } from "react-use"; -import useEnqueueErrorSnackbar from "../../../../hooks/useEnqueueErrorSnackbar"; -import usePromiseWithSnackbarError from "../../../../hooks/usePromiseWithSnackbarError"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; import { getMaintenanceMode, getMessageInfo, updateMaintenanceMode, updateMessageInfo, -} from "../../../../services/api/maintenance"; -import ConfirmationDialog from "../../../common/dialogs/ConfirmationDialog"; +} from "@/services/api/maintenance"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; function Maintenance() { const { t } = useTranslation(); diff --git a/webapp/src/components/App/Settings/Tokens/Header.tsx b/webapp/src/components/App/Settings/Tokens/Header.tsx index 0cf3d3e329..f73721b2d3 100644 --- a/webapp/src/components/App/Settings/Tokens/Header.tsx +++ b/webapp/src/components/App/Settings/Tokens/Header.tsx @@ -16,9 +16,9 @@ import { Box, Button } from "@mui/material"; import TokenIcon from "@mui/icons-material/Token"; import { useTranslation } from "react-i18next"; import { useState } from "react"; -import { BotDTO } from "../../../../common/types"; +import { BotDTO } from "@/common/types"; import CreateTokenDialog from "./dialog/CreateTokenDialog"; -import SearchFE from "../../../common/fieldEditors/SearchFE"; +import SearchFE from "@/components/common/fieldEditors/SearchFE"; interface Props { setSearchValue: (v: string) => void; diff --git a/webapp/src/components/App/Settings/Tokens/dialog/CreateTokenDialog.tsx b/webapp/src/components/App/Settings/Tokens/dialog/CreateTokenDialog.tsx index c735ddb702..80de770739 100644 --- a/webapp/src/components/App/Settings/Tokens/dialog/CreateTokenDialog.tsx +++ b/webapp/src/components/App/Settings/Tokens/dialog/CreateTokenDialog.tsx @@ -19,17 +19,12 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { usePromise as usePromiseWrapper } from "react-use"; import ContentCopyIcon from "@mui/icons-material/ContentCopy"; -import { - BotCreateDTO, - BotDTO, - GroupDTO, - RoleType, -} from "../../../../../common/types"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; -import { createBot } from "../../../../../services/api/user"; -import OkDialog from "../../../../common/dialogs/OkDialog"; +import { BotCreateDTO, BotDTO, GroupDTO, RoleType } from "@/common/types"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { createBot } from "@/services/api/user"; import TokenFormDialog, { TokenFormDialogProps } from "./TokenFormDialog"; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +import OkDialog from "@/components/common/dialogs/OkDialog"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; type InheritPropsToOmit = "title" | "titleIcon" | "onSubmit" | "onCancel"; diff --git a/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/TokenForm.tsx b/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/TokenForm.tsx index 08b8fa928c..e8fe80c4fe 100644 --- a/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/TokenForm.tsx +++ b/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/TokenForm.tsx @@ -38,16 +38,13 @@ import { v4 as uuidv4 } from "uuid"; import DeleteIcon from "@mui/icons-material/Delete"; import GroupIcon from "@mui/icons-material/Group"; import { TokenFormDialogProps } from "."; -import { GroupDTO, RoleType } from "../../../../../../common/types"; -import usePromise from "../../../../../../hooks/usePromise"; -import { getGroups } from "../../../../../../services/api/user"; -import { roleToString, sortByName } from "../../../../../../services/utils"; -import { RESERVED_GROUP_NAMES, ROLE_TYPE_KEYS } from "../../../utils"; -import { - getAuthUser, - isAuthUserAdmin, -} from "../../../../../../redux/selectors"; -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; +import { GroupDTO, RoleType } from "@/common/types"; +import usePromise from "@/hooks/usePromise"; +import { getGroups } from "@/services/api/user"; +import { roleToString, sortByName } from "@/services/utils"; +import { getAuthUser, isAuthUserAdmin } from "@/redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { RESERVED_GROUP_NAMES, ROLE_TYPE_KEYS } from "@/common/contants"; interface Props extends UseFormReturn { onlyPermissions?: TokenFormDialogProps["onlyPermissions"]; diff --git a/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/index.tsx b/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/index.tsx index 24516f6b7e..d800d98544 100644 --- a/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/index.tsx +++ b/webapp/src/components/App/Settings/Tokens/dialog/TokenFormDialog/index.tsx @@ -14,7 +14,7 @@ import FormDialog, { FormDialogProps, -} from "../../../../../common/dialogs/FormDialog"; +} from "@/components/common/dialogs/FormDialog"; import TokenForm from "./TokenForm"; export interface TokenFormDialogProps diff --git a/webapp/src/components/App/Settings/Tokens/dialog/TokenInfoDialog.tsx b/webapp/src/components/App/Settings/Tokens/dialog/TokenInfoDialog.tsx index 23f12dc088..987553669e 100644 --- a/webapp/src/components/App/Settings/Tokens/dialog/TokenInfoDialog.tsx +++ b/webapp/src/components/App/Settings/Tokens/dialog/TokenInfoDialog.tsx @@ -12,15 +12,15 @@ * This file is part of the Antares project. */ +import { BotDetailsDTO } from "@/common/types"; +import OkDialog, { OkDialogProps } from "@/components/common/dialogs/OkDialog"; import { DialogContentText } from "@mui/material"; -import { useTranslation } from "react-i18next"; -import InfoIcon from "@mui/icons-material/Info"; import { useMemo } from "react"; import { FieldValues } from "react-hook-form"; -import { BotDetailsDTO } from "../../../../../common/types"; -import OkDialog, { OkDialogProps } from "../../../../common/dialogs/OkDialog"; +import { useTranslation } from "react-i18next"; import TokenForm from "./TokenFormDialog/TokenForm"; -import Form from "../../../../common/Form"; +import Form from "@/components/common/Form"; +import { Info } from "@mui/icons-material"; interface Props extends Omit { token: BotDetailsDTO; @@ -52,7 +52,7 @@ function TokenInfoDialog(props: Props) { fullWidth {...dialogProps} title={t("global.permissions")} - titleIcon={InfoIcon} + titleIcon={Info} > {t("settings.currentToken", { 0: token.name })} diff --git a/webapp/src/components/App/Settings/Tokens/index.tsx b/webapp/src/components/App/Settings/Tokens/index.tsx index 18aa3b4d9a..17fcdbcea1 100644 --- a/webapp/src/components/App/Settings/Tokens/index.tsx +++ b/webapp/src/components/App/Settings/Tokens/index.tsx @@ -34,22 +34,17 @@ import InfoIcon from "@mui/icons-material/Info"; import TokenIcon from "@mui/icons-material/Token"; import * as R from "ramda"; import { useSnackbar } from "notistack"; -import { BotDTO, BotDetailsDTO, UserDTO } from "../../../../common/types"; -import usePromiseWithSnackbarError from "../../../../hooks/usePromiseWithSnackbarError"; -import { - deleteBot, - getBots, - getUser, - getUsers, -} from "../../../../services/api/user"; -import { isUserAdmin, sortByProp } from "../../../../services/utils"; -import ConfirmationDialog from "../../../common/dialogs/ConfirmationDialog"; -import useEnqueueErrorSnackbar from "../../../../hooks/useEnqueueErrorSnackbar"; +import { BotDTO, BotDetailsDTO, UserDTO } from "@/common/types"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import { deleteBot, getBots, getUser, getUsers } from "@/services/api/user"; +import { isUserAdmin, sortByProp } from "@/services/utils"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import Header from "./Header"; -import { getAuthUser } from "../../../../redux/selectors"; +import { getAuthUser } from "@/redux/selectors"; import TokenInfoDialog from "./dialog/TokenInfoDialog"; -import useAppSelector from "../../../../redux/hooks/useAppSelector"; -import { isSearchMatching } from "../../../../utils/stringUtils"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { isSearchMatching } from "@/utils/stringUtils"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; interface BotDetailsDtoWithUser extends BotDetailsDTO { user: UserDTO; diff --git a/webapp/src/components/App/Settings/Users/Header.tsx b/webapp/src/components/App/Settings/Users/Header.tsx index 47969745bf..39cbd76354 100644 --- a/webapp/src/components/App/Settings/Users/Header.tsx +++ b/webapp/src/components/App/Settings/Users/Header.tsx @@ -17,8 +17,8 @@ import PersonAddAltIcon from "@mui/icons-material/PersonAddAlt"; import { useTranslation } from "react-i18next"; import { useState } from "react"; import CreateUserDialog from "./dialog/CreateUserDialog"; -import { UserDetailsDTO } from "../../../../common/types"; -import SearchFE from "../../../common/fieldEditors/SearchFE"; +import { UserDetailsDTO } from "@/common/types"; +import SearchFE from "@/components/common/fieldEditors/SearchFE"; interface Props { setSearchValue: (v: string) => void; diff --git a/webapp/src/components/App/Settings/Users/dialog/CreateUserDialog.tsx b/webapp/src/components/App/Settings/Users/dialog/CreateUserDialog.tsx index 298b7fb84d..d3c6c546ca 100644 --- a/webapp/src/components/App/Settings/Users/dialog/CreateUserDialog.tsx +++ b/webapp/src/components/App/Settings/Users/dialog/CreateUserDialog.tsx @@ -22,11 +22,11 @@ import { RoleType, UserDetailsDTO, UserDTO, -} from "../../../../../common/types"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; -import { createRole, createUser } from "../../../../../services/api/user"; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +} from "@/common/types"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { createRole, createUser } from "@/services/api/user"; import UserFormDialog, { UserFormDialogProps } from "./UserFormDialog"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; type InheritPropsToOmit = "title" | "titleIcon" | "onSubmit" | "onCancel"; diff --git a/webapp/src/components/App/Settings/Users/dialog/UpdateUserDialog.tsx b/webapp/src/components/App/Settings/Users/dialog/UpdateUserDialog.tsx index 1f8f6afabb..bbce6568a3 100644 --- a/webapp/src/components/App/Settings/Users/dialog/UpdateUserDialog.tsx +++ b/webapp/src/components/App/Settings/Users/dialog/UpdateUserDialog.tsx @@ -17,16 +17,12 @@ import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { usePromise as usePromiseWrapper } from "react-use"; import { useSnackbar } from "notistack"; -import { - GroupDTO, - RoleType, - UserDetailsDTO, -} from "../../../../../common/types"; -import { createRole, deleteUserRoles } from "../../../../../services/api/user"; +import { GroupDTO, RoleType, UserDetailsDTO } from "@/common/types"; +import { createRole, deleteUserRoles } from "@/services/api/user"; import UserFormDialog, { UserFormDialogProps } from "./UserFormDialog"; import { UserEdit } from ".."; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; type InheritPropsToOmit = | "title" diff --git a/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/UserForm.tsx b/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/UserForm.tsx index 7607a4a00f..d32b49cd22 100644 --- a/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/UserForm.tsx +++ b/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/UserForm.tsx @@ -37,18 +37,19 @@ import { Controller, useFieldArray } from "react-hook-form"; import { v4 as uuidv4 } from "uuid"; import DeleteIcon from "@mui/icons-material/Delete"; import GroupIcon from "@mui/icons-material/Group"; + +import { GroupDTO, RoleType } from "@/common/types"; +import { roleToString, sortByName } from "@/services/utils"; +import usePromise from "@/hooks/usePromise"; +import { getGroups, getUsers } from "@/services/api/user"; +import { UserFormDialogProps } from "."; +import { validatePassword, validateString } from "@/utils/validation/string"; +import { UseFormReturnPlus } from "@/components/common/Form/types"; import { RESERVED_GROUP_NAMES, RESERVED_USER_NAMES, ROLE_TYPE_KEYS, -} from "../../../utils"; -import { GroupDTO, RoleType } from "../../../../../../common/types"; -import { roleToString, sortByName } from "../../../../../../services/utils"; -import usePromise from "../../../../../../hooks/usePromise"; -import { getGroups, getUsers } from "../../../../../../services/api/user"; -import { UserFormDialogProps } from "."; -import { UseFormReturnPlus } from "../../../../../common/Form/types"; -import { validatePassword, validateString } from "@/utils/validation/string"; +} from "@/common/contants"; interface Props extends UseFormReturnPlus { onlyPermissions?: UserFormDialogProps["onlyPermissions"]; diff --git a/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/index.tsx b/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/index.tsx index cc2dd19efd..ee2bc07ba2 100644 --- a/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/index.tsx +++ b/webapp/src/components/App/Settings/Users/dialog/UserFormDialog/index.tsx @@ -13,11 +13,11 @@ */ import { DialogContentText } from "@mui/material"; +import { GroupDTO, RoleType } from "@/common/types"; +import UserForm from "./UserForm"; import FormDialog, { FormDialogProps, -} from "../../../../../common/dialogs/FormDialog"; -import { GroupDTO, RoleType } from "../../../../../../common/types"; -import UserForm from "./UserForm"; +} from "@/components/common/dialogs/FormDialog"; export interface UserFormDialogProps extends Omit { defaultValues?: { diff --git a/webapp/src/components/App/Settings/Users/index.tsx b/webapp/src/components/App/Settings/Users/index.tsx index 373ca36b84..4eab4049c8 100644 --- a/webapp/src/components/App/Settings/Users/index.tsx +++ b/webapp/src/components/App/Settings/Users/index.tsx @@ -34,16 +34,16 @@ import { usePromise as usePromiseWrapper, useUpdateEffect } from "react-use"; import { Action } from "redux"; import { useSnackbar } from "notistack"; import * as R from "ramda"; -import { deleteUser, getUsers } from "../../../../services/api/user"; -import usePromiseWithSnackbarError from "../../../../hooks/usePromiseWithSnackbarError"; -import useEnqueueErrorSnackbar from "../../../../hooks/useEnqueueErrorSnackbar"; -import ConfirmationDialog from "../../../common/dialogs/ConfirmationDialog"; +import { deleteUser, getUsers } from "@/services/api/user"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import Header from "./Header"; -import { RESERVED_USER_NAMES } from "../utils"; -import { UserDetailsDTO } from "../../../../common/types"; +import { UserDetailsDTO } from "@/common/types"; import UpdateUserDialog from "./dialog/UpdateUserDialog"; -import { sortByName } from "../../../../services/utils"; -import { isSearchMatching } from "../../../../utils/stringUtils"; +import { sortByName } from "@/services/utils"; +import { isSearchMatching } from "@/utils/stringUtils"; +import { RESERVED_USER_NAMES } from "@/common/contants"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; enum UserActionKind { ADD = "ADD", diff --git a/webapp/src/components/App/Settings/index.tsx b/webapp/src/components/App/Settings/index.tsx index e1479ed8b8..b027eb0fd6 100644 --- a/webapp/src/components/App/Settings/index.tsx +++ b/webapp/src/components/App/Settings/index.tsx @@ -17,17 +17,14 @@ import { TabContext, TabList, TabPanel } from "@mui/lab"; import { Box, Tab } from "@mui/material"; import { SyntheticEvent, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; -import RootPage from "../../common/page/RootPage"; import Groups from "./Groups"; import Maintenance from "./Maintenance"; import Tokens from "./Tokens"; import Users from "./Users"; -import useAppSelector from "../../../redux/hooks/useAppSelector"; -import { - isAuthUserAdmin, - isAuthUserInGroupAdmin, -} from "../../../redux/selectors"; -import { tuple } from "../../../utils/tsUtils"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { isAuthUserAdmin, isAuthUserInGroupAdmin } from "@/redux/selectors"; +import { tuple } from "@/utils/tsUtils"; +import RootPage from "@/components/common/page/RootPage"; function Settings() { const [tabValue, setTabValue] = useState("1"); diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/CommandMatrixViewer.tsx b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/CommandMatrixViewer.tsx index d57efcec10..7d3a7232ed 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/CommandMatrixViewer.tsx +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/CommandMatrixViewer.tsx @@ -12,11 +12,11 @@ * This file is part of the Antares project. */ +import MatrixDialog from "@/components/App/Data/MatrixDialog"; import { Box, Button } from "@mui/material"; import { isString } from "ramda-adjunct"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import MatrixDialog from "../../../../../Data/MatrixDialog"; import { CommandEnum, CommandItem } from "../../commandTypes"; interface PropTypes { diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/index.tsx b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/index.tsx index c53d7b7ef1..6ac46c7e47 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/index.tsx +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/index.tsx @@ -28,10 +28,6 @@ import { styled, Typography, } from "@mui/material"; -import { CommandItem } from "../../commandTypes"; -import CommandImportButton from "../CommandImportButton"; -import { CommandResultDTO } from "../../../../../../../common/types"; -import LogModal from "../../../../../../common/LogModal"; import { detailsStyle, DraggableAccorderon, @@ -43,6 +39,10 @@ import { StyledDeleteIcon, } from "./style"; import CommandMatrixViewer from "./CommandMatrixViewer"; +import { CommandResultDTO } from "@/common/types"; +import LogModal from "@/components/common/LogModal"; +import { CommandItem } from "../../commandTypes"; +import CommandImportButton from "../CommandImportButton"; export const Item = styled(Box)(({ theme }) => ({ boxSizing: "border-box", diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/style.ts b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/style.ts index e0d056e66c..b8805743bd 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/style.ts +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListItem/style.ts @@ -14,7 +14,7 @@ import { Accordion, Box, styled } from "@mui/material"; import DeleteIcon from "@mui/icons-material/HighlightOff"; -import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "../../../../../../../theme"; +import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "@/theme"; export const ItemContainer = styled(Box, { shouldForwardProp: (prop) => prop !== "onTopVisible", diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListView.tsx b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListView.tsx index 5ba09ec873..0cac99c0cc 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListView.tsx +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/DraggableCommands/CommandListView.tsx @@ -20,8 +20,8 @@ import { Draggable, OnDragEndResponder, } from "react-beautiful-dnd"; -import { CommandItem } from "../commandTypes"; import CommandListItem from "./CommandListItem"; +import { CommandItem } from "../commandTypes"; const Row = memo((props: ListChildComponentProps) => { const { data, index, style } = props; diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/commandTypes.ts b/webapp/src/components/App/Singlestudy/Commands/Edition/commandTypes.ts index 76d63180d0..8361edfd1c 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/commandTypes.ts +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/commandTypes.ts @@ -12,7 +12,7 @@ * This file is part of the Antares project. */ -import { CommandResultDTO } from "../../../../../common/types"; +import { CommandResultDTO } from "@/common/types"; export interface CommandItem { id?: string; diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/index.tsx b/webapp/src/components/App/Singlestudy/Commands/Edition/index.tsx index cdb2098be6..a7878568fb 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/index.tsx +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/index.tsx @@ -45,27 +45,27 @@ import { applyCommands, getStudyTask, exportCommandsMatrices, -} from "../../../../../services/api/variant"; +} from "@/services/api/variant"; import { WSEvent, WSMessage, CommandResultDTO, TaskEventPayload, TaskStatus, -} from "../../../../../common/types"; +} from "@/common/types"; import CommandImportButton from "./DraggableCommands/CommandImportButton"; -import { getTask } from "../../../../../services/api/tasks"; +import { getTask } from "@/services/api/tasks"; import { Body, EditHeader, Header, headerIconStyle, Root } from "./style"; -import SimpleLoader from "../../../../common/loaders/SimpleLoader"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import { addWsMessageListener, sendWsSubscribeMessage, WsChannel, -} from "../../../../../services/webSockets"; -import ConfirmationDialog from "../../../../common/dialogs/ConfirmationDialog"; -import CheckBoxFE from "../../../../common/fieldEditors/CheckBoxFE"; -import EmptyView from "../../../../common/page/SimpleContent"; +} from "@/services/webSockets"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; +import CheckBoxFE from "@/components/common/fieldEditors/CheckBoxFE"; +import SimpleLoader from "@/components/common/loaders/SimpleLoader"; +import EmptyView from "@/components/common/page/SimpleContent"; const logError = debug("antares:variantedition:error"); diff --git a/webapp/src/components/App/Singlestudy/Commands/Edition/utils.ts b/webapp/src/components/App/Singlestudy/Commands/Edition/utils.ts index 5d19407ad5..0063b5a7d5 100644 --- a/webapp/src/components/App/Singlestudy/Commands/Edition/utils.ts +++ b/webapp/src/components/App/Singlestudy/Commands/Edition/utils.ts @@ -17,7 +17,7 @@ import { CommandResultDTO, TaskDTO, TaskStatus, -} from "../../../../../common/types"; +} from "@/common/types"; import { CommandEnum, CommandItem, JsonCommandItem } from "./commandTypes"; export const CommandList = [ diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/CreateVariantDialog.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/CreateVariantDialog.tsx index b4b4cd8c4d..a5778bb3d5 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/CreateVariantDialog.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/CreateVariantDialog.tsx @@ -16,14 +16,14 @@ import { useEffect, useMemo, useState } from "react"; import { useNavigate } from "react-router"; import { useTranslation } from "react-i18next"; import AddCircleIcon from "@mui/icons-material/AddCircle"; -import { GenericInfo, VariantTree } from "../../../../../common/types"; -import { createVariant } from "../../../../../services/api/variant"; -import { createListFromTree } from "../../../../../services/utils"; -import FormDialog from "../../../../common/dialogs/FormDialog"; -import StringFE from "../../../../common/fieldEditors/StringFE"; -import Fieldset from "../../../../common/Fieldset"; -import SelectFE from "../../../../common/fieldEditors/SelectFE"; -import { SubmitHandlerPlus } from "../../../../common/Form/types"; +import { GenericInfo, VariantTree } from "@/common/types"; +import { createVariant } from "@/services/api/variant"; +import { createListFromTree } from "@/services/utils"; +import FormDialog from "@/common/dialogs/FormDialog"; +import StringFE from "@/common/fieldEditors/StringFE"; +import Fieldset from "@/common/Fieldset"; +import SelectFE from "@/common/fieldEditors/SelectFE"; +import { SubmitHandlerPlus } from "@/common/Form/types"; import { validateString } from "@/utils/validation/string"; interface Props { diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/JobStepper.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/JobStepper.tsx index 80ce0830c3..b1d07c0785 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/JobStepper.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/JobStepper.tsx @@ -25,15 +25,11 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useSnackbar } from "notistack"; import { AxiosError } from "axios"; -import { - JobStatus, - LaunchJob, - LaunchJobsProgress, -} from "../../../../../../common/types"; -import { convertUTCToLocalTime } from "../../../../../../services/utils"; -import { killStudy } from "../../../../../../services/api/study"; -import LaunchJobLogView from "../../../../Tasks/LaunchJobLogView"; -import useEnqueueErrorSnackbar from "../../../../../../hooks/useEnqueueErrorSnackbar"; +import { JobStatus, LaunchJob, LaunchJobsProgress } from "@/common/types"; +import { convertUTCToLocalTime } from "@/services/utils"; +import { killStudy } from "@/services/api/study"; +import LaunchJobLogView from "@/Tasks/LaunchJobLogView"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import { CancelContainer, JobRoot, @@ -42,10 +38,10 @@ import { StepLabelRoot, StepLabelRow, } from "./style"; -import ConfirmationDialog from "../../../../../common/dialogs/ConfirmationDialog"; -import LinearProgressWithLabel from "../../../../../common/LinearProgressWithLabel"; -import DigestDialog from "../../../../../common/dialogs/DigestDialog"; -import type { EmptyObject } from "../../../../../../utils/tsUtils"; +import ConfirmationDialog from "@/common/dialogs/ConfirmationDialog"; +import LinearProgressWithLabel from "@/common/LinearProgressWithLabel"; +import DigestDialog from "@/common/dialogs/DigestDialog"; +import type { EmptyObject } from "@/utils/tsUtils"; export const ColorStatus = { running: "warning.main", diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/index.tsx index 263a12d1a5..9a7b887231 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/LauncherHistory/index.tsx @@ -26,19 +26,16 @@ import { StudyMetadata, WSEvent, WSMessage, -} from "../../../../../../common/types"; -import { - getStudyJobs, - mapLaunchJobDTO, -} from "../../../../../../services/api/study"; +} from "@/common/types"; +import { getStudyJobs, mapLaunchJobDTO } from "@/services/api/study"; import { addWsMessageListener, sendWsSubscribeMessage, WsChannel, -} from "../../../../../../services/webSockets"; +} from "@/services/webSockets"; import JobStepper from "./JobStepper"; -import useEnqueueErrorSnackbar from "../../../../../../hooks/useEnqueueErrorSnackbar"; -import { getProgress } from "../../../../../../services/api/tasks"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { getProgress } from "@/services/api/tasks"; const TitleHeader = styled(Box)(({ theme }) => ({ display: "flex", diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/NodeEditorModal/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/NodeEditorModal/index.tsx index 7dae04424a..21415202f1 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/NodeEditorModal/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/NodeEditorModal/index.tsx @@ -18,8 +18,8 @@ import { Button } from "@mui/material"; import { useTranslation } from "react-i18next"; import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted"; import FormatListNumberedIcon from "@mui/icons-material/FormatListNumbered"; -import { convertDraftJSToXML, convertXMLToDraftJS } from "../utils"; -import BasicDialog from "../../../../../../common/dialogs/BasicDialog"; +import { convertDraftJSToXML, convertXMLToDraftJS } from "@/utils"; +import BasicDialog from "@/common/dialogs/BasicDialog"; import { EditorButton, EditorContainer, diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/index.tsx index 9491982e92..930fe14d93 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/index.tsx @@ -29,17 +29,17 @@ import { editComments, getComments, getStudyDiskUsage, -} from "../../../../../../services/api/study"; +} from "@/services/api/study"; import { convertSize, convertXMLToDraftJS, getColorForSize } from "./utils"; -import { StudyMetadata } from "../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; import NoteEditorModal from "./NodeEditorModal"; -import useEnqueueErrorSnackbar from "../../../../../../hooks/useEnqueueErrorSnackbar"; -import usePromiseWithSnackbarError from "../../../../../../hooks/usePromiseWithSnackbarError"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; import DetailsList from "./DetailsList"; -import { getAreas, getLinks } from "../../../../../../redux/selectors"; -import UsePromiseCond from "../../../../../common/utils/UsePromiseCond"; -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import useStudySynthesis from "../../../../../../redux/hooks/useStudySynthesis"; +import { getAreas, getLinks } from "@/redux/selectors"; +import UsePromiseCond from "@/common/utils/UsePromiseCond"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import useStudySynthesis from "@/redux/hooks/useStudySynthesis"; const Root = styled(Box)(() => ({ flex: "0 0 40%", diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/utils.ts b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/utils.ts index 4f2d146330..72002fa5a1 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/utils.ts +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/Notes/utils.ts @@ -18,7 +18,7 @@ import { ContentState, convertToRaw, EditorState } from "draft-js"; import draftToHtml from "draftjs-to-html"; import { convertFromHTML } from "draft-convert"; import { Element as XMLElement, js2xml, xml2json } from "xml-js"; -import theme from "../../../../../../theme"; +import theme from "@/theme"; interface BlockMap { from: string; diff --git a/webapp/src/components/App/Singlestudy/HomeView/InformationView/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/InformationView/index.tsx index 52b57f4935..602fa1e8cb 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/InformationView/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/InformationView/index.tsx @@ -17,16 +17,16 @@ import { Paper, Button, Box, Divider } from "@mui/material"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { AxiosError } from "axios"; -import { StudyMetadata, VariantTree } from "../../../../../common/types"; +import { StudyMetadata, VariantTree } from "@/common/types"; import CreateVariantDialog from "./CreateVariantDialog"; import LauncherHistory from "./LauncherHistory"; import Notes from "./Notes"; -import LauncherDialog from "../../../Studies/LauncherDialog"; +import LauncherDialog from "@/Studies/LauncherDialog"; import { copyStudy, unarchiveStudy as callUnarchiveStudy, -} from "../../../../../services/api/study"; -import useEnqueueErrorSnackbar from "../../../../../hooks/useEnqueueErrorSnackbar"; +} from "@/services/api/study"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; interface Props { study: StudyMetadata | undefined; diff --git a/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/index.tsx index 3e483c8e21..5d5ee7e694 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/index.tsx @@ -15,7 +15,7 @@ import { useEffect, useMemo, useState } from "react"; import * as React from "react"; import { Box, styled } from "@mui/material"; -import { StudyMetadata, VariantTree } from "../../../../../common/types"; +import { StudyMetadata, VariantTree } from "@/common/types"; import { StudyTree, getTreeNodes } from "./utils"; import { CIRCLE_RADIUS, diff --git a/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/utils.ts b/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/utils.ts index f9225289fb..776a092b08 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/utils.ts +++ b/webapp/src/components/App/Singlestudy/HomeView/StudyTreeView/utils.ts @@ -13,11 +13,7 @@ */ /* eslint-disable no-param-reassign */ -import { - GenericInfo, - StudyMetadata, - VariantTree, -} from "../../../../../common/types"; +import { GenericInfo, StudyMetadata, VariantTree } from "@/common/types"; export interface StudyTree { name: string; diff --git a/webapp/src/components/App/Singlestudy/HomeView/index.tsx b/webapp/src/components/App/Singlestudy/HomeView/index.tsx index 83f4d765a5..226b8c79f0 100644 --- a/webapp/src/components/App/Singlestudy/HomeView/index.tsx +++ b/webapp/src/components/App/Singlestudy/HomeView/index.tsx @@ -15,7 +15,7 @@ import { useNavigate } from "react-router-dom"; import { Box } from "@mui/material"; import Split from "react-split"; -import { StudyMetadata, VariantTree } from "../../../../common/types"; +import { StudyMetadata, VariantTree } from "@/common/types"; import "./Split.css"; import StudyTreeView from "./StudyTreeView"; import InformationView from "./InformationView"; diff --git a/webapp/src/components/App/Singlestudy/NavHeader/Actions.tsx b/webapp/src/components/App/Singlestudy/NavHeader/Actions.tsx index fb9dca2669..7468b04c25 100644 --- a/webapp/src/components/App/Singlestudy/NavHeader/Actions.tsx +++ b/webapp/src/components/App/Singlestudy/NavHeader/Actions.tsx @@ -19,12 +19,12 @@ import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; -import { StudyMetadata, StudyType } from "../../../../common/types"; -import { toggleFavorite } from "../../../../redux/ducks/studies"; -import StarToggle from "../../../common/StarToggle"; -import useAppDispatch from "../../../../redux/hooks/useAppDispatch"; -import useAppSelector from "../../../../redux/hooks/useAppSelector"; -import { isCurrentStudyFavorite } from "../../../../redux/selectors"; +import { StudyMetadata, StudyType } from "@/common/types"; +import { toggleFavorite } from "@/redux/ducks/studies"; +import StarToggle from "@/common/StarToggle"; +import useAppDispatch from "@/redux/hooks/useAppDispatch"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { isCurrentStudyFavorite } from "@/redux/selectors"; interface Props { study: StudyMetadata | undefined; diff --git a/webapp/src/components/App/Singlestudy/NavHeader/Details.tsx b/webapp/src/components/App/Singlestudy/NavHeader/Details.tsx index 2a59f1dca5..da79e18d7f 100644 --- a/webapp/src/components/App/Singlestudy/NavHeader/Details.tsx +++ b/webapp/src/components/App/Singlestudy/NavHeader/Details.tsx @@ -26,9 +26,9 @@ import { convertUTCToLocalTime, countAllChildrens, displayVersionName, -} from "../../../../services/utils"; -import { StudyMetadata, VariantTree } from "../../../../common/types"; -import { PUBLIC_MODE_LIST } from "../../../common/utils/constants"; +} from "@/services/utils"; +import { StudyMetadata, VariantTree } from "@/common/types"; +import { PUBLIC_MODE_LIST } from "@/common/utils/constants"; const MAX_STUDY_TITLE_LENGTH = 45; diff --git a/webapp/src/components/App/Singlestudy/NavHeader/index.tsx b/webapp/src/components/App/Singlestudy/NavHeader/index.tsx index decab0bfa8..d8b6e9cf93 100644 --- a/webapp/src/components/App/Singlestudy/NavHeader/index.tsx +++ b/webapp/src/components/App/Singlestudy/NavHeader/index.tsx @@ -25,22 +25,22 @@ import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined"; import DeleteOutlinedIcon from "@mui/icons-material/DeleteOutlined"; import EditOutlinedIcon from "@mui/icons-material/EditOutlined"; import { useTranslation } from "react-i18next"; -import { StudyMetadata, VariantTree } from "../../../../common/types"; -import { STUDIES_HEIGHT_HEADER } from "../../../../theme"; -import { archiveStudy, unarchiveStudy } from "../../../../services/api/study"; -import { deleteStudy } from "../../../../redux/ducks/studies"; -import LauncherDialog from "../../Studies/LauncherDialog"; -import PropertiesDialog from "../PropertiesDialog"; -import useEnqueueErrorSnackbar from "../../../../hooks/useEnqueueErrorSnackbar"; -import { getLatestStudyVersion } from "../../../../redux/selectors"; -import ExportDialog from "../../Studies/ExportModal"; -import ConfirmationDialog from "../../../common/dialogs/ConfirmationDialog"; -import useAppSelector from "../../../../redux/hooks/useAppSelector"; -import useAppDispatch from "../../../../redux/hooks/useAppDispatch"; -import CheckBoxFE from "../../../common/fieldEditors/CheckBoxFE"; +import { StudyMetadata, VariantTree } from "@/common/types"; +import { STUDIES_HEIGHT_HEADER } from "@/theme"; +import { archiveStudy, unarchiveStudy } from "@/services/api/study"; +import { deleteStudy } from "@/redux/ducks/studies"; +import LauncherDialog from "@/Studies/LauncherDialog"; +import PropertiesDialog from "@/PropertiesDialog"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { getLatestStudyVersion } from "@/redux/selectors"; +import ExportDialog from "@/Studies/ExportModal"; +import ConfirmationDialog from "@/common/dialogs/ConfirmationDialog"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import useAppDispatch from "@/redux/hooks/useAppDispatch"; +import CheckBoxFE from "@/common/fieldEditors/CheckBoxFE"; import Details from "./Details"; import Actions from "./Actions"; -import UpgradeDialog from "../UpgradeDialog"; +import UpgradeDialog from "@/UpgradeDialog"; import ActionsMenu, { ActionsMenuItem } from "./ActionsMenu"; const logError = debug("antares:singlestudy:navheader:error"); diff --git a/webapp/src/components/App/Singlestudy/PropertiesDialog.tsx b/webapp/src/components/App/Singlestudy/PropertiesDialog.tsx index 39520299c4..9f788e83a6 100644 --- a/webapp/src/components/App/Singlestudy/PropertiesDialog.tsx +++ b/webapp/src/components/App/Singlestudy/PropertiesDialog.tsx @@ -18,25 +18,25 @@ import { useTranslation } from "react-i18next"; import { AxiosError } from "axios"; import { useSnackbar } from "notistack"; import { useMemo } from "react"; -import { StudyMetadata } from "../../../common/types"; +import { StudyMetadata } from "@/common/types"; import { addStudyGroup, changePublicMode, deleteStudyGroup, updateStudyMetadata, -} from "../../../services/api/study"; -import { getGroups } from "../../../services/api/user"; -import useEnqueueErrorSnackbar from "../../../hooks/useEnqueueErrorSnackbar"; -import { PUBLIC_MODE_LIST } from "../../common/utils/constants"; -import usePromiseWithSnackbarError from "../../../hooks/usePromiseWithSnackbarError"; -import FormDialog from "../../common/dialogs/FormDialog"; -import StringFE from "../../common/fieldEditors/StringFE"; -import SelectFE from "../../common/fieldEditors/SelectFE"; -import CheckboxesTagsFE from "../../common/fieldEditors/CheckboxesTagsFE"; -import Fieldset from "../../common/Fieldset"; -import { SubmitHandlerPlus } from "../../common/Form/types"; -import useAppDispatch from "../../../redux/hooks/useAppDispatch"; -import { updateStudy } from "../../../redux/ducks/studies"; +} from "@/services/api/study"; +import { getGroups } from "@/services/api/user"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { PUBLIC_MODE_LIST } from "@/common/utils/constants"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import FormDialog from "@/common/dialogs/FormDialog"; +import StringFE from "@/common/fieldEditors/StringFE"; +import SelectFE from "@/common/fieldEditors/SelectFE"; +import CheckboxesTagsFE from "@/common/fieldEditors/CheckboxesTagsFE"; +import Fieldset from "@/common/Fieldset"; +import { SubmitHandlerPlus } from "@/common/Form/types"; +import useAppDispatch from "@/redux/hooks/useAppDispatch"; +import { updateStudy } from "@/redux/ducks/studies"; import { validateString } from "@/utils/validation/string"; const logErr = debug("antares:createstudyform:error"); diff --git a/webapp/src/components/App/Singlestudy/UpgradeDialog.tsx b/webapp/src/components/App/Singlestudy/UpgradeDialog.tsx index 48663558b6..f61a6861e0 100644 --- a/webapp/src/components/App/Singlestudy/UpgradeDialog.tsx +++ b/webapp/src/components/App/Singlestudy/UpgradeDialog.tsx @@ -15,14 +15,14 @@ import UpgradeIcon from "@mui/icons-material/Upgrade"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../common/types"; -import { SubmitHandlerPlus } from "../../common/Form/types"; -import Fieldset from "../../common/Fieldset"; -import SelectFE from "../../common/fieldEditors/SelectFE"; -import FormDialog from "../../common/dialogs/FormDialog"; -import useAppSelector from "../../../redux/hooks/useAppSelector"; -import { getStudyVersionsFormatted } from "../../../redux/selectors"; -import { upgradeStudy } from "../../../services/api/study"; +import { StudyMetadata } from "@/common/types"; +import { SubmitHandlerPlus } from "@/common/Form/types"; +import Fieldset from "@/common/Fieldset"; +import SelectFE from "@/common/fieldEditors/SelectFE"; +import FormDialog from "@/common/dialogs/FormDialog"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getStudyVersionsFormatted } from "@/redux/selectors"; +import { upgradeStudy } from "@/services/api/study"; interface Props { study: StudyMetadata; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/Fields.tsx index cbdccd3911..f029cb2c15 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/Fields.tsx @@ -15,14 +15,14 @@ import { Box } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useOutletContext } from "react-router"; -import NumberFE from "../../../../../common/fieldEditors/NumberFE"; -import SelectFE from "../../../../../common/fieldEditors/SelectFE"; -import SwitchFE from "../../../../../common/fieldEditors/SwitchFE"; -import Fieldset from "../../../../../common/Fieldset"; -import { useFormContextPlus } from "../../../../../common/Form"; import { AdequacyPatchFormFields, PRICE_TAKING_ORDER_OPTIONS } from "./utils"; -import { StudyMetadata } from "../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; import { validateNumber } from "@/utils/validation/number"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; function Fields() { const { t } = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/index.tsx index 8b8b178543..865ed9f36c 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/index.tsx @@ -14,17 +14,17 @@ import { useOutletContext } from "react-router"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../../common/types"; -import Form from "../../../../../common/Form"; -import { SubmitHandlerPlus } from "../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; import Fields from "./Fields"; import { AdequacyPatchFormFields, getAdequacyPatchFormFields, setAdequacyPatchFormFields, } from "./utils"; -import TableMode from "../../../../../common/TableMode"; -import TabsView from "../../../../../common/TabsView"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import TableMode from "@/components/common/TableMode"; +import TabsView from "@/components/common/TabsView"; +import Form from "@/components/common/Form"; function AdequacyPatch() { const { study } = useOutletContext<{ study: StudyMetadata }>(); @@ -34,9 +34,7 @@ function AdequacyPatch() { // Event Handlers //////////////////////////////////////////////////////////////// - const handleSubmit = async ( - data: SubmitHandlerPlus, - ) => { + const handleSubmit = (data: SubmitHandlerPlus) => { return setAdequacyPatchFormFields(study.id, data.dirtyValues); }; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/utils.ts index 3fb10e2782..4f1be592c6 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdequacyPatch/utils.ts @@ -12,8 +12,8 @@ * This file is part of the Antares project. */ -import { StudyMetadata } from "../../../../../../common/types"; -import client from "../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Enums diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/Fields.tsx index 19a19d41a9..abfa1363e4 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/Fields.tsx @@ -14,10 +14,6 @@ import { Box } from "@mui/material"; import { useTranslation } from "react-i18next"; -import NumberFE from "../../../../../common/fieldEditors/NumberFE"; -import SelectFE from "../../../../../common/fieldEditors/SelectFE"; -import Fieldset from "../../../../../common/Fieldset"; -import { useFormContextPlus } from "../../../../../common/Form"; import { AdvancedParamsFormFields, HYDRO_HEURISTIC_POLICY_OPTIONS, @@ -33,7 +29,11 @@ import { UnitCommitmentMode, } from "./utils"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; function Fields() { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/index.tsx index 28e5ef9ee2..2ad31f71f8 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/index.tsx @@ -13,17 +13,17 @@ */ import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../common/types"; -import { updateStudySynthesis } from "../../../../../../redux/ducks/studySyntheses"; -import useAppDispatch from "../../../../../../redux/hooks/useAppDispatch"; -import Form from "../../../../../common/Form"; -import { SubmitHandlerPlus } from "../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; +import { updateStudySynthesis } from "@/redux/ducks/studySyntheses"; +import useAppDispatch from "@/redux/hooks/useAppDispatch"; import Fields from "./Fields"; import { AdvancedParamsFormFields, getAdvancedParamsFormFields, setAdvancedParamsFormFields, } from "./utils"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function AdvancedParameters() { const { study } = useOutletContext<{ study: StudyMetadata }>(); diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/utils.ts index addfec700c..98ab1b86ce 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/AdvancedParameters/utils.ts @@ -13,8 +13,8 @@ */ import { DeepPartial } from "react-hook-form"; -import { StudyMetadata } from "../../../../../../common/types"; -import client from "../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Enums diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/Fields.tsx index f4d23505b4..ba7f180206 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/Fields.tsx @@ -18,8 +18,6 @@ import SettingsIcon from "@mui/icons-material/Settings"; import { useEffect } from "react"; import * as RA from "ramda-adjunct"; import { Validate } from "react-hook-form"; -import SelectFE from "../../../../../common/fieldEditors/SelectFE"; -import SwitchFE from "../../../../../common/fieldEditors/SwitchFE"; import { BuildingMode, BUILDING_MODE_OPTIONS, @@ -30,12 +28,14 @@ import { WEEK_OPTIONS, YEAR_OPTIONS, } from "./utils"; -import BooleanFE from "../../../../../common/fieldEditors/BooleanFE"; -import { useFormContextPlus } from "../../../../../common/Form"; -import StringFE from "../../../../../common/fieldEditors/StringFE"; -import NumberFE from "../../../../../common/fieldEditors/NumberFE"; -import Fieldset from "../../../../../common/Fieldset"; import { FieldWithButton } from "./styles"; +import { useFormContextPlus } from "@/components/common/Form"; +import BooleanFE from "@/components/common/fieldEditors/BooleanFE"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import StringFE from "@/components/common/fieldEditors/StringFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; interface Props { setDialog: React.Dispatch>; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/Table.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/Table.tsx index 9b0648912a..2400ef1673 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/Table.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/Table.tsx @@ -13,19 +13,19 @@ */ import { useTranslation } from "react-i18next"; -import TableForm from "../../../../../../../common/TableForm"; +import TableForm from "@/common/TableForm"; import { GenericScenarioConfig, ScenarioType, ClustersHandlerReturn, updateScenarioBuilderConfig, } from "./utils"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; -import EmptyView from "../../../../../../../common/page/SimpleContent"; -import useEnqueueErrorSnackbar from "../../../../../../../../hooks/useEnqueueErrorSnackbar"; -import { toError } from "../../../../../../../../utils/fnUtils"; +import { SubmitHandlerPlus } from "@/common/Form/types"; +import EmptyView from "@/common/page/SimpleContent"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { toError } from "@/utils/fnUtils"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; interface Props { config: GenericScenarioConfig | ClustersHandlerReturn; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/index.tsx index 3f86bc643c..7e2b7ff0c4 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/index.tsx @@ -16,13 +16,13 @@ import { TabContext, TabList, TabListProps, TabPanel } from "@mui/lab"; import { Box, Button, Tab, Skeleton } from "@mui/material"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import BasicDialog from "../../../../../../../common/dialogs/BasicDialog"; +import { StudyMetadata } from "@/common/types"; import Table from "./Table"; import { getScenarioConfigByType, SCENARIOS, ScenarioType } from "./utils"; -import UsePromiseCond from "../../../../../../../common/utils/UsePromiseCond"; import withAreas from "./withAreas"; -import usePromiseWithSnackbarError from "../../../../../../../../hooks/usePromiseWithSnackbarError"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import BasicDialog from "@/components/common/dialogs/BasicDialog"; +import UsePromiseCond from "@/components/common/utils/UsePromiseCond"; interface Props { study: StudyMetadata; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/utils.ts index 87e4f5a979..d3652b3e51 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/utils.ts @@ -13,8 +13,8 @@ */ import { AxiosResponse } from "axios"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Constants diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/withAreas.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/withAreas.tsx index 05dfcb013f..7b85528084 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/withAreas.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioBuilderDialog/withAreas.tsx @@ -14,9 +14,9 @@ import { ComponentType, useEffect, useMemo, useState } from "react"; import { Box } from "@mui/material"; -import SplitView from "../../../../../../../common/SplitView"; -import PropertiesView from "../../../../../../../common/PropertiesView"; -import ListElement from "../../../../common/ListElement"; +import SplitView from "@/common/SplitView"; +import PropertiesView from "@/common/PropertiesView"; +import ListElement from "@/common/ListElement"; import { GenericScenarioConfig, HandlerReturnTypes, diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/index.tsx index 80f78ef82c..8c1be4198f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/index.tsx @@ -18,22 +18,19 @@ import { useTranslation } from "react-i18next"; import * as R from "ramda"; import * as RA from "ramda-adjunct"; import Handsontable from "handsontable"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import usePromise from "../../../../../../../../hooks/usePromise"; -import BasicDialog from "../../../../../../../common/dialogs/BasicDialog"; -import TableForm from "../../../../../../../common/TableForm"; -import UsePromiseCond from "../../../../../../../common/utils/UsePromiseCond"; +import { StudyMetadata } from "@/common/types"; +import usePromise from "@/hooks/usePromise"; +import BasicDialog from "@/common/dialogs/BasicDialog"; +import TableForm from "@/common/TableForm"; +import UsePromiseCond from "@/common/utils/UsePromiseCond"; import { DEFAULT_WEIGHT, getPlaylist, PlaylistData, setPlaylist, } from "./utils"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; -import { - HandsontableProps, - HotTableClass, -} from "../../../../../../../common/Handsontable"; +import { SubmitHandlerPlus } from "@/common/Form/types"; +import { HandsontableProps, HotTableClass } from "@/common/Handsontable"; interface Props { study: StudyMetadata; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/utils.ts index bd7c015df8..5404a5399c 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ScenarioPlaylistDialog/utils.ts @@ -12,8 +12,8 @@ * This file is part of the Antares project. */ -import { StudyMetadata } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; interface PlaylistColumns extends Record { status: boolean; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/index.tsx index 19cbfdf8b9..6235ebe43c 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/index.tsx @@ -24,25 +24,22 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import * as R from "ramda"; import * as RA from "ramda-adjunct"; import { useState } from "react"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import SwitchFE from "../../../../../../../common/fieldEditors/SwitchFE"; -import { - SubmitHandlerPlus, - UseFormReturnPlus, -} from "../../../../../../../common/Form/types"; -import SearchFE from "../../../../../../../common/fieldEditors/SearchFE"; -import { isSearchMatching } from "../../../../../../../../utils/stringUtils"; -import FormDialog from "../../../../../../../common/dialogs/FormDialog"; +import { StudyMetadata } from "@/common/types"; +import SwitchFE from "@/common/fieldEditors/SwitchFE"; +import { SubmitHandlerPlus, UseFormReturnPlus } from "@/common/Form/types"; +import SearchFE from "@/common/fieldEditors/SearchFE"; +import { isSearchMatching } from "@/utils/stringUtils"; +import FormDialog from "@/common/dialogs/FormDialog"; import { THEMATIC_TRIMMING_GROUPS, getFieldLabelsForGroup, type ThematicTrimmingGroup, } from "./utils"; -import type { ThematicTrimmingConfig } from "../../../../../../../../services/api/studies/config/thematicTrimming/types"; +import type { ThematicTrimmingConfig } from "@/services/api/studies/config/thematicTrimming/types"; import { getThematicTrimmingConfig, setThematicTrimmingConfig, -} from "../../../../../../../../services/api/studies/config/thematicTrimming"; +} from "@/services/api/studies/config/thematicTrimming"; import { useTranslation } from "react-i18next"; import Stack from "@mui/material/Stack"; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/utils.ts index a3a16e5661..7084f8afb1 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/dialogs/ThematicTrimmingDialog/utils.ts @@ -13,7 +13,7 @@ */ import * as R from "ramda"; -import { ThematicTrimmingConfig } from "../../../../../../../../services/api/studies/config/thematicTrimming/types"; +import { ThematicTrimmingConfig } from "@/services/api/studies/config/thematicTrimming/types"; import { O } from "ts-toolbelt"; export const THEMATIC_TRIMMING_GROUPS = [ diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/General/index.tsx index 9d9ea519d9..6e6a8e6675 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/index.tsx @@ -15,8 +15,7 @@ import { useOutletContext } from "react-router"; import * as R from "ramda"; import { useState } from "react"; -import { StudyMetadata } from "../../../../../../common/types"; -import Form from "../../../../../common/Form"; +import { StudyMetadata } from "@/common/types"; import Fields from "./Fields"; import ThematicTrimmingDialog from "./dialogs/ThematicTrimmingDialog"; import ScenarioPlaylistDialog from "./dialogs/ScenarioPlaylistDialog"; @@ -28,8 +27,9 @@ import { SetDialogStateType, setGeneralFormFields, } from "./utils"; -import { SubmitHandlerPlus } from "../../../../../common/Form/types"; import ScenarioBuilderDialog from "./dialogs/ScenarioBuilderDialog"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function General() { const { study } = useOutletContext<{ study: StudyMetadata }>(); diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/General/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/General/utils.ts index 612e43080f..53659f9a17 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/General/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/General/utils.ts @@ -13,8 +13,8 @@ */ import * as R from "ramda"; -import { StudyMetadata } from "../../../../../../common/types"; -import client from "../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Enums diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/Fields.tsx index 143b3108ed..3d624c82f6 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/Fields.tsx @@ -14,11 +14,7 @@ import { Box } from "@mui/material"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../../common/types"; -import SelectFE from "../../../../../common/fieldEditors/SelectFE"; -import SwitchFE from "../../../../../common/fieldEditors/SwitchFE"; -import Fieldset from "../../../../../common/Fieldset"; -import { useFormContextPlus } from "../../../../../common/Form"; +import { StudyMetadata } from "@/common/types"; import { LEGACY_TRANSMISSION_CAPACITIES_OPTIONS, OptimizationFormFields, @@ -27,6 +23,10 @@ import { TRANSMISSION_CAPACITIES_OPTIONS, UNFEASIBLE_PROBLEM_BEHAVIOR_OPTIONS, } from "./utils"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; interface Props { study: StudyMetadata; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/index.tsx index 775665d746..4301fa197b 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/index.tsx @@ -13,15 +13,15 @@ */ import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../common/types"; -import Form from "../../../../../common/Form"; -import { SubmitHandlerPlus } from "../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; import Fields from "./Fields"; import { getOptimizationFormFields, OptimizationFormFields, setOptimizationFormFields, } from "./utils"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function Optimization() { const { study } = useOutletContext<{ study: StudyMetadata }>(); @@ -30,9 +30,7 @@ function Optimization() { // Event Handlers //////////////////////////////////////////////////////////////// - const handleSubmit = async ( - data: SubmitHandlerPlus, - ) => { + const handleSubmit = (data: SubmitHandlerPlus) => { return setOptimizationFormFields(study.id, data.dirtyValues); }; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/utils.ts index 319509ac63..579efe7354 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/Optimization/utils.ts @@ -18,8 +18,8 @@ import * as R from "ramda"; // Enums //////////////////////////////////////////////////////////////// -import { StudyMetadata } from "../../../../../../common/types"; -import client from "../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; enum UnfeasibleProblemBehavior { WarningDry = "warning-dry", diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/Fields.tsx index d70ab020a4..1f95bc8590 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/Fields.tsx @@ -22,12 +22,12 @@ import { } from "@mui/material"; import { capitalize } from "lodash"; import * as R from "ramda"; -import CheckBoxFE from "../../../../../common/fieldEditors/CheckBoxFE"; -import NumberFE from "../../../../../common/fieldEditors/NumberFE"; -import SelectFE from "../../../../../common/fieldEditors/SelectFE"; -import SwitchFE from "../../../../../common/fieldEditors/SwitchFE"; -import { useFormContextPlus } from "../../../../../common/Form"; import { TSFormFields, SEASONAL_CORRELATION_OPTIONS, TSType } from "./utils"; +import CheckBoxFE from "@/components/common/fieldEditors/CheckBoxFE"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import { useFormContextPlus } from "@/components/common/Form"; const borderStyle = "1px solid rgba(255, 255, 255, 0.12)"; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/index.tsx index 2619fe284c..5d763b5868 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/index.tsx @@ -13,15 +13,15 @@ */ import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../common/types"; -import Form from "../../../../../common/Form"; -import { SubmitHandlerPlus } from "../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; import Fields from "./Fields"; import { getTimeSeriesFormFields, setTimeSeriesFormFields, TSFormFields, } from "./utils"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function TimeSeriesManagement() { const { study } = useOutletContext<{ study: StudyMetadata }>(); @@ -30,7 +30,7 @@ function TimeSeriesManagement() { // Event Handlers //////////////////////////////////////////////////////////////// - const handleSubmit = async (data: SubmitHandlerPlus) => { + const handleSubmit = (data: SubmitHandlerPlus) => { return setTimeSeriesFormFields(study.id, data.dirtyValues); }; diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/utils.ts b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/utils.ts index 19e42b5b33..7c223c1914 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/TimeSeriesManagement/utils.ts @@ -13,8 +13,8 @@ */ import { DeepPartial } from "react-hook-form"; -import { StudyMetadata } from "../../../../../../common/types"; -import client from "../../../../../../services/api/client"; +import { StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Enums diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx index 2cb4312daa..26bee5fb6e 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx @@ -16,17 +16,17 @@ import * as R from "ramda"; import { useMemo, useState } from "react"; import { useOutletContext } from "react-router"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../common/types"; -import PropertiesView from "../../../../common/PropertiesView"; -import ListElement from "../common/ListElement"; +import { StudyMetadata } from "@/common/types"; import AdequacyPatch from "./AdequacyPatch"; import AdvancedParameters from "./AdvancedParameters"; import General from "./General"; import Optimization from "./Optimization"; import TimeSeriesManagement from "./TimeSeriesManagement"; -import TableMode from "../../../../common/TableMode"; -import SplitView from "../../../../common/SplitView"; -import ViewWrapper from "../../../../common/page/ViewWrapper"; +import ViewWrapper from "@/components/common/page/ViewWrapper"; +import PropertiesView from "@/components/common/PropertiesView"; +import SplitView from "@/components/common/SplitView"; +import TableMode from "@/components/common/TableMode"; +import ListElement from "../common/ListElement"; function Configuration() { const { study } = useOutletContext<{ study: StudyMetadata }>(); diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Folder.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Folder.tsx index 88c1aaea1e..ca3b51fc2e 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Folder.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Folder.tsx @@ -27,27 +27,27 @@ import { import FolderIcon from "@mui/icons-material/Folder"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import DeleteIcon from "@mui/icons-material/Delete"; -import { - getFileIcon, - getFileType, - type TreeFolder, - type DataCompProps, - isFolder, - canEditFile, -} from "../utils"; import { Fragment, useState } from "react"; -import EmptyView from "../../../../../common/page/SimpleContent"; import { useTranslation } from "react-i18next"; import { Filename, Menubar } from "./styles"; -import UploadFileButton from "../../../../../common/buttons/UploadFileButton"; -import ConfirmationDialog from "../../../../../common/dialogs/ConfirmationDialog"; -import useConfirm from "../../../../../../hooks/useConfirm"; -import { deleteFile } from "../../../../../../services/api/studies/raw"; -import useEnqueueErrorSnackbar from "../../../../../../hooks/useEnqueueErrorSnackbar"; -import { toError } from "../../../../../../utils/fnUtils"; +import useConfirm from "@/hooks/useConfirm"; +import { deleteFile } from "@/services/api/studies/raw"; +import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; +import { toError } from "@/utils/fnUtils"; import { useOutletContext } from "react-router"; -import type { StudyMetadata } from "../../../../../../common/types"; +import type { StudyMetadata } from "@/common/types"; import { useSnackbar } from "notistack"; +import UploadFileButton from "@/components/common/buttons/UploadFileButton"; +import ConfirmationDialog from "@/components/common/dialogs/ConfirmationDialog"; +import EmptyView from "@/components/common/page/SimpleContent"; +import { + DataCompProps, + TreeFolder, + isFolder, + getFileType, + getFileIcon, + canEditFile, +} from "../utils"; function Folder(props: DataCompProps) { const { diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Image.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Image.tsx index 23aa34e993..f68162e937 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Image.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Image.tsx @@ -13,10 +13,10 @@ */ import { useTranslation } from "react-i18next"; -import EmptyView from "../../../../../common/page/SimpleContent"; import ImageIcon from "@mui/icons-material/Image"; import { Filename, Flex, Menubar } from "./styles"; -import type { DataCompProps } from "../utils"; +import { DataCompProps } from "../utils"; +import EmptyView from "@/components/common/page/SimpleContent"; function Image({ filename }: DataCompProps) { const { t } = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Json.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Json.tsx index 1a8eb2fce5..87dafb1232 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Json.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Json.tsx @@ -14,16 +14,16 @@ import { useTranslation } from "react-i18next"; import { useSnackbar } from "notistack"; -import { editStudy, getStudyData } from "../../../../../../services/api/study"; -import JSONEditor, { JSONEditorProps } from "../../../../../common/JSONEditor"; -import usePromiseWithSnackbarError from "../../../../../../hooks/usePromiseWithSnackbarError"; -import UsePromiseCond from "../../../../../common/utils/UsePromiseCond"; -import type { DataCompProps } from "../utils"; -import DownloadButton from "../../../../../common/buttons/DownloadButton"; -import { downloadFile } from "../../../../../../utils/fileUtils"; +import { editStudy, getStudyData } from "@/services/api/study"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import { downloadFile } from "@/utils/fileUtils"; import { useEffect, useState } from "react"; import { Filename, Flex, Menubar } from "./styles"; -import UploadFileButton from "../../../../../common/buttons/UploadFileButton"; +import DownloadButton from "@/components/common/buttons/DownloadButton"; +import UploadFileButton from "@/components/common/buttons/UploadFileButton"; +import JSONEditor, { JSONEditorProps } from "@/components/common/JSONEditor"; +import UsePromiseCond from "@/components/common/utils/UsePromiseCond"; +import { DataCompProps } from "../utils"; function Json({ filePath, filename, studyId, canEdit }: DataCompProps) { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Matrix.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Matrix.tsx index 8c791964ab..4d97686ca9 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Matrix.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Matrix.tsx @@ -12,8 +12,8 @@ * This file is part of the Antares project. */ -import Matrix from "../../../../../common/Matrix"; -import type { DataCompProps } from "../utils"; +import Matrix from "@/components/common/Matrix"; +import { DataCompProps } from "../utils"; function DebugMatrix({ studyId, filename, filePath, canEdit }: DataCompProps) { return ; diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx index 4cf121b951..ccebe2c8af 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx @@ -14,9 +14,8 @@ import { useTranslation } from "react-i18next"; import { Box, useTheme } from "@mui/material"; -import { getStudyData } from "../../../../../../services/api/study"; -import usePromiseWithSnackbarError from "../../../../../../hooks/usePromiseWithSnackbarError"; -import UsePromiseCond from "../../../../../common/utils/UsePromiseCond"; +import { getStudyData } from "@/services/api/study"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; import { Light as SyntaxHighlighter, type SyntaxHighlighterProps, @@ -26,11 +25,12 @@ import plaintext from "react-syntax-highlighter/dist/esm/languages/hljs/plaintex import ini from "react-syntax-highlighter/dist/esm/languages/hljs/ini"; import properties from "react-syntax-highlighter/dist/esm/languages/hljs/properties"; import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs"; -import type { DataCompProps } from "../utils"; -import DownloadButton from "../../../../../common/buttons/DownloadButton"; -import { downloadFile } from "../../../../../../utils/fileUtils"; +import { downloadFile } from "@/utils/fileUtils"; import { Filename, Flex, Menubar } from "./styles"; -import UploadFileButton from "../../../../../common/buttons/UploadFileButton"; +import DownloadButton from "@/components/common/buttons/DownloadButton"; +import UploadFileButton from "@/components/common/buttons/UploadFileButton"; +import UsePromiseCond from "@/components/common/utils/UsePromiseCond"; +import { DataCompProps } from "../utils"; SyntaxHighlighter.registerLanguage("xml", xml); SyntaxHighlighter.registerLanguage("plaintext", plaintext); diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Data/index.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Data/index.tsx index f387b7ef9c..d0f7b523f6 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Data/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Data/index.tsx @@ -17,10 +17,9 @@ import Image from "./Image"; import Json from "./Json"; import Matrix from "./Matrix"; import Folder from "./Folder"; -import { canEditFile, type FileInfo, type FileType } from "../utils"; -import type { DataCompProps } from "../utils"; -import ViewWrapper from "../../../../../common/page/ViewWrapper"; -import type { StudyMetadata } from "../../../../../../common/types"; +import type { StudyMetadata } from "@/common/types"; +import { canEditFile, DataCompProps, FileInfo, FileType } from "../utils"; +import ViewWrapper from "@/components/common/page/ViewWrapper"; interface Props extends FileInfo { study: StudyMetadata; diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/DebugContext.ts b/webapp/src/components/App/Singlestudy/explore/Debug/DebugContext.ts index 4e10130ef9..ad175b2f5f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/DebugContext.ts +++ b/webapp/src/components/App/Singlestudy/explore/Debug/DebugContext.ts @@ -14,7 +14,7 @@ import { createContext } from "react"; import type { FileInfo } from "./utils"; -import { voidFn } from "../../../../../utils/fnUtils"; +import { voidFn } from "@/utils/fnUtils"; const initialDebugContextValue = { setSelectedFile: voidFn<[FileInfo]>, diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Tree/FileTreeItem.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Tree/FileTreeItem.tsx index dbc52c5a9f..a87b76e33f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Tree/FileTreeItem.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Tree/FileTreeItem.tsx @@ -12,11 +12,11 @@ * This file is part of the Antares project. */ +import TreeItemEnhanced from "@/components/common/TreeItemEnhanced"; import { Box } from "@mui/material"; -import { TreeData, getFileType, getFileIcon, isFolder } from "../utils"; -import DebugContext from "../DebugContext"; import { useContext } from "react"; -import TreeItemEnhanced from "../../../../../common/TreeItemEnhanced"; +import DebugContext from "../DebugContext"; +import { TreeData, getFileType, getFileIcon, isFolder } from "../utils"; interface Props { name: string; diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/Tree/index.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/Tree/index.tsx index 417ef33b4f..90e275bdbe 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/Tree/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/Tree/index.tsx @@ -14,8 +14,8 @@ import { SimpleTreeView } from "@mui/x-tree-view/SimpleTreeView"; import FileTreeItem from "./FileTreeItem"; -import type { TreeFolder } from "../utils"; -import { getParentPaths } from "../../../../../../utils/pathUtils"; +import { getParentPaths } from "@/utils/pathUtils"; +import { TreeFolder } from "../utils"; interface Props { data: TreeFolder; diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/index.tsx b/webapp/src/components/App/Singlestudy/explore/Debug/index.tsx index 96f8de8e91..98dcc61813 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Debug/index.tsx @@ -18,10 +18,9 @@ import { useOutletContext, useSearchParams } from "react-router-dom"; import { Box } from "@mui/material"; import Tree from "./Tree"; import Data from "./Data"; -import { StudyMetadata } from "../../../../../common/types"; -import UsePromiseCond from "../../../../common/utils/UsePromiseCond"; -import usePromiseWithSnackbarError from "../../../../../hooks/usePromiseWithSnackbarError"; -import { getStudyData } from "../../../../../services/api/study"; +import { StudyMetadata } from "@/common/types"; +import usePromiseWithSnackbarError from "@/hooks/usePromiseWithSnackbarError"; +import { getStudyData } from "@/services/api/study"; import DebugContext from "./DebugContext"; import { getFileType, @@ -30,8 +29,9 @@ import { type TreeFolder, } from "./utils"; import * as R from "ramda"; -import SplitView from "../../../../common/SplitView"; import { useUpdateEffect } from "react-use"; +import SplitView from "@/components/common/SplitView"; +import UsePromiseCond from "@/components/common/utils/UsePromiseCond"; function Debug() { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Debug/utils.ts b/webapp/src/components/App/Singlestudy/explore/Debug/utils.ts index b1d8653f07..61f356e824 100644 --- a/webapp/src/components/App/Singlestudy/explore/Debug/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Debug/utils.ts @@ -19,7 +19,7 @@ import FolderIcon from "@mui/icons-material/Folder"; import DatasetIcon from "@mui/icons-material/Dataset"; import { SvgIconComponent } from "@mui/icons-material"; import * as RA from "ramda-adjunct"; -import type { StudyMetadata } from "../../../../../common/types"; +import type { StudyMetadata } from "@/common/types"; //////////////////////////////////////////////////////////////// // Types diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreaPropsView.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreaPropsView.tsx index feb39df236..44e2859fc5 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreaPropsView.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreaPropsView.tsx @@ -13,12 +13,12 @@ */ import { useEffect, useState } from "react"; -import { Area } from "../../../../../../common/types"; -import PropertiesView from "../../../../../common/PropertiesView"; -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import { getAreas } from "../../../../../../redux/selectors"; +import { Area } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getAreas } from "@/redux/selectors"; +import { transformNameToId } from "@/services/utils"; +import PropertiesView from "@/components/common/PropertiesView"; import ListElement from "../../common/ListElement"; -import { transformNameToId } from "../../../../../../services/utils"; interface PropsType { studyId: string; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx index 508e75705a..66b7e0d30b 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx @@ -15,10 +15,10 @@ import { useEffect, useMemo } from "react"; import { useLocation, useNavigate, useOutletContext } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import TabWrapper from "../../TabWrapper"; -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../redux/selectors"; interface Props { renewablesClustering: boolean; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/AllocationField.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/AllocationField.tsx index b95d995a48..e0a7a35ea7 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/AllocationField.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/AllocationField.tsx @@ -14,8 +14,8 @@ import { Typography, Grid } from "@mui/material"; import { FieldArrayWithId } from "react-hook-form"; -import NumberFE from "../../../../../../../common/fieldEditors/NumberFE"; -import { useFormContextPlus } from "../../../../../../../common/Form"; +import NumberFE from "@/common/fieldEditors/NumberFE"; +import { useFormContextPlus } from "@/common/Form"; import { AllocationFormFields } from "./utils"; import { validateNumber } from "@/utils/validation/number"; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/Fields.tsx index ce708a4771..edd0d26041 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/Fields.tsx @@ -14,14 +14,14 @@ import { useFieldArray } from "react-hook-form"; import { useOutletContext } from "react-router"; -import { useFormContextPlus } from "../../../../../../../common/Form"; +import { useFormContextPlus } from "@/common/Form"; import { AllocationFormFields } from "./utils"; import AllocationField from "./AllocationField"; -import DynamicList from "../../../../../../../common/DynamicList"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getAreasById } from "../../../../../../../../redux/selectors"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import { useAreasOptions } from "../hooks/useAreasOptions"; +import DynamicList from "@/common/DynamicList"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getAreasById } from "@/redux/selectors"; +import { StudyMetadata } from "@/common/types"; +import { useAreasOptions } from "@/hooks/useAreasOptions"; function Fields() { const { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/index.tsx index fc50dff4a8..e337adf970 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/index.tsx @@ -15,20 +15,20 @@ import { Grid } from "@mui/material"; import { useOutletContext } from "react-router"; import { useState } from "react"; -import Form from "../../../../../../../common/Form"; import Fields from "./Fields"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../../redux/selectors"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import { AllocationFormFields, getAllocationFormFields, setAllocationFormFields, } from "./utils"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; +import Form from "@/components/common/Form"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; import HydroMatrixDialog from "../HydroMatrixDialog"; -import { HydroMatrix } from "../utils"; import { FormBox, FormPaper } from "../style"; +import { HydroMatrix } from "../utils"; import ViewMatrixButton from "../ViewMatrixButton"; function Allocation() { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/utils.ts index 5d5d054a11..7b05690cf1 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Allocation/utils.ts @@ -12,9 +12,9 @@ * This file is part of the Antares project. */ -import { StudyMetadata, Area } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; -import { MatrixDataDTO } from "../../../../../../../common/Matrix/shared/types"; +import { StudyMetadata, Area } from "@/common/types"; +import { MatrixDataDTO } from "@/components/common/Matrix/shared/types"; +import client from "@/services/api/client"; import { AreaCoefficientItem } from "../utils"; //////////////////////////////////////////////////////////////// diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/CorrelationField.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/CorrelationField.tsx index 0dd9f41016..d0d88498dc 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/CorrelationField.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/CorrelationField.tsx @@ -15,12 +15,12 @@ import { Typography, Grid } from "@mui/material"; import { FieldArrayWithId } from "react-hook-form"; import { useTranslation } from "react-i18next"; -import NumberFE from "../../../../../../../common/fieldEditors/NumberFE"; import { CorrelationFormFields } from "./utils"; -import { useFormContextPlus } from "../../../../../../../common/Form"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentArea } from "../../../../../../../../redux/selectors"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentArea } from "@/redux/selectors"; import { validateNumber } from "@/utils/validation/number"; +import { useFormContextPlus } from "@/components/common/Form"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; interface Props { field: FieldArrayWithId; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/Fields.tsx index 60a99464c7..ff811d8d33 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/Fields.tsx @@ -14,17 +14,14 @@ import { useFieldArray } from "react-hook-form"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { - getAreasById, - getCurrentArea, -} from "../../../../../../../../redux/selectors"; -import DynamicList from "../../../../../../../common/DynamicList"; -import { useFormContextPlus } from "../../../../../../../common/Form"; -import { useAreasOptions } from "../hooks/useAreasOptions"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getAreasById, getCurrentArea } from "@/redux/selectors"; import CorrelationField from "./CorrelationField"; import { CorrelationFormFields } from "./utils"; +import DynamicList from "@/components/common/DynamicList"; +import { useFormContextPlus } from "@/components/common/Form"; +import { useAreasOptions } from "../hooks/useAreasOptions"; function Fields() { const { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/index.tsx index df566ba68d..dcce1bba5f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/index.tsx @@ -15,21 +15,21 @@ import { Grid } from "@mui/material"; import { useOutletContext } from "react-router"; import { useState } from "react"; -import Form from "../../../../../../../common/Form"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../../redux/selectors"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import { CorrelationFormFields, getCorrelationFormFields, setCorrelationFormFields, } from "./utils"; import Fields from "./Fields"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; import HydroMatrixDialog from "../HydroMatrixDialog"; -import { HydroMatrix } from "../utils"; import { FormBox, FormPaper } from "../style"; import ViewMatrixButton from "../ViewMatrixButton"; +import { HydroMatrix } from "../utils"; function Correlation() { const { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/utils.ts index 253963b1c6..94dddc6d69 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/Correlation/utils.ts @@ -12,9 +12,9 @@ * This file is part of the Antares project. */ -import { StudyMetadata, Area } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; -import { MatrixDataDTO } from "../../../../../../../common/Matrix/shared/types"; +import { StudyMetadata, Area } from "@/common/types"; +import { MatrixDataDTO } from "@/components/common/Matrix/shared/types"; +import client from "@/services/api/client"; import { AreaCoefficientItem } from "../utils"; //////////////////////////////////////////////////////////////// diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrix.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrix.tsx index 372ae3cfce..928fa96b87 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrix.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrix.tsx @@ -12,11 +12,11 @@ * This file is part of the Antares project. */ -import useAppSelector from "../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../redux/selectors"; +import Matrix from "@/components/common/Matrix"; import { MATRICES, HydroMatrixType } from "./utils"; -import Matrix from "../../../../../../common/Matrix"; import { Box } from "@mui/material"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; interface Props { type: HydroMatrixType; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrixDialog.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrixDialog.tsx index 73b109f7dc..7231fc14d4 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrixDialog.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/HydroMatrixDialog.tsx @@ -15,10 +15,7 @@ import { Button, Box, Skeleton } from "@mui/material"; import { useTranslation } from "react-i18next"; import { useState, useEffect } from "react"; -import BasicDialog, { - BasicDialogProps, -} from "../../../../../../common/dialogs/BasicDialog"; -import Matrix from "../../../../../../common/Matrix"; + import { HydroMatrixType } from "./utils"; import { getAllocationMatrix } from "./Allocation/utils"; import { getCorrelationMatrix } from "./Correlation/utils"; @@ -27,6 +24,10 @@ import { StudyMetadata } from "../../../../../../../common/types"; import { MatrixDataDTO } from "@/components/common/Matrix/shared/types"; import useEnqueueErrorSnackbar from "@/hooks/useEnqueueErrorSnackbar"; import { AxiosError } from "axios"; +import BasicDialog, { + BasicDialogProps, +} from "@/components/common/dialogs/BasicDialog"; +import Matrix from "@/components/common/Matrix"; interface AdaptedMatrixData { data: number[][]; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/index.tsx index d63487a116..f0a635f4de 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/index.tsx @@ -13,18 +13,18 @@ */ import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../../redux/selectors"; -import Form from "../../../../../../../common/Form"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import { type InflowStructureFields, getInflowStructureFields, updateInflowStructureFields, } from "./utils"; -import NumberFE from "../../../../../../../common/fieldEditors/NumberFE"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; import { useTranslation } from "react-i18next"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function InflowStructure() { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/utils.ts index 0c0525059a..ee4adbe39f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/InflowStructure/utils.ts @@ -12,8 +12,8 @@ * This file is part of the Antares project. */ -import { type StudyMetadata } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; +import { type StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Types diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/Fields.tsx index 91d3cdb6ee..05c9df7e08 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/Fields.tsx @@ -12,11 +12,11 @@ * This file is part of the Antares project. */ -import NumberFE from "../../../../../../../common/fieldEditors/NumberFE"; -import SelectFE from "../../../../../../../common/fieldEditors/SelectFE"; -import SwitchFE from "../../../../../../../common/fieldEditors/SwitchFE"; -import Fieldset from "../../../../../../../common/Fieldset"; -import { useFormContextPlus } from "../../../../../../../common/Form"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; import { INITIALIZE_RESERVOIR_DATE_OPTIONS, HydroFormFields } from "./utils"; function Fields() { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/index.tsx index 6b778d69da..c623a8f9cb 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/index.tsx @@ -13,17 +13,17 @@ */ import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../../redux/selectors"; -import Form from "../../../../../../../common/Form"; -import { SubmitHandlerPlus } from "../../../../../../../common/Form/types"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import Fields from "./Fields"; import { getManagementOptionsFormFields, HydroFormFields, setManagementOptionsFormFields, } from "./utils"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function ManagementOptions() { const { diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/utils.ts index ebb3a34512..0d72a4c6a0 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/ManagementOptions/utils.ts @@ -12,8 +12,8 @@ * This file is part of the Antares project. */ -import { Area, StudyMetadata } from "../../../../../../../../common/types"; -import client from "../../../../../../../../services/api/client"; +import { Area, StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; //////////////////////////////////////////////////////////////// // Enums diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/SplitHydroMatrix.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/SplitHydroMatrix.tsx index 1adbc4e2b9..1755045401 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/SplitHydroMatrix.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/SplitHydroMatrix.tsx @@ -13,9 +13,9 @@ */ import { Box } from "@mui/material"; -import SplitView, { SplitViewProps } from "../../../../../../common/SplitView"; import HydroMatrix from "./HydroMatrix"; import { HydroMatrixType } from "./utils"; +import SplitView, { SplitViewProps } from "@/components/common/SplitView"; interface Props { types: [HydroMatrixType, HydroMatrixType]; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/hooks/useAreasOptions.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/hooks/useAreasOptions.ts index 611c671625..cffa05fb4e 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/hooks/useAreasOptions.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/hooks/useAreasOptions.ts @@ -14,10 +14,10 @@ import { useMemo } from "react"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../../common/types"; -import useAppSelector from "../../../../../../../../redux/hooks/useAppSelector"; -import { getAreas } from "../../../../../../../../redux/selectors"; -import { DynamicListProps } from "../../../../../../../common/DynamicList"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getAreas } from "@/redux/selectors"; +import { DynamicListProps } from "@/components/common/DynamicList"; import { AreaCoefficientItem } from "../utils"; export function useAreasOptions( diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/index.tsx index 215b3b5954..6e24ce5331 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/index.tsx @@ -14,10 +14,10 @@ import { useMemo } from "react"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import TabWrapper from "../../../TabWrapper"; -import useAppSelector from "../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../redux/selectors"; function Hydro() { const { study } = useOutletContext<{ study: StudyMetadata }>(); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/utils.ts index db3d8802a0..9980e4b538 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Hydro/utils.ts @@ -15,8 +15,8 @@ import { MatrixDataDTO, AggregateConfig, -} from "../../../../../../common/Matrix/shared/types"; -import { SplitViewProps } from "../../../../../../common/SplitView"; +} from "@/components/common/Matrix/shared/types"; +import { SplitViewProps } from "@/components/common/SplitView"; import { getAllocationMatrix } from "./Allocation/utils"; import { getCorrelationMatrix } from "./Correlation/utils"; import InflowStructure from "./InflowStructure"; diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Load.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Load.tsx index 9581fae79d..9644786a6b 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Load.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Load.tsx @@ -12,9 +12,9 @@ * This file is part of the Antares project. */ -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../redux/selectors"; -import Matrix from "../../../../../common/Matrix"; +import Matrix from "@/components/common/Matrix"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; function Load() { const currentArea = useAppSelector(getCurrentAreaId); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/MiscGen.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/MiscGen.tsx index 8cdf4946af..1fad04d338 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/MiscGen.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/MiscGen.tsx @@ -12,9 +12,9 @@ * This file is part of the Antares project. */ -import useAppSelector from "../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../redux/selectors"; -import Matrix from "../../../../../common/Matrix"; +import Matrix from "@/components/common/Matrix"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; function MiscGen() { const currentArea = useAppSelector(getCurrentAreaId); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/Fields.tsx index 7055f2e792..a9327305ee 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/Fields.tsx @@ -15,13 +15,13 @@ import { useTranslation } from "react-i18next"; import { useOutletContext } from "react-router"; import { useMemo } from "react"; -import SelectFE from "../../../../../../common/fieldEditors/SelectFE"; -import Fieldset from "../../../../../../common/Fieldset"; -import SwitchFE from "../../../../../../common/fieldEditors/SwitchFE"; -import NumberFE from "../../../../../../common/fieldEditors/NumberFE"; -import { useFormContextPlus } from "../../../../../../common/Form"; import { ADEQUACY_PATCH_OPTIONS, PropertiesFormFields } from "./utils"; -import { StudyMetadata } from "../../../../../../../common/types"; +import { StudyMetadata } from "@/common/types"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; function Fields() { const { t } = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/index.tsx index d654ba80c7..7ff6ce5ec7 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/index.tsx @@ -14,17 +14,17 @@ import { Paper } from "@mui/material"; import { useOutletContext } from "react-router"; -import { StudyMetadata } from "../../../../../../../common/types"; -import useAppSelector from "../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../redux/selectors"; -import Form from "../../../../../../common/Form"; +import { StudyMetadata } from "@/common/types"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; import { PropertiesFormFields, getPropertiesFormFields, setPropertiesFormFields, } from "./utils"; import Fields from "./Fields"; -import { SubmitHandlerPlus } from "../../../../../../common/Form/types"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function Properties() { const { study } = useOutletContext<{ study: StudyMetadata }>(); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/utils.ts b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/utils.ts index 5eef82d3f7..102ea2ae4f 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/utils.ts +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Properties/utils.ts @@ -17,8 +17,8 @@ //////////////////////////////////////////////////////////////// import { DeepPartial } from "redux"; -import { Area, StudyMetadata } from "../../../../../../../common/types"; -import client from "../../../../../../../services/api/client"; +import { Area, StudyMetadata } from "@/common/types"; +import client from "@/services/api/client"; enum AdequacyPatchMode { Outside = "outside", diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Fields.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Fields.tsx index 0ee371d7fa..2b4953c2f9 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Fields.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Fields.tsx @@ -13,17 +13,17 @@ */ import { useTranslation } from "react-i18next"; -import NumberFE from "../../../../../../common/fieldEditors/NumberFE"; -import SelectFE from "../../../../../../common/fieldEditors/SelectFE"; -import StringFE from "../../../../../../common/fieldEditors/StringFE"; -import SwitchFE from "../../../../../../common/fieldEditors/SwitchFE"; -import Fieldset from "../../../../../../common/Fieldset"; -import { useFormContextPlus } from "../../../../../../common/Form"; import { RENEWABLE_GROUPS, RenewableCluster, TS_INTERPRETATION_OPTIONS, } from "./utils"; +import NumberFE from "@/components/common/fieldEditors/NumberFE"; +import SelectFE from "@/components/common/fieldEditors/SelectFE"; +import StringFE from "@/components/common/fieldEditors/StringFE"; +import SwitchFE from "@/components/common/fieldEditors/SwitchFE"; +import Fieldset from "@/components/common/Fieldset"; +import { useFormContextPlus } from "@/components/common/Form"; function Fields() { const [t] = useTranslation(); diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Form.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Form.tsx index a180b0fe05..4382060f05 100644 --- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Form.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Renewables/Form.tsx @@ -17,8 +17,7 @@ import { Box, Button } from "@mui/material"; import { useParams, useOutletContext, useNavigate } from "react-router-dom"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import { useTranslation } from "react-i18next"; -import { StudyMetadata } from "../../../../../../../common/types"; -import Form from "../../../../../../common/Form"; +import { StudyMetadata } from "@/common/types"; import Fields from "./Fields"; import Matrix from "./Matrix"; import { @@ -26,11 +25,12 @@ import { getRenewableCluster, updateRenewableCluster, } from "./utils"; -import { SubmitHandlerPlus } from "../../../../../../common/Form/types"; -import useAppSelector from "../../../../../../../redux/hooks/useAppSelector"; -import { getCurrentAreaId } from "../../../../../../../redux/selectors"; -import useNavigateOnCondition from "../../../../../../../hooks/useNavigateOnCondition"; -import { nameToId } from "../../../../../../../services/utils"; +import useAppSelector from "@/redux/hooks/useAppSelector"; +import { getCurrentAreaId } from "@/redux/selectors"; +import useNavigateOnCondition from "@/hooks/useNavigateOnCondition"; +import { nameToId } from "@/services/utils"; +import { SubmitHandlerPlus } from "@/components/common/Form/types"; +import Form from "@/components/common/Form"; function Renewables() { const { t } = useTranslation(); @@ -41,7 +41,7 @@ function Renewables() { useNavigateOnCondition({ deps: [areaId], - to: "../renewables", + to: "@/renewables", }); // prevent re-fetch while useNavigateOnCondition event occurs @@ -69,7 +69,7 @@ function Renewables() {