Skip to content

Commit

Permalink
feat(ui-config): move frozen Table Mode templates in Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Jan 8, 2024
1 parent d85bd1b commit 6dfddbf
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions webapp/public/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions webapp/public/locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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(
Expand All @@ -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 (
Expand Down Expand Up @@ -58,6 +64,44 @@ function Configuration() {
[R.equals(3), () => <Optimization />],
[R.equals(4), () => <AdequacyPatch />],
[R.equals(5), () => <AdvancedParameters />],
[
R.equals(6),
() => (
<TableMode
studyId={study.id}
type="area"
columns={[
"averageUnsuppliedEnergyCost",
"spreadUnsuppliedEnergyCost",
"averageSpilledEnergyCost",
"spreadSpilledEnergyCost",
"nonDispatchablePower",
"dispatchableHydroPower",
"otherDispatchablePower",
]}
/>
),
],
[
R.equals(7),
() => (
<TableMode
studyId={study.id}
type="area"
columns={["filterYearByYear", "filterSynthesis"]}
/>
),
],
[
R.equals(8),
() => (
<TableMode
studyId={study.id}
type="link"
columns={["filterYearByYear", "filterSynthesis"]}
/>
),
],
])(tabList[currentTabIndex].id)}
</Paper>
}
Expand Down

0 comments on commit 6dfddbf

Please sign in to comment.