diff --git a/src/components/Charts/Bar.tsx b/src/components/Charts/Bar.tsx index 44205a41cedb39a55b2c47df9c2e9abaa9b810eb..f8db2183431a40cf2aa260b8de03e9abbdcaa312 100644 --- a/src/components/Charts/Bar.tsx +++ b/src/components/Charts/Bar.tsx @@ -175,7 +175,10 @@ const Bar = ({ return ( <g> {height > 0 ? ( - <g transform={`translate(${xScaleValue}, -40)`}> + <g + transform={`translate(${xScaleValue}, -40)`} + className="barContainer" + > <rect onClick={handleClick} x="0" @@ -194,6 +197,7 @@ const Bar = ({ <g transform={`translate(${xScaleValue}, ${yScaleValue})`} fill="#00000" + className="barFill" > <defs> <linearGradient diff --git a/src/components/FluidChart/FluidChart.tsx b/src/components/FluidChart/FluidChart.tsx index ed3411f552746f4838572b50c28db27e2c84c932..161f7e01e7b5e6fdc1cc399f60c994cff1f2f79c 100644 --- a/src/components/FluidChart/FluidChart.tsx +++ b/src/components/FluidChart/FluidChart.tsx @@ -55,16 +55,18 @@ const FluidChart: React.FC<FluidChartProps> = ({ let isEnedisConsentValid = true async function loadData() { const consumptionService = new ConsumptionService(client) - const activateHalfHourLoad = await consumptionService.checkDoctypeEntries( - FluidType.ELECTRICITY, - TimeStep.HALF_AN_HOUR - ) + let activateHalfHourLoad = false + if (fluidType === FluidType.ELECTRICITY) { + activateHalfHourLoad = await consumptionService.checkDoctypeEntries( + FluidType.ELECTRICITY, + TimeStep.HALF_AN_HOUR + ) + } if (currentTimeStep === TimeStep.HALF_AN_HOUR && activateHalfHourLoad) { isEnedisConsentValid = await consumptionService.checkEnedisHalHourConsent( selectedDate ) } - if (subscribed) { if (!activateHalfHourLoad) { setMinuteBlocked(true) @@ -77,7 +79,7 @@ const FluidChart: React.FC<FluidChartProps> = ({ return () => { subscribed = false } - }, [client, fluidStatus, selectedDate, currentTimeStep]) + }, [client, fluidStatus, selectedDate, currentTimeStep, fluidType]) useEffect(() => { if (!isMinuteBlocked && currentTimeStep === TimeStep.HALF_AN_HOUR) { diff --git a/src/components/Konnector/KonnectorModal.tsx b/src/components/Konnector/KonnectorModal.tsx index 88dd51db9e51e7d266d0402a74b36617907f5e65..dc245e4b2e0e2ffde3563393b22a1d2fcb0cdc61 100644 --- a/src/components/Konnector/KonnectorModal.tsx +++ b/src/components/Konnector/KonnectorModal.tsx @@ -63,7 +63,7 @@ const KonnectorModal: React.FC<KonnectorModalProps> = ({ useEffect(() => { const interval = setInterval(() => { - if (open && !state) { + if (open && (!state || state === LOGIN_SUCCESS_EVENT)) { setIndex((prev: number) => prev + 1) } }, 8000) diff --git a/src/components/ProfileType/ProfileTypeFormNumber.tsx b/src/components/ProfileType/ProfileTypeFormNumber.tsx index d6fa7948d6c38b80f43264fc19f758f87d3a094c..c5acc3d348d1701663974450f0de7210ec5baddb 100644 --- a/src/components/ProfileType/ProfileTypeFormNumber.tsx +++ b/src/components/ProfileType/ProfileTypeFormNumber.tsx @@ -63,6 +63,7 @@ const ProfileTypeFormNumber: React.FC<ProfileTypeFormNumberProps> = ({ value={answer} name={answerType.attribute} onChange={e => setAnswer(e.target.value)} + autoFocus /> m² </label> diff --git a/src/styles/components/_barchart.scss b/src/styles/components/_barchart.scss index 2ed535dce9e26702b9b49b20fc926b300eaeba8c..70bd59c11a6c1ffbec9c5aa64aeaab2d805357e9 100644 --- a/src/styles/components/_barchart.scss +++ b/src/styles/components/_barchart.scss @@ -21,8 +21,17 @@ fill: $grey-bright; } } +.barContainer, +.barFill { + &:hover { + cursor: pointer; + } +} .background-true { opacity: 0.1; + &:hover { + cursor: pointer; + } } .background-false { opacity: 0; @@ -100,7 +109,7 @@ } } .bar-duel { - fill: $blue-light; + fill: $blue-light; &.selected { fill: $blue-light; filter: drop-shadow(0 -0.1rem 0.2rem $blue-light); @@ -133,7 +142,7 @@ } } .bar-average { - stroke-width:2; + stroke-width: 2; stroke: $multi-color; } /** Animation **/