From c261b5718835531d665ddab7aa23d1864d1fe442 Mon Sep 17 00:00:00 2001 From: MathildeIgier <44711385+MathildeIgier@users.noreply.github.com> Date: Thu, 20 Oct 2022 14:51:40 +0200 Subject: [PATCH 1/2] fix(10): month time for nbVisit --- src/app/types/generalFormTypes.ts | 45 +++++++++------ src/components/zones/GeneralForm.tsx | 13 +++-- src/components/zones/ZonesView.tsx | 86 ++++++++++++++-------------- 3 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/app/types/generalFormTypes.ts b/src/app/types/generalFormTypes.ts index 602923a..5a85c7e 100644 --- a/src/app/types/generalFormTypes.ts +++ b/src/app/types/generalFormTypes.ts @@ -1,23 +1,32 @@ import { EBoolean } from "./types"; export enum ServerType { - RENEWABLE = "Renewable energy", - NON_RENEWABLE = "Non renewable energy", - UNKNOWN = "Do not know", - } + RENEWABLE = "Renewable energy", + NON_RENEWABLE = "Non renewable energy", + UNKNOWN = "Do not know", +} + +export const GeneralFormEntries = { + nbVisit: 0, + server: ServerType, + plugins: EBoolean, + genericFont: EBoolean, + inifiteScroll: EBoolean, +}; - export const GeneralFormEntries = { - nbVisit: 0, - server: ServerType, - plugins: EBoolean, - genericFont: EBoolean, - inifiteScroll: EBoolean, - }; +export const getGeneralEntryLabel = (entry: string) => { + switch (entry) { + case "nbVisit": + return "number of visits/month"; + default: + return entry; + } +}; - export interface GenericParameters { - nbVisit?: number; - server?: ServerType; - plugins?: boolean; - genericFont?: boolean; - inifiteScroll?: boolean; - } \ No newline at end of file +export interface GenericParameters { + nbVisit?: number; + server?: ServerType; + plugins?: boolean; + genericFont?: boolean; + inifiteScroll?: boolean; +} diff --git a/src/components/zones/GeneralForm.tsx b/src/components/zones/GeneralForm.tsx index ff42b47..924dac0 100644 --- a/src/components/zones/GeneralForm.tsx +++ b/src/components/zones/GeneralForm.tsx @@ -20,6 +20,7 @@ import { useAppSelector } from "../../app/hooks"; import { GeneralFormEntries, GenericParameters, + getGeneralEntryLabel, } from "../../app/types/generalFormTypes"; import { Project } from "../../app/types/types"; import { @@ -38,7 +39,7 @@ export default function GeneralFormAccordion() { const dispatch = useDispatch(); const { isOpen, onOpen, onClose } = useDisclosure(); return ( - + {({ isExpanded }) => ( <> - + - Reset + Reset{" "} + @@ -96,13 +98,14 @@ function GeneralForm({ project }: { project: Project }) { return (
- {key} + {getGeneralEntryLabel(key)} {typeof data === "number" && ( - - - - - - } - /> - - RE homepage - - } - /> - - RE about page - - } - /> - - RE network map - - } - /> - - - - } - /> - + + + + + + } + /> + + RE homepage + + } + /> + + RE about page + + } + /> + + RE network map + + } + /> + + + + } + /> + {zones.map((z) => { return ( From 486ba66198f866d3370ef5cdf980e4f76fc5d59b Mon Sep 17 00:00:00 2001 From: MathildeIgier <44711385+MathildeIgier@users.noreply.github.com> Date: Thu, 20 Oct 2022 14:52:43 +0200 Subject: [PATCH 2/2] fix(10): add time for energy save --- src/components/recommandations/ReportGeneralInfo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/recommandations/ReportGeneralInfo.tsx b/src/components/recommandations/ReportGeneralInfo.tsx index 98ea4c9..709cd52 100644 --- a/src/components/recommandations/ReportGeneralInfo.tsx +++ b/src/components/recommandations/ReportGeneralInfo.tsx @@ -25,7 +25,7 @@ export default function ReportGeneralInfo() { - Energy (KWh) + Energy (KWh)/month @@ -45,7 +45,7 @@ export default function ReportGeneralInfo() { grow={1} > - GWP ( kg CO2eq) + GWP ( kg CO2eq)/month