From 477cb148431f12552572aaf73ca119b88d74b5f3 Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:05:00 +0100 Subject: [PATCH] feat(ui-config): move frozen Table Mode templates in Configuration --- webapp/public/locales/en/main.json | 3 ++ webapp/public/locales/fr/main.json | 3 ++ .../explore/Configuration/index.tsx | 46 ++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/webapp/public/locales/en/main.json b/webapp/public/locales/en/main.json index 72f8f6ed00..0daa43c3de 100644 --- a/webapp/public/locales/en/main.json +++ b/webapp/public/locales/en/main.json @@ -367,6 +367,9 @@ "study.configuration.advancedParameters.unitCommitmentMode": "Unit commitment mode", "study.configuration.advancedParameters.simulationCores": "Simulation cores", "study.configuration.advancedParameters.renewableGenerationModeling": "Renewable generation modeling", + "study.configuration.economicOpt": "Economic Opt.", + "study.configuration.geographicTrimmingAreas": "Geographic Trimming (areas)", + "study.configuration.geographicTrimmingLinks": "Geographic Trimming (links)", "study.modelization.properties": "Properties", "study.modelization.properties.posX": "Position X", "study.modelization.properties.posY": "Position Y", diff --git a/webapp/public/locales/fr/main.json b/webapp/public/locales/fr/main.json index fcee42b459..02d345d17c 100644 --- a/webapp/public/locales/fr/main.json +++ b/webapp/public/locales/fr/main.json @@ -367,6 +367,9 @@ "study.configuration.advancedParameters.unitCommitmentMode": "Unit commitment mode", "study.configuration.advancedParameters.simulationCores": "Simulation cores", "study.configuration.advancedParameters.renewableGenerationModeling": "Renewable generation modeling", + "study.configuration.economicOpt": "Options économiques", + "study.configuration.geographicTrimmingAreas": "Filtre géographique (zones)", + "study.configuration.geographicTrimmingLinks": "Filtre géographique (liens)", "study.modelization.properties": "Propriétés", "study.modelization.properties.posX": "Position X", "study.modelization.properties.posY": "Position Y", diff --git a/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx b/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx index f31ec83894..bd56ed29fc 100644 --- a/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx +++ b/webapp/src/components/App/Singlestudy/explore/Configuration/index.tsx @@ -3,6 +3,7 @@ import { Paper } from "@mui/material"; 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 UnderConstruction from "../../../../common/page/UnderConstruction"; import PropertiesView from "../../../../common/PropertiesView"; @@ -14,10 +15,12 @@ import General from "./General"; import Optimization from "./Optimization"; import RegionalDistricts from "./RegionalDistricts"; import TimeSeriesManagement from "./TimeSeriesManagement"; +import TableMode from "../../../../common/TableMode"; function Configuration() { const { study } = useOutletContext<{ study: StudyMetadata }>(); const [currentTabIndex, setCurrentTabIndex] = useState(0); + const { t } = useTranslation(); // TODO i18n const tabList = useMemo( @@ -29,8 +32,11 @@ function Configuration() { { id: 3, name: "Optimization preferences" }, Number(study.version) >= 830 && { id: 4, name: "Adequacy Patch" }, { id: 5, name: "Advanced parameters" }, + { id: 6, name: t("study.configuration.economicOpt") }, + { id: 7, name: t("study.configuration.geographicTrimmingAreas") }, + { id: 8, name: t("study.configuration.geographicTrimmingLinks") }, ].filter(Boolean), - [study.version], + [study.version, t], ); return ( @@ -58,6 +64,44 @@ function Configuration() { [R.equals(3), () => ], [R.equals(4), () => ], [R.equals(5), () => ], + [ + R.equals(6), + () => ( + + ), + ], + [ + R.equals(7), + () => ( + + ), + ], + [ + R.equals(8), + () => ( + + ), + ], ])(tabList[currentTabIndex].id)} }