From 28cf78560732bee523274c297dab7ad3cd6a241a Mon Sep 17 00:00:00 2001
From: Samir Kamal <1954121+skamril@users.noreply.github.com>
Date: Tue, 18 Jun 2024 09:31:45 +0200
Subject: [PATCH] feat(ui-model): update style
---
.../explore/Modelization/Areas/AreasTab.tsx | 19 +------
.../Areas/Hydro/InflowStructure/index.tsx | 3 +-
.../Areas/Hydro/ManagementOptions/index.tsx | 1 -
.../Modelization/Areas/Hydro/index.tsx | 7 +--
.../Modelization/Areas/Renewables/Form.tsx | 50 +++++++++--------
.../Modelization/Areas/Storages/Form.tsx | 54 ++++++++++---------
.../Modelization/Areas/Thermal/Form.tsx | 46 +++++++++-------
.../explore/Modelization/Areas/index.tsx | 20 +++----
.../BindingConstView/index.tsx | 4 +-
.../Modelization/BindingConstraints/index.tsx | 16 +++---
.../Modelization/Links/LinkView/index.tsx | 21 +++-----
.../explore/Modelization/Links/index.tsx | 16 +++---
webapp/src/components/App/index.tsx | 8 +--
13 files changed, 127 insertions(+), 138 deletions(-)
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 cb54e2fb30..0bc26081dc 100644
--- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx
+++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/AreasTab.tsx
@@ -1,6 +1,5 @@
import { useEffect, useMemo } from "react";
import { useLocation, useNavigate, useOutletContext } from "react-router-dom";
-import { Paper } from "@mui/material";
import { useTranslation } from "react-i18next";
import { StudyMetadata } from "../../../../../../common/types";
import TabWrapper from "../../TabWrapper";
@@ -83,23 +82,7 @@ function AreasTab({ renewablesClustering }: Props) {
}));
}, [study.id, areaId, renewablesClustering, t, study.version]);
- return (
-
-
-
- );
+ return ;
}
export default AreasTab;
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 d5f38785b8..79bef831a5 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
@@ -38,7 +38,8 @@ function InflowStructure() {
onSubmit={handleSubmit}
miniSubmitButton
enableUndoRedo
- sx={{ display: "flex", alignItems: "center", ".Form__Footer": { p: 0 } }}
+ hideFooterDivider
+ sx={{ flexDirection: "row", alignItems: "center" }}
>
{({ control }) => (
getManagementOptionsFormFields(studyId, areaId),
}}
onSubmit={handleSubmit}
- sx={{ pb: 2 }}
enableUndoRedo
>
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 ae0cafa00e..cca7f9519a 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
@@ -2,7 +2,6 @@ import { useMemo } from "react";
import { useOutletContext } from "react-router";
import { StudyMetadata } from "../../../../../../../common/types";
import TabWrapper from "../../../TabWrapper";
-import { Root } from "./style";
import useAppSelector from "../../../../../../../redux/hooks/useAppSelector";
import { getCurrentAreaId } from "../../../../../../../redux/selectors";
@@ -37,11 +36,7 @@ function Hydro() {
// JSX
////////////////////////////////////////////////////////////////
- return (
-
-
-
- );
+ return ;
}
export default Hydro;
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 30dc1bc7b7..fe39be2fc8 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
@@ -18,7 +18,7 @@ import { getCurrentAreaId } from "../../../../../../../redux/selectors";
import useNavigateOnCondition from "../../../../../../../hooks/useNavigateOnCondition";
import { nameToId } from "../../../../../../../services/utils";
-function RenewablesForm() {
+function Renewables() {
const { t } = useTranslation();
const { study } = useOutletContext<{ study: StudyMetadata }>();
const navigate = useNavigate();
@@ -51,37 +51,43 @@ function RenewablesForm() {
////////////////////////////////////////////////////////////////
return (
-
+
-
-
-
+
+
+
+
+
);
}
-export default RenewablesForm;
+export default Renewables;
diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Storages/Form.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Storages/Form.tsx
index 40aa166664..38a4bb2bc2 100644
--- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Storages/Form.tsx
+++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Storages/Form.tsx
@@ -15,7 +15,7 @@ import Matrix from "./Matrix";
import useNavigateOnCondition from "../../../../../../../hooks/useNavigateOnCondition";
import { nameToId } from "../../../../../../../services/utils";
-function StorageForm() {
+function Storages() {
const { t } = useTranslation();
const { study } = useOutletContext<{ study: StudyMetadata }>();
const navigate = useNavigate();
@@ -63,39 +63,45 @@ function StorageForm() {
////////////////////////////////////////////////////////////////
return (
-
+
-
-
-
+
+
+
+
+
);
}
-export default StorageForm;
+export default Storages;
diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Thermal/Form.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Thermal/Form.tsx
index 810338b581..e37f4749dd 100644
--- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Thermal/Form.tsx
+++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/Thermal/Form.tsx
@@ -49,34 +49,40 @@ function ThermalForm() {
////////////////////////////////////////////////////////////////
return (
-
+
-
-
-
+
+
+
+
+
);
diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/index.tsx
index d5926b6e63..8868838934 100644
--- a/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/index.tsx
+++ b/webapp/src/components/App/Singlestudy/explore/Modelization/Areas/index.tsx
@@ -1,4 +1,3 @@
-import { Box } from "@mui/material";
import { useOutletContext } from "react-router";
import { StudyMetadata } from "../../../../../../common/types";
import SimpleContent from "../../../../../common/page/SimpleContent";
@@ -14,6 +13,7 @@ import { setCurrentArea } from "../../../../../../redux/ducks/studySyntheses";
import useAppSelector from "../../../../../../redux/hooks/useAppSelector";
import UsePromiseCond from "../../../../../common/utils/UsePromiseCond";
import SplitView from "../../../../../common/SplitView";
+import ViewWrapper from "../../../../../common/page/ViewWrapper";
function Areas() {
const { study } = useOutletContext<{ study: StudyMetadata }>();
@@ -38,14 +38,14 @@ function Areas() {
return (
-
-
-
-
+ {/* Left */}
+
+ {/* Right */}
+
@@ -58,7 +58,7 @@ function Areas() {
)
}
/>
-
+
);
}
diff --git a/webapp/src/components/App/Singlestudy/explore/Modelization/BindingConstraints/BindingConstView/index.tsx b/webapp/src/components/App/Singlestudy/explore/Modelization/BindingConstraints/BindingConstView/index.tsx
index d889ae3173..43dd656e8a 100644
--- a/webapp/src/components/App/Singlestudy/explore/Modelization/BindingConstraints/BindingConstView/index.tsx
+++ b/webapp/src/components/App/Singlestudy/explore/Modelization/BindingConstraints/BindingConstView/index.tsx
@@ -113,14 +113,14 @@ function BindingConstView({ constraintId }: Props) {
height: 1,
display: "flex",
flexDirection: "column",
- overflow: "hidden",
+ overflow: "auto",
}}
>
(
<>
-
+